ROS2: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
ROS2 is released in a docker container named <code>ros_docker_epuck</code>.<br/> | ROS2 Humble is released in a docker container named <code>ros_docker_epuck</code>.<br/> | ||
The ROS2 node can be found here [https://github.com/gctronic/epuck_ros2 https://github.com/gctronic/epuck_ros2].<br/> | The ROS2 node can be found here [https://github.com/gctronic/epuck_ros2 https://github.com/gctronic/epuck_ros2].<br/> | ||
In order to start the node follow these steps: | In order to start the node follow these steps: | ||
Line 6: | Line 6: | ||
# <code>ros2 launch epuck_ros2 robot_launch.py</code> | # <code>ros2 launch epuck_ros2 robot_launch.py</code> | ||
From your computer (pi-puck and computer must be connected to the same network) you can then list the topics with the command <code>ros2 topic list</code>. For example you can read the time of flight sensor values with the command <code>ros2 topic echo /tof</code> | From your computer (pi-puck and computer must be connected to the same network) you can then list the topics with the command <code>ros2 topic list</code>. <br/> | ||
For example you can read the time of flight sensor values with the command <code>ros2 topic echo /tof</code>.<br/> | |||
You can turn on led0 with the command <code>ros2 topic pub -1 /led0 std_msgs/msg/Bool "{data: true}"</code>.<br/> | |||
You can move forward with the command <code>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}}"</code>. |
Latest revision as of 09:08, 19 October 2023
ROS2 Humble 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:
docker run -it --privileged --network="host" ros_docker_epuck
source /opt/ros/humble/install/local_setup.bash
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}}"
.