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

SerialServoBoard: Documentation to be added More...

#include <SerialServoBoard/SerialServoBoard.h>

+ Inheritance diagram for SerialServoBoard:

Public Member Functions

yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue positionMove (int j, double ref) override
 Set new reference point for a single axis.
 
yarp::dev::ReturnValue positionMove (const double *refs) override
 Set new reference point for all axes.
 
yarp::dev::ReturnValue relativeMove (int j, double delta) override
 Set relative position.
 
yarp::dev::ReturnValue relativeMove (const double *deltas) override
 Set relative position, all joints.
 
yarp::dev::ReturnValue checkMotionDone (int j, bool &flag) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue checkMotionDone (bool &flag) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue setTrajSpeed (int j, double sp) override
 Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
 
yarp::dev::ReturnValue setTrajSpeeds (const double *spds) override
 Set reference speed on all joints.
 
yarp::dev::ReturnValue setTrajAcceleration (int j, double acc) override
 Set reference acceleration for a joint.
 
yarp::dev::ReturnValue setTrajAccelerations (const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajSpeed (int j, double *ref) override
 Get reference speed for a joint.
 
yarp::dev::ReturnValue getTrajSpeeds (double *spds) override
 Get reference speed of all joints.
 
yarp::dev::ReturnValue getTrajAcceleration (int j, double *acc) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue getTrajAccelerations (double *accs) override
 Get reference acceleration of all joints.
 
yarp::dev::ReturnValue stop (int j) override
 Stop motion, single joint.
 
yarp::dev::ReturnValue stop () override
 Stop motion, multiple joints.
 
yarp::dev::ReturnValue positionMove (const int n_joint, const int *joints, const double *refs) override
 Set new reference point for a subset of joints.
 
yarp::dev::ReturnValue relativeMove (const int n_joint, const int *joints, const double *deltas) override
 Set relative position for a subset of joints.
 
yarp::dev::ReturnValue checkMotionDone (const std::vector< int > &joints, bool &flag) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue setTrajSpeeds (const int n_joint, const int *joints, const double *spds) override
 Set reference speed on all joints.
 
yarp::dev::ReturnValue setTrajAccelerations (const int n_joint, const int *joints, const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajSpeeds (const int n_joint, const int *joints, double *spds) override
 Get reference speed of all joints.
 
yarp::dev::ReturnValue getTrajAccelerations (const int n_joint, const int *joints, double *accs) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue stop (const int n_joint, const int *joints) override
 Stop motion for subset of joints.
 
yarp::dev::ReturnValue getTargetPosition (const int, double *)
 Get the last position reference for the specified axis.
 
yarp::dev::ReturnValue getTargetPositions (double *)
 Get the last position reference for all axes.
 
yarp::dev::ReturnValue getTargetPositions (const int, const int *, double *)
 Get the last position reference for the specified group of axes.
 
bool open (Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
- 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 yarp::dev::IPositionControl
virtual ~IPositionControl ()
 Destructor.
 

Public Attributes

int servoboard
 
ISerialDevice * serial
 
PolyDriver dd
 
bool(* move )(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
 
double * positions
 
double * speeds
 

Detailed Description

SerialServoBoard: Documentation to be added

Definition at line 43 of file SerialServoBoard.h.

Member Function Documentation

◆ checkMotionDone() [1/3]

ReturnValue SerialServoBoard::checkMotionDone ( bool &  flag)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
flagis a pointer to return value ("and" of all joints)
Returns
true/false on network communication (value you actually want is stored in *flag)

Implements yarp::dev::IPositionControl.

Definition at line 180 of file SerialServoBoard.cpp.

◆ checkMotionDone() [2/3]

ReturnValue SerialServoBoard::checkMotionDone ( const std::vector< int > &  joints,
bool &  flag 
)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
jointsarray of joint numbers
flaglogical "and" of all set of joints
Returns
true/false if network communication went well.

Implements yarp::dev::IPositionControl.

Definition at line 267 of file SerialServoBoard.cpp.

◆ checkMotionDone() [3/3]

ReturnValue SerialServoBoard::checkMotionDone ( int  j,
bool &  flag 
)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
jis the axis number
flagis a pointer to return value
Returns
true/false on network communication (value you actually want is stored in *flag)

Implements yarp::dev::IPositionControl.

Definition at line 172 of file SerialServoBoard.cpp.

◆ close()

bool SerialServoBoard::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 103 of file SerialServoBoard.cpp.

◆ getAxes()

ReturnValue SerialServoBoard::getAxes ( size_t &  ax)
overridevirtual

Get the number of controlled axes.

This command asks the number of controlled axes for the current physical interface.

Parameters
axpointer to storage
Returns
true/false.

Implements yarp::dev::IPositionControl.

Definition at line 114 of file SerialServoBoard.cpp.

◆ getTargetPosition()

ReturnValue SerialServoBoard::getTargetPosition ( const int  joint,
double *  ref 
)
virtual

Get the last position reference for the specified axis.

This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition

Parameters
reflast reference sent using PositionMove functions
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 292 of file SerialServoBoard.cpp.

◆ getTargetPositions() [1/2]

ReturnValue SerialServoBoard::getTargetPositions ( const int  n_joint,
const int *  joints,
double *  refs 
)
virtual

Get the last position reference for the specified group of axes.

This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition

Parameters
reflast reference sent using PositionMove functions
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 302 of file SerialServoBoard.cpp.

◆ getTargetPositions() [2/2]

ReturnValue SerialServoBoard::getTargetPositions ( double *  refs)
virtual

Get the last position reference for all axes.

This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition

Parameters
reflast reference sent using PositionMove functions
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 297 of file SerialServoBoard.cpp.

◆ getTrajAcceleration()

ReturnValue SerialServoBoard::getTrajAcceleration ( int  j,
double *  acc 
)
overridevirtual

Get reference acceleration for a joint.

Returns the acceleration used to generate the trajectory profile.

Parameters
jjoint number
accpointer to storage for the return value
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 236 of file SerialServoBoard.cpp.

◆ getTrajAccelerations() [1/2]

ReturnValue SerialServoBoard::getTrajAccelerations ( const int  n_joint,
const int *  joints,
double *  accs 
)
overridevirtual

Get reference acceleration for a joint.

Returns the acceleration used to generate the trajectory profile.

Parameters
jointspointer to the array of joint numbers
accspointer to the array that will store the acceleration values
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 283 of file SerialServoBoard.cpp.

◆ getTrajAccelerations() [2/2]

ReturnValue SerialServoBoard::getTrajAccelerations ( double *  accs)
overridevirtual

Get reference acceleration of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
accspointer to the array that will store the acceleration values.
Returns
true/false on success or failure

Implements yarp::dev::IPositionControl.

Definition at line 242 of file SerialServoBoard.cpp.

◆ getTrajSpeed()

ReturnValue SerialServoBoard::getTrajSpeed ( int  j,
double *  ref 
)
overridevirtual

Get reference speed for a joint.

Returns the speed used to generate the trajectory profile.

Parameters
jjoint number
refpointer to storage for the return value
Returns
true/false on success or failure

Implements yarp::dev::IPositionControl.

Definition at line 218 of file SerialServoBoard.cpp.

◆ getTrajSpeeds() [1/2]

ReturnValue SerialServoBoard::getTrajSpeeds ( const int  n_joint,
const int *  joints,
double *  spds 
)
overridevirtual

Get reference speed of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
jointspointer to the array of joint numbers
spdspointer to the array that will store the speed values.
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 279 of file SerialServoBoard.cpp.

◆ getTrajSpeeds() [2/2]

ReturnValue SerialServoBoard::getTrajSpeeds ( double *  spds)
overridevirtual

Get reference speed of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
spdspointer to the array that will store the speed values.

Implements yarp::dev::IPositionControl.

Definition at line 226 of file SerialServoBoard.cpp.

◆ open()

bool SerialServoBoard::open ( 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 31 of file SerialServoBoard.cpp.

◆ positionMove() [1/3]

ReturnValue SerialServoBoard::positionMove ( const double *  refs)
overridevirtual

Set new reference point for all axes.

Parameters
refsarray, new reference points.
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 144 of file SerialServoBoard.cpp.

◆ positionMove() [2/3]

ReturnValue SerialServoBoard::positionMove ( const int  n_joint,
const int *  joints,
const double *  refs 
)
overridevirtual

Set new reference point for a subset of joints.

Parameters
jointspointer to the array of joint numbers
refspointer to the array specifying the new reference points
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 259 of file SerialServoBoard.cpp.

◆ positionMove() [3/3]

ReturnValue SerialServoBoard::positionMove ( int  j,
double  ref 
)
overridevirtual

Set new reference point for a single axis.

Parameters
jjoint number
refspecifies the new ref point
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 134 of file SerialServoBoard.cpp.

◆ relativeMove() [1/3]

ReturnValue SerialServoBoard::relativeMove ( const double *  deltas)
overridevirtual

Set relative position, all joints.

Parameters
deltaspointer to the relative commands
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 162 of file SerialServoBoard.cpp.

◆ relativeMove() [2/3]

ReturnValue SerialServoBoard::relativeMove ( const int  n_joint,
const int *  joints,
const double *  deltas 
)
overridevirtual

Set relative position for a subset of joints.

Parameters
jointspointer to the array of joint numbers
deltaspointer to the array of relative commands
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 263 of file SerialServoBoard.cpp.

◆ relativeMove() [3/3]

ReturnValue SerialServoBoard::relativeMove ( int  j,
double  delta 
)
overridevirtual

Set relative position.

The command is relative to the current position of the axis.

Parameters
jjoint axis number
deltarelative command
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 154 of file SerialServoBoard.cpp.

◆ setTrajAcceleration()

ReturnValue SerialServoBoard::setTrajAcceleration ( int  j,
double  acc 
)
overridevirtual

Set reference acceleration for a joint.

This value is used during the trajectory generation.

Parameters
jjoint number
accacceleration value
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 206 of file SerialServoBoard.cpp.

◆ setTrajAccelerations() [1/2]

ReturnValue SerialServoBoard::setTrajAccelerations ( const double *  accs)
overridevirtual

Set reference acceleration on all joints.

This is the value that is used during the generation of the trajectory.

Parameters
accspointer to the array of acceleration values
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 212 of file SerialServoBoard.cpp.

◆ setTrajAccelerations() [2/2]

ReturnValue SerialServoBoard::setTrajAccelerations ( const int  n_joint,
const int *  joints,
const double *  accs 
)
overridevirtual

Set reference acceleration on all joints.

This is the value that is used during the generation of the trajectory.

Parameters
jointspointer to the array of joint numbers
accspointer to the array with acceleration values
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 275 of file SerialServoBoard.cpp.

◆ setTrajSpeed()

ReturnValue SerialServoBoard::setTrajSpeed ( int  j,
double  sp 
)
overridevirtual

Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.

Parameters
jjoint number
spspeed value
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 188 of file SerialServoBoard.cpp.

◆ setTrajSpeeds() [1/2]

ReturnValue SerialServoBoard::setTrajSpeeds ( const double *  spds)
overridevirtual

Set reference speed on all joints.

These values are used during the interpolation of the trajectory.

Parameters
spdspointer to the array of speed values.
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 196 of file SerialServoBoard.cpp.

◆ setTrajSpeeds() [2/2]

ReturnValue SerialServoBoard::setTrajSpeeds ( const int  n_joint,
const int *  joints,
const double *  spds 
)
overridevirtual

Set reference speed on all joints.

These values are used during the interpolation of the trajectory.

Parameters
jointspointer to the array of joint numbers
spdspointer to the array with speed values.
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControl.

Definition at line 271 of file SerialServoBoard.cpp.

◆ stop() [1/3]

ReturnValue SerialServoBoard::stop ( )
overridevirtual

Stop motion, multiple joints.

Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 254 of file SerialServoBoard.cpp.

◆ stop() [2/3]

ReturnValue SerialServoBoard::stop ( const int  n_joint,
const int *  joints 
)
overridevirtual

Stop motion for subset of joints.

Parameters
jointspointer to the array of joint numbers
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 287 of file SerialServoBoard.cpp.

◆ stop() [3/3]

ReturnValue SerialServoBoard::stop ( int  j)
overridevirtual

Stop motion, single joint.

Parameters
jjoint number
Returns
true/false on success/failure

Implements yarp::dev::IPositionControl.

Definition at line 248 of file SerialServoBoard.cpp.

Member Data Documentation

◆ dd

PolyDriver SerialServoBoard::dd

Definition at line 50 of file SerialServoBoard.h.

◆ move

bool(* SerialServoBoard::move) (int j, double ref, double *positions, double *speeds, ISerialDevice *serial)

Definition at line 52 of file SerialServoBoard.h.

◆ positions

double* SerialServoBoard::positions

Definition at line 54 of file SerialServoBoard.h.

◆ serial

ISerialDevice* SerialServoBoard::serial

Definition at line 48 of file SerialServoBoard.h.

◆ servoboard

int SerialServoBoard::servoboard

Definition at line 46 of file SerialServoBoard.h.

◆ speeds

double* SerialServoBoard::speeds

Definition at line 55 of file SerialServoBoard.h.


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