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: add custom ROS 2 messages and service interfaces #24277

Merged
merged 1 commit into from Jul 19, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions Tools/ros2/ardupilot_msgs/CMakeLists.txt
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.8)
project(ardupilot_msgs)

# --------------------------------------------------------------------------- #
# Find dependencies.

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)

# --------------------------------------------------------------------------- #
# Generate and export message interfaces.

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

ament_export_dependencies(rosidl_default_runtime)

# --------------------------------------------------------------------------- #
# Call last.

ament_package()
24 changes: 24 additions & 0 deletions Tools/ros2/ardupilot_msgs/package.xml
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd"
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ardupilot_msgs</name>
<version>0.0.0</version>
<description>Custom ROS 2 messages and services for ArduPilot</description>
<maintainer email="rhys.mainwaring@me.com">maintainer</maintainer>
<license>GPL-3.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
8 changes: 8 additions & 0 deletions Tools/ros2/ardupilot_msgs/srv/ArmMotors.srv
@@ -0,0 +1,8 @@

# This service requests the vehicle to arm or disarm its motors.

# Set true to arm motors, false to disarm motors.
bool arm
---
# True if the vehicle is armed.
bool result