Wish to create interesting robot motion and have control over your world and robots in Webots? Soft_illusion Channel is here with a new tutorial series on the integration of Webots and ROS2. (A channel which aims to help the robotics community).
https://github.com/harshkakashaniya/w...
#ROS2_tutorial #ROS2_project #SLAM_toolbox
Video series:
1. ROS 2, Webots installation and Setup of a workspace in VS Code
2. Different examples in Webots with ROS2
3. Use ROS2 services to interact with robots in Webots
4. Control a robot with ROS2 Publisher
5. Get feedback from different sensors of Robot with ROS2 Subscriber
6. Implement Master and Slave robots project with ROS2
7. Setup Rviz2 (Showing different sensor output )
8. Ways to debug projects with Rostopic echo, Rostopic info, RQT_graph
9. Use advance debugging tools like Rqt console, Rqt gui
10 & 11. Implementation of SLAM toolbox or LaMa library for unknown environment.
12. & 13. Implementation of AR-tag detection and getting exact pose from camera.
Note: Following are the system specifications that will be used in the tutorial series.
Ubuntu 20.04, ROS 2 Foxy, Webots R2020b-rev1
01:26 Lidar_enabler
14:11 Master node
14:57 SLAM configuration
17:38 Setup.py
19:29 Launch file.
20:43 Build and Run the project
26:11 Save the map
This 11th video performs the complete implementation of the project based on the integration of the SLAM toolbox in an unknown environment.
1. Lidar_enabler
Each sensor made use of, in the custom robot, like distance sensor, Lidar sensor and wheels etc needs to be enabled. This section teaches you how to write a node to do that.
We discuss the need to publish odometry and transform between odom and base_link in order to use SLAM toolbox to generate and correct the map. Here we are using models of generating odometry as differential drive with a factor X = 4 to approximate our 4 wheel drive with a differential drive. This helps us understand that slam toolbox is doing a great job to improve on updating the odometry as needed in order to get a great map. Also we publish Lidar scan on topic /scan in this node.
2. Master node
This is the same as the node in the 6th video. This is used to generate cmd_vel depending on the readings of the sensor. This node has features of correction of direction in order to follow the line and stop if it does not see any line by the infrared sensors.
3. SLAM configuration
This is the most important of this video where we are setting configuration of SLAM toolbox in order to facilitate publishing and update of the map and accordingly change transform between map and odom link by matching the laser scan with the generated occupancy grip. Hence it truly does localization at each step before adding points in the occupancy grid that are mapping. Some parameters which we set were robot base_link , map link, odom link , and scan topic. Also we set the updation distance and set different solvers and optimizers. If you want to know more about this toolbox refer to the 10th video of this series.
4. Setup.py
In this section we see how to setup different world files , protos , and launch file in setup.py in order to use it in the ROS2 framework.
5. Launch file.
This section includes writing a launch file in order to make this project work. It has 2 parts:
In the first part we use an inbuilt webots framework to call the world and call files to enable all the sensors and wheels in the custom robot. In the second part we make a node for line following logic. This node takes in IR sensor readings and processes the data. Finally it spits out cmd_vel which can be used by robot for navigation.
6. Build and Run the project
Finally we build the project again. For this purpose we go to the repo directory which in our case is: “cd ~/ros_ws/” then do “colcon build”. This builds all the packages in the repository. After this as a mandatory step we need to source the package so that ROS2 can register all the packages in the repository.
“source install/setup.bash”
And finally we run the project:
On the first terminal :
cd ~/ros2_ws/src/webots_ros2/webots_ros2_tutorials/config/
ros2 run slam_toolbox async_slam_toolbox_node --ros-args --param use_sim_time:=true --params-file slam_config.yaml
On the second terminal :cd ~/ros2_ws
ros2 launch webots_ros2_tutorials slam_toolbox_launch.py
In third terminal :rviz2
If you want the same configuration as in the video you can load it from rviz folder.
7. Save the map
After work, it is the results time. In order to save the map we need to open the terminal.
“Close the terminal with the slam_toolbox_launch” and Type the following in the new file:
ros2 run nav2_map_server map_saver_cli -t map
Webots ROS2 tutorial series is available here: • Webots ROS2 tutorial series : Setting Up R...
Introductory Webots tutorial playlist:
https://www.youtube.com/watch?v=yi4e5...
Comment if you have any doubts on the above video.