PX4 Firmware
PX4 Autopilot Software http://px4.io
vmount::InputTest Class Reference

class InputTest Send a single control command, configured via constructor arguments More...

#include <input_test.h>

Inheritance diagram for vmount::InputTest:
Collaboration diagram for vmount::InputTest:

Public Member Functions

 InputTest (float roll_deg, float pitch_deg, float yaw_deg)
 set to a fixed angle More...
 
virtual ~InputTest ()
 
bool finished ()
 check whether the test finished, and thus the main thread can quit More...
 
virtual int update (unsigned int timeout_ms, ControlData **control_data, bool already_active)
 Wait for an input update, with a timeout. More...
 
- Public Member Functions inherited from vmount::InputBase
virtual ~InputBase ()
 

Protected Member Functions

virtual int update_impl (unsigned int timeout_ms, ControlData **control_data, bool already_active)
 
virtual int initialize ()
 
virtual void print_status ()
 report status to stdout More...
 
- Protected Member Functions inherited from vmount::InputBase
void control_data_set_lon_lat (double lon, double lat, float altitude, float roll_angle=0.f, float pitch_fixed_angle=-10.f)
 

Private Attributes

float _angles [3]
 desired angles in [deg] More...
 

Additional Inherited Members

- Protected Attributes inherited from vmount::InputBase
ControlData _control_data
 

Detailed Description

class InputTest Send a single control command, configured via constructor arguments

Definition at line 51 of file input_test.h.

Constructor & Destructor Documentation

◆ InputTest()

vmount::InputTest::InputTest ( float  roll_deg,
float  pitch_deg,
float  yaw_deg 
)

set to a fixed angle

Definition at line 50 of file input_test.cpp.

References _angles.

◆ ~InputTest()

virtual vmount::InputTest::~InputTest ( )
inlinevirtual

Definition at line 59 of file input_test.h.

References finished(), timeout_ms, and update().

Here is the call graph for this function:

Member Function Documentation

◆ finished()

bool vmount::InputTest::finished ( )

check whether the test finished, and thus the main thread can quit

Definition at line 57 of file input_test.cpp.

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

Here is the caller graph for this function:

◆ initialize()

int vmount::InputTest::initialize ( )
protectedvirtual

Reimplemented from vmount::InputBase.

Definition at line 80 of file input_test.cpp.

Referenced by update_impl().

Here is the caller graph for this function:

◆ print_status()

void vmount::InputTest::print_status ( )
protectedvirtual

report status to stdout

Implements vmount::InputBase.

Definition at line 85 of file input_test.cpp.

Referenced by update_impl().

Here is the caller graph for this function:

◆ update()

int vmount::InputTest::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 from vmount::InputBase.

Definition at line 62 of file input_test.cpp.

References _angles, vmount::InputBase::_control_data, vmount::ControlData::Angle, vmount::ControlData::TypeData::angle, vmount::ControlData::TypeData::TypeAngle::angles, vmount::ControlData::gimbal_shutter_retract, vmount::ControlData::TypeData::TypeAngle::is_speed, vmount::ControlData::stabilize_axis, vmount::ControlData::type, and vmount::ControlData::type_data.

Referenced by ~InputTest().

Here is the caller graph for this function:

◆ update_impl()

virtual int vmount::InputTest::update_impl ( unsigned int  timeout_ms,
ControlData **  control_data,
bool  already_active 
)
inlineprotectedvirtual

Implements vmount::InputBase.

Definition at line 67 of file input_test.h.

References initialize(), and print_status().

Here is the call graph for this function:

Member Data Documentation

◆ _angles

float vmount::InputTest::_angles[3]
private

desired angles in [deg]

Definition at line 74 of file input_test.h.

Referenced by InputTest(), and update().


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