PX4 Firmware
PX4 Autopilot Software http://px4.io
vmount::InputBase Class Referenceabstract

class InputBase Base class for all driver input classes More...

#include <input.h>

Inheritance diagram for vmount::InputBase:
Collaboration diagram for vmount::InputBase:

Public Member Functions

virtual ~InputBase ()
 
virtual int update (unsigned int timeout_ms, ControlData **control_data, bool already_active)
 Wait for an input update, with a timeout. More...
 
virtual void print_status ()=0
 report status to stdout More...
 

Protected Member Functions

virtual int update_impl (unsigned int timeout_ms, ControlData **control_data, bool already_active)=0
 
virtual int initialize ()
 
void control_data_set_lon_lat (double lon, double lat, float altitude, float roll_angle=0.f, float pitch_fixed_angle=-10.f)
 

Protected Attributes

ControlData _control_data
 

Private Attributes

bool _initialized = false
 

Detailed Description

class InputBase Base class for all driver input classes

Definition at line 52 of file input.h.

Constructor & Destructor Documentation

◆ ~InputBase()

virtual vmount::InputBase::~InputBase ( )
inlinevirtual

Definition at line 55 of file input.h.

References print_status(), timeout_ms, update(), and update_impl().

Here is the call graph for this function:

Member Function Documentation

◆ control_data_set_lon_lat()

◆ initialize()

virtual int vmount::InputBase::initialize ( )
inlineprotectedvirtual

Reimplemented in vmount::InputMavlinkCmdMount, vmount::InputRC, vmount::InputTest, and vmount::InputMavlinkROI.

Definition at line 78 of file input.h.

References control_data_set_lon_lat(), and f().

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_status()

virtual void vmount::InputBase::print_status ( )
pure virtual

report status to stdout

Implemented in vmount::InputMavlinkCmdMount, vmount::InputTest, vmount::InputRC, and vmount::InputMavlinkROI.

Referenced by vmount_main(), and ~InputBase().

Here is the caller graph for this function:

◆ update()

int vmount::InputBase::update ( unsigned int  timeout_ms,
ControlData **  control_data,
bool  already_active 
)
virtual

Wait for an input update, with a timeout.

Parameters
timeout_mstimeout in ms
control_dataunchanged on error. On success it is nullptr if no new data is available, otherwise set to an object. If it is set, the returned object will not be changed for subsequent calls to update() that return no new data (in other words: if (some) control_data values change, non-null will be returned).
already_activetrue if the mode was already active last time, false if it was not and "major" change is necessary such as big stick movement for RC.
Returns
0 on success, <0 otherwise

Reimplemented in vmount::InputTest.

Definition at line 46 of file input.cpp.

References _control_data, _initialized, vmount::ControlData::gimbal_shutter_retract, initialize(), vmount::ControlData::Neutral, vmount::ControlData::type, and update_impl().

Referenced by vmount_thread_main(), and ~InputBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_impl()

virtual int vmount::InputBase::update_impl ( unsigned int  timeout_ms,
ControlData **  control_data,
bool  already_active 
)
protectedpure virtual

Implemented in vmount::InputMavlinkCmdMount, vmount::InputRC, vmount::InputTest, and vmount::InputMavlinkROI.

Referenced by update(), and ~InputBase().

Here is the caller graph for this function:

Member Data Documentation

◆ _control_data

◆ _initialized

bool vmount::InputBase::_initialized = false
private

Definition at line 86 of file input.h.

Referenced by update().


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