This paper considers the problem of trajectory optimization for two platforms which perform bearings only tracking for multiple targets. It is not assumed that the measurements contain identifying features that enable measurements to be associated to targets. Therefore, ghost targets can appear, which strongly affect the resulting error. In comparison to existing approaches, we propose a trajectory optimization method that considers both the ambiguity in the data association as well as the track error. It is shown that this approach can resolve ghost targets much quicker, resulting in a significantly lower estimation error.