As part of improving the the developer wiki, we’ve added a page that attempts to explain how Rover is using the L1 controller.
It’s explained in more detail on the new page but in short:
- the main vehicle code calls the AP_L1_Control library on each iteration pass in the origin (A) and destination (B).
- within the L1 controller it then:
- pulls the vehicle’s position from the AHRS and uses it to calculate the closest point on the line between A and B.
- next a target position on the line is calculated (see L1_dist) using the “damping” and “period” parameters supplied by the user along with the vehicle’s speed.
- a desired lateral acceleration (called “latAccDem” in the code) is calculated to turn the vehicle towards the target point. The “Nu1” and “Nu2” angles are used in this calculation.
- the desired lateral acceleration is then passed into the APM/Control/AR_AttitudeControl library which feeds it into the steering-rate PID controller and finally sends to the AP_MotorsUGV class which does the mixing and sends out to the motors
Hope this is slightly interesting to others. As per usual, if you want to get involved with development, check out the “Getting Involved” section on the top page of our developer wiki started section of the wiki.