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.

agribot_description is the primary robot modeling package. It contains the URDF/Xacro description of AGRIBOT’s chassis and sensors, Gazebo world files for the farm simulation, STL mesh files, and all launch files to spawn the robot and open visualization tools. Every other package in the workspace depends on the robot description defined here — it is the single source of truth for the physical model, sensor placement, and Gazebo plugin configuration.

Package Contents

agribot_description/
├── urdf/
│   ├── agribot.urdf               # Generated URDF (do not edit directly)
│   ├── agribot_sensors.urdf.xacro # Top-level: includes body + Gazebo plugins
│   ├── agribot_body.urdf.xacro    # Chassis links and joints
│   ├── agribot_parts.urdf.xacro   # Wheel and part definitions
│   ├── agribot_materials.urdf.xacro # Material color definitions
│   ├── entry_gate.urdf            # Farm entry gate model
│   └── gate_sensor.urdf           # Gate sensor URDF
├── meshes/
│   ├── base_link.STL              # Robot chassis mesh
│   ├── wheel_1.STL                # Wheel mesh (rear-left)
│   ├── wheel_2.STL                # Wheel mesh (rear-right)
│   ├── wheel_3.STL                # Wheel mesh (front-left)
│   ├── wheel 4.STL                # Wheel mesh (front-right, note space in filename)
│   └── camera.dae                 # Camera mesh (Collada)
├── worlds/
│   ├── Farm.world                 # Full farm world with crops
│   ├── final.world                # Final simulation world
│   ├── world1.world               # Development world
│   └── volcano.world              # Terrain variation world
├── models/
│   ├── CropWithWeed/              # Cylindrical crop+weed SDF model
│   └── farm_field/                # Farm ground and soil textures
├── maps/
│   └── farm.yaml                  # Map origin configuration
├── launch/
│   ├── agribot_description.launch
│   ├── agribot_gazebo_simulation.launch
│   ├── agribot_rviz_display.launch
│   └── my_world.launch
├── config/
│   └── joint_names_agribot.yaml
└── rviz/
    └── agribot_urdf.rviz

URDF/Xacro Structure

The robot description is split across several Xacro files to keep each concern isolated and maintainable. At build time, xacro processes the top-level file and resolves all includes into a single URDF loaded onto the ROS parameter server. The include chain is:
  • agribot_sensors.urdf.xacro (top-level) — includes agribot_body.urdf.xacro and declares all Gazebo simulation plugins. This is the file passed to xacro in every launch file.
  • agribot_body.urdf.xacro — defines the chassis (base_link), four wheel links and joints, IMU link, GPS link, magnetometer link, and the camera link with its libgazebo_ros_camera.so plugin.
  • agribot_parts.urdf.xacro — defines the agribot_part Xacro macro used to instantiate each wheel with the correct geometry, inertia, and joint.
  • agribot_materials.urdf.xacro — declares named URDF materials (Black, Gray, DarkGray, White, Yellow, WoodBrown, Red) that are referenced throughout the body description.
The Gazebo plugins added in agribot_sensors.urdf.xacro are:
PluginLibraryPurpose
gazebo_ros_controllibgazebo_ros_control.soROS control bridge (exposes hardware interface)
skid_steer_drive_controllerlibgazebo_ros_skid_steer_drive.so4-wheel skid-steer kinematics
imulibhector_gazebo_ros_imu.soIMU simulation with configurable Gaussian noise
gps_controllerlibhector_gazebo_ros_gps.soGPS simulation with drift and noise
magnetometerlibhector_gazebo_ros_magnetic.soMagnetometer simulation

Gazebo Plugin Configuration

The skid-steer drive plugin bridges /agribot/cmd_vel Twist commands to individual wheel joint torques. The configuration below is extracted directly from agribot_sensors.urdf.xacro:
<plugin name="skid_steer_drive_controller"
        filename="libgazebo_ros_skid_steer_drive.so">
  <updateRate>100.0</updateRate>
  <robotNamespace>/agribot</robotNamespace>
  <commandTopic>/agribot/cmd_vel</commandTopic>
  <odometryTopic>odom</odometryTopic>
  <odometryFrame>odom</odometryFrame>
  <leftFrontJoint>base_link_to_left_wheel_F_joint</leftFrontJoint>
  <rightFrontJoint>base_link_to_right_wheel_F_joint</rightFrontJoint>
  <leftRearJoint>base_link_to_left_wheel_R_joint</leftRearJoint>
  <rightRearJoint>base_link_to_right_wheel_R_joint</rightRearJoint>
  <wheelSeparation>0.65</wheelSeparation>
  <wheelDiameter>0.2</wheelDiameter>
  <robotBaseFrame>dummy_link</robotBaseFrame>
  <torque>20</torque>
  <topicName>/agribot/cmd_vel</topicName>
  <broadcastTF>True</broadcastTF>
  <covariance_x>0.000100</covariance_x>
  <covariance_y>0.000100</covariance_y>
  <covariance_z>0.000100</covariance_z>
  <covariance_yaw>0.0100</covariance_yaw>
</plugin>
The GPS plugin uses a reference latitude/longitude centered on the test site (21.1613108102°N, 72.7869817026°E). Simulated drift of 5.0 m in each axis and Gaussian noise of 0.1 approximate real-world GPS uncertainty. The IMU plugin publishes at 200 Hz to /agribot/imu with near-zero noise values suitable for orientation estimation.

Launch Files Reference

Four launch files cover the main usage scenarios from URDF inspection to full farm simulation.
# Load URDF and publish joint states (no Gazebo)
roslaunch agribot_description agribot_description.launch

# Spawn AGRIBOT in empty Gazebo world
roslaunch agribot_description agribot_gazebo_simulation.launch

# Spawn AGRIBOT in farm field world (also starts controllers and navigation nodes)
roslaunch agribot_description my_world.launch

# Open RViz with pre-configured display
roslaunch agribot_description agribot_rviz_display.launch
Loads agribot_body.urdf.xacro as robot_description on the parameter server, starts joint_state_publisher (with optional GUI slider), and starts robot_state_publisher to broadcast TF transforms. Does not launch Gazebo — useful for inspecting the URDF model in RViz without simulation overhead.
Launches an empty Gazebo world, adds a static TF between base_link and base_footprint, spawns the AGRIBOT model from the raw Xacro file using spawn_model, and publishes a /calibrated flag via rostopic pub. Intended for rapid model testing before the full farm world is loaded.
The primary full-stack launch file. Loads Farm.world in Gazebo, processes the Xacro description and uploads it to the parameter server, remaps joint states from /agribot/joint_states to /joint_states, publishes a static odom → map TF, includes agribot_control.launch to spawn PID controllers, and launches the gps_converter and sensor_data navigation nodes in separate xterm windows.
Opens RViz with the pre-configured .rviz file at rviz/agribot_urdf.rviz. Starts joint_state_publisher and robot_state_publisher so all TF frames and the robot model render correctly.
The my_world.launch file is the recommended entry point for a complete simulation session. It launches Gazebo, spawns all controllers, and starts the navigation nodes in a single command. See the Simulation Guide for the recommended step-by-step startup sequence.

Build docs developers (and LLMs) love