Is there an equivalent to rosservice from ROS1 in ROS2? Much appreciated.
Originally posted by ROS_Engineer on ROS Answers with karma: 16 on 2023-02-19
Post score: 0
Is there an equivalent to rosservice from ROS1 in ROS2? Much appreciated.
Originally posted by ROS_Engineer on ROS Answers with karma: 16 on 2023-02-19
Post score: 0
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.
Originally posted by ROS_Engineer with karma: 16 on 2023-02-20
This answer was ACCEPTED on the original site
Post score: 0