diff --git a/docs/ko/ros2/px4_ros2_control_interface.md b/docs/ko/ros2/px4_ros2_control_interface.md
index 890858df38..fb7d9a4c76 100644
--- a/docs/ko/ros2/px4_ros2_control_interface.md
+++ b/docs/ko/ros2/px4_ros2_control_interface.md
@@ -108,92 +108,92 @@ The following steps are required to get started:
2. Clone the repository into the workspace:
- ```sh
- cd $ros_workspace/src
- git clone --recursive https://github.com/Auterion/px4-ros2-interface-lib
- ```
+ ```sh
+ cd $ros_workspace/src
+ git clone --recursive https://github.com/Auterion/px4-ros2-interface-lib
+ ```
- ::: info
- To ensure compatibility, use the latest _main_ branches for PX4, _px4_msgs_ and the library.
- See also [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4).
+ ::: info
+ To ensure compatibility, use the latest _main_ branches for PX4, _px4_msgs_ and the library.
+ See also [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4).
:::
3. Build the workspace:
- ```sh
- cd ..
- colcon build
- source install/setup.bash
- ```
+ ```sh
+ cd ..
+ colcon build
+ source install/setup.bash
+ ```
4. In a different shell, start PX4 SITL:
- ```sh
- cd $px4-autopilot
- make px4_sitl gazebo-classic
- ```
+ ```sh
+ cd $px4-autopilot
+ make px4_sitl gazebo-classic
+ ```
- (here we use Gazebo-Classic, but you can use any model or simulator)
+ (here we use Gazebo-Classic, but you can use any model or simulator)
5. Run the micro XRCE agent in a new shell (you can keep it running afterward):
- ```sh
- MicroXRCEAgent udp4 -p 8888
- ```
+ ```sh
+ MicroXRCEAgent udp4 -p 8888
+ ```
6. Start QGroundControl.
- ::: info
- Use QGroundControl Daily, which supports dynamically updating the list of modes.
+ ::: info
+ Use QGroundControl Daily, which supports dynamically updating the list of modes.
:::
7. Back in the ROS 2 terminal, run one of the example modes:
- ```sh
- ros2 run example_mode_manual_cpp example_mode_manual
- ```
+ ```sh
+ ros2 run example_mode_manual_cpp example_mode_manual
+ ```
- You should get an output like this showing 'My Manual Mode' mode being registered:
+ You should get an output like this showing 'My Manual Mode' mode being registered:
- ```sh
- [DEBUG] [example_mode_manual]: Checking message compatibility...
- [DEBUG] [example_mode_manual]: Subscriber found, continuing
- [DEBUG] [example_mode_manual]: Publisher found, continuing
- [DEBUG] [example_mode_manual]: Registering 'My Manual Mode' (arming check: 1, mode: 1, mode executor: 0)
- [DEBUG] [example_mode_manual]: Subscriber found, continuing
- [DEBUG] [example_mode_manual]: Publisher found, continuing
- [DEBUG] [example_mode_manual]: Got RegisterExtComponentReply
- [DEBUG] [example_mode_manual]: Arming check request (id=1, only printed once)
- ```
+ ```sh
+ [DEBUG] [example_mode_manual]: Checking message compatibility...
+ [DEBUG] [example_mode_manual]: Subscriber found, continuing
+ [DEBUG] [example_mode_manual]: Publisher found, continuing
+ [DEBUG] [example_mode_manual]: Registering 'My Manual Mode' (arming check: 1, mode: 1, mode executor: 0)
+ [DEBUG] [example_mode_manual]: Subscriber found, continuing
+ [DEBUG] [example_mode_manual]: Publisher found, continuing
+ [DEBUG] [example_mode_manual]: Got RegisterExtComponentReply
+ [DEBUG] [example_mode_manual]: Arming check request (id=1, only printed once)
+ ```
8. On the PX4 shell, you can check that PX4 registered the new mode:
- ```sh
- commander status
- ```
+ ```sh
+ commander status
+ ```
- The output should contain:
+ The output should contain:
- ```plain
- INFO [commander] Disarmed
- INFO [commander] navigation mode: Position
- INFO [commander] user intended navigation mode: Position
- INFO [commander] in failsafe: no
- INFO [commander] External Mode 1: nav_state: 23, name: My Manual Mode
- ```
+ ```plain
+ INFO [commander] Disarmed
+ INFO [commander] navigation mode: Position
+ INFO [commander] user intended navigation mode: Position
+ INFO [commander] in failsafe: no
+ INFO [commander] External Mode 1: nav_state: 23, name: My Manual Mode
+ ```
9. At this point you should be able to see the mode in QGroundControl as well:
- 
+ 
10. Select the mode, make sure you have a manual control source (physical or virtual joystick), and arm the vehicle.
- The mode will then activate, and it should print the following output:
+ The mode will then activate, and it should print the following output:
- ```sh
- [DEBUG] [example_mode_manual]: Mode 'My Manual Mode' activated
- ```
+ ```sh
+ [DEBUG] [example_mode_manual]: Mode 'My Manual Mode' activated
+ ```
11. Now you are ready to create your own mode.
@@ -266,9 +266,9 @@ This section steps through an example of how to create a mode executor class.
class MyModeExecutor : public px4_ros2::ModeExecutorBase // [1]
{
public:
- MyModeExecutor(rclcpp::Node & node, px4_ros2::ModeBase & owned_mode) // [2]
- : ModeExecutorBase(node, px4_ros2::ModeExecutorBase::Settings{}, owned_mode),
- _node(node)
+ MyModeExecutor(px4_ros2::ModeBase & owned_mode) // [2]
+ : ModeExecutorBase(px4_ros2::ModeExecutorBase::Settings{}, owned_mode),
+ _node(owned_mode.node())
{ }
enum class State // [3]
@@ -344,8 +344,8 @@ The used types also define the compatibility with different vehicle types.
The following sections provide a list of supported setpoint types:
-- [GotoSetpointType](#go-to-setpoint-gotosetpointtype): Smooth position and (optionally) heading control
-- [FwLateralLongitudinalSetpointType](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype): Direct control of lateral and longitudinal fixed wing dynamics
+- [MulticopterGotoSetpointType](#go-to-setpoint-multicoptergotosetpointtype): Smooth position and (optionally) heading control
+- [FwLateralLongitudinalSetpointType](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype): Direct control of lateral and longitudinal fixed wing dynamics
- [DirectActuatorsSetpointType](#direct-actuator-control-setpoint-directactuatorssetpointtype): Direct control of motors and flight surface servo setpoints
:::tip
@@ -354,15 +354,19 @@ The other setpoint types are currently experimental, and can be found in: [px4_r
You can add your own setpoint types by adding a class that inherits from `px4_ros2::SetpointBase`, sets the configuration flags according to what the setpoint requires, and then publishes any topic containing a setpoint.
:::
-#### Go-to Setpoint (GotoSetpointType)
+#### Go-to Setpoint (MulticopterGotoSetpointType)
+
+
:::info
This setpoint type is currently only supported for multicopters.
:::
-Smoothly control position and (optionally) heading setpoints with the [`px4_ros2::GotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/goto.hpp) setpoint type.
+Smoothly control position and (optionally) heading setpoints with the [`px4_ros2::MulticopterGotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp) setpoint type.
The setpoint type is streamed to FMU based position and heading smoothers formulated with time-optimal, maximum-jerk trajectories, with velocity and acceleration constraints.
+There is also a [`px4_ros2::MulticopterGotoGlobalSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp) class that allows to send setpoints in global coordinates.
+
The most trivial use is simply inputting a 3D position into the update method:
```cpp
@@ -419,7 +423,7 @@ This setpoint is streamed to the PX4 [_FwLateralLongitudinalControl_ module](../
To control the vehicle, at least one lateral **and** one longitudinal setpoint must be provided:
1. Of the longitudinal inputs: either `altitude` or `height_rate` must be finite to control vertical motion.
- If both are set to `NAN`, the vehicle will maintain its current altitude.
+ If both are set to `NAN`, the vehicle will maintain its current altitude.
2. Of the lateral inputs: at least one of `course`, `airspeed_direction`, or `lateral_acceleration` must be finite.
For a detailed description of the controllable parameters, please refer to message definitions ([FixedWingLateralSetpoint](../msg_docs/FixedWingLateralSetpoint.md) and [FixedWingLongitudinalSetpoint](../msg_docs/FixedWingLongitudinalSetpoint.md)).
@@ -553,7 +557,7 @@ If you want to control an actuator that does not control the vehicle's motion, b
To control a VTOL in an external flight mode, ensure you're returning the correct setpoint type based on the current flight configuration:
-- Multicopter mode: use a setpoint type that is compatible with multicopter control. For example: either the [`GotoSetpointType`](#go-to-setpoint-gotosetpointtype) or the [`TrajectorySetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html).
+- Multicopter mode: use a setpoint type that is compatible with multicopter control. For example: either the [`MulticopterGotoSetpointType`](#go-to-setpoint-multicoptergotosetpointtype) or the [`TrajectorySetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html).
- Fixed-wing mode: Use the [`FwLateralLongitudinalSetpointType`](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype).
As long as the VTOL remains in either multicopter or fixed-wing mode throughout the external mode, no additional handling is required.
@@ -568,24 +572,24 @@ Commanding transitions externally makes the user partially responsible for ensur
3. To command a transition, you can use the `toMulticopter()` or `toFixedwing()` methods on your VTOL object to set the desired state.
4. During transition, send the following combination of setpoints:
- ```cpp
- // Assuming the instance of the px4_ros2::VTOL object is called vtol
+ ```cpp
+ // Assuming the instance of the px4_ros2::VTOL object is called vtol
- // Send TrajectorySetpointType as follows:
- Eigen::Vector3f acceleration_sp = vtol.computeAccelerationSetpointDuringTransition();
- Eigen::Vector3f velocity_sp{NAN, NAN, 0.f};
+ // Send TrajectorySetpointType as follows:
+ Eigen::Vector3f acceleration_sp = vtol.computeAccelerationSetpointDuringTransition();
+ Eigen::Vector3f velocity_sp{NAN, NAN, 0.f};
- _trajectory_setpoint->update(velocity_sp, acceleration_sp);
+ _trajectory_setpoint->update(velocity_sp, acceleration_sp);
- // Send FwLateralLongitudinalSetpointType with lateral input to realign vehicle as desired
+ // Send FwLateralLongitudinalSetpointType with lateral input to realign vehicle as desired
- float course_sp = 0.F; // North
+ float course_sp = 0.F; // North
- _fw_lateral_longitudinal_setpoint->updateWithAltitude(NAN, course_sp)
- ```
+ _fw_lateral_longitudinal_setpoint->updateWithAltitude(NAN, course_sp)
+ ```
- This will ensure that the transition is handled properly within PX4.
- You can optionally pass a deceleration setpoint to `computeAccelerationSetpointDuringTransition()` to be used during back-transitions.
+ This will ensure that the transition is handled properly within PX4.
+ You can optionally pass a deceleration setpoint to `computeAccelerationSetpointDuringTransition()` to be used during back-transitions.
To check the current state of the vehicle, use the `getCurrentState()` method on your `px4_ros2::VTOL` object.
@@ -598,7 +602,7 @@ If you want to control an independent actuator (a servo), follow these steps:
1. [Configure the output](../payloads/generic_actuator_control.md#generic-actuator-control-with-mavlink).
2. Create an instance of [px4_ros2::PeripheralActuatorControls](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1PeripheralActuatorControls.html) in the constructor of your mode.
3. Call the `set()` method to control the actuator(s).
- This can be done independently of any active setpoints.
+ This can be done independently of any active setpoints.
### 텔레메트리