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

Add information to path planning re: Bezier curves #680

Merged
merged 6 commits into from Mar 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions en/computer_vision/path_planning_interface.md
Expand Up @@ -2,6 +2,7 @@

PX4 uses a number of MAVLink interfaces for integrating path planning services from a companion computer (including obstacle avoidance in missions, [safe landing](../computer_vision/safe_landing.md), and future services):
- The [MAVLink Path Planning Protocol](https://mavlink.io/en/services/trajectory.html) message [TRAJECTORY_REPRESENTATION_WAYPOINTS](https://mavlink.io/en/messages/common.html#TRAJECTORY_REPRESENTATION_WAYPOINTS) is used to sent the current and next waypoint, and receive a stream of setpoints for the new path.
- Alternatively, via mavlink the [TRAJECTORY_REPRESENTATION_BEZIER](https://mavlink.io/en/messages/common.html#TRAJECTORY_REPRESENTATION_BEZIER) can be used, parameterized by time, to specify the moving position setpoint of the vehicle over a given amount of time.
- The [HEARTBEAT/Connection Protocol](https://mavlink.io/en/services/heartbeat.html) is used for "proof of life" detection.
- [LOCAL_POSITION_NED](https://mavlink.io/en/messages/common.html#LOCAL_POSITION_NED) and [ALTITUDE](https://mavlink.io/en/messages/common.html#ALTITUDE) send the vehicle local position and altitude, respectively.

Expand Down Expand Up @@ -107,6 +108,17 @@ PX4 safely handles the case where messages are not received from the offboard sy
- A planner will mirror back setpoints it receives when the vehicle is in a mode/state for which it doesn't provide path planning. (i.e. the vehicle will follow its desired path, delayed by a very small amount).


## Bezier Trajectory Interface {#bezier_interface)

If the obstacle avoidance interface is enabled, it can also receive mavlink messages in the [TRAJECTORY_REPRESENTATION_BEZIER](https://mavlink.io/en/messages/common.html#TRAJECTORY_REPRESENTATION_BEZIER) format. This is parsed as follows:

- The number of Bezier control points determines the degree of the Bezier curve. For example, 3 points makes a quadratic bezier curve with constant acceleration.
- The Bezier curve must be the same degree in x,y,z and yaw, with all Bezier control points finite
- The `delta` array should have the value corresponding with the last Bezier control point indicate the duration that the waypoint takes to execute the curve to that point, from beginning to end. Other values in the `delta` array are ignored.
- The timestamp of the mavlink message should be the time that the curve starts, and communication delay and clock mismatch will be compensated for on the flight controller via the timesync mechanism.
- The control points should all be specified in local coordinates.
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved
- Bezier curves do not only expire after 0.5s like the waypoint interface, but also after the execution time of the bezier curve has been reached. Be careful not to specify such short times for the bezier curve that you cannot send the next one in time.

## Supported Hardware

Tested companion computers and cameras are listed in [PX4/avoidance](https://github.com/PX4/avoidance#run-on-hardware).
Expand Down