Problem
There is no easy way to zero the orientation of the rocket as it appears in the orientation visual
Context
The previous orientation visualizer simply started off assuming a vertical rocket and then updated with acceleration and gyro data from MARTHA. Now the entire orientation estimator runs on MARTHA, so the orientation visualizer takes the orientation at face value and doesn't apply any corrections for the board's orientation.
Solutions
Ground-Side
This is likely the easiest and quickest solution. Simply add a button to the GUI to zero the rocket's orientation to straight up.
You can modify the orientation values as soon as they are read from the status model in cure_ground/gui/view/OrientationVisual.py and apply offsets that are the opposite of the current rotation when the zeroing button is pressed.
Flight Computer Dynamically
In Avionics, the only concept of finding orientation is defined when the rocket launches and the VerticalVelocityEstimator chooses the axis of largest acceleration to be 'up'. There is no determination of orientation prior to launch.
Instead, the OrientationEstimator could use the normal force of gravity while waiting on the pad to determine the rocket's direction.
The main caveat is that the rocket's orientation can change several times before launch (hence why we waited until launch to pick the direction of 'up' rather than on board-power-on). The solution could be similar to the GroundLevelEstimator, which constantly updates what it believes to be 'ground level' up until launch. Similarity, the 'OrientationEstimator' could be rezeroing itself with the direction of 'up' until launch occurs.
Flight Computer Statically
There are no launch/mission-specific configuration for MARTHA. We could add a config that defines the orientation of MARTHA's mounting for each launch rather than MARTHA having to figure it out herself each time. The problem is that a MARTHA flashed with one config cannot be launched on a later mission without reflashing it with a new config (if the mounting orientation is different). Futhermore, you could use an approach of making these configs editable via the CommandHandler and store them in the external flash chip allowing you to change the mounting orientation without reflashing.
Problem
There is no easy way to zero the orientation of the rocket as it appears in the orientation visual
Context
The previous orientation visualizer simply started off assuming a vertical rocket and then updated with acceleration and gyro data from MARTHA. Now the entire orientation estimator runs on MARTHA, so the orientation visualizer takes the orientation at face value and doesn't apply any corrections for the board's orientation.
Solutions
Ground-Side
This is likely the easiest and quickest solution. Simply add a button to the GUI to zero the rocket's orientation to straight up.
You can modify the orientation values as soon as they are read from the status model in
cure_ground/gui/view/OrientationVisual.pyand apply offsets that are the opposite of the current rotation when the zeroing button is pressed.Flight Computer Dynamically
In
Avionics,the only concept of finding orientation is defined when the rocket launches and theVerticalVelocityEstimatorchooses the axis of largest acceleration to be 'up'. There is no determination of orientation prior to launch.Instead, the
OrientationEstimatorcould use the normal force of gravity while waiting on the pad to determine the rocket's direction.The main caveat is that the rocket's orientation can change several times before launch (hence why we waited until launch to pick the direction of 'up' rather than on board-power-on). The solution could be similar to the
GroundLevelEstimator,which constantly updates what it believes to be 'ground level' up until launch. Similarity, the 'OrientationEstimator' could be rezeroing itself with the direction of 'up' until launch occurs.Flight Computer Statically
There are no launch/mission-specific configuration for MARTHA. We could add a config that defines the orientation of MARTHA's mounting for each launch rather than MARTHA having to figure it out herself each time. The problem is that a MARTHA flashed with one config cannot be launched on a later mission without reflashing it with a new config (if the mounting orientation is different). Futhermore, you could use an approach of making these configs editable via the
CommandHandlerand store them in the external flash chip allowing you to change the mounting orientation without reflashing.