10 #ifndef YARP_FAKEMOTOR_FAKEMOTOR_H
11 #define YARP_FAKEMOTOR_FAKEMOTOR_H
33 public
yarp::dev::DeviceDriver,
34 public
yarp::dev::IPositionControl,
35 public
yarp::dev::IEncodersTimed,
36 public
yarp::dev::IVelocityControl
72 for (
int i=0; i<njoints; i++) {
97 for (
int i=0; i<njoints; i++) {
117 for (
int i=0; i<njoints; i++) {
148 for (
int i=0; i<njoints; i++) {
166 for (
int i=0; i<njoints; i++) {
184 for (
int i=0; i<njoints; i++) {
194 (*acc) = this->acc[j];
202 for (
int i=0; i<njoints; i++) {
220 bool positionMove(
const int n_joint,
const int *joints,
const double *refs)
override
225 bool relativeMove(
const int n_joint,
const int *joints,
const double *deltas)
override
235 bool setRefSpeeds(
const int n_joint,
const int *joints,
const double *spds)
override
245 bool getRefSpeeds(
const int n_joint,
const int *joints,
double *spds)
override
255 bool stop(
const int n_joint,
const int *joints)
override
275 bool velocityMove(
const int n_joint,
const int *joints,
const double *spds)
override
295 for (
int i=0; i<njoints; i++) {
313 for (
int i=0; i<njoints; i++) {
332 for (
int i=0; i<njoints; i++) {
341 bool ret = getEncoder(j, encs);
348 for (
int i=0; i<njoints; i++)
350 getEncoderTimed(i, &encs[i], &time[i]);
365 for (
int i=0; i<njoints; i++) {
381 for (
int i=0; i<njoints; i++) {
399 for (
int i=0; i<njoints; i++) {
define control board standard interfaces
const yarp::os::LogComponent & FAKEMOTOR()
contains the definition of a Vector type
A fake motor control board for testing.
bool checkMotionDone(bool *flag) override
Check if the current trajectory is terminated.
FakeMotor(const FakeMotor &)=delete
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool setRefAccelerations(const double *accs) override
Set reference acceleration on all joints.
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
~FakeMotor() override=default
bool relativeMove(const int n_joint, const int *joints, const double *deltas) override
Set relative position for a subset of joints.
bool stop(int j) override
Stop motion, single joint.
bool velocityMove(const int n_joint, const int *joints, const double *spds) override
Start motion at a given speed for a subset of joints.
bool getEncodersTimed(double *encs, double *time) override
Read the instantaneous acceleration of all axes.
bool setRefSpeeds(const double *spds) override
Set reference speed on all joints.
bool resetEncoders() override
Reset encoders.
bool getRefAccelerations(double *accs) override
Get reference acceleration of all joints.
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool getRefSpeeds(double *spds) override
Get reference speed of all joints.
bool getEncoderAcceleration(int j, double *spds) override
Read the instantaneous acceleration of an axis.
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool setRefSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool relativeMove(int j, double delta) override
Set relative position.
FakeMotor & operator=(const FakeMotor &)=delete
FakeMotor & operator=(FakeMotor &&)=delete
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool checkMotionDone(const int n_joint, const int *joints, bool *flags) override
Check if the current trajectory is terminated.
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool stop() override
Stop motion, multiple joints.
FakeMotor(FakeMotor &&)=delete
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool positionMove(const int n_joint, const int *joints, const double *refs) override
Set new reference point for a subset of joints.
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool velocityMove(int j, double sp) override
Start motion at a given speed, single joint.
bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
bool positionMove(const double *refs) override
Set new reference point for all axes.
bool velocityMove(const double *sp) override
Start motion at a given speed, multiple joints.
bool getEncoderTimed(int j, double *encs, double *time) override
Read the instantaneous acceleration of all axes.
bool getTargetPositions(const int n_joint, const int *joints, double *refs) override
Get the last position reference for the specified group of axes.
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
bool stop(const int n_joint, const int *joints) override
Stop motion for subset of joints.
bool resetEncoder(int j) override
Reset encoder, single joint.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool getEncoders(double *encs) override
Read the position of all axes.
bool relativeMove(const double *deltas) override
Set relative position, all joints.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
A single value (typically within a Bottle).
void resize(size_t size) override
Resize the vector.
#define yCInfo(component,...)
#define YARP_DECLARE_LOG_COMPONENT(name)
double now()
Return the current time in seconds, relative to an arbitrary starting point.
void delay(double seconds)
Wait for a certain number of seconds.
The main, catch-all namespace for YARP.