filmov
tv
ROS Turtlesim

Показать описание
You've installed ROS. Now what? You may not yet be ready to program a self-driving car--but you can get familiar with ROS using turtlesim, the "hello, world" of ROS. This video shows how to install turtlesim (we're using ROS Foxy installed in an LXD container on an 18.04 workstation) and demonstrates some basic commands.
Here's a list of the commands that were used in this video:
- To install turtlesim:
sudo apt install ros-foxy-turtlesim
- Commands to explore ROS packages:
ros2 pkg --help
ros2 pkg executables turtlesim
- To start the turtlesim simulator:
ros2 run turtlesim turtlesim_node
- To start the turtlesim keyboard controller:
ros2 run turtlesim turtle_teleop_key
- To make the turtle draw a square:
ros2 run turtlesim draw_square
- To clear the playing field:
ros2 service call /clear std_srvs/srv/Empty
- To add another turtle to the simulator:
ros2 service call /spawn turtlesim/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"
- To control the second turtle with the keyboard (assuming the new turtle node is called "turtle2"):
ros2 run turtlesim turtle_teleop_key --ros-args --remap turtle1/cmd_vel:=turtle2/cmd_vel
––––––––––––––––––––––––––––––
Soundtrack:
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
Here's a list of the commands that were used in this video:
- To install turtlesim:
sudo apt install ros-foxy-turtlesim
- Commands to explore ROS packages:
ros2 pkg --help
ros2 pkg executables turtlesim
- To start the turtlesim simulator:
ros2 run turtlesim turtlesim_node
- To start the turtlesim keyboard controller:
ros2 run turtlesim turtle_teleop_key
- To make the turtle draw a square:
ros2 run turtlesim draw_square
- To clear the playing field:
ros2 service call /clear std_srvs/srv/Empty
- To add another turtle to the simulator:
ros2 service call /spawn turtlesim/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"
- To control the second turtle with the keyboard (assuming the new turtle node is called "turtle2"):
ros2 run turtlesim turtle_teleop_key --ros-args --remap turtle1/cmd_vel:=turtle2/cmd_vel
––––––––––––––––––––––––––––––
Soundtrack:
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0