-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Restructure and update differential rover module #23430
Restructure and update differential rover module #23430
Conversation
019a7db
to
d02c055
Compare
4a5bfd1
to
aa01791
Compare
aa01791
to
08569b0
Compare
2d8ce45
to
bee4500
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.
So we don't want to keep the inverse kinematics? I guess most rovers don't do wheel speed control anyway and don't care about it.
Looks very clean otherwise!
Correct me if I'm wrong but the inverse kinematics of the old implementation didn't do direct wheel speed control either: Lines 70 to 97 in b93dd0e
I implemented the same inverse kinematics, but in a "normalized" form to directly compute the motor inputs (yaw rate setpoint is already transformed into a normalized required speed_diff before going into this function) : PX4-Autopilot/src/modules/rover_differential/RoverDifferential.cpp Lines 193 to 205 in 817bd21
|
817bd21
to
59099d7
Compare
rebased on main and squashed |
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.
Agree that we can simplify the inverse kinematics like you propose. If we ever have somebody with a rover driver that takes wheel speed as input (and not throttle) we can revisit it.
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-v1-15-public-changes-what-needs-docs/39850/13 |
I tried Overall, it's nice to see a clean implementation, I am tempted to move some of it to my custom code and see it working on my Husquarna Z254F. I am wondering if switching from L1 to Pure Pursuit will achieve better line following. Thanks for you work! |
@slgrobotics Thanks for testing the changes!
For the r1 rover I added my tuning directly to the SITL airframe s.t. it works "out of the box" when you start the simulation, which I think is what people would expect. I should do the same for the landmower, thanks for the reminder!
Thank you! Please keep me updated if you use it on your rover, it's always very insightful to see how it works on different vehicles. |
@chfriedrich98 Please see #23527 I am sure there's room for perfecting/tuning these parameters further, but for now the vehicle provides reasonable demo - even when running a realistic lawn mowing "survey" with 1 meter distance between the stripes. |
* differential: rename module * differential: restructure and update module
@chfriedrich98 @dagar - please take a look at #23611 (Stanley Pursuit implementation offered) |
Solved Problem
This PR adresses 2 issues:
Solution
2a. Bring folder structure in line with ackermann module:
2b. With the restructure in 2a the
DifferentialDriveSetpoint
message becomes obsolete and is instead replaced withRoverDifferentialStatus
andRoverDifferentialGuidanceStatus
which are used exclusively for logging purposes (in line with the ackermann module):RoverDifferentialStatus
(General logging):RoverDifferentialGuidanceStatus
(Mission specific logging):2c. Implement pure pursuit in the guidance algorithm:
The differential rover guidance is now based on the same algorithm as the ackermann rover (#23387). The rover will now actually track the line segment between waypoints, rather than just target the next waypoint, leading to a lower overall crosstrack error.
To fully exploit the 'turn on the spot' capabilities of differential rovers (as opposed to ackermann) the following state machine is implemented:
This causes the rover to stop and turn on the spot if the heading error exceeds a certain threshhold.
This decreases the accumulated crosstrack error, especially whenever the waypoint triplet changes.
Alternatives
Open to any suggestions
Test coverage
2024-07-19.14-52-47.mp4
Flight Log.