diff_drive_bot
Install diff_drive_robot
Link:
https://github.com/devanshdhrafani/diff_drive_bot
Ubuntu 18.04
Ubuntu 20.04 Install
Create a workspace:
http://wiki.ros.org/catkin/Tutorials/create_a_workspace
$ mkdir -p ~/robot_ws/src
$ cd ~/robot_ws/
$ catkin_make
Clone project:
$ cd ~/robot_ws/
$ git clone https://github.com/devanshdhrafani/diff_drive_bot.git
$ cd ..
$ catkin_make
Install Required dependencies:
$ sudo apt-get install ros-noetic-dwa-local-planner
$ sudo apt-get install ros-noetic-joy
$ sudo apt install ros-noetic-slam-gmapping
Source path and Load the robot in the Gazebo environment. :
bblab7490@bblab7490:~/robot_ws$ source devel/setup.bash
Load the robot in the Gazebo environment. Default model is the turtlebot3_house. You can change this from /worlds/mybot.world. To continue with default model:
$ roslaunch diff_drive_bot gazebo.launch
Get error:
RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: no such command [['/opt/ros/noetic/share/xacro/xacro.py', '/home/bblab7490/robot_ws/src/diff_drive_bot/urdf/mybot.xacro']].
how to Fix:
Edit file : bblab7490@bblab7490:~/robot_ws/src/diff_drive_bot/launch/gazebo.launch
Delele ".py" in 25 <param name="robot_description" command="$(find xacro)/xacro '$(find diff_drive_bot)/urdf/mybot.xacro.py'"/>
Launch robot in gazebo:
$ roslaunch diff_drive_bot gazebo.launch
Install turtlebot3 for model:
https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/
$ cd ~/catkin_ws/src/
$ git clone -b kinetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
$ cd ~/catkin_ws && catkin_make
Missing package:
sudo apt-get install ros-noetic-turtlebot3-msgs
sudo apt-get install ros-noetic-turtlebot3-teleop
Open model:
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_gazebo turtlebot3_house.launch
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
4. Launch the slam_gmapping node. This will also start rviz where you can visualize the map being created:
$ roslaunch diff_drive_bot gmapping.launch
Get error RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: no such command [['/opt/ros/noetic/share/xacro/xacro.py', '/home/bblab7490/robot_ws/src/diff_drive_bot/urdf/mybot.xacro']].
Fix same as step 3.
5. Move the robot around. If you have a Joystick, use:
$ roslaunch diff_drive_bot joy_teleop_launch.launch
OR teleop using keyboard:
$ rosrun diff_drive_bot keyboard_teleop.py
got error: SyntaxError: Missing parentheses in call to 'print'. Did you mean print(msg)
Fix: Edit : bblab7490@bblab7490:~/robot_ws/src/diff_drive_bot/scripts/keyboard_teleop.py
all print change to include (): print msg -> print (msg)
print vels(target_linear_vel,target_angular_vel) -> print (vels(target_linear_vel,target_angular_vel) )
got error: /usr/bin/env: ‘python’: No such file or directory
Fix: sudo apt-get install python-is-python3
6. Autonomous Navigation
Load the robot in gazebo environment:
$ roslaunch diff_drive_bot gazebo.launch
Start the amcl, move_base and rviz nodes:
$ roslaunch diff_drive_bot amcl_move_base.launch
Got error: failed to open image file "/home/ipro/ros_ws/src/diff_drive_bot/maps/test_map.pgm": Couldn't open /home/ipro/ros_ws/src/diff_drive_bot/maps/test_map.pgm
Fix : Edit file : {your directory }/robot_ws/src/diff_drive_bot/maps/ test_map.yaml
change " image: /home/bblab7490/robot_ws/src/diff_drive_bot/maps/test_map.pgm" to your correct path in your computer