Hi, I have a question about the Yaw Compensation Attitude Provider, specifically the algorithm used to calculate the attitude.
I have been developing my own algorithm and testing it against the orekit YawCompensation provider, and have been getting an error of about 0.006 degrees.
To get the normal vector (which should be normal to the relative velocity wrt ground), the Spacecraft velocity obtained in an ECEF frame should be sufficient right? This should take into account the movement of the earth as well.
The code is as follows:
#compute earth-fixed references at the specified date
sat_PV = pvcoordinates_provider.getPVCoordinates(date, self.earth_fixed_frame)
sat_pos = sat_PV.getPosition()
sat_vel = sat_PV.getVelocity()
# Compute nadir position in celestial frame
gp_sat = self.earth_shape.transform(
sat_PV.getPosition(), self.earth_fixed_frame, date
)
gp_nadir = GeodeticPoint(
gp_sat.getLatitude(), gp_sat.getLongitude(), float(0.0)
)
nadir_pos = self.earth_shape.transform(gp_nadir)
relativePosition = nadir_pos.subtract(sat_pos)
relativeNormal = Vector3D.crossProduct(relativePosition, sat_vel)
# compute transform from earth-fixed frame to satellite frame
earthToSatRotation = Rotation(
relativePosition, relativeNormal, Vector3D.PLUS_K, Vector3D.PLUS_J
)
However, this does not produce a similar result. I am wondering where my thought process might be wrong. Would appreciate any help. Thanks!