fakebot
: Documentation to be added
More...
#include <fakebot/FakeBot.h>
Public Member Functions | |
FakeBot () | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | getImage (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override |
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied. More... | |
int | height () const override |
Return the height of each frame. More... | |
int | width () const override |
Return the width of each frame. More... | |
bool | getAxes (int *ax) override |
Get the number of controlled axes. More... | |
bool | positionMove (int j, double ref) override |
Set new reference point for a single axis. More... | |
bool | positionMove (const double *refs) override |
Set new reference point for all axes. More... | |
bool | relativeMove (int j, double delta) override |
Set relative position. More... | |
bool | relativeMove (const double *deltas) override |
Set relative position, all joints. More... | |
bool | checkMotionDone (int j, bool *flag) override |
Check if the current trajectory is terminated. More... | |
bool | checkMotionDone (bool *flag) override |
Check if the current trajectory is terminated. More... | |
bool | setRefSpeed (int j, double sp) override |
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory. More... | |
bool | setRefSpeeds (const double *spds) override |
Set reference speed on all joints. More... | |
bool | setRefAcceleration (int j, double acc) override |
Set reference acceleration for a joint. More... | |
bool | setRefAccelerations (const double *accs) override |
Set reference acceleration on all joints. More... | |
bool | getRefSpeed (int j, double *ref) override |
Get reference speed for a joint. More... | |
bool | getRefSpeeds (double *spds) override |
Get reference speed of all joints. More... | |
bool | getRefAcceleration (int j, double *acc) override |
Get reference acceleration for a joint. More... | |
bool | getRefAccelerations (double *accs) override |
Get reference acceleration of all joints. More... | |
bool | stop (int j) override |
Stop motion, single joint. More... | |
bool | stop () override |
Stop motion, multiple joints. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
bool | resetEncoder (int j) override |
Reset encoder, single joint. More... | |
bool | resetEncoders () override |
Reset encoders. More... | |
bool | setEncoder (int j, double val) override |
Set the value of the encoder for a given joint. More... | |
bool | setEncoders (const double *vals) override |
Set the value of all encoders. More... | |
bool | getEncoder (int j, double *v) override |
Read the value of an encoder. More... | |
bool | getEncoders (double *encs) override |
Read the position of all axes. More... | |
bool | getEncoderSpeed (int j, double *sp) override |
Read the istantaneous speed of an axis. More... | |
bool | getEncoderSpeeds (double *spds) override |
Read the instantaneous speed of all axes. More... | |
bool | getEncoderAcceleration (int j, double *spds) override |
Read the instantaneous acceleration of an axis. More... | |
bool | getEncoderAccelerations (double *accs) override |
Read the instantaneous acceleration of all axes. More... | |
bool | positionMove (const int n_joint, const int *joints, const double *refs) override |
Set new reference point for a subset of joints. More... | |
bool | relativeMove (const int n_joint, const int *joints, const double *deltas) override |
Set relative position for a subset of joints. More... | |
bool | checkMotionDone (const int n_joint, const int *joints, bool *flags) override |
Check if the current trajectory is terminated. More... | |
bool | setRefSpeeds (const int n_joint, const int *joints, const double *spds) override |
Set reference speed on all joints. More... | |
bool | setRefAccelerations (const int n_joint, const int *joints, const double *accs) override |
Set reference acceleration on all joints. More... | |
bool | getRefSpeeds (const int n_joint, const int *joints, double *spds) override |
Get reference speed of all joints. More... | |
bool | getRefAccelerations (const int n_joint, const int *joints, double *accs) override |
Get reference acceleration for a joint. More... | |
bool | stop (const int n_joint, const int *joints) override |
Stop motion for subset of joints. More... | |
bool | getEncodersTimed (double *encs, double *time) override |
Read the instantaneous acceleration of all axes. More... | |
bool | getEncoderTimed (int j, double *enc, double *time) override |
Read the instantaneous acceleration of all axes. More... | |
bool | velocityMove (int j, double sp) override |
Start motion at a given speed, single joint. More... | |
bool | velocityMove (const double *sp) override |
Start motion at a given speed, multiple joints. More... | |
bool | velocityMove (const int n_joint, const int *joints, const double *spds) override |
Start motion at a given speed for a subset of joints. More... | |
bool | enableAmp (int j) override |
Enable the amplifier on a specific joint. More... | |
bool | disableAmp (int j) override |
Disable the amplifier on a specific joint. More... | |
bool | getCurrent (int j, double *val) override |
bool | getCurrents (double *vals) override |
bool | getMaxCurrent (int j, double *v) override |
Returns the maximum electric current allowed for a given motor. More... | |
bool | setMaxCurrent (int j, double v) override |
bool | getAmpStatus (int *st) override |
bool | getAmpStatus (int k, int *v) override |
bool | calibrateAxisWithParams (int j, unsigned int iv, double v1, double v2, double v3) override |
Start calibration, this method is very often platform specific. More... | |
bool | calibrationDone (int j) override |
Check if the calibration is terminated, on a particular joint. More... | |
bool | getLimits (int axis, double *min, double *max) override |
Get the software limits for a particular axis. More... | |
bool | setLimits (int axis, double min, double max) override |
Set the software limits for a particular axis, the behavior of the control card when these limits are exceeded, depends on the implementation. More... | |
bool | setVelLimits (int axis, double min, double max) override |
Set the software speed limits for a particular axis, the behavior of the control card when these limits are exceeded, depends on the implementation. More... | |
bool | getVelLimits (int axis, double *min, double *max) override |
Get the software speed limits for a particular axis. More... | |
void | run () override |
Main body of the new thread. More... | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Public Member Functions inherited from yarp::dev::IPositionControl | |
virtual | ~IPositionControl () |
Destructor. More... | |
virtual bool | getTargetPosition (const int joint, double *ref) |
Get the last position reference for the specified axis. More... | |
virtual bool | getTargetPositions (double *refs) |
Get the last position reference for all axes. More... | |
virtual bool | getTargetPositions (const int n_joint, const int *joints, double *refs) |
Get the last position reference for the specified group of axes. More... | |
Public Member Functions inherited from yarp::dev::IVelocityControl | |
virtual | ~IVelocityControl () |
Destructor. More... | |
virtual bool | getRefVelocity (const int joint, double *vel) |
Get the last reference speed set by velocityMove for single joint. More... | |
virtual bool | getRefVelocities (double *vels) |
Get the last reference speed set by velocityMove for all joints. More... | |
virtual bool | getRefVelocities (const int n_joint, const int *joints, double *vels) |
Get the last reference speed set by velocityMove for a group of joints. More... | |
Public Member Functions inherited from yarp::dev::IAmplifierControl | |
virtual | ~IAmplifierControl () |
Destructor. More... | |
virtual bool | getNominalCurrent (int m, double *val) |
virtual bool | setNominalCurrent (int m, const double val) |
virtual bool | getPeakCurrent (int m, double *val) |
virtual bool | setPeakCurrent (int m, const double val) |
virtual bool | getPWM (int j, double *val) |
virtual bool | getPWMLimit (int j, double *val) |
virtual bool | setPWMLimit (int j, const double val) |
virtual bool | getPowerSupplyVoltage (int j, double *val) |
Public Member Functions inherited from yarp::dev::IEncodersTimed | |
virtual | ~IEncodersTimed () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::IEncoders | |
virtual | ~IEncoders () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::IFrameGrabberImage | |
virtual | ~IFrameGrabberImage () |
Destructor. More... | |
virtual bool | getImageCrop (cropType_id_t cropType, yarp::sig::VectorOf< std::pair< int, int > > vertices, yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) |
Get a crop of the rgb image from the frame grabber, if required demosaicking/color reconstruction is applied. More... | |
Public Member Functions inherited from yarp::dev::IControlCalibration | |
IControlCalibration () | |
virtual | ~IControlCalibration () |
Destructor. More... | |
virtual bool | setCalibrationParameters (int axis, const CalibrationParameters ¶ms) |
Start calibration, this method is very often platform specific. More... | |
virtual bool | setCalibrator (ICalibrator *c) |
Set the calibrator object to be used to calibrate the robot. More... | |
virtual bool | calibrateRobot () |
Calibrate robot by using an external calibrator. More... | |
virtual bool | park (bool wait=true) |
virtual bool | abortCalibration () |
virtual bool | abortPark () |
Public Member Functions inherited from yarp::dev::IControlLimits | |
virtual | ~IControlLimits () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::DeviceResponder | |
DeviceResponder () | |
Constructor. More... | |
void | addUsage (const char *txt, const char *explain=nullptr) |
Add information about a message that the respond() method understands. More... | |
void | addUsage (const yarp::os::Bottle &bot, const char *explain=nullptr) |
Add information about a message that the respond() method understands. More... | |
virtual bool | respond (const yarp::os::Bottle &command, yarp::os::Bottle &reply) |
Respond to a message. More... | |
bool | read (yarp::os::ConnectionReader &connection) override |
Handler for reading messages from the network, and passing them on to the respond() method. More... | |
void | onRead (yarp::os::Bottle &v) override |
Alternative handler for reading messages from the network, and passing them on to the respond() method. More... | |
void | makeUsage () |
Regenerate usage information. More... | |
void | attach (yarp::os::TypedReader< yarp::os::Bottle > &source) |
Attach this object to a source of messages. More... | |
Public Member Functions inherited from yarp::os::PortReader | |
virtual | ~PortReader () |
Destructor. More... | |
virtual Type | getReadType () const |
Public Member Functions inherited from yarp::os::TypedReaderCallback< yarp::os::Bottle > | |
virtual | ~TypedReaderCallback () |
Destructor. More... | |
virtual void | onRead (yarp::os::Bottle &datum) |
Callback method. More... | |
virtual void | onRead (yarp::os::Bottle &datum, const yarp::os::TypedReader< yarp::os::Bottle > &reader) |
Callback method. More... | |
Public Member Functions inherited from yarp::os::Thread | |
Thread () | |
Constructor. More... | |
virtual | ~Thread () |
Destructor. More... | |
virtual void | onStop () |
Call-back, called while halting the thread (before join). More... | |
bool | start () |
Start the new thread running. More... | |
bool | stop () |
Stop the thread. More... | |
virtual void | beforeStart () |
Called just before a new thread starts. More... | |
virtual void | afterStart (bool success) |
Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). More... | |
virtual bool | threadInit () |
Initialization method. More... | |
virtual void | threadRelease () |
Release method. More... | |
bool | isStopping () |
Returns true if the thread is stopping (Thread::stop has been called). More... | |
bool | isRunning () |
Returns true if the thread is running (Thread::start has been called successfully and the thread has not stopped). More... | |
long int | getKey () |
Get a unique identifier for the thread. More... | |
int | setPriority (int priority, int policy=-1) |
Set the priority and scheduling policy of the thread, if the OS supports that. More... | |
int | getPriority () |
Query the current priority of the thread, if the OS supports that. More... | |
int | getPolicy () |
Query the current scheduling policy of the thread, if the OS supports that. More... | |
bool | join (double seconds=-1) |
The function returns when the thread execution has completed. More... | |
void | setOptions (int stackSize=0) |
Set the stack size for the new thread. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from yarp::os::Thread | |
static int | getCount () |
Check how many threads are running. More... | |
static long int | getKeyOfCaller () |
Get a unique identifier for the calling thread. More... | |
static void | yield () |
Reschedule the execution of current thread, allowing other threads to run. More... | |
static void | setDefaultStackSize (int stackSize) |
Set the default stack size for all threads created after this point. More... | |
|
inlineoverridevirtual |
Start calibration, this method is very often platform specific.
Implements yarp::dev::IControlCalibration.
|
inlineoverridevirtual |
Check if the calibration is terminated, on a particular joint.
Non blocking.
Implements yarp::dev::IControlCalibration.
|
inlineoverridevirtual |
Check if the current trajectory is terminated.
Non blocking.
flag | is a pointer to return value ("and" of all joints) |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Check if the current trajectory is terminated.
Non blocking.
joints | pointer to the array of joint numbers |
flag | pointer to return value (logical "and" of all set of joints) |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Check if the current trajectory is terminated.
Non blocking.
j | is the axis number |
flag | is a pointer to return value |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
|
inlineoverridevirtual |
Disable the amplifier on a specific joint.
All computations within the board will be carried out normally, but the output will be disabled.
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Enable the amplifier on a specific joint.
Be careful, check that the output of the controller is appropriate (usually zero), to avoid generating abrupt movements.
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Get the number of controlled axes.
This command asks the number of controlled axes for the current physical interface.
ax | pointer to storage |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Read the value of an encoder.
j | encoder number |
v | pointer to storage for the return value |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Read the instantaneous acceleration of an axis.
j | axis number |
spds | pointer to the array that will contain the output |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Read the instantaneous acceleration of all axes.
accs | pointer to the array that will contain the output |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Read the position of all axes.
encs | pointer to the array that will contain the output |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Read the istantaneous speed of an axis.
j | axis number |
sp | pointer to storage for the output |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Read the instantaneous speed of all axes.
spds | pointer to storage for the output values |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Read the instantaneous acceleration of all axes.
encs | pointer to the array that will contain the output |
time | pointer to the array that will contain individual timestamps |
Implements yarp::dev::IEncodersTimed.
|
inlineoverridevirtual |
Read the instantaneous acceleration of all axes.
j | axis index |
encs | encoder value (pointer to) |
time | corresponding timestamp (pointer to) |
Implements yarp::dev::IEncodersTimed.
|
overridevirtual |
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied.
image | the image to be filled |
Implements yarp::dev::IFrameGrabberImage.
Definition at line 117 of file FakeBot.cpp.
|
inlineoverridevirtual |
Get the software limits for a particular axis.
axis | joint number |
pointer | to store the value of the lower limit |
pointer | to store the value of the upper limit |
Implements yarp::dev::IControlLimits.
|
inlineoverridevirtual |
Returns the maximum electric current allowed for a given motor.
Exceeding this value will trigger instantaneous hardware fault.
j | motor number |
v | the return value |
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Get reference acceleration for a joint.
Returns the acceleration used to generate the trajectory profile.
j | joint number |
acc | pointer to storage for the return value |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Get reference acceleration for a joint.
Returns the acceleration used to generate the trajectory profile.
joints | pointer to the array of joint numbers |
accs | pointer to the array that will store the acceleration values |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Get reference acceleration of all joints.
These are the values used during the interpolation of the trajectory.
accs | pointer to the array that will store the acceleration values. |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Get reference speed for a joint.
Returns the speed used to generate the trajectory profile.
j | joint number |
ref | pointer to storage for the return value |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Get reference speed of all joints.
These are the values used during the interpolation of the trajectory.
joints | pointer to the array of joint numbers |
spds | pointer to the array that will store the speed values. |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Get reference speed of all joints.
These are the values used during the interpolation of the trajectory.
spds | pointer to the array that will store the speed values. |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Get the software speed limits for a particular axis.
axis | joint number |
min | pointer to store the value of the lower limit |
max | pointer to store the value of the upper limit |
Implements yarp::dev::IControlLimits.
|
inlineoverridevirtual |
|
overridevirtual |
Open the DeviceDriver.
config | is 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). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 88 of file FakeBot.cpp.
|
inlineoverridevirtual |
Set new reference point for all axes.
refs | array, new reference points. |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set new reference point for a subset of joints.
joints | pointer to the array of joint numbers |
refs | pointer to the array specifying the new reference points |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set new reference point for a single axis.
j | joint number |
ref | specifies the new ref point |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set relative position, all joints.
deltas | pointer to the relative commands |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set relative position for a subset of joints.
joints | pointer to the array of joint numbers |
deltas | pointer to the array of relative commands |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set relative position.
The command is relative to the current position of the axis.
j | joint axis number |
delta | relative command |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Reset encoder, single joint.
Set the encoder value to zero
j | encoder number |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
|
overridevirtual |
Main body of the new thread.
Override this method to do what you want. After Thread::start is called, this method will start running in a separate thread. It is important that this method either keeps checking Thread::isStopping to see if it should stop, or you override the Thread::onStop method to interact with it in some way to shut the new thread down. There is no really reliable, portable way to stop a thread cleanly unless that thread cooperates.
Implements yarp::os::Thread.
Definition at line 176 of file FakeBot.cpp.
|
inlineoverridevirtual |
Set the value of the encoder for a given joint.
j | encoder number |
val | new value |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Set the value of all encoders.
vals | pointer to the new values |
Implements yarp::dev::IEncoders.
|
inlineoverridevirtual |
Set the software limits for a particular axis, the behavior of the control card when these limits are exceeded, depends on the implementation.
axis | joint number (why am I telling you this) |
min | the value of the lower limit |
max | the value of the upper limit |
Implements yarp::dev::IControlLimits.
|
inlineoverridevirtual |
Implements yarp::dev::IAmplifierControl.
|
inlineoverridevirtual |
Set reference acceleration for a joint.
This value is used during the trajectory generation.
j | joint number |
acc | acceleration value |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set reference acceleration on all joints.
This is the valure that is used during the generation of the trajectory.
accs | pointer to the array of acceleration values |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set reference acceleration on all joints.
This is the valure that is used during the generation of the trajectory.
joints | pointer to the array of joint numbers |
accs | pointer to the array with acceleration values |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
j | joint number |
sp | speed value |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set reference speed on all joints.
These values are used during the interpolation of the trajectory.
spds | pointer to the array of speed values. |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set reference speed on all joints.
These values are used during the interpolation of the trajectory.
joints | pointer to the array of joint numbers |
spds | pointer to the array with speed values. |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Set the software speed limits for a particular axis, the behavior of the control card when these limits are exceeded, depends on the implementation.
axis | joint number |
min | the value of the lower limit |
max | the value of the upper limit |
Implements yarp::dev::IControlLimits.
|
inlineoverridevirtual |
Stop motion, multiple joints.
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Stop motion for subset of joints.
joints | pointer to the array of joint numbers |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Stop motion, single joint.
j | joint number |
Implements yarp::dev::IPositionControl.
|
inlineoverridevirtual |
Start motion at a given speed, multiple joints.
sp | pointer to the array containing the new speed values |
Implements yarp::dev::IVelocityControl.
|
inlineoverridevirtual |
Start motion at a given speed for a subset of joints.
n_joint | how many joints this command is referring to |
joints | of joints controlled. The size of this array is n_joints |
spds | pointer to the array containing the new speed values, one value for each joint, the size of the array is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 spds 10 30 40 |
Implements yarp::dev::IVelocityControl.
|
inlineoverridevirtual |
Start motion at a given speed, single joint.
j | joint number |
sp | speed value |
Implements yarp::dev::IVelocityControl.
|
inlineoverridevirtual |