  [ABRIDGED] CONTEXT: Gaia DR2 has opened a trove of astrometric and
photometric data for Galactic clusters close to the Sun. Lucky imaging has been
an operational technique to measure the positions of visual binary systems for
a decade and a half, enough to apply its results to the calculation of orbits
of some massive multiple systems within ~1 kpc of the Sun. AIMS: We are
measuring distances to Galactic stellar groups containing O stars and I start
with two of them: Collinder 419 in Cygnus and NGC 2264 in Monoceros. I also aim
to derive new astrometric orbits for the Aa,Ab components for the main ionizing
sources for both clusters: HD 193 322 and 15 Mon, respectively. METHODS: First,
I present a method that uses Gaia DR2 photometry, positions, proper motions,
and parallaxes to obtain the membership and distance of a stellar group and
apply it to Collinder 419 and NGC 2264. Second, I present a new code that
calculates astrometric orbits by searching the whole 7-parameter orbit space
and apply it to HD 193 322 Aa,Ab and 15 Mon Aa,Ab using as input literature
data from the Washington Double Star Catalog (WDS) and the AstraLux
measurements recently presented by Ma\'iz Apell\'aniz et al. (2019). RESULTS: I
obtain Gaia DR2 distances of 1006+37-34 pc for Collinder 419 and 719+-16 pc for
NGC 2264, with the main contribution to the uncertainties coming from the
spatial covariance of the parallaxes. The two NGC 2264 subclusters are at the
same distance (within the uncertainties) and they show a significant relative
proper motion. The distances are shown to be robust. HD 193 322 Aa,Ab follows
an eccentric (e = 0.58+0.03-0.04) orbit with a period of 44+-1 a and the three
stars it contains have a total mass of 76.1+9.9-7.4 M_Sol. The orbit of 15 Mon
Aa,Ab is even more eccentric (e = 0.770+0.023-0.030), with a period of 108+-12
a and a total mass of 45.1+3.6-3.3 M_Sol for its two stars.
