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

JoypadControl_nwc_yarp: joypad input network wrapper on client side More...

#include <networkWrappers/joypadControl_nwc_yarp/JoypadControl_nwc_yarp.h>

+ Inheritance diagram for JoypadControl_nwc_yarp:

Public Member Functions

 JoypadControl_nwc_yarp ()
 
 JoypadControl_nwc_yarp (const JoypadControl_nwc_yarp &)=delete
 
 JoypadControl_nwc_yarp (JoypadControl_nwc_yarp &&)=delete
 
JoypadControl_nwc_yarp & operator= (const JoypadControl_nwc_yarp &)=delete
 
JoypadControl_nwc_yarp & operator= (JoypadControl_nwc_yarp &&)=delete
 
 ~JoypadControl_nwc_yarp () override=default
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
yarp::dev::ReturnValue getAxisCount (size_t &axis_count) override
 Get number of axes.
 
yarp::dev::ReturnValue getButtonCount (size_t &button_count) override
 Get number of buttons.
 
yarp::dev::ReturnValue getTrackballCount (size_t &Trackball_count) override
 Get number of trackballs.
 
yarp::dev::ReturnValue getHatCount (size_t &Hat_count) override
 Get number of hats.
 
yarp::dev::ReturnValue getTouchSurfaceCount (size_t &touch_count) override
 Get the number of touch surface.
 
yarp::dev::ReturnValue getStickCount (size_t &stick_count) override
 Get the number of the sticks.
 
yarp::dev::ReturnValue getButton (size_t button_id, double &value) override
 Get the value of a button.
 
yarp::dev::ReturnValue getTrackball (size_t trackball_id, yarp::dev::TrackballData &value) override
 Get the axes change of a Trackball.
 
yarp::dev::ReturnValue getHat (size_t hat_id, unsigned char &value) override
 Get the value of an Hat.
 
yarp::dev::ReturnValue getAxis (size_t axis_id, double &value) override
 Get the value of an axis if present, return false otherwise.
 
yarp::dev::ReturnValue getAllAxes (std::vector< double > &values) override
 Get the values of all available joystick axes.
 
yarp::dev::ReturnValue getStick (size_t stick_id, yarp::dev::StickData &value, JoypadCtrl_coordinateMode coordinate_mode) override
 Get the value of a stick if present, return false otherwise.
 
yarp::dev::ReturnValue getTouch (size_t touch_id, std::vector< yarp::dev::TouchData > &value) override
 Get the value of a touch if present, return false otherwise.
 
- Public Member Functions inherited from yarp::dev::IJoypadController
virtual ~IJoypadController ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriver & operator= (const DeviceDriver &other)=delete
 
DeviceDriver & operator= (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 DeviceDriver * getImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from JoypadControl_nwc_yarp_ParamsParser
 JoypadControl_nwc_yarp_ParamsParser ()
 
 ~JoypadControl_nwc_yarp_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.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Public Attributes

size_t m_axis_count =0
 
size_t m_button_count =0
 
size_t m_trackball_count =0
 
size_t m_hat_count =0
 
size_t m_touch_count =0
 
size_t m_stick_count =0
 
- Public Attributes inherited from JoypadControl_nwc_yarp_ParamsParser
const std::string m_device_classname = {"JoypadControl_nwc_yarp"}
 
const std::string m_device_name = {"JoypadControl_nwc_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_local_defaultValue = {""}
 
const std::string m_remote_defaultValue = {""}
 
const std::string m_use_streaming_defaultValue = {"true"}
 
const std::string m_use_all_port_defaultValue = {"true"}
 
std::string m_local = {}
 
std::string m_remote = {}
 
bool m_use_streaming = {true}
 
bool m_use_all_port = {true}
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IJoypadController
enum class  JoypadCtrl_coordinateMode {
  JypCtrlcoord_POLAR = 0 ,
  JypCtrlcoord_CARTESIAN = 1
}
 

Detailed Description

JoypadControl_nwc_yarp: joypad input network wrapper on client side

Description of input parameters

Parameters required by this device are shown in class: JoypadControl_nwc_yarp_ParamsParser

Definition at line 64 of file JoypadControl_nwc_yarp.h.

Constructor & Destructor Documentation

◆ JoypadControl_nwc_yarp() [1/3]

JoypadControl_nwc_yarp::JoypadControl_nwc_yarp ( )

Definition at line 20 of file JoypadControl_nwc_yarp.cpp.

◆ JoypadControl_nwc_yarp() [2/3]

JoypadControl_nwc_yarp::JoypadControl_nwc_yarp ( const JoypadControl_nwc_yarp &  )
delete

◆ JoypadControl_nwc_yarp() [3/3]

JoypadControl_nwc_yarp::JoypadControl_nwc_yarp ( JoypadControl_nwc_yarp &&  )
delete

◆ ~JoypadControl_nwc_yarp()

JoypadControl_nwc_yarp::~JoypadControl_nwc_yarp ( )
overridedefault

Member Function Documentation

◆ close()

bool JoypadControl_nwc_yarp::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 450 of file JoypadControl_nwc_yarp.cpp.

◆ getAllAxes()

ReturnValue JoypadControl_nwc_yarp::getAllAxes ( std::vector< double > &  values)
overridevirtual

Get the values of all available joystick axes.

Parameters
valuesthe vector containing the axes values.
Returns
true if succeeded, false otherwise.

Reimplemented from yarp::dev::IJoypadController.

Definition at line 289 of file JoypadControl_nwc_yarp.cpp.

◆ getAxis()

ReturnValue JoypadControl_nwc_yarp::getAxis ( size_t  axis_id,
double &  value 
)
overridevirtual

Get the value of an axis if present, return false otherwise.

Parameters
axis_idId of the axis to get. must be > -1 && < getAxisCount(), return false otherwise.
valuereference to be valued. the absolute boundaries for the values should be -1.0 and 1.0 However the actual range depends on the physical device (example: analog trigger does not have a central position thus can give a value from 0.0 to 0.1).
Returns
true if succeeded, false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 314 of file JoypadControl_nwc_yarp.cpp.

◆ getAxisCount()

ReturnValue JoypadControl_nwc_yarp::getAxisCount ( size_t &  axis_count)
overridevirtual

Get number of axes.

Parameters
axes_countunsigned int reference that will contain the result.
Returns
true if succeeded. false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 142 of file JoypadControl_nwc_yarp.cpp.

◆ getButton()

ReturnValue JoypadControl_nwc_yarp::getButton ( size_t  button_id,
double &  value 
)
overridevirtual

Get the value of a button.

From 0-unpressed to 1-fullpressed and values in the middle in the analog-face-button case.

Parameters
button_idId of the button to get. Must be > -1 && < getButtonCount(), return false otherwise
valuereference to be valued. The value will be from 0.0 (not even touched) to 1.0 (fully pressed)
Returns
true if succeeded, false otherwise

Implements yarp::dev::IJoypadController.

Definition at line 177 of file JoypadControl_nwc_yarp.cpp.

◆ getButtonCount()

ReturnValue JoypadControl_nwc_yarp::getButtonCount ( size_t &  button_count)
overridevirtual

Get number of buttons.

Parameters
button_countunsigned int reference that will contain the result.
Returns
true if succeeded. false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 135 of file JoypadControl_nwc_yarp.cpp.

◆ getHat()

ReturnValue JoypadControl_nwc_yarp::getHat ( size_t  hat_id,
unsigned char &  value 
)
overridevirtual

Get the value of an Hat.

Parameters
hat_idId of the POV hat to get. Must be > -1 && < getHatCount(), return false otherwise.
valuereference to be valued. use the YRPJOY_HAT_ macro series to get the currently pressed directions.
Returns
true if succeeded, false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 252 of file JoypadControl_nwc_yarp.cpp.

◆ getHatCount()

ReturnValue JoypadControl_nwc_yarp::getHatCount ( size_t &  Hat_count)
overridevirtual

Get number of hats.

Parameters
Hat_countunsigned int reference that will contain the result.
Returns
true if succeeded. false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 156 of file JoypadControl_nwc_yarp.cpp.

◆ getStick()

ReturnValue JoypadControl_nwc_yarp::getStick ( size_t  stick_id,
yarp::dev::StickData &  value,
JoypadCtrl_coordinateMode  coordinate_mode 
)
overridevirtual

Get the value of a stick if present, return false otherwise.

Parameters
stick_idId of the stick to get. must be > -1 && < getStickCount(), return false otherwise.
valuea vector that will contain the joystick position. the size of the vector will give you the Number of degrees of freedom and the value will be from -1.0 to 1.0.
coordinate_modeto get data in cartesian mode or polar mode.
Returns
true if succeeded, false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 352 of file JoypadControl_nwc_yarp.cpp.

◆ getStickCount()

ReturnValue JoypadControl_nwc_yarp::getStickCount ( size_t &  stick_count)
overridevirtual

Get the number of the sticks.

Parameters
stick_countunsigned int reference that will contain the result.
Returns
bool if succeeded, false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 170 of file JoypadControl_nwc_yarp.cpp.

◆ getTouch()

ReturnValue JoypadControl_nwc_yarp::getTouch ( size_t  touch_id,
std::vector< yarp::dev::TouchData > &  value 
)
overridevirtual

Get the value of a touch if present, return false otherwise.

Parameters
valuea vector that will contain the touch values normalized from 0.0 to 1.0.
Returns
true if succeeded, false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 408 of file JoypadControl_nwc_yarp.cpp.

◆ getTouchSurfaceCount()

ReturnValue JoypadControl_nwc_yarp::getTouchSurfaceCount ( size_t &  touch_count)
overridevirtual

Get the number of touch surface.

Multiple touch surface can represent either multiple physical monotouch surface or a multitouch surface or a combination of the two.

Parameters
touch_countunsigned int reference that will contain the result.
Returns
true if succeeded. false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 163 of file JoypadControl_nwc_yarp.cpp.

◆ getTrackball()

ReturnValue JoypadControl_nwc_yarp::getTrackball ( size_t  trackball_id,
yarp::dev::TrackballData &  value 
)
overridevirtual

Get the axes change of a Trackball.

Parameters
trackball_idId of the Trackball to get. Must be > -1 && < getTrackballCount(), return false otherwise.
valuereference to be valued. the value will be from 0.0 (not moving) to 1.0 (full velocity).
Returns
true if succeeded, false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 215 of file JoypadControl_nwc_yarp.cpp.

◆ getTrackballCount()

ReturnValue JoypadControl_nwc_yarp::getTrackballCount ( size_t &  Trackball_count)
overridevirtual

Get number of trackballs.

Parameters
Trackball_countunsigned int reference that will contain the result.
Returns
true if succeeded. false otherwise.

Implements yarp::dev::IJoypadController.

Definition at line 149 of file JoypadControl_nwc_yarp.cpp.

◆ open()

bool JoypadControl_nwc_yarp::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. 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 37 of file JoypadControl_nwc_yarp.cpp.

◆ operator=() [1/2]

JoypadControl_nwc_yarp & JoypadControl_nwc_yarp::operator= ( const JoypadControl_nwc_yarp &  )
delete

◆ operator=() [2/2]

JoypadControl_nwc_yarp & JoypadControl_nwc_yarp::operator= ( JoypadControl_nwc_yarp &&  )
delete

Member Data Documentation

◆ m_axis_count

size_t JoypadControl_nwc_yarp::m_axis_count =0

Definition at line 94 of file JoypadControl_nwc_yarp.h.

◆ m_button_count

size_t JoypadControl_nwc_yarp::m_button_count =0

Definition at line 95 of file JoypadControl_nwc_yarp.h.

◆ m_hat_count

size_t JoypadControl_nwc_yarp::m_hat_count =0

Definition at line 97 of file JoypadControl_nwc_yarp.h.

◆ m_stick_count

size_t JoypadControl_nwc_yarp::m_stick_count =0

Definition at line 99 of file JoypadControl_nwc_yarp.h.

◆ m_touch_count

size_t JoypadControl_nwc_yarp::m_touch_count =0

Definition at line 98 of file JoypadControl_nwc_yarp.h.

◆ m_trackball_count

size_t JoypadControl_nwc_yarp::m_trackball_count =0

Definition at line 96 of file JoypadControl_nwc_yarp.h.


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