Implementation from scratch of a mobile robot
https://www.youtube.com/shorts/2U2N2IlqIuU
- Ubuntu 18 with ROS Melodic installed. This computer can be a laptop, like in this case, but it also can run in an embedded system like a Jetson Nano or a Raspberry.
- A differential drive robot with 4 wheels (this project was implemented with 4), but it also can be with two wheels.
- The hardware: encoders in the motors for the wheels, Arduino Leonardo, Laptop, Two Motor Drivers for 4 motos, RPLIDAR.
You need to implement the Arduino code mobile_robot_final.ino . You need to connect the encoders, motor drivers and serial cable to the Arduino (connects to the computer)
After that you can implement the robot package in your computer. You need to download the repository and paste the requiered package in your workspace, depending on the tutorial you are working.
- Create a catkin workspace
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/
$ catkin_make
- Download the repository insider the /src file of the workspace
$ cd /src
$ copy the mrobot_ws in the src folder
- Make again and check all compiles correctly.
$ cd ..
$ catkin_make
You can see the hardware that is used. The connections can be obtained from the Arduino code. In the future, there will be a more detailed connection descrition.
- Source your environment
$ cd catkin_ws
$ cd source devel/setup.bash
- Launch the hardware interface. This communicates the Arduino and the Computer with ROS
$ roslaunch hardware_interface mobile_robot_serial.launch
- Launch the mapping package
$ roslaunch mobile_robot_slam mobile_robot_slam.launch
- Launch the teleoperation
$ roslaunch mobile_robot_teleop mobile_robot_teleop_key.launch
Stop the mapping and place the robot in the initial position where it started mapping
- Launch the hardware interface. This communicates the Arduino and the Computer with ROS
$ roslaunch hardware_interface mobile_robot_serial.launch
- In another terminal, run the bringup launch file, wich publish the /odom topic and connects to the RPLIDAR
$ roslaunch hardware_interface mobile_robot_bringup.launch
- In another terminal, run the navigation package
$ roslaunch mobile_robot_navigation mobile_robot_navigation.launch
Inside RVIZ you can start navigating