Skip to content

Fix Ruggiero RAAN correction

This is a baffling bug to me, so it must be a stupid thing.

The RAAN correction is identical to the inclination correction with the difference that we're using a sine instead of a cosine. I've investigated whether wrapping the angles between +/- pi/2 changes anything, but it does not.

                    Achieve::Raan { target, tol } => {
                        let weight =
                            Self::weighting(self.init_state.raan(), target, osc.raan(), tol);
                        if weight.abs() > 0.0 {
                            let beta =
                                half_pi.copysign(((osc.ta() + osc.aop()).to_radians()).sin());
                            // TODO: Add efficiency
                            ctrl += unit_vector_from_angles(0.0, beta) * weight;
                        }
                    }