AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
VehicleCommandClient Class Reference

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.
 

Detailed Description

Client for sending requests to the PX4 autopilot using the VehicleCommand topic.

Definition at line 33 of file vehicle_command_client.hpp.

Member Function Documentation

◆ startMission()

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.

◆ syncActivateFlightModeAndWait()

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.

Parameters
mode_idTarget PX4 navigation state (mode id).
timeoutMaximum time to wait for the target nav_state to become active.
Returns
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.


The documentation for this class was generated from the following files: