mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:38:52 +08:00
Docs: Rover API (#25499)
* docs: add RoverSetpointTypes * docs: add rover api * docs: remove rover offboard mavlink support * docs: fix broken links * Apply suggestion from @hamishwillee --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
This commit is contained in:
co-authored by
Hamish Willee
parent
5023174715
commit
66b07d8219
@@ -1,6 +1,6 @@
|
||||
# ROS 2 Offboard Control Example
|
||||
|
||||
The following C++ example shows how to do position control in [offboard mode](../flight_modes/offboard.md) from a ROS 2 node.
|
||||
The following C++ example shows how to do multicopter position control in [offboard mode](../flight_modes/offboard.md) from a ROS 2 node.
|
||||
|
||||
The example starts sending setpoints, enters offboard mode, arms, ascends to 5 metres, and waits.
|
||||
While simple, it shows the main principles of how to use offboard control and how to send vehicle commands.
|
||||
@@ -22,7 +22,7 @@ To subscribe to data coming from nodes that publish in a different frame (for ex
|
||||
|
||||
## Trying it out
|
||||
|
||||
Follow the instructions in [ROS 2 User Guide](../ros2/user_guide.md) to install PX and run the simulator, install ROS 2, and start the XRCE-DDS Agent.
|
||||
Follow the instructions in [ROS 2 User Guide](../ros2/user_guide.md) to install PX and run the multicopter simulator, install ROS 2, and start the XRCE-DDS Agent.
|
||||
|
||||
After that we can follow a similar set of steps to those in [ROS 2 User Guide > Build ROS 2 Workspace](../ros2/user_guide.md#build-ros-2-workspace) to run the example.
|
||||
|
||||
|
||||
@@ -343,6 +343,7 @@ The following sections provide a list of supported setpoint types:
|
||||
- [MulticopterGotoSetpointType](#go-to-setpoint-multicoptergotosetpointtype): <Badge type="warning" text="MC only" /> Smooth position and (optionally) heading control
|
||||
- [FwLateralLongitudinalSetpointType](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype): <Badge type="warning" text="FW only" /> <Badge type="tip" text="main (planned for: PX4 v1.17)" /> Direct control of lateral and longitudinal fixed wing dynamics
|
||||
- [DirectActuatorsSetpointType](#direct-actuator-control-setpoint-directactuatorssetpointtype): Direct control of motors and flight surface servo setpoints
|
||||
- [Rover Setpoints](#rover-setpoints): <Badge type="tip" text="main (planned for: PX4 v1.17)" /> Direct access to rover control setpoints (Position, Speed, Attitude, Rate, Throttle and Steering).
|
||||
|
||||
:::tip
|
||||
The other setpoint types are currently experimental, and can be found in: [px4_ros2/control/setpoint_types/experimental](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental).
|
||||
@@ -354,6 +355,8 @@ You can add your own setpoint types by adding a class that inherits from `px4_ro
|
||||
|
||||
<Badge type="warning" text="MC only" />
|
||||
|
||||
<Badge type="warning" text="Multicopter only" />
|
||||
|
||||
::: info
|
||||
This setpoint type is currently only supported for multicopters.
|
||||
:::
|
||||
@@ -547,6 +550,40 @@ For example to control a quadrotor, you need to set the first 4 motors according
|
||||
If you want to control an actuator that does not control the vehicle's motion, but for example a payload servo, see [below](#controlling-an-independent-actuator-servo).
|
||||
:::
|
||||
|
||||
#### Rover Setpoints
|
||||
|
||||
<Badge type="tip" text="main (planned for: PX4 v1.17)" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
The rover modules use a hierarchical structure to propagate setpoints:
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
The "highest" setpoint that is provided will be used within the PX4 rover modules to generate the setpoints that are below it (Overriding them!).
|
||||
With this hierarchy there are clear rules for providing a valid control input:
|
||||
|
||||
- Provide a position setpoint, **or**
|
||||
- One of the setpoints on the "left" (speed **or** throttle) **and** one of the setpoints on the "right" (attitude, rate **or** steering). All combinations of "left" and "right" setpoints are valid.
|
||||
|
||||
For ease of use we expose these valid combinations as new SetpointTypes.
|
||||
:::
|
||||
|
||||
The RoverSetpointTypes exposed through the control interface are combinations of these setpoints that lead to a valid control input:
|
||||
|
||||
| SetpointType | Position | Speed | Throttle | Attitude | Rate | Steering | Control Flags |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------- | -------- | --------- | --------- | --------- | --------- | --------- | ------------------------------------------------------ |
|
||||
| [RoverPosition](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverPositionSetpointType.html#details) | ✓ | (✓) | (✓) | (✓) | (✓) | (✓) | Position, Velocity, Attitude, Rate, Control Allocation |
|
||||
| [RoverSpeedAttitude](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverSpeedAttitudeSetpointType.html) | | ✓ | (✓) | ✓ | (✓) | (✓) | Velocity, Attitude, Rate, Control Allocation |
|
||||
| [RoverSpeedRate](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverSpeedRateSetpointType.html) | | ✓ | (✓) | | ✓ | (✓) | Velocity, Rate, Control Allocation |
|
||||
| [RoverSpeedSteering](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverSpeedSteeringSetpointType.html) | | ✓ | (✓) | | | ✓ | Velocity, Control Allocation |
|
||||
| [RoverThrottleAttitude](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverThrottleAttitudeSetpointType.html) | | | ✓ | ✓ | (✓) | (✓) | Attitude, Rate, Control Allocation |
|
||||
| [RoverThrottleRate](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverThrottleRateSetpointType.html) | | | ✓ | | ✓ | (✓) | Rate, Control Allocation |
|
||||
| [RoverThrottleSteering](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverThrottleSteeringSetpointType.html) | | | ✓ | | | ✓ | Control Allocation |
|
||||
|
||||
✓ are the setpoints we publish, and (✓) are generated internally by the PX4 rover modules according to the hierarchy above.
|
||||
|
||||
An example for a rover specific drive mode using the `RoverSpeedAttitudeSetpointType` is provided [here](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/rover_velocity).
|
||||
|
||||
### Controlling a VTOL
|
||||
|
||||
<Badge type="tip" text="main (planned for: PX4 v1.17)" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
Reference in New Issue
Block a user