mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-13 11:37:34 +08:00
navigator: use reference instead of pointer to pass the vehicle command to publish
This commit is contained in:
committed by
Silvan Fuhrer
parent
672d228d79
commit
dfed3970d4
@@ -88,9 +88,9 @@ Commands supported in missions, including camera commands, are shown in these me
|
||||
- Mission items are executed when set active.
|
||||
- `issue_command(_mission_item)` is called at the end of this to send the current non-waypoint command
|
||||
- [`MissionBlock::issue_command(const mission_item_s &item)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562)
|
||||
- Creates a vehicle command for the mission item then calls `publish_vehicle_command` to publish it (`_navigator->publish_vehicle_command(&vehicle_command);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s *vehicle_command)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- For some camera commands it sets the component ID to the camera component id (`vehicle_command->target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- Creates a vehicle command for the mission item then calls `publish_vehicle_command` to publish it (`_navigator->publish_vehicle_command(vehicle_command);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- For some camera commands it sets the component ID to the camera component id (`vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- All others just get published to default component ID.
|
||||
- The `VehicleCommand` UORB topic is published.
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ void Mission::setActiveMissionItems() => https://github.com/PX4/PX4-Autopilot/bl
|
||||
Issuing command:
|
||||
MissionBlock::issue_command(const mission_item_s &item) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562
|
||||
At end this publishes the current vehicle command
|
||||
_navigator->publish_vehicle_command(&vehicle_command);
|
||||
_navigator.publish_vehicle_command(vehicle_command);
|
||||
|
||||
Publishing command:
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s *vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command->target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
All others just get published as-is
|
||||
-->
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ Commands supported in missions, including camera commands, are shown in these me
|
||||
- Mission items are executed when set active.
|
||||
- `issue_command(_mission_item)` is called at the end of this to send the current non-waypoint command
|
||||
- [`MissionBlock::issue_command(const mission_item_s &item)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562)
|
||||
- Creates a vehicle command for the mission item then calls `publish_vehicle_command` to publish it (`_navigator->publish_vehicle_command(&vehicle_command);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s *vehicle_command)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- For some camera commands it sets the component ID to the camera component id (`vehicle_command->target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- Creates a vehicle command for the mission item then calls `publish_vehicle_command` to publish it (`_navigator->publish_vehicle_command(vehicle_command);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- For some camera commands it sets the component ID to the camera component id (`vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- All others just get published to default component ID.
|
||||
- The `VehicleCommand` UORB topic is published.
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ void Mission::setActiveMissionItems() => https://github.com/PX4/PX4-Autopilot/bl
|
||||
Issuing command:
|
||||
MissionBlock::issue_command(const mission_item_s &item) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562
|
||||
At end this publishes the current vehicle command
|
||||
_navigator->publish_vehicle_command(&vcmd);
|
||||
_navigator->publish_vehicle_command(vehicle_command);
|
||||
|
||||
Publishing command:
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s *vcmd) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vcmd->target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
All others just get published as-is
|
||||
-->
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ PX4 повторно видає пункти камери, знайдені в
|
||||
- Предмети місії виконуються, коли вони активовані.
|
||||
- `issue_command(_mission_item)` викликається в кінці цього, щоб відправити поточну непунктову команду
|
||||
- [`MissionBlock::видача_команди(const mission_item_s &item)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562)
|
||||
- Створює команду для місії транспортного засобу, а потім викликає `publish_vehicle_command` для публікації її (`_navigator->publish_vehicle_command(&vcmd);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s *vcmd)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- Для деяких команд камери це встановлює ідентифікатор компонента на ідентифікатор компонента камери (`vcmd->target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- Створює команду для місії транспортного засобу, а потім викликає `publish_vehicle_command` для публікації її (`_navigator->publish_vehicle_command(vehicle_command);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- Для деяких команд камери це встановлює ідентифікатор компонента на ідентифікатор компонента камери (`vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- Усі інші просто публікуються під стандартний компонент ID.
|
||||
- Тема UORB `VehicleCommand` публікується.
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ MissionBlock::issue_command(const mission_item_s &item) => https://github.com/P
|
||||
_navigator->publish_vehicle_command(&vehicle_command);
|
||||
|
||||
Publishing command:
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s *vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command->target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
All others just get published as-is
|
||||
-->
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ Commands supported in missions, including camera commands, are shown in these me
|
||||
- Mission items are executed when set active.
|
||||
- `issue_command(_mission_item)` is called at the end of this to send the current non-waypoint command
|
||||
- [`MissionBlock::issue_command(const mission_item_s &item)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562)
|
||||
- Creates a vehicle command for the mission item then calls `publish_vehicle_command` to publish it (`_navigator->publish_vehicle_command(&vcmd);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s *vcmd)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- For some camera commands it sets the component ID to the camera component id (`vcmd->target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- Creates a vehicle command for the mission item then calls `publish_vehicle_command` to publish it (`_navigator->publish_vehicle_command(vehicle_command);`)
|
||||
- [`void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command)`](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358)
|
||||
- For some camera commands it sets the component ID to the camera component id (`vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA`)
|
||||
- All others just get published to default component ID.
|
||||
- The `VehicleCommand` UORB topic is published.
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ void Mission::setActiveMissionItems() => https://github.com/PX4/PX4-Autopilot/bl
|
||||
Issuing command:
|
||||
MissionBlock::issue_command(const mission_item_s &item) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/mission_block.cpp#L543-L562
|
||||
At end this publishes the current vehicle command
|
||||
_navigator->publish_vehicle_command(&vehicle_command);
|
||||
_navigator->publish_vehicle_command(vehicle_command);
|
||||
|
||||
Publishing command:
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s *vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command->target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command) => https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp#L1358
|
||||
For camera commands set to vehicle_command.target_component = 100; // MAV_COMP_ID_CAMERA
|
||||
All others just get published as-is
|
||||
-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user