|
AutoAPMS
Streamlining behaviors in ROS 2
|
Client for sending requests to the PX4 autopilot using the VehicleCommand topic.
More...
#include <auto_apms_px4/vehicle_command_client.hpp>
Public Member Functions | |
| bool | startMission () const |
| (Re)starts the uploaded mission plan. | |
| bool | syncActivateFlightModeAndWait (uint8_t mode_id, const std::chrono::milliseconds &timeout) const |
| Activate a flight mode and block until the vehicle actually reports it as active. | |
Client for sending requests to the PX4 autopilot using the VehicleCommand topic.
Definition at line 33 of file vehicle_command_client.hpp.
| bool startMission | ( | ) | const |
(Re)starts the uploaded mission plan.
If you want to resume a mission, use syncActivateFlightMode(FlightMode::Mission) instead.
Definition at line 135 of file vehicle_command_client.cpp.
| bool syncActivateFlightModeAndWait | ( | uint8_t | mode_id, |
| const std::chrono::milliseconds & | timeout ) const |
Activate a flight mode and block until the vehicle actually reports it as active.
Unlike syncActivateFlightMode(), which only waits for the command acknowledgement, this variant additionally waits for fmu/out/vehicle_status to report the requested nav_state as active. This confirms the mode change really took effect (and, for a mode owned by a mode executor, that the executor has been put in charge) rather than merely that the FMU accepted the request.
| mode_id | Target PX4 navigation state (mode id). |
| timeout | Maximum time to wait for the target nav_state to become active. |
true if the target nav_state became active within timeout, false otherwise (command rejected or the mode never became active in time). Definition at line 164 of file vehicle_command_client.cpp.