Skip to content

Commit

Permalink
gimbal: fix device flags for RC gimbals
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes authored and bkueng committed Oct 30, 2024
1 parent e320593 commit 6509e70
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/modules/gimbal/output_rc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,19 @@ void OutputRC::_stream_device_attitude_status()
attitude_status.timestamp = hrt_absolute_time();
attitude_status.target_system = 0;
attitude_status.target_component = 0;
attitude_status.device_flags = gimbal_device_attitude_status_s::DEVICE_FLAGS_NEUTRAL |
gimbal_device_attitude_status_s::DEVICE_FLAGS_ROLL_LOCK |
gimbal_device_attitude_status_s::DEVICE_FLAGS_PITCH_LOCK |
gimbal_device_attitude_status_s::DEVICE_FLAGS_YAW_LOCK;
attitude_status.device_flags = 0;

if (_absolute_angle[0]) {
attitude_status.device_flags |= gimbal_device_attitude_status_s::DEVICE_FLAGS_ROLL_LOCK;
}

if (_absolute_angle[1]) {
attitude_status.device_flags |= gimbal_device_attitude_status_s::DEVICE_FLAGS_PITCH_LOCK;
}

if (_absolute_angle[2]) {
attitude_status.device_flags |= gimbal_device_attitude_status_s::DEVICE_FLAGS_YAW_LOCK;
}

matrix::Eulerf euler(_angle_outputs[0], _angle_outputs[1], _angle_outputs[2]);
matrix::Quatf q(euler);
Expand Down

0 comments on commit 6509e70

Please sign in to comment.