Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCS_MAVLink: handle MAV_CMD_DO_SPRAYER as both long and int #25454

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9851,7 +9851,7 @@ def Sprayer(self):

self.start_subtest("Checking mavlink commands")
self.progress("Starting Sprayer")
self.run_cmd(mavutil.mavlink.MAV_CMD_DO_SPRAYER, p1=1)
self.run_cmd_int(mavutil.mavlink.MAV_CMD_DO_SPRAYER, p1=1)

self.progress("Testing speed-ramping")
self.wait_servo_channel_value(
Expand Down
2 changes: 1 addition & 1 deletion libraries/GCS_MAVLink/GCS.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ class GCS_MAVLINK
MAV_RESULT handle_command_do_set_roi(const mavlink_command_int_t &packet);
virtual MAV_RESULT handle_command_do_set_roi(const Location &roi_loc);
MAV_RESULT handle_command_do_gripper(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_do_sprayer(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_do_sprayer(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_do_set_mode(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_get_home_position(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_do_fence_enable(const mavlink_command_int_t &packet);
Expand Down
12 changes: 6 additions & 6 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4584,7 +4584,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_do_gripper(const mavlink_command_long_t &
#endif // AP_GRIPPER_ENABLED

#if HAL_SPRAYER_ENABLED
MAV_RESULT GCS_MAVLINK::handle_command_do_sprayer(const mavlink_command_long_t &packet)
MAV_RESULT GCS_MAVLINK::handle_command_do_sprayer(const mavlink_command_int_t &packet)
{
AC_Sprayer *sprayer = AP::sprayer();
if (sprayer == nullptr) {
Expand Down Expand Up @@ -4731,11 +4731,6 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
result = handle_command_do_gripper(packet);
break;
#endif
#if HAL_SPRAYER_ENABLED
case MAV_CMD_DO_SPRAYER:
result = handle_command_do_sprayer(packet);
break;
#endif

#if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED
case MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES: {
Expand Down Expand Up @@ -5059,6 +5054,11 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &p
case MAV_CMD_DO_SET_MODE:
return handle_command_do_set_mode(packet);

#if HAL_SPRAYER_ENABLED
case MAV_CMD_DO_SPRAYER:
return handle_command_do_sprayer(packet);
#endif

#if AP_CAMERA_ENABLED
case MAV_CMD_DO_DIGICAM_CONFIGURE:
case MAV_CMD_DO_DIGICAM_CONTROL:
Expand Down