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’s autonomous navigation stack converts GPS coordinates into local XY positions, computes heading error from a magnetometer, applies noise filters, and drives the robot with a PD controller. The three ROS nodes — gps_converter, data_manipulation, and autonomousdrive — work in a continuous feedback loop so the robot can traverse crop rows from a start GPS fix to an operator-specified goal without human intervention. The following steps describe the end-to-end flow from operator input to motor commands:
  1. User enters goal GPS (lat/lon) at startup. The gps_converter node prompts interactively at launch and stores the target coordinates for the life of the mission.
  2. gps_converter receives the current GPS fix on /agribot/fix, converts both the current position and the goal to local XY using a Mercator projection, then computes the straight-line distance and bearing to the goal. Results are published to /distance and angleOG.
  3. data_manipulation receives the raw magnetometer reading on /magnetic, collects samples into a sliding window, applies a Moving Median filter every 8 samples, and combines the filtered heading with the GPS bearing to produce a corrected angle error on /angle.
  4. autonomousdrive receives /angle and /distance, runs a PD controller, and publishes linear and angular velocity commands to /agribot/cmd_vel to steer and propel the robot toward the goal.

GPS & IMU Sensors

Coordinate conversion, bearing calculation, and magnetometer heading extraction.

Sensor Noise Filtering

Moving Median and Kalman filter implementation details.

Path Planning & Control

PD controller logic, gain tuning, and waypoint patrol mode.

ROS Package Reference

Full node, topic, and launch-file reference for the autonomous_drive package.

Simulation Note

In Gazebo, sensor noise is simulated via Hector plugins with configurable drift and Gaussian noise parameters, matching real-sensor behavior. This allows the full navigation stack — including the noise filters — to be validated entirely in simulation before deploying to physical hardware.

ROS Topic Reference

All topics used by the autonomous navigation stack are listed below. Topics that carry data between two nodes are marked Pub/Sub in the Direction column.
TopicDirectionTypeNodeDescription
/agribot/fixSubsensor_msgs/NavSatFixgps_converterCurrent GPS position of the robot
/Pole/fixSubsensor_msgs/NavSatFixgps_converterOrigin/pole GPS fix for dynamic origin setting
/magneticSubgeometry_msgs/Vector3Stampeddata_manipulationRaw magnetometer reading from IMU
/currentPosePub/Subgeometry_msgs/Posegps_converter / data_manipulationCurrent XY pose relative to origin
/distancePubstd_msgs/Float64gps_converterEuclidean distance to goal in metres
angleOGPubstd_msgs/Float64gps_converterGPS bearing angle to goal in degrees
/anglePubstd_msgs/Float64data_manipulationCorrected heading error to goal
FilteredheadingPubstd_msgs/Float64data_manipulationFiltered magnetometer heading
/agribot/cmd_velPubgeometry_msgs/TwistautonomousdriveMotor velocity commands
goal_GPSPubsensor_msgs/NavSatFixgps_converterGoal GPS coordinates for Mapviz visualization

Build docs developers (and LLMs) love