Skip to content

Commit

Permalink
mavlink_receiver: ifdef guard for velocity limits
Browse files Browse the repository at this point in the history
Since this message is defined in development.xml and
not yet common.xml and some targets use
common.xml and the builds then failed.
  • Loading branch information
MaEtUgR committed Dec 5, 2023
1 parent 53674a7 commit c28128e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/mavlink/mavlink_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,12 @@ MavlinkReceiver::handle_message(mavlink_message_t *msg)
handle_message_gimbal_device_attitude_status(msg);
break;

#if defined(MAVLINK_MSG_ID_SET_VELOCITY_LIMITS) // For now only defined if development.xml is used

case MAVLINK_MSG_ID_SET_VELOCITY_LIMITS:
handle_message_set_velocity_limits(msg);
break;
#endif

default:
break;
Expand Down Expand Up @@ -1215,6 +1218,7 @@ MavlinkReceiver::handle_message_set_gps_global_origin(mavlink_message_t *msg)
handle_request_message_command(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN);
}

#if defined(MAVLINK_MSG_ID_SET_VELOCITY_LIMITS) // For now only defined if development.xml is used
void MavlinkReceiver::handle_message_set_velocity_limits(mavlink_message_t *msg)
{
mavlink_set_velocity_limits_t mavlink_set_velocity_limits;
Expand All @@ -1227,6 +1231,7 @@ void MavlinkReceiver::handle_message_set_velocity_limits(mavlink_message_t *msg)
velocity_limits.timestamp = hrt_absolute_time();
_velocity_limits_pub.publish(velocity_limits);
}
#endif // MAVLINK_MSG_ID_SET_VELOCITY_LIMITS

void
MavlinkReceiver::handle_message_vision_position_estimate(mavlink_message_t *msg)
Expand Down
2 changes: 2 additions & 0 deletions src/modules/mavlink/mavlink_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ class MavlinkReceiver : public ModuleParams
void handle_message_trajectory_representation_bezier(mavlink_message_t *msg);
void handle_message_trajectory_representation_waypoints(mavlink_message_t *msg);
void handle_message_utm_global_position(mavlink_message_t *msg);
#if defined(MAVLINK_MSG_ID_SET_VELOCITY_LIMITS) // For now only defined if development.xml is used
void handle_message_set_velocity_limits(mavlink_message_t *msg);
#endif
void handle_message_vision_position_estimate(mavlink_message_t *msg);
void handle_message_gimbal_manager_set_attitude(mavlink_message_t *msg);
void handle_message_gimbal_manager_set_manual_control(mavlink_message_t *msg);
Expand Down

0 comments on commit c28128e

Please sign in to comment.