18#ifndef __FAKEMOTORDEVICECOMPONENTS_H__ 
   19#define __FAKEMOTORDEVICECOMPONENTS_H__ 
   23#include <yarp/os/all.h> 
   24#include <yarp/dev/all.h> 
   25#include <yarp/sig/all.h> 
   34                              public yarp::os::PeriodicThread,
 
   35                              public yarp::os::PortReader,
 
   36                              public yarp::dev::IControlLimits,
 
   37                              public yarp::dev::IEncoders,
 
   38                              public yarp::dev::IVelocityControl
 
   41    yarp::os::BufferedPort<yarp::sig::Vector> 
statePort;
 
   42    yarp::os::BufferedPort<yarp::os::Bottle>  
cmdPort;
 
   48    yarp::sig::Vector 
vel;
 
   56    bool read(yarp::os::ConnectionReader &connection);
 
   60    bool open(yarp::os::Searchable &config);
 
   68    bool getLimits(
int axis, 
double *min, 
double *max);
 
  107    bool velocityMove(
const int,
const int*,
const double*)        { 
return false; }
 
  114    bool stop(
const int,
const int*)                              { 
return false; }
 
 
  123                              public yarp::dev::IControlLimits,
 
  124                              public yarp::dev::IEncoders,
 
  125                              public yarp::dev::IVelocityControl
 
  128    class StatePort : 
public yarp::os::BufferedPort<yarp::sig::Vector>
 
  131        void onRead(yarp::sig::Vector &
encs)
 
  135                std::lock_guard<std::mutex> lg(owner->
mtx);
 
 
  145    yarp::os::BufferedPort<yarp::os::Bottle> 
cmdPort;
 
  157    bool open(yarp::os::Searchable &config);
 
  165    bool getLimits(
int axis, 
double *min, 
double *max);
 
  204    bool velocityMove(
const int,
const int*,
const double*)        { 
return false; }
 
  211    bool stop(
const int,
const int*)                              { 
return false; }
 
 
void setOwner(fakeMotorDeviceClient *owner)
 
This class implements the client part of the fake motor device driver.
 
bool getRefAccelerations(const int, const int *, double *)
 
bool getEncoderAcceleration(int, double *)
 
bool getEncoderAccelerations(double *)
 
bool open(yarp::os::Searchable &config)
 
yarp::os::RpcClient rpcPort
 
bool getRefAcceleration(int, double *)
 
bool getEncoder(int, double *)
 
bool setEncoders(const double *)
 
bool setRefAccelerations(const double *)
 
bool setRefAcceleration(int j, double acc)
 
bool getEncoderSpeed(int, double *)
 
bool setEncoder(int, double)
 
bool getEncoders(double *encs)
 
bool getLimits(int axis, double *min, double *max)
 
bool velocityMove(const double *)
 
yarp::os::BufferedPort< yarp::os::Bottle > cmdPort
 
bool velocityMove(const int, const int *, const double *)
 
bool setRefAccelerations(const int, const int *, const double *)
 
bool stop(const int, const int *)
 
bool getVelLimits(int, double *, double *)
 
bool getRefAccelerations(double *)
 
bool getEncoderSpeeds(double *)
 
bool velocityMove(int j, double sp)
 
bool setLimits(int, double, double)
 
bool setVelLimits(int, double, double)
 
This class implements the server part of the fake motor device driver.
 
yarp::os::BufferedPort< yarp::sig::Vector > statePort
 
yarp::os::BufferedPort< yarp::os::Bottle > cmdPort
 
bool getVelLimits(int, double *, double *)
 
bool getEncoderAccelerations(double *)
 
bool getLimits(int axis, double *min, double *max)
 
bool getRefAccelerations(const int, const int *, double *)
 
bool read(yarp::os::ConnectionReader &connection)
This method decodes the requests forwarded by the client and responds with corresponding replies.
 
bool getRefAccelerations(double *)
 
bool getEncoderSpeeds(double *)
 
bool velocityMove(int j, double sp)
 
bool getEncoderSpeed(int, double *)
 
bool velocityMove(const double *)
 
bool setEncoder(int, double)
 
bool setVelLimits(int, double, double)
 
iCub::ctrl::Integrator * motors
 
bool getEncoders(double *)
 
bool open(yarp::os::Searchable &config)
 
bool getRefAcceleration(int, double *)
 
bool getEncoder(int, double *)
 
bool stop(const int, const int *)
 
bool setRefAcceleration(int j, double acc)
 
bool setRefAccelerations(const double *)
 
bool setEncoders(const double *)
 
bool setRefAccelerations(const int, const int *, const double *)
 
bool setLimits(int, double, double)
 
bool getEncoderAcceleration(int, double *)
 
bool velocityMove(const int, const int *, const double *)
 
A class for defining a saturated integrator based on Tustin formula: .