Environment: Ros 2 Foxy, Python 3, Ubuntu 20.04 Use the prepared docker environment for fast deployment and testing, instructions available in launch_docker_env.md
Finished tf2 tutorial
Package with base programming practice:
- Center body follow:
ros2 launch snake_tf2 snake_base.launch.py
- Tail follow (follower stays slightly behind):
ros2 launch snake_tf2 snake_fixed_frame.launch.py
- Center body follow for Empty service call:
ros2 launch snake_tf2 snake_wait_call.launch.py
- Tail follow for Empty service call(follower stays slightly behind):
ros2 launch snake_tf2 snake_fixed_frame_wait_call.launch.py
Launch one of those launch.py and then call a ros2 service with the name /start_turtlesim_snake like this to spawn turtle in random point:
ros2 service call /start_turtlesim_snake std_srvs/Empty
- Center body follow for service call with input location:
ros2 launch snake_tf2 snake_wait_initial_pose.launch.py
- Tail follow for service call with input location(follower stays slightly behind):
ros2 launch snake_tf2 snake_fixed_frame_wait_initial_pose.launch.py
Launch one of those launch.py and then call a ros2 service with the name /start_turtlesim_snake like this to spawn turtle in specific place:
ros2 service call /start_turtlesim_snake snake_interfaces/srv/TurtlePos "{pos_x: 1, pos_y: 1, angle: 1}"
Snake game needs heavy debugging. The multinode modular approach is not capable of handing all the nodes in one core process and the speed commands are too slow/irregular to move the turtles correctly. The dynamic spawn works fine and creates complex nodes but from a single computer perspective it needs refinement to achieve proper performance. A simpler approach just accessing the data as a service would probably work better.
ros2 launch snake_tf2 game_of_snake.launch.py
- Change the simulation background color when the turtle is eaten. Good example on how to set parameters from other packages using their own services with a minimal client that belongs to the listener class.
C++ package with the additional msg and srv types used in the snake package.