Function lupnt::spice::GetBodyPosVel(const Real, BodyId, BodyId)

Function Documentation

Vec6 lupnt::spice::GetBodyPosVel(const Real t_tdb, BodyId center, BodyId target)

Get the Body Position and Velocity using Chebyshev polynomials.

Get the inertial (J2000) position and velocity of target relative to center at t_tdb, via the cached Chebyshev SPK segments extracted by LoadSpiceKernel.

This is lupnt’s primary high-accuracy ephemeris source: it is the function backing spice::ConvertFrameSpice’s body-relative frame shifts (GCRF<->ICRF, GCRF<->MOON_CI, GCRF<->EMR, …) and is the reference sampled by InitFrameConversionFromSpice / ComputeEopFromSpice. Handles barycenter-vs-body indirection internally (e.g. Earth/Moon/Mercury/Venus positions are obtained via their system barycenters plus a body-relative-to-barycenter Chebyshev segment) by delegating to the internal GetBodyPosVelBase helper. Note: returned in the SPK’s native km / km/s units (unlike most other lupnt state vectors, which are in meters); ConvertFrameSpice operates consistently in these units internally.

Parameters:
  • t_tdb – TDB seconds from J2000.

  • center – center body id

  • target – target body id

  • t_tdb – Epoch [s, TDB seconds since J2000]

  • center – Origin body of the returned state

  • targetBody whose state is returned

Returns:

Vec6 in intertial axes

Returns:

[r; v] position [km] and velocity [km/s] of target relative to center, in the J2000 inertial frame