ROS2

From GCtronic wiki
Revision as of 09:05, 19 October 2023 by WikiSysop (talk | contribs)
Jump to navigation Jump to search

ROS2 is released in a docker container named ros_docker_epuck.
The ROS2 node can be found here https://github.com/gctronic/epuck_ros2.
In order to start the node follow these steps:

  1. docker run -it --privileged --network="host" ros_docker_epuck
  2. source /opt/ros/humble/install/local_setup.bash
  3. ros2 launch epuck_ros2 robot_launch.py

From your computer (pi-puck and computer must be connected to the same network) you can then list the topics with the command ros2 topic list.
For example you can read the time of flight sensor values with the command ros2 topic echo /tof.
You can turn on led0 with the command ros2 topic pub -1 /led0 std_msgs/msg/Bool "{data: true}".
You can move forward with the command ros2 topic pub -1 /cmd_vel geometry_msgs/Twist "{linear:{x: 0.0, y: 0.0, z: 0.0}, angular:{x: 0.0, y: 0.0, z: 0.0}}".