AGRIBOT includes a complete Gazebo simulation environment featuring a 50 × 50 m farm field world with textured grass and pavement tiles, a grid of cylindricalDocumentation 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.
CropWithWeed plant models, an entry gate pole, and a surrounding scene of pine trees, oak trees, and lamp posts. The robot model itself carries simulated GPS (NEO-M8N style via libhector_gazebo_ros_gps.so), IMU, magnetometer, and a 640 × 480 RGB camera — all with configurable Gaussian noise — making the simulation closely representative of real-world sensor conditions.
Available Launch Files
Theagribot_description and agribot_control packages expose five launch files that cover every stage of the simulation workflow, from bare URDF loading through to full autonomous drive.
agribot_description.launch — URDF, joint state publishers, and RViz
agribot_description.launch — URDF, joint state publishers, and RViz
Loads
agribot_body.urdf.xacro onto the ROS parameter server and starts robot_state_publisher, joint_state_publisher, and RViz with a default display configuration. Use this for URDF inspection and RViz-only visualization without a running Gazebo instance.Nodes started: joint_state_publisher, robot_state_publisher, rvizagribot_gazebo_simulation.launch — Empty world spawn
agribot_gazebo_simulation.launch — Empty world spawn
Spawns AGRIBOT (
agribot_sensors.urdf.xacro) into an empty Gazebo world using gazebo_ros/empty_world.launch. Also publishes a static TF from base_link to base_footprint and fires a fake joint calibration signal on /calibrated.Nodes started: gazebo, spawn_model, tf_footprint_base, fake_joint_calibrationmy_world.launch — Farm field world spawn
my_world.launch — Farm field world spawn
Spawns AGRIBOT into the custom
Farm.world Gazebo scene. Also starts joint_state_publisher, robot_state_publisher, a static TF from odom to map, and includes agribot_control.launch automatically. The GPS converter and data manipulation nodes are also launched in separate xterm terminals from this file.Nodes started: gazebo, joint_state_publisher, robot_state_publisher, controller_spawner, gps_converter, sensor_data, plus a static TF broadcasteragribot_rviz_display.launch — Robot state publishers
agribot_rviz_display.launch — Robot state publishers
Starts
joint_state_publisher and robot_state_publisher only, without launching RViz or Gazebo. Use this as a lightweight base when you want to bring up the robot state topics and then open your own RViz session manually.Nodes started: joint_state_publisher, robot_state_publisheragribot_control.launch — Effort controllers
agribot_control.launch — Effort controllers
Loads the PID controller configuration from
agribot_control/config/agribot_control.yaml and spawns five controllers under the /agribot namespace: joint_state_controller, rightwheelR_effort_controller, leftwheelR_effort_controller, rightwheelF_effort_controller, and leftwheelF_effort_controller. Also loads agribot_sensors.urdf.xacro onto the parameter server.Nodes started: controller_spawnerFarm World Description
TheFarm.world SDF file defines the complete simulation environment. Understanding its structure helps when extending or debugging the scene.
Terrain layout. The ground plane is a 50 × 50 m static model (farm_field_0_0) composed of 100 tiled 5 × 5 m visual panels. Most panels use the vrc/grass material, while an interior band of panels uses the vrc/pavement material (Gazebo/Grey) — creating a visual driving corridor distinct from the surrounding field grass.
CropWithWeed models. The farm field is populated with a grid of CropWithWeed SDF objects, each a cylinder of radius 0.055 m and length 0.2 m placed 0.115 m above ground. Their visual material (CropWithWeed/Diffuse) is driven by a custom OGRE script (CropWithWeed.material) that applies a plant texture PNG. The cylinder geometry provides both a collision shape for the physics engine and a surface for the camera-based CNN classifier to segment.
Simulated sensors on the robot. The AGRIBOT model embedded in Farm.world runs the following Gazebo plugins:
| Plugin | Topic | Update Rate |
|---|---|---|
libhector_gazebo_ros_gps.so | /agribot/fix, /agribot/fix_velocity | 5 Hz |
libhector_gazebo_ros_imu.so | /agribot/imu | 200 Hz |
libhector_gazebo_ros_magnetic.so | /magnetic | 5 Hz |
libgazebo_ros_camera.so | /agribot/camera/image_raw | 30 Hz |
libgazebo_ros_skid_steer_drive.so | /agribot/cmd_vel, /agribot/odom | 100 Hz |
maps/farm.yaml file defines the occupancy grid used with the optional map_server node:
Teleoperation for Manual Testing
Before running the autonomous drive nodes, you can drive AGRIBOT manually to verify that the controllers, motor effort publishers, and skid-steer drive plugin are working correctly. Open a new terminal and run one of the following:geometry_msgs/Twist messages to /agribot/cmd_vel, which the libgazebo_ros_skid_steer_drive.so plugin consumes to apply torque to all four wheel joints. Confirm the robot moves in the expected direction before starting the GPS navigation stack.
Recording and Replaying Sensor Data
Pre-recorded ROS bag files are included inDocuments/bag_files/. These bags capture all sensor topics (GPS fix, IMU, magnetometer, camera, odometry) from actual simulation runs and can be replayed to test the navigation and classification nodes without running a live Gazebo instance.
rosbag play --clock and set use_sim_time:=true on the ROS parameter server if any nodes depend on the ROS clock.