A robot that chases white-colored balls in an office enviornment created with Gazebo. This robot uses a camera sensor to detect the ball and drive in that direction.
This project is comprised of two ROS packages: ball_chaser and robot.
This was created as part of the Udacity Robotics Software Engineer Nanodegree Program.
To correctly load the project, the GAZEBO_MODEL_PATH environment
variable must be set:
$ export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:<path_to_robot_pkg>/modelsThis project uses catkin. Assuming you have catkin correctly setup, you can then run this project.
First, run the following to build the packages.
$ cd <path_to_catkin_ws>
$ catkin_makeIn one terminal window, please run:
$ cd <path_to_catkin_ws>
$ source devel/setup.bash
$ roslaunch robot world.launchIn a second terminal window, please run:
$ cd <path_to_catkin_ws>
$ source devel/setup.bash
$ roslaunch ball_chaser ball_chaser.launchYou should then see the robot follow the white ball in Gazebo.
You can also visualize the scene using RViz. In order to do this, wait for RViz to show up by running the commands above. Then, on the left side of RViz under Displays, perform the following:
- Select
odomfor Fixed Frame. - Click the Add button.
- Add
Robot Modelto display the robot in RViz. - Add
Cameraand choose/camera/rgb/image_rawfor the Image Topic. - Add
Laser Scanand select/scanfor the Topic.
- Add
You should now be able to fully visualize the scene in RViz.