mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2025-12-08 03:22:27 +08:00
New Crowdin translations - uk
This commit is contained in:
committed by
Hamish Willee
parent
5af5bdb478
commit
f9c36b8235
@@ -47,7 +47,7 @@ PX4 v1.14 (and later) supports the [LightWare LiDAR SF45](../sensor/sf45_rotatin
|
||||
|
||||
- Attach and configure the distance sensor on a particular port (see [sensor-specific docs](../sensor/rangefinders.md)) and enable collision prevention using [CP_DIST](#CP_DIST).
|
||||
- Модифікуйте драйвер для встановлення орієнтації.
|
||||
This should be done by mimicking the `SENS_CM8JL65_R_0` parameter (though you might also hard-code the orientation in the sensor _module.yaml_ file to something like `sf0x start -d ${SERIAL_DEV} -R 25` - where 25 is equivalent to `ROTATION_DOWNWARD_FACING`).
|
||||
This should be done by mimicking the `SENS_CM8JL65_R_0` parameter (though you might also hard-code the orientation in the sensor _module.yaml_ file to something like `sf0x start -d ${SERIAL_DEV} -R 25` - where 25 is equivalent to `ROTATION_DOWNWARD_FACING`).
|
||||
- Modify the driver to set the _field of view_ in the distance sensor UORB topic (`distance_sensor_s.h_fov`).
|
||||
|
||||
## PX4 (Software) Setup
|
||||
@@ -203,85 +203,85 @@ The Lua script works by extracting the `obstacle_distance_fused` data at each ti
|
||||
|
||||
2. Configure PX4 to publish obstacle distance data (so that it is available to PlotJuggler):
|
||||
|
||||
Add the [`obstacle_distance_fused`](../msg_docs/ObstacleDistance.md) UORB topic to your [`dds_topics.yaml`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) so that it is published by PX4:
|
||||
Add the [`obstacle_distance_fused`](../msg_docs/ObstacleDistance.md) UORB topic to your [`dds_topics.yaml`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) so that it is published by PX4:
|
||||
|
||||
```sh
|
||||
- topic: /fmu/out/obstacle_distance_fused
|
||||
type: px4_msgs::msg::ObstacleDistance
|
||||
```
|
||||
```sh
|
||||
- topic: /fmu/out/obstacle_distance_fused
|
||||
type: px4_msgs::msg::ObstacleDistance
|
||||
```
|
||||
|
||||
For more information see [DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml) in _uXRCE-DDS (PX4-ROS 2/DDS Bridge)_.
|
||||
For more information see [DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml) in [uXRCE-DDS](../middleware/uxrce_dds.md) (PX4-ROS 2/DDS Bridge)_.
|
||||
|
||||
3. Open PlotJuggler and navigate to the **Tools > Reactive Script Editor** section.
|
||||
In the **Script Editor** tab, add following scripts in the appropriate sections:
|
||||
In the **Script Editor** tab, add following scripts in the appropriate sections:
|
||||
|
||||
- **Global code, executed once:**
|
||||
- **Global code, executed once:**
|
||||
|
||||
```lua
|
||||
obs_dist_fused_xy = ScatterXY.new("obstacle_distance_fused_xy")
|
||||
obs_dist_min = Timeseries.new("obstacle_distance_minimum")
|
||||
```
|
||||
```lua
|
||||
obs_dist_fused_xy = ScatterXY.new("obstacle_distance_fused_xy")
|
||||
obs_dist_min = Timeseries.new("obstacle_distance_minimum")
|
||||
```
|
||||
|
||||
- **function(tracker_time)**
|
||||
- **function(tracker_time)**
|
||||
|
||||
```lua
|
||||
obs_dist_fused_xy:clear()
|
||||
```lua
|
||||
obs_dist_fused_xy:clear()
|
||||
|
||||
i = 0
|
||||
angle_offset = TimeseriesView.find("/fmu/out/obstacle_distance_fused/angle_offset")
|
||||
increment = TimeseriesView.find("/fmu/out/obstacle_distance_fused/increment")
|
||||
min_dist = 65535
|
||||
i = 0
|
||||
angle_offset = TimeseriesView.find("/fmu/out/obstacle_distance_fused/angle_offset")
|
||||
increment = TimeseriesView.find("/fmu/out/obstacle_distance_fused/increment")
|
||||
min_dist = 65535
|
||||
|
||||
-- Cache increment and angle_offset values at tracker_time to avoid repeated calls
|
||||
local angle_offset_value = angle_offset:atTime(tracker_time)
|
||||
local increment_value = increment:atTime(tracker_time)
|
||||
-- Cache increment and angle_offset values at tracker_time to avoid repeated calls
|
||||
local angle_offset_value = angle_offset:atTime(tracker_time)
|
||||
local increment_value = increment:atTime(tracker_time)
|
||||
|
||||
if increment_value == nil or increment_value <= 0 then
|
||||
print("Invalid increment value: " .. tostring(increment_value))
|
||||
return
|
||||
end
|
||||
if increment_value == nil or increment_value <= 0 then
|
||||
print("Invalid increment value: " .. tostring(increment_value))
|
||||
return
|
||||
end
|
||||
|
||||
local max_steps = math.floor(360 / increment_value)
|
||||
local max_steps = math.floor(360 / increment_value)
|
||||
|
||||
while i < max_steps do
|
||||
local str = string.format("/fmu/out/obstacle_distance_fused/distances[%d]", i)
|
||||
local distance = TimeseriesView.find(str)
|
||||
if distance == nil then
|
||||
print("No distance data for: " .. str)
|
||||
break
|
||||
end
|
||||
while i < max_steps do
|
||||
local str = string.format("/fmu/out/obstacle_distance_fused/distances[%d]", i)
|
||||
local distance = TimeseriesView.find(str)
|
||||
if distance == nil then
|
||||
print("No distance data for: " .. str)
|
||||
break
|
||||
end
|
||||
|
||||
local dist = distance:atTime(tracker_time)
|
||||
if dist ~= nil and dist < 65535 then
|
||||
-- Calculate angle and Cartesian coordinates
|
||||
local angle = angle_offset_value + i * increment_value
|
||||
local y = dist * math.cos(math.rad(angle))
|
||||
local x = dist * math.sin(math.rad(angle))
|
||||
local dist = distance:atTime(tracker_time)
|
||||
if dist ~= nil and dist < 65535 then
|
||||
-- Calculate angle and Cartesian coordinates
|
||||
local angle = angle_offset_value + i * increment_value
|
||||
local y = dist * math.cos(math.rad(angle))
|
||||
local x = dist * math.sin(math.rad(angle))
|
||||
|
||||
obs_dist_fused_xy:push_back(x, y)
|
||||
obs_dist_fused_xy:push_back(x, y)
|
||||
|
||||
-- Update minimum distance
|
||||
if dist < min_dist then
|
||||
min_dist = dist
|
||||
end
|
||||
end
|
||||
-- Update minimum distance
|
||||
if dist < min_dist then
|
||||
min_dist = dist
|
||||
end
|
||||
end
|
||||
|
||||
i = i + 1
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
-- Push minimum distance once after the loop
|
||||
if min_dist < 65535 then
|
||||
obs_dist_min:push_back(tracker_time, min_dist)
|
||||
else
|
||||
print("No valid minimum distance found")
|
||||
end
|
||||
```
|
||||
-- Push minimum distance once after the loop
|
||||
if min_dist < 65535 then
|
||||
obs_dist_min:push_back(tracker_time, min_dist)
|
||||
else
|
||||
print("No valid minimum distance found")
|
||||
end
|
||||
```
|
||||
|
||||
4. Enter a name for the script on the top right, and press **Save**.
|
||||
Once saved, the script should appear in the _Active Scripts_ section.
|
||||
Once saved, the script should appear in the _Active Scripts_ section.
|
||||
|
||||
5. Start streaming the data using the approach described in [Plotting uORB Topic Data in Real Time using PlotJuggler](../debug/plotting_realtime_uorb_data.md).
|
||||
You should see the `obstacle_distance_fused_xy` and `obstacle_distance_minimum` timeseries on the left.
|
||||
You should see the `obstacle_distance_fused_xy` and `obstacle_distance_minimum` timeseries on the left.
|
||||
|
||||
Note that you have to press **Save** again to re-enable the scripts after loading a new log file or otherwise clearing data.
|
||||
|
||||
|
||||
@@ -96,13 +96,13 @@ Exporting the messages allows ROS 2 and the uXRCE-DDS agent to be independent of
|
||||
|
||||
While `px4_msgs` has messages for all uORB topics in PX4, not all messages in `px4_msgs` are available to ROS 2/PlotJuggler by default.
|
||||
The set that are available must be built into the client running on PX4.
|
||||
These are defined in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml).
|
||||
These are defined in [dds_topics.yaml](../middleware/dds_topics.md).
|
||||
|
||||
The instructions below explain the changes needed to monitor topics that are not available by default.
|
||||
|
||||
### Missing Topics
|
||||
|
||||
If a normal uORB topic is not available in PlotJuggler you will need to modify the [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) to include the topic and rebuild PX4.
|
||||
If a normal uORB topic is not available in PlotJuggler you will need to modify the [dds_topics.yaml](../middleware/dds_topics.md) ([source](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml)) to include the topic and rebuild PX4.
|
||||
|
||||
If working with real hardware you will need to build and [install](../config/firmware.md#installing-px4-main-beta-or-custom-firmware) custom firmware after changing the YAML file.
|
||||
|
||||
@@ -122,7 +122,7 @@ cd ~/ros2_ws/ && colcon build
|
||||
|
||||
### Custom Topics
|
||||
|
||||
After defining the topic, follow the instructions above to add the topic to [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), and export the new message into your ROS 2 workspace.
|
||||
After defining the topic, follow the instructions above to add the topic to [dds_topics.yaml](../middleware/dds_topics.md), and export the new message into your ROS 2 workspace.
|
||||
|
||||
## Дивись також
|
||||
|
||||
|
||||
@@ -128,8 +128,7 @@ To enable recording for EKF replay you must set the parameters to enable a [sing
|
||||
|
||||
Для виконання повторення EKF2:
|
||||
|
||||
- Запишіть оригінальний журнал.
|
||||
Optionally set `SDLOG_MODE` to `1` to log from boot.
|
||||
- Record the original log with `SDLOG_MODE` set to `1` to log from boot.
|
||||
|
||||
- In addition to the `replay` environment variable, set `replay_mode` to `ekf2`:
|
||||
|
||||
|
||||
277
docs/uk/middleware/dds_topics.md
Normal file
277
docs/uk/middleware/dds_topics.md
Normal file
@@ -0,0 +1,277 @@
|
||||
# dds_topics.yaml — PX4 Topics Exposed to ROS 2
|
||||
|
||||
:::info
|
||||
This document is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/msg/generate_msg_docs.py) from the source code.
|
||||
:::
|
||||
|
||||
The [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) file specifies which uORB message definitions are compiled into the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) module when [PX4 is built](../middleware/uxrce_dds.md#code-generation), and hence which topics are available for ROS 2 applications to subscribe or publish (by default).
|
||||
|
||||
This document shows a markdown-rendered version of [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), listing the publications, subscriptions, and so on.
|
||||
|
||||
## Publications
|
||||
|
||||
| Topic | Тип | Rate Limit |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
||||
| `/fmu/out/register_ext_component_reply` | [px4_msgs::msg::RegisterExtComponentReply](../msg_docs/RegisterExtComponentReply.md) | |
|
||||
| `/fmu/out/arming_check_request` | [px4_msgs::msg::ArmingCheckRequest](../msg_docs/ArmingCheckRequest.md) | 5.0 |
|
||||
| `/fmu/out/mode_completed` | [px4_msgs::msg::ModeCompleted](../msg_docs/ModeCompleted.md) | 50.0 |
|
||||
| `/fmu/out/battery_status` | [px4_msgs::msg::BatteryStatus](../msg_docs/BatteryStatus.md) | 1.0 |
|
||||
| `/fmu/out/collision_constraints` | [px4_msgs::msg::CollisionConstraints](../msg_docs/CollisionConstraints.md) | 50.0 |
|
||||
| `/fmu/out/estimator_status_flags` | [px4_msgs::msg::EstimatorStatusFlags](../msg_docs/EstimatorStatusFlags.md) | 5.0 |
|
||||
| `/fmu/out/failsafe_flags` | [px4_msgs::msg::FailsafeFlags](../msg_docs/FailsafeFlags.md) | 5.0 |
|
||||
| `/fmu/out/manual_control_setpoint` | [px4_msgs::msg::ManualControlSetpoint](../msg_docs/ManualControlSetpoint.md) | 25.0 |
|
||||
| `/fmu/out/message_format_response` | [px4_msgs::msg::MessageFormatResponse](../msg_docs/MessageFormatResponse.md) | |
|
||||
| `/fmu/out/position_setpoint_triplet` | [px4_msgs::msg::PositionSetpointTriplet](../msg_docs/PositionSetpointTriplet.md) | 5.0 |
|
||||
| `/fmu/out/sensor_combined` | [px4_msgs::msg::SensorCombined](../msg_docs/SensorCombined.md) | |
|
||||
| `/fmu/out/timesync_status` | [px4_msgs::msg::TimesyncStatus](../msg_docs/TimesyncStatus.md) | 10.0 |
|
||||
| `/fmu/out/vehicle_land_detected` | [px4_msgs::msg::VehicleLandDetected](../msg_docs/VehicleLandDetected.md) | 5.0 |
|
||||
| `/fmu/out/vehicle_attitude` | [px4_msgs::msg::VehicleAttitude](../msg_docs/VehicleAttitude.md) | |
|
||||
| `/fmu/out/vehicle_control_mode` | [px4_msgs::msg::VehicleControlMode](../msg_docs/VehicleControlMode.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_command_ack` | [px4_msgs::msg::VehicleCommandAck](../msg_docs/VehicleCommandAck.md) | |
|
||||
| `/fmu/out/vehicle_global_position` | [px4_msgs::msg::VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_gps_position` | [px4_msgs::msg::SensorGps](../msg_docs/SensorGps.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_local_position` | [px4_msgs::msg::VehicleLocalPosition](../msg_docs/VehicleLocalPosition.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_odometry` | [px4_msgs::msg::VehicleOdometry](../msg_docs/VehicleOdometry.md) | |
|
||||
| `/fmu/out/vehicle_status` | [px4_msgs::msg::VehicleStatus](../msg_docs/VehicleStatus.md) | 5.0 |
|
||||
| `/fmu/out/airspeed_validated` | [px4_msgs::msg::AirspeedValidated](../msg_docs/AirspeedValidated.md) | 50.0 |
|
||||
| `/fmu/out/vtol_vehicle_status` | [px4_msgs::msg::VtolVehicleStatus](../msg_docs/VtolVehicleStatus.md) | |
|
||||
| `/fmu/out/home_position` | [px4_msgs::msg::HomePosition](../msg_docs/HomePosition.md) | 5.0 |
|
||||
|
||||
## Subscriptions
|
||||
|
||||
| Topic | Тип |
|
||||
| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| /fmu/in/register_ext_component_request | [px4_msgs::msg::RegisterExtComponentRequest](../msg_docs/RegisterExtComponentRequest.md) |
|
||||
| /fmu/in/unregister_ext_component | [px4_msgs::msg::UnregisterExtComponent](../msg_docs/UnregisterExtComponent.md) |
|
||||
| /fmu/in/config_overrides_request | [px4_msgs::msg::ConfigOverrides](../msg_docs/ConfigOverrides.md) |
|
||||
| /fmu/in/arming_check_reply | [px4_msgs::msg::ArmingCheckReply](../msg_docs/ArmingCheckReply.md) |
|
||||
| /fmu/in/message_format_request | [px4_msgs::msg::MessageFormatRequest](../msg_docs/MessageFormatRequest.md) |
|
||||
| /fmu/in/mode_completed | [px4_msgs::msg::ModeCompleted](../msg_docs/ModeCompleted.md) |
|
||||
| /fmu/in/config_control_setpoints | [px4_msgs::msg::VehicleControlMode](../msg_docs/VehicleControlMode.md) |
|
||||
| /fmu/in/distance_sensor | [px4_msgs::msg::DistanceSensor](../msg_docs/DistanceSensor.md) |
|
||||
| /fmu/in/manual_control_input | [px4_msgs::msg::ManualControlSetpoint](../msg_docs/ManualControlSetpoint.md) |
|
||||
| /fmu/in/offboard_control_mode | [px4_msgs::msg::OffboardControlMode](../msg_docs/OffboardControlMode.md) |
|
||||
| /fmu/in/onboard_computer_status | [px4_msgs::msg::OnboardComputerStatus](../msg_docs/OnboardComputerStatus.md) |
|
||||
| /fmu/in/obstacle_distance | [px4_msgs::msg::ObstacleDistance](../msg_docs/ObstacleDistance.md) |
|
||||
| /fmu/in/sensor_optical_flow | [px4_msgs::msg::SensorOpticalFlow](../msg_docs/SensorOpticalFlow.md) |
|
||||
| /fmu/in/goto_setpoint | [px4_msgs::msg::GotoSetpoint](../msg_docs/GotoSetpoint.md) |
|
||||
| /fmu/in/telemetry_status | [px4_msgs::msg::TelemetryStatus](../msg_docs/TelemetryStatus.md) |
|
||||
| /fmu/in/trajectory_setpoint | [px4_msgs::msg::TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) |
|
||||
| /fmu/in/vehicle_attitude_setpoint | [px4_msgs::msg::VehicleAttitudeSetpoint](../msg_docs/VehicleAttitudeSetpoint.md) |
|
||||
| /fmu/in/vehicle_mocap_odometry | [px4_msgs::msg::VehicleOdometry](../msg_docs/VehicleOdometry.md) |
|
||||
| /fmu/in/vehicle_rates_setpoint | [px4_msgs::msg::VehicleRatesSetpoint](../msg_docs/VehicleRatesSetpoint.md) |
|
||||
| /fmu/in/vehicle_visual_odometry | [px4_msgs::msg::VehicleOdometry](../msg_docs/VehicleOdometry.md) |
|
||||
| /fmu/in/vehicle_command | [px4_msgs::msg::VehicleCommand](../msg_docs/VehicleCommand.md) |
|
||||
| /fmu/in/vehicle_command_mode_executor | [px4_msgs::msg::VehicleCommand](../msg_docs/VehicleCommand.md) |
|
||||
| /fmu/in/vehicle_thrust_setpoint | [px4_msgs::msg::VehicleThrustSetpoint](../msg_docs/VehicleThrustSetpoint.md) |
|
||||
| /fmu/in/vehicle_torque_setpoint | [px4_msgs::msg::VehicleTorqueSetpoint](../msg_docs/VehicleTorqueSetpoint.md) |
|
||||
| /fmu/in/actuator_motors | [px4_msgs::msg::ActuatorMotors](../msg_docs/ActuatorMotors.md) |
|
||||
| /fmu/in/actuator_servos | [px4_msgs::msg::ActuatorServos](../msg_docs/ActuatorServos.md) |
|
||||
| /fmu/in/aux_global_position | [px4_msgs::msg::VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) |
|
||||
| /fmu/in/fixed_wing_longitudinal_setpoint | [px4_msgs::msg::FixedWingLongitudinalSetpoint](../msg_docs/FixedWingLongitudinalSetpoint.md) |
|
||||
| /fmu/in/fixed_wing_lateral_setpoint | [px4_msgs::msg::FixedWingLateralSetpoint](../msg_docs/FixedWingLateralSetpoint.md) |
|
||||
| /fmu/in/longitudinal_control_configuration | [px4_msgs::msg::LongitudinalControlConfiguration](../msg_docs/LongitudinalControlConfiguration.md) |
|
||||
| /fmu/in/lateral_control_configuration | [px4_msgs::msg::LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md) |
|
||||
|
||||
## Subscriptions Multi
|
||||
|
||||
None
|
||||
|
||||
## Not Exported
|
||||
|
||||
These messages are not listed in the yaml file.
|
||||
They are not build into the module, and hence are neither published or subscribed.
|
||||
|
||||
:::details
|
||||
See messages
|
||||
|
||||
- [SensorCorrection](../msg_docs/SensorCorrection.md)
|
||||
- [ActuatorOutputs](../msg_docs/ActuatorOutputs.md)
|
||||
- [FixedWingRunwayControl](../msg_docs/FixedWingRunwayControl.md)
|
||||
- [EstimatorInnovations](../msg_docs/EstimatorInnovations.md)
|
||||
- [FlightPhaseEstimation](../msg_docs/FlightPhaseEstimation.md)
|
||||
- [PurePursuitStatus](../msg_docs/PurePursuitStatus.md)
|
||||
- [Px4ioStatus](../msg_docs/Px4ioStatus.md)
|
||||
- [SatelliteInfo](../msg_docs/SatelliteInfo.md)
|
||||
- [GeofenceResult](../msg_docs/GeofenceResult.md)
|
||||
- [GimbalManagerStatus](../msg_docs/GimbalManagerStatus.md)
|
||||
- [ManualControlSwitches](../msg_docs/ManualControlSwitches.md)
|
||||
- [OpenDroneIdSelfId](../msg_docs/OpenDroneIdSelfId.md)
|
||||
- [OpenDroneIdSystem](../msg_docs/OpenDroneIdSystem.md)
|
||||
- [EventV0](../msg_docs/EventV0.md)
|
||||
- [QshellRetval](../msg_docs/QshellRetval.md)
|
||||
- [RoverThrottleSetpoint](../msg_docs/RoverThrottleSetpoint.md)
|
||||
- [AirspeedValidatedV0](../msg_docs/AirspeedValidatedV0.md)
|
||||
- [RcChannels](../msg_docs/RcChannels.md)
|
||||
- [SensorAccel](../msg_docs/SensorAccel.md)
|
||||
- [GimbalDeviceAttitudeStatus](../msg_docs/GimbalDeviceAttitudeStatus.md)
|
||||
- [EscStatus](../msg_docs/EscStatus.md)
|
||||
- [RoverAttitudeSetpoint](../msg_docs/RoverAttitudeSetpoint.md)
|
||||
- [RateCtrlStatus](../msg_docs/RateCtrlStatus.md)
|
||||
- [AirspeedWind](../msg_docs/AirspeedWind.md)
|
||||
- [InputRc](../msg_docs/InputRc.md)
|
||||
- [GpioIn](../msg_docs/GpioIn.md)
|
||||
- [LaunchDetectionStatus](../msg_docs/LaunchDetectionStatus.md)
|
||||
- [VehicleImu](../msg_docs/VehicleImu.md)
|
||||
- [Event](../msg_docs/Event.md)
|
||||
- [SensorUwb](../msg_docs/SensorUwb.md)
|
||||
- [ActuatorServosTrim](../msg_docs/ActuatorServosTrim.md)
|
||||
- [DatamanResponse](../msg_docs/DatamanResponse.md)
|
||||
- [OrbTest](../msg_docs/OrbTest.md)
|
||||
- [VehicleLocalPositionSetpoint](../msg_docs/VehicleLocalPositionSetpoint.md)
|
||||
- [VehicleAngularVelocity](../msg_docs/VehicleAngularVelocity.md)
|
||||
- [FollowTargetStatus](../msg_docs/FollowTargetStatus.md)
|
||||
- [NormalizedUnsignedSetpoint](../msg_docs/NormalizedUnsignedSetpoint.md)
|
||||
- [YawEstimatorStatus](../msg_docs/YawEstimatorStatus.md)
|
||||
- [TakeoffStatus](../msg_docs/TakeoffStatus.md)
|
||||
- [UlogStreamAck](../msg_docs/UlogStreamAck.md)
|
||||
- [OrbTestLarge](../msg_docs/OrbTestLarge.md)
|
||||
- [RoverSteeringSetpoint](../msg_docs/RoverSteeringSetpoint.md)
|
||||
- [CameraCapture](../msg_docs/CameraCapture.md)
|
||||
- [VehicleRoi](../msg_docs/VehicleRoi.md)
|
||||
- [ActuatorArmed](../msg_docs/ActuatorArmed.md)
|
||||
- [FixedWingLateralGuidanceStatus](../msg_docs/FixedWingLateralGuidanceStatus.md)
|
||||
- [ParameterSetValueResponse](../msg_docs/ParameterSetValueResponse.md)
|
||||
- [GeofenceStatus](../msg_docs/GeofenceStatus.md)
|
||||
- [VehicleAngularAccelerationSetpoint](../msg_docs/VehicleAngularAccelerationSetpoint.md)
|
||||
- [SensorGnssRelative](../msg_docs/SensorGnssRelative.md)
|
||||
- [PowerMonitor](../msg_docs/PowerMonitor.md)
|
||||
- [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md)
|
||||
- [ParameterResetRequest](../msg_docs/ParameterResetRequest.md)
|
||||
- [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md)
|
||||
- [TecsStatus](../msg_docs/TecsStatus.md)
|
||||
- [EstimatorSelectorStatus](../msg_docs/EstimatorSelectorStatus.md)
|
||||
- [CanInterfaceStatus](../msg_docs/CanInterfaceStatus.md)
|
||||
- [Ping](../msg_docs/Ping.md)
|
||||
- [LedControl](../msg_docs/LedControl.md)
|
||||
- [Wind](../msg_docs/Wind.md)
|
||||
- [VehicleStatusV0](../msg_docs/VehicleStatusV0.md)
|
||||
- [ActuatorTest](../msg_docs/ActuatorTest.md)
|
||||
- [IridiumsbdStatus](../msg_docs/IridiumsbdStatus.md)
|
||||
- [FailureDetectorStatus](../msg_docs/FailureDetectorStatus.md)
|
||||
- [GimbalManagerSetAttitude](../msg_docs/GimbalManagerSetAttitude.md)
|
||||
- [Gripper](../msg_docs/Gripper.md)
|
||||
- [SensorMag](../msg_docs/SensorMag.md)
|
||||
- [DebugValue](../msg_docs/DebugValue.md)
|
||||
- [SensorPreflightMag](../msg_docs/SensorPreflightMag.md)
|
||||
- [RcParameterMap](../msg_docs/RcParameterMap.md)
|
||||
- [LandingGear](../msg_docs/LandingGear.md)
|
||||
- [GimbalDeviceInformation](../msg_docs/GimbalDeviceInformation.md)
|
||||
- [VehicleOpticalFlow](../msg_docs/VehicleOpticalFlow.md)
|
||||
- [UlogStream](../msg_docs/UlogStream.md)
|
||||
- [GimbalControls](../msg_docs/GimbalControls.md)
|
||||
- [RoverRateSetpoint](../msg_docs/RoverRateSetpoint.md)
|
||||
- [LogMessage](../msg_docs/LogMessage.md)
|
||||
- [RoverVelocitySetpoint](../msg_docs/RoverVelocitySetpoint.md)
|
||||
- [GpioOut](../msg_docs/GpioOut.md)
|
||||
- [TaskStackInfo](../msg_docs/TaskStackInfo.md)
|
||||
- [VelocityLimits](../msg_docs/VelocityLimits.md)
|
||||
- [MagWorkerData](../msg_docs/MagWorkerData.md)
|
||||
- [ParameterUpdate](../msg_docs/ParameterUpdate.md)
|
||||
- [TrajectorySetpoint6dof](../msg_docs/TrajectorySetpoint6dof.md)
|
||||
- [SensorBaro](../msg_docs/SensorBaro.md)
|
||||
- [VehicleImuStatus](../msg_docs/VehicleImuStatus.md)
|
||||
- [InternalCombustionEngineStatus](../msg_docs/InternalCombustionEngineStatus.md)
|
||||
- [VehicleOpticalFlowVel](../msg_docs/VehicleOpticalFlowVel.md)
|
||||
- [GimbalManagerSetManualControl](../msg_docs/GimbalManagerSetManualControl.md)
|
||||
- [Rpm](../msg_docs/Rpm.md)
|
||||
- [MagnetometerBiasEstimate](../msg_docs/MagnetometerBiasEstimate.md)
|
||||
- [MountOrientation](../msg_docs/MountOrientation.md)
|
||||
- [ActionRequest](../msg_docs/ActionRequest.md)
|
||||
- [OpenDroneIdArmStatus](../msg_docs/OpenDroneIdArmStatus.md)
|
||||
- [SensorAccelFifo](../msg_docs/SensorAccelFifo.md)
|
||||
- [LoggerStatus](../msg_docs/LoggerStatus.md)
|
||||
- [GeneratorStatus](../msg_docs/GeneratorStatus.md)
|
||||
- [InternalCombustionEngineControl](../msg_docs/InternalCombustionEngineControl.md)
|
||||
- [Ekf2Timestamps](../msg_docs/Ekf2Timestamps.md)
|
||||
- [LandingTargetPose](../msg_docs/LandingTargetPose.md)
|
||||
- [PositionControllerLandingStatus](../msg_docs/PositionControllerLandingStatus.md)
|
||||
- [UavcanParameterValue](../msg_docs/UavcanParameterValue.md)
|
||||
- [OrbitStatus](../msg_docs/OrbitStatus.md)
|
||||
- [PositionControllerStatus](../msg_docs/PositionControllerStatus.md)
|
||||
- [EstimatorStatus](../msg_docs/EstimatorStatus.md)
|
||||
- [DatamanRequest](../msg_docs/DatamanRequest.md)
|
||||
- [HoverThrustEstimate](../msg_docs/HoverThrustEstimate.md)
|
||||
- [FixedWingLateralStatus](../msg_docs/FixedWingLateralStatus.md)
|
||||
- [NavigatorMissionItem](../msg_docs/NavigatorMissionItem.md)
|
||||
- [Cpuload](../msg_docs/Cpuload.md)
|
||||
- [EstimatorAidSource3d](../msg_docs/EstimatorAidSource3d.md)
|
||||
- [RoverRateStatus](../msg_docs/RoverRateStatus.md)
|
||||
- [EscReport](../msg_docs/EscReport.md)
|
||||
- [DebugArray](../msg_docs/DebugArray.md)
|
||||
- [ControlAllocatorStatus](../msg_docs/ControlAllocatorStatus.md)
|
||||
- [SensorHygrometer](../msg_docs/SensorHygrometer.md)
|
||||
- [EstimatorSensorBias](../msg_docs/EstimatorSensorBias.md)
|
||||
- [EstimatorBias3d](../msg_docs/EstimatorBias3d.md)
|
||||
- [GimbalManagerInformation](../msg_docs/GimbalManagerInformation.md)
|
||||
- [QshellReq](../msg_docs/QshellReq.md)
|
||||
- [CameraStatus](../msg_docs/CameraStatus.md)
|
||||
- [GpsInjectData](../msg_docs/GpsInjectData.md)
|
||||
- [FigureEightStatus](../msg_docs/FigureEightStatus.md)
|
||||
- [TransponderReport](../msg_docs/TransponderReport.md)
|
||||
- [UavcanParameterRequest](../msg_docs/UavcanParameterRequest.md)
|
||||
- [MavlinkLog](../msg_docs/MavlinkLog.md)
|
||||
- [EstimatorGpsStatus](../msg_docs/EstimatorGpsStatus.md)
|
||||
- [FuelTankStatus](../msg_docs/FuelTankStatus.md)
|
||||
- [Mission](../msg_docs/Mission.md)
|
||||
- [PositionSetpoint](../msg_docs/PositionSetpoint.md)
|
||||
- [MissionResult](../msg_docs/MissionResult.md)
|
||||
- [EstimatorEventFlags](../msg_docs/EstimatorEventFlags.md)
|
||||
- [VehicleMagnetometer](../msg_docs/VehicleMagnetometer.md)
|
||||
- [MavlinkTunnel](../msg_docs/MavlinkTunnel.md)
|
||||
- [DifferentialPressure](../msg_docs/DifferentialPressure.md)
|
||||
- [CellularStatus](../msg_docs/CellularStatus.md)
|
||||
- [GpsDump](../msg_docs/GpsDump.md)
|
||||
- [GimbalDeviceSetAttitude](../msg_docs/GimbalDeviceSetAttitude.md)
|
||||
- [ArmingCheckReplyV0](../msg_docs/ArmingCheckReplyV0.md)
|
||||
- [NavigatorStatus](../msg_docs/NavigatorStatus.md)
|
||||
- [RoverPositionSetpoint](../msg_docs/RoverPositionSetpoint.md)
|
||||
- [FollowTarget](../msg_docs/FollowTarget.md)
|
||||
- [SensorsStatusImu](../msg_docs/SensorsStatusImu.md)
|
||||
- [EstimatorStates](../msg_docs/EstimatorStates.md)
|
||||
- [SensorGyro](../msg_docs/SensorGyro.md)
|
||||
- [SensorAirflow](../msg_docs/SensorAirflow.md)
|
||||
- [ButtonEvent](../msg_docs/ButtonEvent.md)
|
||||
- [DebugKeyValue](../msg_docs/DebugKeyValue.md)
|
||||
- [GpioConfig](../msg_docs/GpioConfig.md)
|
||||
- [CameraTrigger](../msg_docs/CameraTrigger.md)
|
||||
- [LandingGearWheel](../msg_docs/LandingGearWheel.md)
|
||||
- [VehicleConstraints](../msg_docs/VehicleConstraints.md)
|
||||
- [HealthReport](../msg_docs/HealthReport.md)
|
||||
- [PowerButtonState](../msg_docs/PowerButtonState.md)
|
||||
- [RadioStatus](../msg_docs/RadioStatus.md)
|
||||
- [SensorGyroFifo](../msg_docs/SensorGyroFifo.md)
|
||||
- [EstimatorBias](../msg_docs/EstimatorBias.md)
|
||||
- [DebugVect](../msg_docs/DebugVect.md)
|
||||
- [DistanceSensorModeChangeRequest](../msg_docs/DistanceSensorModeChangeRequest.md)
|
||||
- [RtlTimeEstimate](../msg_docs/RtlTimeEstimate.md)
|
||||
- [PpsCapture](../msg_docs/PpsCapture.md)
|
||||
- [SensorSelection](../msg_docs/SensorSelection.md)
|
||||
- [SystemPower](../msg_docs/SystemPower.md)
|
||||
- [ActuatorControlsStatus](../msg_docs/ActuatorControlsStatus.md)
|
||||
- [SensorGyroFft](../msg_docs/SensorGyroFft.md)
|
||||
- [VehicleAirData](../msg_docs/VehicleAirData.md)
|
||||
- [FollowTargetEstimator](../msg_docs/FollowTargetEstimator.md)
|
||||
- [ParameterSetUsedRequest](../msg_docs/ParameterSetUsedRequest.md)
|
||||
- [GpioRequest](../msg_docs/GpioRequest.md)
|
||||
- [OpenDroneIdOperatorId](../msg_docs/OpenDroneIdOperatorId.md)
|
||||
- [RtlStatus](../msg_docs/RtlStatus.md)
|
||||
- [Airspeed](../msg_docs/Airspeed.md)
|
||||
- [VehicleAcceleration](../msg_docs/VehicleAcceleration.md)
|
||||
- [ParameterSetValueRequest](../msg_docs/ParameterSetValueRequest.md)
|
||||
- [IrlockReport](../msg_docs/IrlockReport.md)
|
||||
- [HeaterStatus](../msg_docs/HeaterStatus.md)
|
||||
- [AdcReport](../msg_docs/AdcReport.md)
|
||||
- [PwmInput](../msg_docs/PwmInput.md)
|
||||
- [TiltrotorExtraControls](../msg_docs/TiltrotorExtraControls.md)
|
||||
- [EstimatorAidSource1d](../msg_docs/EstimatorAidSource1d.md)
|
||||
- [OrbTestMedium](../msg_docs/OrbTestMedium.md)
|
||||
- [VehicleAttitudeSetpointV0](../msg_docs/VehicleAttitudeSetpointV0.md)
|
||||
- [EstimatorAidSource2d](../msg_docs/EstimatorAidSource2d.md)
|
||||
- [TuneControl](../msg_docs/TuneControl.md)
|
||||
- [WheelEncoders](../msg_docs/WheelEncoders.md)
|
||||
- [AutotuneAttitudeControlStatus](../msg_docs/AutotuneAttitudeControlStatus.md)
|
||||
- [LandingTargetInnovations](../msg_docs/LandingTargetInnovations.md)
|
||||
- [SensorsStatus](../msg_docs/SensorsStatus.md)
|
||||
|
||||
:::
|
||||
@@ -61,12 +61,12 @@ For example the [VelocityLimits](../msg_docs/VelocityLimits.md) message definiti
|
||||
```text
|
||||
# Velocity and yaw rate limits for a multicopter position slow mode only
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp # [us] Time since system start.
|
||||
|
||||
# absolute speeds, NAN means use default limit
|
||||
float32 horizontal_velocity # [m/s]
|
||||
float32 vertical_velocity # [m/s]
|
||||
float32 yaw_rate # [rad/s]
|
||||
float32 horizontal_velocity # [m/s] Horizontal velocity.
|
||||
float32 vertical_velocity # [m/s] Vertical velocity.
|
||||
float32 yaw_rate # [rad/s] Yaw rate.
|
||||
```
|
||||
|
||||
By default this message definition will be compiled to a single topic with an id `velocity_limits`, a direct conversion from the CamelCase name to a snake_case version.
|
||||
@@ -92,15 +92,34 @@ To nest a message, simply include the nested message type in the parent message
|
||||
|
||||
```text
|
||||
# Global position setpoint triplet in WGS84 coordinates.
|
||||
#
|
||||
# This are the three next waypoints (or just the next two or one).
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp # [us] Time since system start.
|
||||
|
||||
PositionSetpoint previous
|
||||
PositionSetpoint current
|
||||
PositionSetpoint next
|
||||
```
|
||||
|
||||
### uORB Buffer Length (ORB_QUEUE_LENGTH)
|
||||
|
||||
uORB messages have a single-message buffer by default, which may be overwritten if the message publication rate is too high.
|
||||
In most cases this does not matter: either we are only interested in the latest sample of a topic, such as a sensor value or a setpoint, or losing a few samples is not a particular problem.
|
||||
For relatively few cases, such as vehicle commands, it is important that we don't drop topics.
|
||||
|
||||
In order to reduce the chance that messages will be dropped we can use named constant `ORB_QUEUE_LENGTH` to create a buffer of the specified length.
|
||||
For example, to create a four-message queue, add the following line to your message definition:
|
||||
|
||||
```sh
|
||||
uint8 ORB_QUEUE_LENGTH = 4
|
||||
```
|
||||
|
||||
As long as subscribers are able to read messages out of the buffer quickly enough than it isn't ever fully filled to the queue length (by publishers), they will be able to get all messages that are sent.
|
||||
Messages will still be lost they are published when the queue is filled.
|
||||
|
||||
Note that the queue length value must be a power of 2 (so 2, 4, 8, ...).
|
||||
|
||||
### Message/Field Deprecation {#deprecation}
|
||||
|
||||
As there are external tools using uORB messages from log files, such as [Flight Review](https://github.com/PX4/flight_review), certain aspects need to be considered when updating existing messages:
|
||||
|
||||
@@ -38,7 +38,7 @@ The PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) is gen
|
||||
Агент не залежить від клієнтського коду.
|
||||
Він може бути побудований окремо або в робочому просторі ROS 2, або встановлений як snap пакет в Ubuntu.
|
||||
|
||||
When PX4 is built, a code generator uses the uORB message definitions in the source tree ([PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)) to compile support for the subset of uORB topics in [PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) into [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client).
|
||||
When PX4 is built, a code generator uses the uORB message definitions in the source tree ([PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)) to compile support for the subset of uORB topics in [/src/modules/uxrce_dds_client/dds_topics.yaml](../middleware/dds_topics.md) into [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client).
|
||||
|
||||
PX4 main or release builds automatically export the set of uORB messages definitions in the build to an associated branch in [PX4/px4_msgs](https://github.com/PX4/px4_msgs).
|
||||
|
||||
@@ -326,13 +326,11 @@ ROS_DOMAIN_ID=3 PX4_UXRCE_DDS_PORT=9999 PX4_UXRCE_DDS_NS=drone make px4_sitl gz_
|
||||
|
||||
## Підтримувані повідомлення uORB
|
||||
|
||||
The set of [PX4 uORB topics](../msg_docs/index.md) that are exposed through the client are set in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml).
|
||||
The set of [PX4 uORB topics](../msg_docs/index.md) that are exposed through the client are set in [dds_topics.yaml](../middleware/dds_topics.md).
|
||||
|
||||
The topics are release specific (support is compiled into [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) at build time).
|
||||
Хоча більшість випусків мають підтримувати дуже схожий набір повідомлень, щоб бути впевненими, вам слід перевірити файл yaml для вашого конкретного релізу.
|
||||
|
||||
<!-- Jublish the set we use?: https://github.com/PX4/px4_msgs/issues/22 -->
|
||||
|
||||
Note that ROS 2/DDS needs to have the _same_ message definitions that were used to create the uXRCE-DDS client module in the PX4 Firmware in order to interpret the messages.
|
||||
The message definitions are stored in the ROS 2 interface package [PX4/px4_msgs](https://github.com/PX4/px4_msgs), and they are automatically synchronized by CI on the `main` and release branches.
|
||||
Note that all the messages from PX4 source code are present in the repository, but only those listed in `dds_topics.yaml` will be available as ROS 2 topics.
|
||||
@@ -349,21 +347,21 @@ Note that all the messages from PX4 source code are present in the repository, b
|
||||
```
|
||||
|
||||
::: info
|
||||
Technically, [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
Technically, [dds_topics.yaml](../middleware/dds_topics.md) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
For more information see [DDS Topics YAML](#dds-topics-yaml) below.
|
||||
|
||||
:::
|
||||
|
||||
## Customizing the Namespace
|
||||
|
||||
Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml)) or at runtime (which is useful for multi vehicle operations):
|
||||
Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](../middleware/dds_topics.md)) or at runtime (which is useful for multi vehicle operations):
|
||||
|
||||
- One possibility is to use the `-n` option when starting the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) from command line.
|
||||
Ця техніка може бути використана як у симуляторах, так і на реальних транспортних засобах.
|
||||
- A custom namespace can be provided for simulations (only) by setting the environment variable `PX4_UXRCE_DDS_NS` before starting the simulation.
|
||||
|
||||
:::info
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) and all [service servers](#dds-ros-2-services).
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](../middleware/dds_topics.md) and all [service servers](#dds-ros-2-services).
|
||||
Отже, команди, подібні до:
|
||||
|
||||
```sh
|
||||
@@ -385,13 +383,13 @@ PX4_UXRCE_DDS_NS=uav_1 make px4_sitl gz_x500
|
||||
|
||||
:::
|
||||
|
||||
## Налаштування PX4 ROS 2 QoS
|
||||
## PX4 ROS 2 QoS Settings
|
||||
|
||||
Налаштування QoS PX4 для видавців несумісні з налаштуваннями QoS за замовчуванням для підписників ROS 2.
|
||||
Таким чином, якщо код ROS 2 потрібно підписатися на тему uORB, йому потрібно використовувати сумісні налаштування QoS.
|
||||
PX4 QoS settings for publishers are incompatible with the default QoS settings for ROS 2 subscribers.
|
||||
So if ROS 2 code needs to subscribe to a uORB topic, it will need to use compatible QoS settings.
|
||||
One example of which is shown in [ROS 2 User Guide > ROS 2 Subscriber QoS Settings](../ros2/user_guide.md#ros-2-subscriber-qos-settings).
|
||||
|
||||
PX4 використовує наступні параметри QoS для видавців:
|
||||
PX4 uses the following QoS settings for publishers:
|
||||
|
||||
```cpp
|
||||
uxrQoS_t qos = {
|
||||
@@ -402,7 +400,7 @@ uxrQoS_t qos = {
|
||||
};
|
||||
```
|
||||
|
||||
PX4 використовує наступні параметри QoS для підписників:
|
||||
PX4 uses the following QoS settings for subscribers:
|
||||
|
||||
```cpp
|
||||
uxrQoS_t qos = {
|
||||
@@ -413,17 +411,17 @@ uxrQoS_t qos = {
|
||||
};
|
||||
```
|
||||
|
||||
ROS 2 використовує наступні налаштування QoS (за замовчуванням) для видавців та підписок: «зберігати останніми» для історії з розміром черги 10, «reliable» для надійності, «volatile» для тривалості і «system default» для життєздатності.
|
||||
Дедлайн, тривалість життя та оренда також налаштовані на "за замовчуванням".
|
||||
ROS 2 uses the following QoS settings (by default) for publishers and subscriptions: "keep last" for history with a queue size of 10, "reliable" for reliability, "volatile" for durability, and "system default" for liveliness.
|
||||
Deadline, lifespan, and lease durations are also all set to "default".
|
||||
|
||||
<!-- From https://github.com/PX4/PX4-user_guide/pull/2259#discussion_r1099788316 -->
|
||||
|
||||
## DDS теми YAML
|
||||
## DDS Topics YAML
|
||||
|
||||
The PX4 yaml file [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) defines the set of PX4 uORB topics that are built into firmware and published.
|
||||
Точніше, він повністю визначає взаємозв'язок/сполучення між повідомленнями PX4 uORB і ROS 2.
|
||||
The PX4 [dds_topics.yaml](../middleware/dds_topics.md) file defines the set of PX4 uORB topics that are built into firmware and published.
|
||||
More precisely, it completely defines the relationship/pairing between PX4 uORB and ROS 2 messages.
|
||||
|
||||
Файл структурований наступним чином:
|
||||
The file is structured as follows:
|
||||
|
||||
```yaml
|
||||
publications:
|
||||
@@ -471,7 +469,7 @@ Each (`topic`,`type`) pairs defines:
|
||||
It is identified by the last token in `topic:` that starts with `/` and does not contains any `/` in it.
|
||||
`vehicle_odometry`, `vehicle_status` and `offboard_control_mode` are examples of base names.
|
||||
3. The topic [namespace](https://design.ros2.org/articles/topic_and_service_names.html#namespaces).
|
||||
За замовчуванням встановлено на:
|
||||
By default it is set to:
|
||||
- `/fmu/out/` for topics that are _published_ by PX4.
|
||||
- `/fmu/in/` for topics that are _subscribed_ by PX4.
|
||||
4. The message type (`VehicleOdometry`, `VehicleStatus`, `OffboardControlMode`, etc.) and the ROS 2 package (`px4_msgs`) that is expected to provide the message definition.
|
||||
@@ -485,22 +483,22 @@ Add a topic to the `subscriptions` section to:
|
||||
|
||||
- Create a unidirectional route going from the ROS2 topic to the _default_ instance (instance 0) of the associated uORB topic.
|
||||
For example, it creates a ROS2 subscriber of `/fmu/in/vehicle_odometry` and a uORB publisher of `vehicle_odometry`.
|
||||
- Якщо інші (внутрішні) модулі PX4 вже публікують у тому ж екземплярі теми uORB, що й публікатор ROS2, підписники цього екземпляра будуть отримувати всі потоки повідомлень.
|
||||
Підписник uORB не зможе визначити, чи вхідне повідомлення було опубліковане PX4 або ROS2.
|
||||
- Це бажана поведінка, коли очікується, що ROS2-видавець буде єдиним видавцем у екземплярі теми (наприклад, для заміни внутрішнього видавця теми під час автономного керування), або коли джерело декількох потоків публікацій не має значення.
|
||||
- If other (internal) PX4 modules are already publishing on the same uORB topic instance as the ROS2 publisher, the instance's subscribers will receive all streams of messages.
|
||||
The uORB subscriber will not be able to determine if an incoming message was published by PX4 or by ROS2.
|
||||
- This is the desired behavior when the ROS2 publisher is expected to be the sole publisher on the topic instance (for example, replacing an internal publisher to the topic during offboard control), or when the source of multiple publishing streams does not matter.
|
||||
|
||||
Add a topic to the `subscriptions_multi` section to:
|
||||
|
||||
- Create a unidirectional route going from the ROS2 topic to a _new_ instance of the associated uORB topic.
|
||||
For example, if `vehicle_odometry` has already `2` instances, it creates a ROS2 subscriber of `/fmu/in/vehicle_odometry` and a uORB publisher on instance `3` of `vehicle_odometry`.
|
||||
- Це гарантує, що жоден інший внутрішній модуль PX4 не публікуватиметься на тому самому екземплярі, що використовується uXRCE-DDS.
|
||||
Підписники зможуть підписатися на потрібний екземпляр і розрізняти видавців.
|
||||
- Зауважте, однак, що це гарантує розділення між видавцями PX4 і ROS2, а не між кількома видавцями ROS2.
|
||||
У цьому випадку їхні повідомлення все одно будуть перенаправлені на той самий екземпляр.
|
||||
- Це бажана поведінка, наприклад, коли ви хочете, щоб PX4 реєстрував показання двох однакових датчиків; вони обидва публікуватимуться в одній темі, але один з них використовуватиме екземпляр 0, а інший - екземпляр 1.
|
||||
- This ensures that no other internal PX4 module will publish on the same instance used by uXRCE-DDS.
|
||||
The subscribers will be able to subscribe to the desired instance and distinguish between publishers.
|
||||
- Note, however, that this guarantees separation between PX4 and ROS2 publishers, not among multiple ROS2 publishers.
|
||||
In that scenario, their messages will still be routed to the same instance.
|
||||
- This is the desired behavior, for example, when you want PX4 to log the readings of two equal sensors; they will both publish on the same topic, but one will use instance 0 and the other will use instance 1.
|
||||
|
||||
Ви можете довільно змінювати конфігурацію.
|
||||
Наприклад, ви можете використовувати різні простори імен за замовчуванням або використовувати власний пакет для зберігання визначень повідомлень.
|
||||
You can arbitrarily change the configuration.
|
||||
For example, you could use different default namespaces or use a custom package to store the message definitions.
|
||||
|
||||
## DDS (ROS 2) Services
|
||||
|
||||
@@ -513,62 +511,62 @@ For example, the `/fmu/vehicle_command` service server defined in [`px4_msgs::sr
|
||||
|
||||
For a list of services, details and examples see the [service documentation](../ros2/user_guide.md#px4-ros-2-service-servers) in the ROS 2 User Guide.
|
||||
|
||||
## Посібник міграції з Fast-RTPS на uXRCE-DDS
|
||||
## Fast-RTPS to uXRCE-DDS Migration Guidelines
|
||||
|
||||
These guidelines explain how to migrate from using PX4 v1.13 [Fast-RTPS](../middleware/micrortps.md) middleware to PX4 v1.14 `uXRCE-DDS` middleware.
|
||||
These are useful if you have [ROS 2 applications written for PX4 v1.13](https://docs.px4.io/v1.13/en/ros/ros2_comm.html), or you have used Fast-RTPS to interface your applications to PX4 [directly](https://docs.px4.io/v1.13/en/middleware/micrortps.html#agent-in-an-offboard-fast-dds-interface-ros-independent).
|
||||
|
||||
:::info
|
||||
This section contains migration-specific information.
|
||||
Вам також слід прочитати решту цієї сторінки, щоб правильно зрозуміти uXRCE-DDS.
|
||||
You should also read the rest of this page to properly understand uXRCE-DDS.
|
||||
:::
|
||||
|
||||
#### Залежності не потрібно видаляти
|
||||
#### Dependencies do not need to be removed
|
||||
|
||||
uXRCE-DDS does not need the dependencies that were required for Fast-RTPS, such as those installed by following the topic [Fast DDS Installation](https://docs.px4.io/v1.13/en/dev_setup/fast-dds-installation.html).
|
||||
Ви можете зберегти їх, якщо хочете, не впливаючи на ваші додатки uXRCE-DDS.
|
||||
You can keep them if you want, without affecting your uXRCE-DDS applications.
|
||||
|
||||
Якщо ви вирішили видалити залежності, будьте обережні, щоб не видалити нічого, що використовується програмами (наприклад, Java).
|
||||
If you do choose to remove the dependencies, take care not to remove anything that is used by applications (for example, Java).
|
||||
|
||||
#### `_rtps` targets have been removed
|
||||
|
||||
Anywhere you previously used a build target with extension `_rtps`, such as `px4_fmu-v5_rtps` or `px4_sitl_rtps`, you can now use the equivalent default target (for these cases `px4_fmu-v5_default` and `px4_sitl_default`).
|
||||
|
||||
The make targets with extension `_rtps` were used to build firmware that included client side RTPS code.
|
||||
Проміжне програмне забезпечення uXRCE-DDS за замовчуванням включено до збірок для більшості плат, тому вам більше не потрібна спеціальна прошивка для роботи з ROS 2.
|
||||
The uXRCE-DDS middleware is included by default in builds for most boards, so you no longer need a special firmware to work with ROS 2.
|
||||
|
||||
To check if your board has the middleware, look for `CONFIG_MODULES_UXRCE_DDS_CLIENT=y` in the `.px4board` file of your board.
|
||||
Those files are nested in [PX4-Autopilot/boards](https://github.com/PX4/PX4-Autopilot/tree/main/boards).
|
||||
|
||||
If it is not present, or if it is set to `n`, then you have to clone the PX4 repo, modify the board configuration and manually [compile](../dev_setup/building_px4.md) the firmware.
|
||||
|
||||
#### Новий модуль клієнта та нові параметри запуску
|
||||
#### New client module and new start parameters
|
||||
|
||||
Оскільки клієнт реалізовано новим модулем PX4, тепер у вас є нові параметри для його запуску.
|
||||
As the client is implemented by a new PX4 module, you now have new parameters to start it.
|
||||
Take a look at the [client startup section](#starting-the-client) to learn how this is done.
|
||||
|
||||
#### Новий файл для налаштування того, які теми публікуються
|
||||
#### New file for setting which topics are published
|
||||
|
||||
The list of topics that are published and subscribed for a particular firmware is now managed by the [dds_topic.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) configuration file, which replaces [urtps_bridge_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/release/1.13/msg/tools/urtps_bridge_topics.yaml)
|
||||
The list of topics that are published and subscribed for a particular firmware is now managed by the [dds_topics.yaml](../middleware/dds_topics.md) configuration file, which replaces [urtps_bridge_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/release/1.13/msg/tools/urtps_bridge_topics.yaml)
|
||||
|
||||
See [Supported uORB Messages](#supported-uorb-messages) and [DDS Topics YAML](#dds-topics-yaml) sections for more information.
|
||||
|
||||
#### Теми більше не потрібно синхронізувати між клієнтом і агентом.
|
||||
#### Topics no longer need to be synced between client and agent.
|
||||
|
||||
The list of bridged topics between agent and client no longer needs to be synced for ROS 2, so the `update_px4_ros2_bridge.sh` script is no longer needed.
|
||||
|
||||
#### Налаштування назви теми за замовчуванням змінено
|
||||
#### Default topic naming convention has changed
|
||||
|
||||
Змінився формат назв тем:
|
||||
The topic naming format changed:
|
||||
|
||||
- Published topics: `/fmu/topic-name/out` (Fast-RTPS) to `/fmu/out/topic-name` (XRCE-DDS).
|
||||
- Subscribed topics: `/fmu/topic-name/in`(Fast-RTPS) to `/fmu/in/topic-name` (XRCE-DDS).
|
||||
|
||||
Вам слід оновити свій додаток відповідно до нової конвенції.
|
||||
You should update your application to the new convention.
|
||||
|
||||
:::info
|
||||
You might also edit [dds_topic.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) to revert to the old convention.
|
||||
Це не рекомендується, оскільки це означає, що вам доведеться завжди використовувати кастомну прошивку.
|
||||
This is not recommended because it means that you would have to always use custom firmware.
|
||||
:::
|
||||
|
||||
#### XRCE-DDS-Agent
|
||||
@@ -576,18 +574,18 @@ You might also edit [dds_topic.yaml](https://github.com/PX4/PX4-Autopilot/blob/m
|
||||
The XRCE-DDS agent is "generic" and independent of PX4: [micro-xrce-dds-agent](https://micro-xrce-dds.docs.eprosima.com/en/latest/agent.html).
|
||||
There are many ways to install it on your PC / companion computer - for more information see the [dedicated section](#micro-xrce-dds-agent-installation).
|
||||
|
||||
#### Зміни, що стосуються конкретних додатків
|
||||
#### Application-Specific Changes
|
||||
|
||||
If you where not using ROS 2 alongside the agent ([Fast DDS Interface ROS-Independent](https://docs.px4.io/v1.13/en/middleware/micrortps.html#agent-in-an-offboard-fast-dds-interface-ros-independent)), then you need to migrate to [eProsima Fast DDS](https://fast-dds.docs.eprosima.com/en/latest/index.html).
|
||||
|
||||
ROS 2 applications still need to compile alongside the PX4 messages, which you do by adding the [px4_msgs](https://github.com/PX4/px4_msgs) package to your workspace.
|
||||
You can remove the [px4_ros_com](https://github.com/PX4/px4_ros_com) package as it is no longer needed, other than for example code.
|
||||
|
||||
У ваших вузлах ROS 2 вам знадобиться:
|
||||
In your ROS 2 nodes, you will need to:
|
||||
|
||||
- Update the [QoS](#px4-ros-2-qos-settings) of your publishers and subscribers as PX4 does not use the ROS 2 default settings.
|
||||
- Change the names of your topics, unless you edited [dds_topic.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml).
|
||||
- Видаліть все, що стосується синхронізації часу, оскільки XRCE-DDS автоматично піклується про синхронізацію часу агента/клієнта.
|
||||
- Remove everything related to time synchronization, as XRCE-DDS automatically takes care of agent/client time synchronization.
|
||||
|
||||
In C++ applications you can set the `timestamp` field of your messages like this:
|
||||
|
||||
@@ -601,7 +599,7 @@ You can remove the [px4_ros_com](https://github.com/PX4/px4_ros_com) package as
|
||||
msg.timestamp = int(self.get_clock().now().nanoseconds / 1000)
|
||||
```
|
||||
|
||||
## Корисні ресурси
|
||||
## Helpful Resources
|
||||
|
||||
- [ROS 2 in PX4: Technical Details of a Seamless Transition to XRCE-DDS](https://www.youtube.com/watch?v=F5oelooT67E) - Pablo Garrido & Nuno Marques (youtube)
|
||||
- [PX4 ROS 2 offboard tutorial](https://gist.github.com/julianoes/adbf76408663829cd9aed8d14c88fa29) (Github gist - JulianOes)
|
||||
|
||||
@@ -28,7 +28,7 @@ The agent acts as a proxy for the client to publish and subscribe to topics in t
|
||||
|
||||
The PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) is generated at build time and included in PX4 firmware by default.
|
||||
It includes both the "generic" micro XRCE-DDS client code, and PX4-specific translation code that it uses to publish to/from uORB topics.
|
||||
The subset of uORB messages that are generated into the client are listed in [PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml).
|
||||
The subset of uORB messages that are generated into the client are specified in [dds_topics.yaml](../middleware/dds_topics.md).
|
||||
The generator uses the uORB message definitions in the source tree: [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to create the code for sending ROS 2 messages.
|
||||
|
||||
ROS 2 applications need to be built in a workspace that has the _same_ message definitions that were used to create the uXRCE-DDS client module in the PX4 Firmware.
|
||||
@@ -97,48 +97,48 @@ To install ROS 2 and its dependencies:
|
||||
|
||||
1. Встановлення ROS 2.
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
To install ROS 2 "Humble" on Ubuntu 22.04:
|
||||
::: tab humble
|
||||
To install ROS 2 "Humble" on Ubuntu 22.04:
|
||||
|
||||
```sh
|
||||
sudo apt update && sudo apt install locales
|
||||
sudo locale-gen en_US en_US.UTF-8
|
||||
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
sudo apt install software-properties-common
|
||||
sudo add-apt-repository universe
|
||||
sudo apt update && sudo apt install curl -y
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
sudo apt install ros-humble-desktop
|
||||
sudo apt install ros-dev-tools
|
||||
source /opt/ros/humble/setup.bash && echo "source /opt/ros/humble/setup.bash" >> .bashrc
|
||||
```
|
||||
```sh
|
||||
sudo apt update && sudo apt install locales
|
||||
sudo locale-gen en_US en_US.UTF-8
|
||||
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
sudo apt install software-properties-common
|
||||
sudo add-apt-repository universe
|
||||
sudo apt update && sudo apt install curl -y
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
sudo apt install ros-humble-desktop
|
||||
sudo apt install ros-dev-tools
|
||||
source /opt/ros/humble/setup.bash && echo "source /opt/ros/humble/setup.bash" >> .bashrc
|
||||
```
|
||||
|
||||
The instructions above are reproduced from the official installation guide: [Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
|
||||
You can install _either_ the desktop (`ros-humble-desktop`) _or_ bare-bones versions (`ros-humble-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
The instructions above are reproduced from the official installation guide: [Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
|
||||
You can install _either_ the desktop (`ros-humble-desktop`) _or_ bare-bones versions (`ros-humble-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
To install ROS 2 "Foxy" on Ubuntu 20.04:
|
||||
::: tab foxy
|
||||
To install ROS 2 "Foxy" on Ubuntu 20.04:
|
||||
|
||||
- Follow the official installation guide: [Install ROS 2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html).
|
||||
- Follow the official installation guide: [Install ROS 2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html).
|
||||
|
||||
You can install _either_ the desktop (`ros-foxy-desktop`) _or_ bare-bones versions (`ros-foxy-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
You can install _either_ the desktop (`ros-foxy-desktop`) _or_ bare-bones versions (`ros-foxy-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
2. Some Python dependencies must also be installed (using **`pip`** or **`apt`**):
|
||||
|
||||
```sh
|
||||
pip install --user -U empy==3.3.4 pyros-genmsg setuptools
|
||||
```
|
||||
```sh
|
||||
pip install --user -U empy==3.3.4 pyros-genmsg setuptools
|
||||
```
|
||||
|
||||
### Setup Micro XRCE-DDS Agent & Client
|
||||
|
||||
@@ -155,22 +155,22 @@ To setup and start the agent:
|
||||
|
||||
2. Введіть наступні команди для витягування та побудови агента з вихідного коду:
|
||||
|
||||
```sh
|
||||
git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||
cd Micro-XRCE-DDS-Agent
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig /usr/local/lib/
|
||||
```
|
||||
```sh
|
||||
git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||
cd Micro-XRCE-DDS-Agent
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig /usr/local/lib/
|
||||
```
|
||||
|
||||
3. Запустіть агента з налаштуваннями для підключення до клієнта uXRCE-DDS, який працює на симуляторі:
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
|
||||
The agent is now running, but you won't see much until we start PX4 (in the next step).
|
||||
|
||||
@@ -187,31 +187,31 @@ To start the simulator (and client):
|
||||
|
||||
1. Open a new terminal in the root of the **PX4 Autopilot** repo that was installed above.
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
- Start a PX4 [Gazebo](../sim_gazebo_gz/index.md) simulation using:
|
||||
- Start a PX4 [Gazebo](../sim_gazebo_gz/index.md) simulation using:
|
||||
|
||||
```sh
|
||||
make px4_sitl gz_x500
|
||||
```
|
||||
```sh
|
||||
make px4_sitl gz_x500
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
- Start a PX4 [Gazebo Classic](../sim_gazebo_classic/index.md) simulation using:
|
||||
- Start a PX4 [Gazebo Classic](../sim_gazebo_classic/index.md) simulation using:
|
||||
|
||||
```sh
|
||||
make px4_sitl gazebo-classic
|
||||
```
|
||||
```sh
|
||||
make px4_sitl gazebo-classic
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
The agent and client are now running they should connect.
|
||||
|
||||
@@ -261,52 +261,52 @@ To create and build the workspace:
|
||||
|
||||
2. Створіть новий каталог робочого простору та перейдіть до нього за допомогою:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/ws_sensor_combined/src/
|
||||
cd ~/ws_sensor_combined/src/
|
||||
```
|
||||
```sh
|
||||
mkdir -p ~/ws_sensor_combined/src/
|
||||
cd ~/ws_sensor_combined/src/
|
||||
```
|
||||
|
||||
::: info
|
||||
A naming convention for workspace folders can make it easier to manage workspaces.
|
||||
::: info
|
||||
A naming convention for workspace folders can make it easier to manage workspaces.
|
||||
|
||||
:::
|
||||
|
||||
3. Clone the example repository and [px4_msgs](https://github.com/PX4/px4_msgs) to the `/src` directory (the `main` branch is cloned by default, which corresponds to the version of PX4 we are running):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
|
||||
4. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
This builds all the folders under `/src` using the sourced toolchain.
|
||||
This builds all the folders under `/src` using the sourced toolchain.
|
||||
|
||||
#### Запуск прикладу
|
||||
|
||||
@@ -322,42 +322,42 @@ In a new terminal:
|
||||
|
||||
1. Перейдіть на верхній рівень каталогу вашого робочого простору та джерело середовища ROS 2 (у цьому випадку "Humble"):
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/humble/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/humble/setup.bash
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/foxy/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/foxy/setup.bash
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
2. Source the `local_setup.bash`.
|
||||
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
|
||||
3. Тепер запустіть приклад.
|
||||
Note here that we use `ros2 launch`, which is described below.
|
||||
Note here that we use `ros2 launch`, which is described below.
|
||||
|
||||
```sh
|
||||
ros2 launch px4_ros_com sensor_combined_listener.launch.py
|
||||
```
|
||||
```sh
|
||||
ros2 launch px4_ros_com sensor_combined_listener.launch.py
|
||||
```
|
||||
|
||||
If this is working you should see data being printed on the terminal/console where you launched the ROS listener:
|
||||
|
||||
@@ -385,18 +385,18 @@ If you were to use incompatible [message versions](../middleware/uorb.md#message
|
||||
|
||||
1. Include the [Message Translation Node](../ros2/px4_ros2_msg_translation_node.md) into the example workspace or a separate workspace by running the following script:
|
||||
|
||||
```sh
|
||||
cd /path/to/ros_ws
|
||||
/path/to/PX4-Autopilot/Tools/copy_to_ros_ws.sh .
|
||||
```
|
||||
```sh
|
||||
cd /path/to/ros_ws
|
||||
/path/to/PX4-Autopilot/Tools/copy_to_ros_ws.sh .
|
||||
```
|
||||
|
||||
2. Build and run the translation node:
|
||||
|
||||
```sh
|
||||
colcon build
|
||||
source install/local_setup.bash
|
||||
ros2 run translation_node translation_node_bin
|
||||
```
|
||||
```sh
|
||||
colcon build
|
||||
source install/local_setup.bash
|
||||
ros2 run translation_node translation_node_bin
|
||||
```
|
||||
|
||||
## Керування Транспортним Засобом
|
||||
|
||||
@@ -405,7 +405,7 @@ To control applications, ROS 2 applications:
|
||||
- підписатися на (слухати) тематичні теми, опубліковані PX4
|
||||
- опублікувати у темах, які спонукають PX4 виконати певну дію.
|
||||
|
||||
The topics that you can use are defined in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), and you can get more information about their data in the [uORB Message Reference](../msg_docs/index.md).
|
||||
The topics that you can use are defined in [dds_topics.yaml](../middleware/dds_topics.md), and you can get more information about their data in the [uORB Message Reference](../msg_docs/index.md).
|
||||
For example, [VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) can be used to get the vehicle global position, while [VehicleCommand](../msg_docs/VehicleCommand.md) can be used to command actions such as takeoff and land.
|
||||
|
||||
The [ROS 2 Example applications](#ros-2-example-applications) examples below provide concrete examples of how to use these topics.
|
||||
@@ -456,13 +456,13 @@ Therefore, ROS 2 nodes that want to interface with PX4 must take care of the fra
|
||||
|
||||
- Для повороту вектора з ENU на NED потрібно виконати дві основні обертання:
|
||||
|
||||
- first a pi/2 rotation around the `Z`-axis (up),
|
||||
- then a pi rotation around the `X`-axis (old East/new North).
|
||||
- first a pi/2 rotation around the `Z`-axis (up),
|
||||
- then a pi rotation around the `X`-axis (old East/new North).
|
||||
|
||||
- To rotate a vector from NED to ENU two basic rotations must be performed:
|
||||
|
||||
- - first a pi/2 rotation around the `Z`-axis (down),
|
||||
- then a pi rotation around the `X`-axis (old North/new East). Note that the two resulting operations are mathematically equivalent.
|
||||
- then a pi rotation around the `X`-axis (old North/new East). Note that the two resulting operations are mathematically equivalent.
|
||||
|
||||
- To rotate a vector from FLU to FRD a pi rotation around the `X`-axis (front) is sufficient.
|
||||
|
||||
@@ -720,17 +720,17 @@ Note that all the messages from PX4 source code are present in the repository, b
|
||||
|
||||
- If you're using a main or release version of PX4 you can get the message definitions by cloning the interface package [PX4/px4_msgs](https://github.com/PX4/px4_msgs) into your workspace.
|
||||
- Якщо ви створюєте або змінюєте повідомлення uORB, вам потрібно вручну оновити повідомлення у вашому робочому просторі з вихідного дерева PX4.
|
||||
Generally this means that you would update [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), clone the interface package, and then manually synchronize it by copying the new/modified message definitions from [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to its `msg` folders.
|
||||
Assuming that PX4-Autopilot is in your home directory `~`, while `px4_msgs` is in `~/ros2_ws/src/`, then the command might be:
|
||||
Generally this means that you would update [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), clone the interface package, and then manually synchronize it by copying the new/modified message definitions from [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to its `msg` folders.
|
||||
Assuming that PX4-Autopilot is in your home directory `~`, while `px4_msgs` is in `~/ros2_ws/src/`, then the command might be:
|
||||
|
||||
```sh
|
||||
rm ~/ros2_ws/src/px4_msgs/msg/*.msg
|
||||
cp ~/PX4-Autopilot/mgs/*.msg ~/ros2_ws/src/px4_msgs/msg/
|
||||
```
|
||||
```sh
|
||||
rm ~/ros2_ws/src/px4_msgs/msg/*.msg
|
||||
cp ~/PX4-Autopilot/mgs/*.msg ~/ros2_ws/src/px4_msgs/msg/
|
||||
```
|
||||
|
||||
::: info
|
||||
Technically, [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
For more information see [uXRCE-DDS > DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml).
|
||||
::: info
|
||||
Technically, [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
For more information see [uXRCE-DDS > DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml).
|
||||
|
||||
:::
|
||||
|
||||
@@ -739,11 +739,11 @@ Note that all the messages from PX4 source code are present in the repository, b
|
||||
Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml)) or at runtime (useful for multi vehicle operations):
|
||||
|
||||
- One possibility is to use the `-n` option when starting the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) from command line.
|
||||
Ця техніка може бути використана як у симуляторах, так і на реальних транспортних засобах.
|
||||
Ця техніка може бути використана як у симуляторах, так і на реальних транспортних засобах.
|
||||
- A custom namespace can be provided for simulations (only) by setting the environment variable `PX4_UXRCE_DDS_NS` before starting the simulation.
|
||||
|
||||
:::info
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) and all [service servers](#px4-ros-2-service-servers).
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](../middleware/dds_topics.md) and all [service servers](#px4-ros-2-service-servers).
|
||||
Отже, команди, подібні до:
|
||||
|
||||
```sh
|
||||
@@ -780,7 +780,7 @@ The service servers that are built into the PX4 [uxrce_dds_client](../modules/mo
|
||||
|
||||
- `/fmu/vehicle_command` (definition: [`px4_msgs::srv::VehicleCommand`](https://github.com/PX4/px4_msgs/blob/main/srv/VehicleCommand.srv).)
|
||||
|
||||
This service can be called by ROS 2 applications to send PX4 [VehicleCommand](../msg_docs/VehicleCommand.md) uORB messages and receive PX4 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md) uORB messages in response.
|
||||
This service can be called by ROS 2 applications to send PX4 [VehicleCommand](../msg_docs/VehicleCommand.md) uORB messages and receive PX4 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md) uORB messages in response.
|
||||
|
||||
All PX4 service names follow the convention `{extra_namespace}/fmu/{server_specific_name}` where `{extra_namespace}` is the same [custom namespace](#customizing-the-namespace) that can be given to the PX4 topics.
|
||||
|
||||
@@ -973,36 +973,36 @@ For information about launch files see [ROS 2 Tutorials > Creating launch files]
|
||||
Якщо щось відсутнє, його можна додати окремо:
|
||||
|
||||
- **`colcon`** build tools should be in the development tools.
|
||||
Можна встановити за допомогою:
|
||||
Можна встановити за допомогою:
|
||||
|
||||
```sh
|
||||
sudo apt install python3-colcon-common-extensions
|
||||
```
|
||||
```sh
|
||||
sudo apt install python3-colcon-common-extensions
|
||||
```
|
||||
|
||||
- Бібліотеку Eigen3, яку використовує бібліотека трансформацій, повинно бути в обох пакунків: desktop та base.
|
||||
Воно повинно бути встановлено, як показано:
|
||||
Воно повинно бути встановлено, як показано:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
sudo apt install ros-humble-eigen3-cmake-module
|
||||
```
|
||||
```sh
|
||||
sudo apt install ros-humble-eigen3-cmake-module
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
sudo apt install ros-foxy-eigen3-cmake-module
|
||||
```
|
||||
```sh
|
||||
sudo apt install ros-foxy-eigen3-cmake-module
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
### ros_gz_bridge not publishing on the \clock topic
|
||||
|
||||
|
||||
Reference in New Issue
Block a user