Describe the bug
QT Info Browser shows wrong rotation direction and length of day for retrograde rotation defined with SpiceRotation
To Reproduce
Modify "Venus" "Sol"
{
SpiceRotation
{
Kernel ["naif0012.tls" "pck00011.tpc"]
Frame "IAU_VENUS"
Period 5832.432
}
}
QT Info Browser shows:
Sidereal rotation period: 243,018 days
Rotation direction: Prograde
Length of day: 2981,33 days
Additional context
The problem occurs because of the shortcut in spicerotation.h:
// No notion of an equator for SPICE rotation models
Eigen::Quaterniond computeEquatorOrientation(double /* tdb */) const override
{
return Eigen::Quaterniond::Identity();
}
But qtinfopanel.cpp needs computeEquatorOrientation() for prograde/retrograde determination:
bool prograde = false;
if (orbitalPeriod > 0.0)
{
Eigen::Vector3d axis = Eigen::AngleAxisd(rotationModel->equatorOrientationAtTime(t)
* body->getBodyFrame(t)->getOrientation(t)).axis();
Eigen::Vector3d orbitNormal = body->getOrbitFrame(t)->getOrientation(t)
* orbit->positionAtTime(t).cross(orbit->velocityAtTime(t));
prograde = axis.dot(orbitNormal) >= 0;
double siderealDaysPerYear = orbitalPeriod / rotPeriod;
double solarDaysPerYear = prograde ? siderealDaysPerYear - 1.0 : siderealDaysPerYear + 1.0;
if (std::abs(solarDaysPerYear) > 0.0001)
{
dayLength = std::abs(orbitalPeriod / solarDaysPerYear);
}
}
Describe the bug
QT Info Browser shows wrong rotation direction and length of day for retrograde rotation defined with SpiceRotation
To Reproduce
QT Info Browser shows:
Additional context
The problem occurs because of the shortcut in spicerotation.h:
But qtinfopanel.cpp needs computeEquatorOrientation() for prograde/retrograde determination: