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

Orbit approach with a line trajectory library #12664

Merged
merged 4 commits into from
Aug 31, 2019
Merged

Orbit approach with a line trajectory library #12664

merged 4 commits into from
Aug 31, 2019

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Aug 8, 2019

Describe problem solved by the proposed pull request
As requested by @RomanBapst I'm fixing the initial approach of the vehicle to the circle in orbit mode. This should vastly improve the user experience when using the Orbit mode.

Test data / coverage
SITL tested. @RomanBapst please submit your feedback on user experience.

Describe your preferred solution
The StraightLine library is supposed to implement a motion primitive to move the vehicle from point A to B on a planned trajectory such that this functionality can be reused where such setpoint generation is useful. The initial approach to the orbit circle is a very good example of such a use case and is now the first client code to test the interface of the library.

The StraightLine implementation currently does a velocity ramp based on the progress measured in distance between the start and endpoint. It ramps up the velocity for half the way and down the second half. The velocity is then limited to the specified speed e.g. the cruise speed.

Describe possible alternatives
The StraightLine implementation here is working but not yet optimal. The idea is to have a minimum viable implementation now to set a baseline that can be tested and built on. I would be very interested to bring in @bresch's jerk optimized planning to be reused in this form.

@hamishwillee
Copy link
Contributor

@MaEtUgR When this is done, sounds like we might need some more docs; note that I don't fully understand what the change is. It sounds like the vehicle will follow the same path for orbit as before, but just change the way that it accel/decelerates to start the orbit.

Docs to consider are http://docs.px4.io/master/en/flight_modes/orbit.html . Depending on how generic this is/what the options are, we might need to create some docs a bit like http://docs.px4.io/master/en/config_mc/mc_slew_rate_type_trajectory.html

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Aug 12, 2019

I

  • rebased on master
  • fixed the issues when changing radius during orbiting (thanks for reporting @RomanBapst )
  • fixed the yaw feed-forward resulting in a small weir offset during initial approach

@hamishwillee Thanks for chiming in. The orbiting itself stays the same but when commanding a new orbit the vehicle approaches the circle in a more controlled less aggressive way on a straight line before starting to rotate.

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Aug 12, 2019

We just come from successful real-world testing with a big vehicle. The approach is now much more agreeable.

I don't say it's perfect but it makes a big difference for the orbit user experience. Improvements of the StraightLine implementation will make it better and the most aggressive behavior is now actually pausing with high velocity. We need a stopping motion primitive to solve that, I'll address it.

@hamishwillee
Copy link
Contributor

The orbiting itself stays the same but when commanding a new orbit the vehicle approaches the circle in a more controlled less aggressive way on a straight line before starting to rotate.

Thanks @MaEtUgR Then IMO no docs are required :-)

Before it was:
- not used anywhere
- copied from an old mission implementation version
- didn't plan in advance
- had a lot of broken cases
- dependent on a lot of parameters

I'm starting with a new relatively simple implementation that works as
expected for a minimum viable implementation and can be improved over time.
The first version is used to approach the circle path in Orbit mode to
verify the interface and get testing such that it gets eventually used
everywhere.
The initial approach to the circle to orbit on was very agressive since
it was just the controller trying to stay on the circle reaching the
limits. Now there's first an approach phase in which the vehicle reaches
the circle trajeectory in a smooth perpendicular line before starting the
orbit execution.
The condition that the vehicle is more than 3m away from the circle line
was too sloppy. That often happens when the radius is changed by sticks.
A reapproach is only necessary when the center is moved and that's only
possible through the orbit command.
The yaw pointing towards the center makes sense since that's the approach
direction anyways. But with the yaw feed forward results in a weird looking
bias when not orbiting yet.
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Aug 31, 2019

@RomanBapst Since we had review rounds in person, this is well tested, clearly much better than before and had no conflicts. I'm merging as soon as CI ran successfully.

@MaEtUgR MaEtUgR merged commit d3c7d06 into master Aug 31, 2019
@MaEtUgR MaEtUgR deleted the orbit-approach branch August 31, 2019 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants