Skip to content

Commit

Permalink
Tools : Added custom ROS-2 serivce definition for switching drive modes
Browse files Browse the repository at this point in the history
  • Loading branch information
arshPratap committed Aug 19, 2023
1 parent 7d264f1 commit f1a44c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tools/ros2/ardupilot_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"srv/ArmMotors.srv"
"srv/ModeSwitch.srv"
ADD_LINTER_TESTS
)

Expand Down
14 changes: 14 additions & 0 deletions Tools/ros2/ardupilot_msgs/srv/ModeSwitch.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# This service requests the vehicle to switch its drive/flight mode

# mode : Set the value to the drive/flight mode to be used
# Copter : https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/mode.h#L14
# Rover : https://github.com/ArduPilot/ardupilot/blob/master/Rover/mode.h#L12
# Plane : https://github.com/ArduPilot/ardupilot/blob/master/ArduPlane/mode.h#L22

int8 mode
---
# status : True if the request for mode switch was successful, False otherwise
# curr_mode : Returns the code for the current drive/flight mode , after the processing the request
bool status
int8 curr_mode

0 comments on commit f1a44c3

Please sign in to comment.