-
Notifications
You must be signed in to change notification settings - Fork 23
Autonomous Navigation
This page contains detailed procedures for simulating AGRIBOT in GAZEBO. Agribot is a four-wheel skid steer drive robot that we can control using a keyboard or autonomously with the help of sensor data. We have used rviz and mapviz for visualization purposes.
- Clone repository into your directory.
$ git clone https://github.com/Dhruv2012/Autonomous-Farm-Robot.git
- Create your Catkin workspace and Copy all directories of
agribot_ws/src
into your workspace's src directory.
$ source /opt/ros/NAME-OF-YOUR-DISTRO/setup.bash
$ mkdir -p ~/NAME-OF-WORKSPACE/src
$ cd ~/NAME-OF-WORKSPACE/
$ catkin_make
$ mv path_to_agribot_ws path_to_NAME_OF_WORKSPCE/src
$ cd ~/NAME-OF-WORKSPACE/
$ catkin_make
- Check & Install Required dependencies.
$ rosdep install [package]
$ sudo apt-get install ros-melodic-ros-control
$ sudo apt-get install ros-melodic-gazebo-ros-control
Note: You may need some more installation of pkgs, try to install them into your system (/opt/ros/melodic/share
). You also may have some broken pkgs, try to solve them before starting a simulation.
- Install Gazebo model from GAZEBO_MODEL_LIBRARY.
$ git clone https://github.com/osrf/gazebo_models.git
Make sure these models are copied into ~/.gazebo/models
. You can check by GAZEBO API through model editor.
The first step is using Keyboard_teleop node to control AGRIBOT in GAZEBO. Using teleop we can check functionality of AGRIBOT using ROS tools such as rostopic visualization, rosmsg, and through rqt. You can use any other teleop method in joy pkg.
- Load AGRIBOT into gazebo environment using launch file provided in
agribot_description/launch/
. Here we have created farming environment by integrating different models from GAZEBO_MODEL_LIBRARY. You can useempty_world
by changing path in launch file. Avoid external terminals to provide goal location.
$ roslaunch agribot_description my_world.launch
- Go into teleop_tools pkg and then keyboard_teleop pkg. You can run this node using 2 methods, either rosrun or python2.
$ rosrun keyboard_teleop keyboard_teleop.py
or
$ python2 keyboard_teleop.py
You can visualize topics and plots using rqt_plugins by running $ rqt
.
- To visualize trajectory of AGRIBOT, launch mapviz from mapviz pkg.
$ roslaunch mapviz mapviz.launch
Once we ready with all functionality checks, we can now work with an autonomous task. It is recommended that we first analyze sensor data before starting autonomous task script.
- Analyze data from rqt
$ rqt
Then select plugins/visualization/plots and select topics to view.
- Load AGRIBOT into gazebo environment using launch file provided in
agribot_description/launch/
. Also start mapviz for visualization.
$ roslaunch agribot_description my_world.launch
$ roslaunch mapviz mapviz.launch
- Now we can select GPS location of destination by traversing through field as GPS location varies time to time. We can use teleop operation or shortcut provided in GAZEBO API to collect GPS locations. Once we have GPS locations then first feed that location into external terminal. Now we can run scripts from
autonomous_drive /scripts/autonomous_drive.py
.
$ cd ~/NAME-OF-WORKSPACE/src/autonomous_drive/scripts
$ python autonomous_drive.py
- Programming Robots with ROS by Morgan Quigley, Brian Gerkey & William D. Smart
- ROS Robotics By Example by Carol Fairchild & Dr. Thomas L. Harman
- Simulation
- The Construct youtube channel
- ROS wiki is best place to learn..!!:punch: :v: