How to Create a Custom Barycenter Frame

Does anyone have a good tutorial or example on creating a custom frame?

I have two objects orbiting each other; I’m using Orekit to calculate frames of an animation. As one isn’t significantly more massive than the other, I’m using the combined masses for the GM calculation.

However, the Keplerian solver in the inertial frame keeps one stationary. While I could calculate the barycenter, include that in the data export, and use that in the animator, I would much rather (if for no other reason to learn how) have a custom frame that’s centered on the barycenter, from which I could output position data for each of the two objects. But digging about for tutorials on creating this for a pair of custom objects eludes me.

Thank you for any help or guidance you can provide!

You can look at CR3BPRotatingFrame.