Skip to content

Commit

Permalink
adapted to enum change in mavlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Chies committed Jul 22, 2024
1 parent 68d1136 commit cc64b84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions msg/OrbitStatus.msg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ uint8 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1
uint8 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2
uint8 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3
uint8 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4
uint8 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5

uint64 timestamp # time since system start (microseconds)
float32 radius # Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise. [m]
Expand Down
14 changes: 11 additions & 3 deletions src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,18 @@ bool FlightTaskOrbit::applyCommandParameters(const vehicle_command_s &command, b

// commanded heading behaviour
if (PX4_ISFINITE(command.param3)) {
_yaw_behaviour = command.param3;
PX4_WARN("commanded yaw behaviour: %f", (double)command.param3);
PX4_WARN("_is_position_on_circle: %d", _is_position_on_circle());

} else {
_yaw_behaviour = _param_mc_orbit_yaw_mod.get();
if (command.param3 - 5.0f < FLT_EPSILON) {
// only change yaw behaviour to the parameter if we are not in an active orbit.
if (!_is_position_on_circle()) {
_yaw_behaviour = _param_mc_orbit_yaw_mod.get();
}

} else {
_yaw_behaviour = command.param3;
}
}

// save current yaw estimate for ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING
Expand Down

0 comments on commit cc64b84

Please sign in to comment.