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 ROS 2 launch file for eProsima integration service #9

Conversation

srmainwaring
Copy link

Add ROS 2 launch file for eProsima integration service

Dependencies

Usage

Checkout the additional repos specified in ./Tools/ros2/ros_repos

$ cd ~/ros2_ws/src
$ wget https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2.repos
$ vcs import --recursive < ros2.repos
$ cd ~/ros2_ws
$ colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMIX_ROS_PACKAGES=ardupilot_msgs

You may need to source ./install/setup.bash after building ardupilot_msgs since is-ros2-mix-generator does not have an explicit dependency on ardupilot_msgs in the package xml.

Launch the integration service:

$ cd ~/ros2_ws
$ source ./install/setup.bash
$ ros2 launch ardupilot_sitl integration_service.launch.py config_file:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/Arm_Motors_DDS_IS_config.yaml is_prefix_path:=$(pwd)/install/is-ros2/lib/is/ros2:$(pwd)/install/is-ros2-mix-generator/lib:$(pwd)/install/is-fastdds/lib

Check nodes:

$ ros2 node list
/Ardupilot_DDS_XRCE_Client
/is_ros2_node_1804289383

Check services:

 ros2 service list -t
/arm_motors [ardupilot_msgs/srv/ArmMotors]
/is_ros2_node_1804289383/describe_parameters [rcl_interfaces/srv/DescribeParameters]
/is_ros2_node_1804289383/get_parameter_types [rcl_interfaces/srv/GetParameterTypes]
/is_ros2_node_1804289383/get_parameters [rcl_interfaces/srv/GetParameters]
/is_ros2_node_1804289383/list_parameters [rcl_interfaces/srv/ListParameters]
/is_ros2_node_1804289383/set_parameters [rcl_interfaces/srv/SetParameters]
/is_ros2_node_1804289383/set_parameters_atomically [rcl_interfaces/srv/SetParametersAtomically]

Call arming service:

$ ros2 service call /arm_motors ardupilot_msgs/srv/ArmMotors "{arm: 1}"
waiting for service to become available...
requester: making request: ardupilot_msgs.srv.ArmMotors_Request(arm=True)

response:
ardupilot_msgs.srv.ArmMotors_Response(result=False)

- Moved from https://github.com/arshPratap/ardupilot_ros2.

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
…onfig

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
@arshPratap
Copy link
Owner

thanks @srmainwaring ! Have merged them in !

@arshPratap arshPratap merged this pull request into arshPratap:ddsServiceSupport Jul 5, 2023
@srmainwaring srmainwaring deleted the reviews/ddsServiceSupport-is-launch branch July 19, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants