Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Dhruv2012/Autonomous-Farm-Robot/llms.txt

Use this file to discover all available pages before exploring further.

This quickstart walks through launching the full AGRIBOT simulation — spawning the robot in a farm world, starting the ROS controller stack, and running the GPS-guided autonomous drive nodes. By the end you will have AGRIBOT navigating autonomously toward a GPS goal coordinate inside a simulated farm field, with its trajectory visible in Mapviz.
Prerequisites before you begin:
  • ROS Melodic (Ubuntu 18.04) or ROS Kinetic (Ubuntu 16.04)
  • Gazebo 9 or later
  • Python 3.6 or later
  • A configured catkin workspace (created during installation)
Complete the Installation guide first if you have not already set up your environment.
1

Clone and build the workspace

Clone the AGRIBOT repository and build the catkin workspace. The catkin_make step compiles all ROS packages — agribot_description, agribot_control, and autonomous_drive — in a single pass.
git clone https://github.com/Dhruv2012/Autonomous-Farm-Robot.git
cd Autonomous-Farm-Robot/agribot_ws
catkin_make
source devel/setup.bash
2

Launch Gazebo with the farm world

Spawn AGRIBOT into a Gazebo simulation. Use agribot_gazebo_simulation.launch to start with an empty world, or my_world.launch to load the full farm field environment (recommended).
roslaunch agribot_description agribot_gazebo_simulation.launch
This launch file spawns the AGRIBOT URDF model (agribot_sensors.urdf.xacro) into an empty Gazebo world and publishes a static transform between base_link and base_footprint. To use the custom farm field world with CropWithWeed models, grass terrain, and a gate instead, run:
roslaunch agribot_description my_world.launch
my_world.launch loads Farm.world, starts joint_state_publisher and robot_state_publisher, and automatically includes agribot_control.launch so you do not need to start the controllers separately. It also opens the GPS converter and data manipulation nodes in separate xterm terminals automatically — if you use my_world.launch, skip Steps 3, 4, and 5 and proceed directly to Step 6.
3

Start the ROS controllers

Open a new terminal and start the effort controllers for all four wheels. These PID controllers (rightwheelR_effort_controller, leftwheelR_effort_controller, rightwheelF_effort_controller, leftwheelF_effort_controller) are required for the autonomous drive node to issue velocity commands.
source devel/setup.bash
roslaunch agribot_control agribot_control.launch
Skip this step if you launched my_world.launch in the previous step — it already includes agribot_control.launch.
4

Launch the GPS converter node

Open a new terminal and start the GPS data conversion node. This node reads the simulated GPS fix topic, converts raw GPS coordinates into a local Cartesian frame, and prompts you to enter a goal position.
source devel/setup.bash
rosrun autonomous_drive GPS_data_conversion.py
When prompted, enter the latitude and longitude of your navigation goal. The node will compute the bearing and distance from the robot’s current GPS position to the goal.
Skip this step if you launched my_world.launch — it already starts this node in an xterm terminal automatically.
5

Launch the data manipulation node

Open a new terminal and start the sensor data manipulation node. This node applies a Moving Median filter and a single-dimension Kalman filter to reduce GPS and magnetometer noise before passing heading corrections to the drive controller.
source devel/setup.bash
rosrun autonomous_drive data_manipulation.py
Skip this step if you launched my_world.launch — it already starts this node in an xterm terminal automatically.
6

Launch the autonomous drive node

Open a new terminal and start the autonomous drive node. AGRIBOT will now use the filtered GPS bearing data to navigate toward the goal coordinates you entered.
source devel/setup.bash
rosrun autonomous_drive autonomus_drive.py
The robot drives forward along the computed heading, correcting its course using the magnetometer and GPS feedback loop. Watch Gazebo to observe AGRIBOT moving through the farm rows.
For waypoint patrol mode — where AGRIBOT visits a sequence of GPS waypoints — use the ROS move_base action server integration instead:
rosrun autonomous_drive AutonomusDriveAction.py
This node sends goal poses to the move_base action server, enabling multi-waypoint autonomous traversal of the field.

Visualizing in Mapviz

Mapviz is a ROS visualization tool that renders the robot’s GPS trace on a map canvas. Launch it in a separate terminal:
roslaunch mapviz mapviz.launch
Once open, Mapviz displays two overlays derived from the autonomous_drive nodes:
  • Green points — the endpoints of each crop row in the field, used as intermediate waypoints.
  • Blue line — the continuous GPS trajectory traced by AGRIBOT as it navigates.
The camera image stream from /agribot/camera/image_raw can also be fed directly into the Bonnet CNN classification model for real-time crop-weed segmentation alongside navigation.

Build docs developers (and LLMs) love