Commit e83202cb authored by Lorenz Meier's avatar Lorenz Meier

Support variable side count cal for PX4

parent 6020fc18
...@@ -312,13 +312,25 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in ...@@ -312,13 +312,25 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
_orientationCalTailDownSideVisible = true; _orientationCalTailDownSideVisible = true;
_orientationCalNoseDownSideVisible = true; _orientationCalNoseDownSideVisible = true;
} else if (text == "mag") { } else if (text == "mag") {
// Work out what the autopilot is configured to
int sides = 0;
if (_autopilot->parameterExists(FactSystem::defaultComponentId, "CAL_MAG_SIDES")) {
// Read the requested calibration directions off the system
sides = _autopilot->getParameterFact(FactSystem::defaultComponentId, "CAL_MAG_SIDES")->rawValue().toFloat();
} else {
// There is no valid setting, default to all six sides
sides = (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0);
}
_magCalInProgress = true; _magCalInProgress = true;
_orientationCalDownSideVisible = true; _orientationCalTailDownSideVisible = ((sides & (1 << 0)) > 0);
_orientationCalUpsideDownSideVisible = false; _orientationCalNoseDownSideVisible = ((sides & (1 << 1)) > 0);
_orientationCalLeftSideVisible = true; _orientationCalLeftSideVisible = ((sides & (1 << 2)) > 0);
_orientationCalRightSideVisible = false; _orientationCalRightSideVisible = ((sides & (1 << 3)) > 0);
_orientationCalTailDownSideVisible = false; _orientationCalUpsideDownSideVisible = ((sides & (1 << 4)) > 0);
_orientationCalNoseDownSideVisible = true; _orientationCalDownSideVisible = ((sides & (1 << 5)) > 0);
} else if (text == "gyro") { } else if (text == "gyro") {
_gyroCalInProgress = true; _gyroCalInProgress = true;
_orientationCalDownSideVisible = true; _orientationCalDownSideVisible = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment