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

Tools : Added custom ROS-2 service definition for switching drive modes #24705

Merged
merged 1 commit into from
Sep 1, 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
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
15 changes: 15 additions & 0 deletions Tools/ros2/ardupilot_msgs/srv/ModeSwitch.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# 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://mavlink.io/en/messages/ardupilotmega.html#COPTER_MODE
# Rover : https://mavlink.io/en/messages/ardupilotmega.html#ROVER_MODE
# Plane : https://mavlink.io/en/messages/ardupilotmega.html#PLANE_MODE

uint8 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
uint8 curr_mode