YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeJoypad Class Reference

FakeJoypad : fake device implementing the device interface More...

#include <fake/fakeJoypad/FakeJoypad.h>

+ Inheritance diagram for FakeJoypad:

Public Member Functions

 FakeJoypad ()
 
virtual ~FakeJoypad ()
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
bool getRawAxisCount (unsigned int &axis_count) override
 
bool getRawButtonCount (unsigned int &button_count) override
 
bool getRawHatCount (unsigned int &hat_count) override
 
bool getRawTrackballCount (unsigned int &trackball_count) override
 
bool getRawTouchSurfaceCount (unsigned int &touch_count) override
 
bool getRawStickCount (unsigned int &stick_count) override
 
bool getRawStickDoF (unsigned int stick_id, unsigned int &DoF) override
 
bool getRawButton (unsigned int button_id, float &value) override
 
bool getRawTrackball (unsigned int trackball_id, yarp::sig::Vector &value) override
 
bool getRawHat (unsigned int hat_id, unsigned char &value) override
 
bool getRawAxis (unsigned int axis_id, double &value) override
 
bool getRawStick (unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode) override
 
bool getRawTouch (unsigned int touch_id, yarp::sig::Vector &value) override
 
- Public Member Functions inherited from yarp::dev::IJoypadEventDriven
bool getAxisCount (unsigned int &axis_count) override final
 Get number of axes.
 
bool getButtonCount (unsigned int &button_count) override final
 Get number of buttons.
 
bool getTrackballCount (unsigned int &Trackball_count) override final
 Get number of trackballs.
 
bool getHatCount (unsigned int &Hat_count) override final
 Get number of hats.
 
bool getTouchSurfaceCount (unsigned int &touch_count) override final
 Get the number of touch surface.
 
bool getStickCount (unsigned int &stick_count) override final
 Get the number of the sticks.
 
bool getStickDoF (unsigned int stick_id, unsigned int &DoF) override final
 Get the Degree Of Freedom count for desired stick.
 
bool getButton (unsigned int button_id, float &value) override final
 Get the value of a button.
 
bool getTrackball (unsigned int trackball_id, yarp::sig::Vector &value) override final
 Get the axes change of a Trackball.
 
bool getHat (unsigned int hat_id, unsigned char &value) override final
 Get the value of an Hat.
 
bool getAxis (unsigned int axis_id, double &value) override final
 Get the value of an axis if present, return false otherwise.
 
bool getStick (unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode) override final
 Get the value of a stick if present, return false otherwise.
 
bool getTouch (unsigned int touch_id, yarp::sig::Vector &value) override final
 Get the value of a touch if present, return false otherwise.
 
 IJoypadEventDriven ()
 
 IJoypadEventDriven (int rate)
 
 IJoypadEventDriven (double period)
 
bool threadInit () override final
 Initialization method.
 
void run () override final
 Loop function.
 
bool eventDriven (bool enable, yarp::dev::IJoypadEvent *event=nullptr) override
 Activate event Driven mode.
 
bool isEventDriven () override
 
- Public Member Functions inherited from yarp::dev::IJoypadController
virtual ~IJoypadController ()=default
 Destructor.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from FakeJoypad_ParamsParser
 FakeJoypad_ParamsParser ()
 
 ~FakeJoypad_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IJoypadEventDriven
enum  JoypadCtrl_coordinateMode
 
- Public Types inherited from yarp::dev::IJoypadController
enum  JoypadCtrl_coordinateMode {
  JypCtrlcoord_POLAR = 0 ,
  JypCtrlcoord_CARTESIAN = 1
}
 
- Public Attributes inherited from FakeJoypad_ParamsParser
const std::string m_device_classname = {"FakeJoypad"}
 
const std::string m_device_name = {"fakeJoypad"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_rpc_port_name_defaultValue = {"/fakeJoypad/rpc"}
 
std::string m_rpc_port_name = {"/fakeJoypad/rpc"}
 
- Protected Member Functions inherited from yarp::dev::IJoypadEventDriven
virtual bool executeAction (int action_id)
 
virtual bool parseActions (const yarp::os::Searchable &cfg, int *count=nullptr)
 
- Protected Attributes inherited from yarp::dev::IJoypadEventDriven
std::map< int, std::string > m_actions
 
- Protected Attributes inherited from yarp::dev::IJoypadController
std::map< int, std::string > m_actions
 

Detailed Description

FakeJoypad : fake device implementing the device interface

Parameters required by this device are shown in class: FakeJoypad_ParamsParser

Definition at line 21 of file FakeJoypad.h.

Constructor & Destructor Documentation

◆ FakeJoypad()

FakeJoypad::FakeJoypad ( )
default

◆ ~FakeJoypad()

FakeJoypad::~FakeJoypad ( )
virtualdefault

Member Function Documentation

◆ close()

bool FakeJoypad::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 33 of file FakeJoypad.cpp.

◆ getRawAxis()

bool FakeJoypad::getRawAxis ( unsigned int  axis_id,
double value 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 96 of file FakeJoypad.cpp.

◆ getRawAxisCount()

bool FakeJoypad::getRawAxisCount ( unsigned int axis_count)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 38 of file FakeJoypad.cpp.

◆ getRawButton()

bool FakeJoypad::getRawButton ( unsigned int  button_id,
float value 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 85 of file FakeJoypad.cpp.

◆ getRawButtonCount()

bool FakeJoypad::getRawButtonCount ( unsigned int button_count)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 44 of file FakeJoypad.cpp.

◆ getRawHat()

bool FakeJoypad::getRawHat ( unsigned int  hat_id,
unsigned char value 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 132 of file FakeJoypad.cpp.

◆ getRawHatCount()

bool FakeJoypad::getRawHatCount ( unsigned int hat_count)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 56 of file FakeJoypad.cpp.

◆ getRawStick()

bool FakeJoypad::getRawStick ( unsigned int  stick_id,
yarp::sig::Vector value,
JoypadCtrl_coordinateMode  coordinate_mode 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 107 of file FakeJoypad.cpp.

◆ getRawStickCount()

bool FakeJoypad::getRawStickCount ( unsigned int stick_count)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 68 of file FakeJoypad.cpp.

◆ getRawStickDoF()

bool FakeJoypad::getRawStickDoF ( unsigned int  stick_id,
unsigned int DoF 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 74 of file FakeJoypad.cpp.

◆ getRawTouch()

bool FakeJoypad::getRawTouch ( unsigned int  touch_id,
yarp::sig::Vector value 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 118 of file FakeJoypad.cpp.

◆ getRawTouchSurfaceCount()

bool FakeJoypad::getRawTouchSurfaceCount ( unsigned int touch_count)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 62 of file FakeJoypad.cpp.

◆ getRawTrackball()

bool FakeJoypad::getRawTrackball ( unsigned int  trackball_id,
yarp::sig::Vector value 
)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 143 of file FakeJoypad.cpp.

◆ getRawTrackballCount()

bool FakeJoypad::getRawTrackballCount ( unsigned int trackball_count)
overridevirtual

Implements yarp::dev::IJoypadEventDriven.

Definition at line 50 of file FakeJoypad.cpp.

◆ open()

bool FakeJoypad::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 26 of file FakeJoypad.cpp.


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