Skip to content

Instantly share code, notes, and snippets.

@Mubashir-alam
Last active October 30, 2023 17:03
Show Gist options
  • Save Mubashir-alam/50bb031fd5e26ee14abb8090328eceec to your computer and use it in GitHub Desktop.
Save Mubashir-alam/50bb031fd5e26ee14abb8090328eceec to your computer and use it in GitHub Desktop.
Launching multiple turtlesim ros1
<launch>
<!-- Start the turtlesim node -->
<node name="turtlesim_node" pkg="turtlesim" type="turtlesim_node" output="screen" />
<!-- Spawn the 'hour' turtle using /spawn service with a different name -->
<node name="robot_1" pkg="rosservice" type="rosservice" args="call /spawn 2.5 5.5 1.5708 hour" output="screen"/>
<!-- Spawn the 'minute_robot' turtle using /spawn service -->
<node name="robot_2" pkg="rosservice" type="rosservice" args="call /spawn 5.5 5.5 1.5708 minute" output="screen"/>
<!-- Spawn the 'second_robot' turtle using /spawn service -->
<node name="robot_3" pkg="rosservice" type="rosservice" args="call /spawn 8.5 5.5 1.5708 second" output="screen"/>
<!-- Kill the first turtle1 -->
<node name="Kill_turtle1" pkg="rosservice" type="rosservice" args="call /kill turtle1" output="screen"/>
</launch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment