rec::robotino::api2 C++ interface
Public Member Functions | Friends | List of all members
rec::robotino::api2::Grappler Class Reference

Access to Robotino's (optional) Grappler. More...

#include <Grappler.h>

Inheritance diagram for rec::robotino::api2::Grappler:
rec::robotino::api2::ComObject

Public Member Functions

void setComId (const ComId &id)
 
void processEvents ()
 
bool setAxis (unsigned int axis, float angle, float speed)
 
bool setAxes (const float *angles, unsigned int anglesSize, const float *speeds, unsigned int speedsSize)
 
bool setPowerEnabled (unsigned int channel, bool enable)
 
void toggleTorque ()
 
GrapplerReadings readings () const
 
GrapplerReadings info () const
 
virtual void servoInfoEvent (const rec::robotino::api2::GrapplerReadings &info)
 
virtual void readingsEvent (const rec::robotino::api2::GrapplerReadings &readings)
 
virtual void storePositionsEvent (const rec::robotino::api2::GrapplerReadings &readings)
 
virtual void toggleTorqueEvent ()
 
- Public Member Functions inherited from rec::robotino::api2::ComObject
 ComObject ()
 
virtual ~ComObject ()
 
ComId comId () const
 

Friends

class GrapplerImpl
 

Additional Inherited Members

- Protected Attributes inherited from rec::robotino::api2::ComObject
ComId _comID
 

Detailed Description

Access to Robotino's (optional) Grappler.

Member Function Documentation

GrapplerReadings rec::robotino::api2::Grappler::info ( ) const

Get the current info. Readings contain

  • channels The channel of the servo found.
  • ids The servos id.
  • cwAxesLimits The servos clockwise axis limit.
  • ccwAxesLimits The servos counter-clockwise axis limit.
Returns
Grappler servo info.
Exceptions
nothing
Remarks
This function is thread save
void rec::robotino::api2::Grappler::processEvents ( )

Call this function from your main thread to get the virtual Grappler functions called. The virtual functions are called directly by a call of this function

Exceptions
nothing
GrapplerReadings rec::robotino::api2::Grappler::readings ( ) const

Get the current readings.

Returns
Grappler readings.
  • channels The channel of the servo found.
  • ids The servos id.
  • angles The servos current angle.
  • speeds The servos current speed.
  • errors The servos current error (if any).
Exceptions
nothing
Remarks
This function is thread save
virtual void rec::robotino::api2::Grappler::readingsEvent ( const rec::robotino::api2::GrapplerReadings readings)
virtual

Called when new Grappler data is available.

Parameters
readingsThe sensor readings.
Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents
virtual void rec::robotino::api2::Grappler::servoInfoEvent ( const rec::robotino::api2::GrapplerReadings info)
virtual

Called when servos are detected.

Parameters
infoServo info.
Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents
bool rec::robotino::api2::Grappler::setAxes ( const float *  angles,
unsigned int  anglesSize,
const float *  speeds,
unsigned int  speedsSize 
)

Set position and speed set-points for all axes.

Parameters
anglesThese are the position set-points in deg for all axes
anglesSizeThe size of the angles array
speedsThese are the speed set-points in rpm for all axes
speedsSizeThe size of the speeds array
Returns
Returns true on success. Returns false if
  • anglesSize != speedsSize
  • anglesSize >= number of servos detected
Exceptions
RobotinoExceptionif the underlying communication object is invalid
Remarks
This function is thread save
bool rec::robotino::api2::Grappler::setAxis ( unsigned int  axis,
float  angle,
float  speed 
)

Set position and speed set-point for one axis.

Parameters
axisAxis number. Axes are counted starting with 0.
angleThis is the position set-point in deg
speedThis is the speed set-point in rpm
Returns
Returns true on success. Returns false if axis is out of range.
Exceptions
RobotinoExceptionif the underlying communication object is invalid
Remarks
This function is thread save
void rec::robotino::api2::Grappler::setComId ( const ComId id)

Sets the associated communication object.

Parameters
idThe id of the associated communication object.
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
bool rec::robotino::api2::Grappler::setPowerEnabled ( unsigned int  channel,
bool  enable 
)

Enable/Disable power of a servo channel

Parameters
channel
  • 0 - RX64
  • 1 - RX28
  • 2 - RX10
enableTrue - enable False - disable
Returns
Returns true on success. Returns false if channel is out of range, i.e. > 2.
Exceptions
RobotinoExceptionif the underlying communication object is invalid
Remarks
This function is thread save
virtual void rec::robotino::api2::Grappler::storePositionsEvent ( const rec::robotino::api2::GrapplerReadings readings)
virtual

Called when new Grappler data is available.

Parameters
readingsThe sensor readings.
Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents
void rec::robotino::api2::Grappler::toggleTorque ( )

Toggle the servo torque status.

Exceptions
RobotinoExceptionif the underlying communication object is invalid
Remarks
This function is thread save
virtual void rec::robotino::api2::Grappler::toggleTorqueEvent ( )
virtual

Called when toggle torque button is pressed at the grappler

Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents

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