-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Rover controller refactor #19957
Conversation
Rebased on |
7d76ad2
to
c344a05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that it is tempting to fix everything at once, but would it be possible to prioritize on getting #18317 in with the current state and we separate the refactoring with the rate controller PR? Note that the current rover PR have already gone through a recent refactor (#16847) and is still not in a good state.
Since people have been already using the current state of the rover position controller we should not try to break it for other people while we move forward for boats.
If we combine refactoring with the added rate control it will be hard to verify whether the behavior is consistent with the previous state. I think it would be much easier to review if we separate refactoring and feature additions.
Initial rate control SITL test shows good progress. All the PID values are 0 and only the feed-forward was enabled.
|
Yes I understand 😿, that's why I am now adding marginal commits like this one so that I can extract only the rate control related commits out of this PR and get it merged. This PR is mostly a reflection of this branch I am testing the boat on that shows the progress / overall changes, and as you mentioned it would be easier if I separate this into the rate control improvement PR + refactor PR! Which I am hoping to do so with marginal commits 😏 |
ea1a866
to
3b2cdda
Compare
Log is here: https://logs.px4.io/plot_app?log=3600d086-09a5-4d06-8433-bfc94a1b6efc Just completed a real life test of the acro mode. On the graph attached above, the rate setpoint / actual rate are displayed on left-right corner, as well as other debugging values in other panels. Overall, yaw rate acro mode seems to work kinda ok-ish on a real vehicle.
Also, for now acro and manual mode feels pretty much the same (maybe it should be?), but glad to have the first real life test! 🎉 Other notes:
Btw, it is quite surprising how slow the yaw rates are when I don't go crazy high on the throttle input. It's almost like the SITL boat (which feels extremely slow), around 0.5 rad/s! For now, I am not going crazy high throttle, since the boat often flips and it's hard to rescue it 🤦♂️ p.s. here's the first test log link (First ever real life test of the Boat in Acro mode!) : https://logs.px4.io/plot_app?log=9eb535b7-57c2-4804-8c2e-5eb1690711bc |
- Simulating the ackermann rover mechanism would be best done with the rover model, but that's not working so well (gazebo model problems) Add big storm airframe to CMakeLists Add settings to catamaran airframe Configure catamaran parameters for better tuning
- Organize and group the uORB Subscription and Publications Format RoverPositionControl and tidy - Use the update_parameters functionality properly (previously, it was calling this function on every loop of the function, which is obviously wrong!!) Small format fixes Continue refactoring and tidy Refactor position control and param descriptions for Rover
421cf0b
to
1eeda55
Compare
Rebased on #20082. Now the PR target branch is this PR as well! |
Reorder parameters and group them to improve readability - Previously it was really messy and hard to track where each parameter comes into play Minor parameter deocumentation / default value changes - Units in PID gains for rate control are not so relevant, remove them (also it isn't strictly rad/s, but rather should be s^-1, and so on since it essentially applies derivative to the unit dimension) Add Rover Rate control debug output custom command - But turns out, the reason I had the boat spinning was because it was a differential and not an ackermann geometry boat with thruster & rudder :P - Also, the feedforward term wouldn't come into effect if I don't set the rate setpoint to non-zero value. Didn't know that :P Use differntial boat thruster geometry since it's the only option - Until a thruster + rudder combination boat model is added in sitl_gazebo :P Apply max rate multiplication for acro rate control Adjust rover max rate parameter value & max range - Initial values just didn't make sense
Apply forward speed lower bound clipping to prevent scalar explosion
- Setting RATE_MAX to a sane value is important, since controller will saturate if it can't achieve that rate. For the SITL boat, we need to use 0.2 rad/s (30 deg/s!!). That is super slow, but what we need to live with for now.
1eeda55
to
882e009
Compare
Removed un-removed |
This has diverged quite a lot, it would be better to make #20082 work, then revisit this PR later. Although I would like to preserve the debug uORB topics and such, but that can be copied over manually and create a minimal diff |
Describe problem solved by this pull request
This started out as testing the #18317, but I ended up doing a lot of side refactoring to improve code readability and update comments / parameter definitions. This is not directly related to improving the PR, and was an initial step I took since I thought the code was pretty messy and unreadable in the beginning.
Also there's new airframe file like the one for the RC speed boat I am testing this on, which shouldn't make it to the
main
branch anyways (since we are only going to support generic geometries from now on).Describe your solution
A clear and concise description of what you have implemented.
Describe possible alternatives
A clear and concise description of alternative solutions or features you've considered.
Test data / coverage
How was it tested? What cases were covered? Logs uploaded to https://review.px4.io/ and screenshots of the important plot parts.
Additional context
Add any other related context or media.