dwijaybane / RoboND-Term1-P2-Go-Chase-It

Project 2 of Udacity Robotics Software Engineer Nanodegree Program

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RoboND-Term1-P2-Go-Chase-It

Project 2 of Udacity Robotics Software Engineer Nanodegree Program Overview

Overview

In this project you'll create two ROS packages inside your catkin_ws/src: the drive_bot and the ball_chaser which will be used in Gazebo for all your upcoming projects in the Udacity Robotics Software Engineer Nanodegree Program. Here are the steps to design the robot, house it inside your world, and program it to chase white-colored balls:

  1. drive_bot:
  • Create a my_robot ROS package to hold your robot, the white ball, and the world.
  • Design a differential drive robot with the Unified Robot Description Format. Add two sensors to your robot: a lidar and a camera. Add Gazebo plugins for your robot’s differential drive, lidar, and camera. The robot you design should be significantly different from the one presented in the project lesson. Implement significant changes such as adjusting the color, wheel radius, and chassis dimensions. Or completely redesign the robot model! After all you want to impress your future employers :-D
  • House your robot inside the world you built in the Build My World project.
  • Add a white-colored ball to your Gazebo world and save a new copy of this world.
  • The world.launch file should launch your world with the white-colored ball and your robot.
  1. ball_chaser:
  • Create a ball_chaser ROS package to hold your C++ nodes.
  • Write a drive_bot C++ node that will provide 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.
  • Write a process_image C++ node that reads your robot’s camera image, analyzes it to determine the presence and position of a white ball. If a white ball exists in the image, your node should request a service via a client to drive the robot towards it.
  • The ball_chaser.launch should run both the drive_bot and the process_image nodes.

Prerequisites/Dependencies

Setup Instructions (abbreviated)

  1. Meet the Prerequisites/Dependencies
  2. Open Ubuntu Bash and clone the project repository
  3. On the command line execute
sudo apt-get update && sudo apt-get upgrade -y
  1. Build and run your code.

Project Description

Directory Structure

.Go-Chase-It                                   # Go Chase It Project
├── catkin_ws                                  # Catkin workspace
│   ├── src
│   │   ├── 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
│   │   ├── my_gokart                          # my_gokart package        
│   │   │   ├── launch                         # launch folder for launch files   
│   │   │   │   ├── gokart_description.launch
│   │   │   │   ├── world.launch
│   │   │   ├── urdf                           # urdf folder for xarco files
│   │   │   │   ├── my_gokart.gazebo
│   │   │   │   ├── my_gokart.xacro
│   │   │   ├── worlds                         # world folder for world files
│   │   │   │   ├── empty.world
│   │   │   │   ├── myoffice.world
│   │   │   ├── CMakeLists.txt                 # compiler instructions
│   │   │   ├── package.xml                    # package info
│   │   ├── my_robot                           # my_robot package        
│   │   │   ├── launch                         # launch folder for launch files   
│   │   │   │   ├── robot_description.launch
│   │   │   │   ├── world.launch
│   │   │   ├── meshes                         # meshes folder for sensors
│   │   │   │   ├── hokuyo.dae
│   │   │   ├── urdf                           # urdf folder for xarco files
│   │   │   │   ├── my_robot.gazebo
│   │   │   │   ├── my_robot.xacro
│   │   │   ├── worlds                         # world folder for world files
│   │   │   │   ├── empty.world
│   │   │   │   ├── myoffice.world
│   │   │   ├── CMakeLists.txt                 # compiler instructions
│   │   │   ├── package.xml                    # package info
├── my_ball                                    # Model files 
│   ├── model.config
│   ├── model.sdf
├── videos                                     # Video files
│   ├── Term1-Project2-Go-Chase-It-Demo.gif    # Demo video

Run the project

  • Clone this repository
  • Open the repository and make
cd /home/workspace/RoboND-Term1-P2-Go-Chase-It/catkin_ws/
catkin_make
  • Launch my_robot/my_gokart in Gazebo to load both the world and plugins
roslaunch my_robot world.launch

or

roslaunch my_gokart world.launch
  • Launch ball_chaser and process_image nodes
cd /home/workspace/RoboND-Term1-P2-Go-Chase-It/catkin_ws/
source devel/setup.bash
roslaunch ball_chaser ball_chaser.launch
  • Visualize
cd /home/workspace/RoboND-Term1-P2-Go-Chase-It/catkin_ws/
source devel/setup.bash
rosrun rqt_image_view rqt_image_view  

Tips

  1. It's recommended to update and upgrade your environment before running the code.
sudo apt-get update && sudo apt-get upgrade -y

Code Style

Please (do your best to) stick to Google's C++ style guide.

Project Rubric

1. Basic Requirements

1.1 Does the submission include the my_robot and the ball_chaser ROS packages?

Yes, it does.

1.2 Do these packages follow the directory structure detailed in the project description section?

Yes, it does.

2. Robot Design

2.1 Does the submission include a design for a differential drive robot, using the Unified Robot Description Format?

Yes, it does.

3. Gazebo World

3.1 Does the my_robot ROS package contain the Gazebo world?

Yes, it does.

4. Ball Chasing

4.1 Does the ball_chaser ROS package contain two C++ ROS nodes to interact with the robot and make it chase a white-colored ball?

Yes, it does.

5. Launch Files

5.1 Does the submission include world.launch and ball_chaser.launch files that launch all the nodes in this project?

Yes, it does.

About

Project 2 of Udacity Robotics Software Engineer Nanodegree Program

License:MIT License


Languages

Language:CMake 69.7%Language:C++ 30.3%