PX4-Autopilot
PX4-Autopilot copied to clipboard
Add support for Acro mode on Rovers with Rates Control
Describe problem solved by this pull request Attitude errors were directly fed into steering angles for stabilized modes rover and boats. However, this can result in unstable behaviors if the vehicle is operating on slippery surfaces or operating on water.
Using a rate control loop improves the stability of the vehicle for stabilized mode.
Describe your solution This commit adds a angular rates controller controlling the yaw rate of the rover. This is also used for the previous attitude controller in order to stabilize the vehicles.
- The rate controller is mapped to the acro mode of the vehicle. The horizontal stick inputs are mapped to the desired angular rate (center stick results in zero yaw rate) and the vertical stick to throttle.
- In stabilized mode, the attitude setpoint is moved using the horizontal stick
- Attitude controller generates rate control commands to control the vehicle, instead of steering commands
- The rates controller is not used for mission mode (yet)
Test data / coverage Tested for stabilized mode and acro mode in SITL: https://logs.px4.io/plot_app?log=a493e453-4460-4c5d-b12f-db02084b8421
- The yaw oscillations are coming from the gazebo model
Additional context
- This is beneficial since it removes the ambiguity of control logic between ackerman steering vehicles and differential steering vehicles. They can both be controlled through the rate controller (related to: https://github.com/PX4/PX4-Autopilot/issues/13468. https://github.com/PX4/PX4-Autopilot/issues/11994)
- This is a re-implementation of https://github.com/PX4/PX4-Autopilot/pull/15257
Build failure in the tests (make tests). https://github.com/PX4/PX4-Autopilot/pull/18317/checks?check_run_id=3758555224
Build failure in the tests (make tests). https://github.com/PX4/PX4-Autopilot/pull/18317/checks?check_run_id=3758555224
@dagar Sorry, fixed!
@bresch Sorry for the late reply.
Currently it has a few issues with input scaling at low speeds when testing on a real vehicle. I think we need to fix this issue before merging.
@Jaeyoung-Lim I'm trying your PR in my boat setup in this branch. And I have couple of questions :thinking:
- Is the L1 guidance logic still relevant? It seems to be tightly integrated into the Rover
- Anything I should keep in mind (regarding recent changes to control allocation), when it comes to the control aspect? (E.g. Rover is setting actuator_controls topic, but also publishing vehicle_torque_setpoint and vehicle_thrust_setpoint as well :thinking: )
@junwoo091400
Is the L1 guidance logic still relevant? It seems to be tightly integrated into the Rover
Could you elaborate? This is how position control is done on the rover in the current state
Anything I should keep in mind (regarding recent changes to control allocation), when it comes to the control aspect? (E.g. Rover is setting actuator_controls topic, but also publishing vehicle_torque_setpoint and vehicle_thrust_setpoint as well thinking )
This I have no idea. In principle it should not make a difference, but not sure how ackerman steering vs differential drive would be applied to control allocation
Oh I was just not sure if L1 was necessary or not since I have never used it before :dizzy_face:. Few more questions :thinking:
- The Rate controller seems to only set the gains in the Z axis, but is this intentional? Do we only want to control the yaw rate?
- What happens when we have a rover that can control it's roll? (E.g. for the boat I imagine the yaw command will inevitably have effect in the roll). Should this be handled in control allocation?
Interestingly, it seems like rover attitude control was intentionally removed at one point in PX4 : https://github.com/PX4/PX4-Autopilot/pull/12239
The Rate controller seems to only set the gains in the Z axis, but is this intentional? Do we only want to control the yaw rate?
Yes, rover fundamentally is a 1Dof vehicle. I would try to get this working before we think about additional degree of freedoms to control.
What happens when we have a rover that can control it's roll? (E.g. for the boat I imagine the yaw command will inevitably have effect in the roll). Should this be handled in control allocation?
Having an effect on roll actuation and trying to control roll are two different problems. For rovers, normally you have only one degree of freedom actuator(e.g. rudder), so you can only control 1 DoF(yaw). We can add more in the future, but for now I would not consider this as a valid use case.
Currently in the Rover Position Control, it seems to use the trajectory_setpoint
to overwrite the position_setpoint_triplet
data (thus modifying the position setpoint :thinking:). Silvan hinted that Rover probably shouldn't even consider using trajectory_setpoint
. What do you think about this? @Jaeyoung-Lim
Currently in the Rover Position Control, it seems to use the trajectory_setpoint to overwrite the position_setpoint_triplet data (thus modifying the position setpoint thinking). Silvan hinted that Rover probably shouldn't even consider using trajectory_setpoint. What do you think about this? @Jaeyoung-Lim
Hmm...Is this discussion relevant for this PR? How does this relate to adding a rate controller for rovers?
Nevertheless, trajectory_setpoints
message is currently used for passing position setpoints for offboard control. I don't see a reason that we would want to take this out, especially in the context of adding a rate controller for rovers
Latest changes include:
- Rebased to latest
main
- Integrated into standard
RateControl
library instead of introducingRoverRateControl
- Integrated rate control for waypoint navigation(position control)
Reopened in https://github.com/PX4/PX4-Autopilot/pull/20082 with adaptation to get it working on boats
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:
https://discuss.px4.io/t/rc-speed-boat-with-px4-episode-1-using-px4-to-control-the-boat/28429/1
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:
https://discuss.px4.io/t/rc-speed-boat-with-px4-episode-0-trying-out-the-boat-and-integrating-pixhawk/28407/1
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:
https://discuss.px4.io/t/px4-community-q-a-july-12-2023/33086/1