-
Notifications
You must be signed in to change notification settings - Fork 0
2. Real robot color follower
All the nodes in this section were tested using ROS2 Foxy Fitzroy distro and a turtlebot3 burger model. It's recommended to see the previous page to make it work in the simuation first.
The image on the right is a scheme of the nodes and the communications between them using ROS2 topics (DDS by default)
First of all you will first have to clone this repository in your ROS2 workspace src folder, change your branch to the tag v0.1_color_filter and build it as it's explained in the previous page.
In this case we are using a turtlebot3 burger model with a camera plugged in. We'll need to do the same for the robot but in this case you will have to change the branch to cam_img_pub_v0.1:
cd <your_workspace_path>/src
git clone https://github.com/USanz/follow_beacon.git
git checkout cam_img_pub_v0.1
cd <your_workspace_path>
colcon build --symlink-install --packages-select follow_beacon
source <your_workspace_path>/install/setup.bash
Once these steps have been done you can run the nodes one by one using the following commands:
-
In the robot (you can and should open a ssh session to run the commands):
- Run the bringup:
ros2 launch turtlebot3_bringup robot.launch.py
- Run the image publisher:
ros2 run follow_beacon camera_image_pub --ros-args --params-file <your_workspace_path>/src/follow_beacon/config/params.yaml
Note 1: you won't have to run this node if your turtlebot3 model already has a camera as the waffle model.
Note 2: remember to test the filter before and change the values of the parameters in the config/params.yaml file.
-
In the computer:
- Run the image filter node:
ros2 run follow_beacon image_color_filter --ros-args --params-file <your_workspace_path>/src/follow_beacon/config/params.yaml
Note: you can set the "display_gui" parameter in the config/params.yaml file to True and run only this node to test the filter until you get the right values, then you can save them in the config/params.yaml file and set the "display_gui" parameter to False again. You will have to stop the node and run it again order to apply the changes.
- Run the centroid finder:
ros2 run follow_beacon operator_image --ros-args --params-file <your_workspace_path>/src/follow_beacon/config/params.yaml
- Run the velocity publisher:
ros2 run follow_beacon sink_motors --ros-args --params-file <your_workspace_path>/src/follow_beacon/config/params.yaml