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 —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.
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.
Navigation Pipeline
The following steps describe the end-to-end flow from operator input to motor commands:- User enters goal GPS (lat/lon) at startup. The
gps_converternode prompts interactively at launch and stores the target coordinates for the life of the mission. gps_converterreceives 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/distanceandangleOG.data_manipulationreceives 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.autonomousdrivereceives/angleand/distance, runs a PD controller, and publishes linear and angular velocity commands to/agribot/cmd_velto 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.| Topic | Direction | Type | Node | Description |
|---|---|---|---|---|
/agribot/fix | Sub | sensor_msgs/NavSatFix | gps_converter | Current GPS position of the robot |
/Pole/fix | Sub | sensor_msgs/NavSatFix | gps_converter | Origin/pole GPS fix for dynamic origin setting |
/magnetic | Sub | geometry_msgs/Vector3Stamped | data_manipulation | Raw magnetometer reading from IMU |
/currentPose | Pub/Sub | geometry_msgs/Pose | gps_converter / data_manipulation | Current XY pose relative to origin |
/distance | Pub | std_msgs/Float64 | gps_converter | Euclidean distance to goal in metres |
angleOG | Pub | std_msgs/Float64 | gps_converter | GPS bearing angle to goal in degrees |
/angle | Pub | std_msgs/Float64 | data_manipulation | Corrected heading error to goal |
Filteredheading | Pub | std_msgs/Float64 | data_manipulation | Filtered magnetometer heading |
/agribot/cmd_vel | Pub | geometry_msgs/Twist | autonomousdrive | Motor velocity commands |
goal_GPS | Pub | sensor_msgs/NavSatFix | gps_converter | Goal GPS coordinates for Mapviz visualization |