Overview • Prerequisites • Directory Structure • How To Launch • Testing
This project is a part of Udacity's Robotics Software Engineer Nanodegree Program. In this project, I used ROSbot as a mobile robot and aws-robomaker-bookstore-world as a gazebo world to replicate realistic simulation. ROSbot had a hard time following white colored balls due to the brightness present inside the bookstore-world. So, I designed red colored ball in gazebo to enable ROSbot to chase it. There are two C++ nodes required to program ROSbot to follow red colored balls.
drive_bot
:
- This node provides a
ball_chaser/command_robot
service to drive the robot by controlling its linear x and angular z velocities. The service should publish to the wheel joints and return back the requested velocities.
process_image
:
- This node reads the robot’s camera image, analyzes it to determine the presence and position of a red ball. If a red ball exists in the image, this node requests a service via a client to drive the robot towards it.
- Gazebo >= 7.0.
- ROS >= Kinetic .
- make >= 4.1(mac, linux), 3.81(Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- Git
- you can click here to download the virtual machine with all dependencies included.
- you will need 7-zip to extract the image and VMware to run the virtual machine.
.Go-Chase-It # Go Chase It Project
├── catkin_ws # Catkin workspace
│ ├── src
│ │ ├── aws-robomaker-bookstore-world # folder that contains bookstore world
│ │ ├── ball_chaser # ball_chaser package
│ │ │ ├── launch # launch folder for launch files
│ │ │ │ ├── ball_chaser.launch
│ │ │ ├── src # source folder for C++ scripts
│ │ │ │ ├── drive_bot.cpp
│ │ │ │ ├── process_images.cpp
│ │ │ ├── srv # service folder for ROS services
│ │ │ │ ├── DriveToTarget.srv
│ │ │ ├── CMakeLists.txt # compiler instructions
│ │ │ ├── package.xml # package info
│ │ ├── images
│ │ ├── my_ball/my_ball # Model files for ball colored ball
│ │ │ ├── model.config
│ │ │ ├── model.sdf
│ │ ├── my_robot # my_robot package
│ │ │ ├── launch # launch folder for launch files
│ │ │ │ ├── robot_description.launch
│ │ │ │ ├── world.launch # Launches bookstore world
│ │ │ │ ├── teleop.launch # To drive the rosbot
│ │ │ ├── meshes # meshes folder for sensors
│ │ │ │ ├── astra.stl
│ │ │ │ ├── box.stl
│ │ │ │ ├── rplidar.stl
│ │ │ │ ├── upper.stl
│ │ │ │ ├── wheel.stl
│ │ │ ├── realsense2_camera # folder that contains launch files for realsense camera
│ │ │ ├── realsense2_description # folder that contains description files for realsense camera
│ │ │ ├── urdf # urdf folder for xarco files
│ │ │ │ ├── materials.xacro #contains material properties used in rosbot
│ │ │ │ ├── my_robot.xacro
│ │ │ │ ├── rosbot.gazebo #contains plugins to interact with rosbot
│ │ │ ├── worlds # world folder for world files
│ │ │ │ ├── empty.world
│ │ │ ├── CMakeLists.txt # compiler instructions
│ │ │ ├── Go-chase-it.rviz # rviz configuration
│ │ │ ├── package.xml # package info
$ cd /home/workspace/catkin_ws/src/
$ git clone https://github.com/Vamshi2198/Go-Chase-it-
$ source /opt/ros/${ROS_DISTRO}/setup.bash
Note : The world file proivided is empy because it only contains the url of remote repository, for this purpose you need to clone the aws-bookstore-world and place it inside your src folder. Also, delete the folder named aws-robomaker-bookstore-world manually before cloning.
$ cd /home/workspace/catkin_ws/src/
$ git clone https://github.com/aws-robotics/aws-robomaker-bookstore-world
$ cd /home/workspace/catkin_ws/
$ catkin_make
$ cd /home/workspace/catkin_ws/
$ source devel/setup.bash
$ roslaunch my_robot world.launch
$ cd /home/workspace/catkin_ws/
source devel/setup.bash
roslaunch ball_chaser ball_chaser.launch
cd /home/workspace/catkin_ws/
source devel/setup.bash
rosrun rqt_image_view rqt_image_view
Move the ball using the translate mode in gazebo. you should see the ROSbot follow the ball if it is in the region of the camera. The code was tested on the following specifications:
- Processor:
Intel Core i7-10875H
- Graphics:
Nvidia GeForce GTX 1650 Ti 4GB GDDR6
- OS:
Ubuntu 20.04.3 LTS
- Kernal:
5.10.60.1-microsoft-standard-WSL2
- ROS:
noetic