How to call a service from XML launch file?
Is there an equivalent to rosservice from ROS1 in ROS2? Much appreciated.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Is there an equivalent to rosservice from ROS1 in ROS2? Much appreciated.
For posterity, I found a solution using the executable tag. Let's say you wanted to spawn a second turtle in turtlesim, the below will accomplish this:
<executable
cmd="/spawn turtlesim/srv/Spawn '{x: 1.0, y: 1.0, theta: 0, name: 'custom_turtle'}'"
cwd="/home"
launch-prefix="ros2 service call"
output="screen"
>
</executable>
I don't know what 'cwd' is used for but it should remain as "/home" or else this particular command won't work. You can also combine the launch-prefix and cmd if so desired.
Asked: 2023-02-19 15:04:36 -0500
Seen: 140 times
Last updated: Feb 19 '23
Drift occurs when the robot turns( scan data ).
No message from ComposableNode when set use_sim_time
I don't know how to use merge_maps_kinematic in slam_toolbox.
ROS2 TurtleBot3 bringup how to connect with Remote PC?
Multiple conditions for IfCondition in ros2 launch script
Nav2 lifecycle nodes don't autostart
Installed galactic but environment ros distro=foxy