Rover & Ground Vehicles¶
This section covers libraries specifically for Rover and ground vehicles.
AR_Motors (Rover Motors)¶
Header: libraries/AR_Motors/AR_Motors.h
Description: Motor control for ground vehicles with skid steering or ackermann steering.
Steering Types:
Skid steering (tank turn)
Ackermann steering (car-like)
Differential steering
Warning
doxygenclass: Cannot find class “AR_Motors” in doxygen xml output for project “ArduPilot” from directory: /home/runner/work/APMapi/APMapi/docs/../build/output-xml
Usage Example:
#include <AR_Motors.h>
AR_Motors *motors = AR_Motors::get_singleton();
// Set throttle (-1 to 1)
motors->set_throttle(0.5f);
// Set steering (-1 to 1)
motors->set_steering(0.3f);
// Or combined
motors->set_throttle_and_steering(0.5f, 0.3f);
// Arm
motors->armed(true);
Rover Control Modes¶
Acro - Manual rate control Steering - Steering with throttle Hold - Hold position Manual - Full manual control Auto - Mission mode RTL - Return to launch SmartRTL - Smart return to launch
Usage Example:
// Get current mode
Mode *mode = rover->mode();
// Check mode
if (mode == &rover->mode_auto) {
// In auto mode
}
// Switch mode
rover->mode()->mode_number = Mode::Number::RTL;
See Also¶
Control Libraries - Overview of control libraries
Sensor Libraries - GPS, Compass