kinematics-dynamics
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
roboticslab::WiimoteDevice Class Reference

Represents a Wiimote device wrapped as an analog sensor by YARP.

#include <WiimoteDevice.hpp>

Inheritance diagram for roboticslab::WiimoteDevice:
roboticslab::StreamingDevice

Public Member Functions

 WiimoteDevice (yarp::os::Searchable &config, bool usingPose)
 
bool acquireInterfaces () override
 Acquires plugin interfaces.
 
bool initialize (bool usingStreamingPreset) override
 Perform any custom initialization needed. This method is called after the successful creation of the device and once all interface handles are acquired.
 
bool acquireData () override
 Acquires data from remote device.
 
bool transformData (double scaling) override
 Performs required operations on stored data.
 
bool hasValidMovementData () const override
 Checks whether the device may forward acquired and processed data to the controller.
 
void sendMovementCommand (double timestamp) override
 Sends movement command to the cartesian controller.
 
void stopMotion () override
 Sends a movement command that would stop motion.
 
- Public Member Functions inherited from roboticslab::StreamingDevice
 StreamingDevice (yarp::os::Searchable &config)
 Constructor.
 
virtual ~StreamingDevice ()
 Destructor.
 
virtual int getActuatorState ()
 If actuator command data is available, return its current state.
 
void setCartesianControllerHandle (ICartesianControl *iCartesianControl)
 Stores handle to an ICartesianControl instance.
 

Private Types

enum  cmd_mode { NONE , FWD , BKWD , ROT }
 

Private Attributes

yarp::dev::IJoypadController * iJoypadController {nullptr}
 
cmd_mode mode {NONE}
 
bool usingPose {false}
 
double step {0.0}
 
bool buttonA {false}
 
bool buttonB {false}
 
bool yawActive {false}
 

Additional Inherited Members

- Protected Attributes inherited from roboticslab::StreamingDevice
ICartesianControliCartesianControl
 
std::vector< double > data
 
std::vector< bool > fixedAxes
 
int actuatorState
 

Member Function Documentation

◆ acquireData()

bool WiimoteDevice::acquireData ( )
overridevirtual
Returns
true on success, false otherwise

Implements roboticslab::StreamingDevice.

◆ acquireInterfaces()

bool WiimoteDevice::acquireInterfaces ( )
overridevirtual
Returns
true on success, false otherwise

Implements roboticslab::StreamingDevice.

◆ hasValidMovementData()

bool WiimoteDevice::hasValidMovementData ( ) const
overridevirtual
Returns
true if valid, false otherwise

Reimplemented from roboticslab::StreamingDevice.

◆ initialize()

bool WiimoteDevice::initialize ( bool  usingStreamingPreset)
overridevirtual
Parameters
usingStreamingPresetWhether the cartesian controller supports streaming command presets or not.
Returns
true on success, false otherwise

Reimplemented from roboticslab::StreamingDevice.

◆ sendMovementCommand()

void WiimoteDevice::sendMovementCommand ( double  timestamp)
overridevirtual
Parameters
timestampCurrent timestamp.

Implements roboticslab::StreamingDevice.

◆ stopMotion()

void WiimoteDevice::stopMotion ( )
overridevirtual

◆ transformData()

bool WiimoteDevice::transformData ( double  scaling)
overridevirtual
Parameters
scalingScaling factor applied to each data value.
Returns
true on success, false otherwise

Reimplemented from roboticslab::StreamingDevice.


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