Skip to content
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

Rover: Enable driving backwards when using attitude setpoints (offboard) #13429

Merged
merged 1 commit into from
Nov 17, 2019

Conversation

jbeyerstedt
Copy link
Contributor

The Offboard attitude control can now drive backwards. The steering angle is reversed to steer in the right direction.

The possibility to drive backwards was not added to velocity control, because we would need to guess the intended driving direction from the data then. Maybe the difference of velocity vector and heading/ yaw data? (Currently heading is ignored, because the "normal" rovers can not move in one direction and look in another.) But I don't see that this is an urgent addition.

@Jaeyoung-Lim
Copy link
Member

@jbeyerstedt Are there any logs regarding the tests you did with this? I am curious if there would be any corner cases

@jbeyerstedt
Copy link
Contributor Author

jbeyerstedt commented Nov 11, 2019

I have a little test script, that drives in the following way (using MAVSDK offboard attitude control):

  • heading 90 deg, throttle 0.2 for 6 seconds
  • heading 135 deg, throttle 0.2 for 9 seconds
  • heading 90 deg, throttle 0.2 for 9 seconds
  • heading 90 deg, throttle -0.2 for 9 seconds
  • heading 135 deg, throttle -0.2 for 9 seconds
  • stop (heading 90 deg, throttle 0) and disarm

Logfile: https://logs.px4.io/plot_app?log=67261d8f-db40-4978-bf33-3d9a178503c8

@Jaeyoung-Lim
Copy link
Member

@jbeyerstedt Awesome script! The last 135 deg in reverse looks a little problematic for me.

Any idea why it didn't track the last yaw setpoint? Also it seems like it didn't have enough time to settle in to the yaw setpoints?

@jbeyerstedt
Copy link
Contributor Author

You mean at 35 seconds, where the yaw set point moved back to 90 degrees?
At this time, I stopped (throttle 0), but the simulation still "drifted" a bit, because it does not brake when setting throttle to 0. So at least for a car-style rover, the last set point isn't actually reasonable.

I just uploaded my testing script as a gist: https://gist.github.com/jbeyerstedt/9a290a4e87678aee8719632338e8bae4

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good on my side

@Jaeyoung-Lim Jaeyoung-Lim added Mode: Offboard Offboard mode control Rover 🚙 Rovers and other UGV labels Nov 12, 2019
Copy link
Member

@LorenzMeier LorenzMeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I've architected PX4 in 2011 to support reverse trust hoping for this moment. Finally we need it!

@LorenzMeier LorenzMeier merged commit 3810365 into PX4:master Nov 17, 2019
@jbeyerstedt jbeyerstedt deleted the pr-rover_attitude_reversegear branch March 13, 2020 16:24
@swimmingseeds
Copy link

Does the 3rd component of the euler angle ever go negative?

I was thinking about a scenario where the target is more than 180 degrees apart from the rover's front axis 🍔. In that case, would the angle value be negative or go over 180 degrees?

@Jaeyoung-Lim
Copy link
Member

@swimmingseeds I think your comments are not related to this PR. Please don't hijack the topic of this PR

If you have any questions, post it on discuss.px4.io or if you have any issues post it as a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mode: Offboard Offboard mode control Rover 🚙 Rovers and other UGV
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants