|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_FAKEMOTOR_FAKEMOTOR_H
11 #define YARP_FAKEMOTOR_FAKEMOTOR_H
34 public
yarp::dev::DeviceDriver,
35 public
yarp::dev::IPositionControl,
36 public
yarp::dev::IEncodersTimed,
37 public
yarp::dev::IVelocityControl
73 for (
int i=0; i<njoints; i++) {
98 for (
int i=0; i<njoints; i++) {
118 for (
int i=0; i<njoints; i++) {
149 for (
int i=0; i<njoints; i++) {
167 for (
int i=0; i<njoints; i++) {
185 for (
int i=0; i<njoints; i++) {
195 (*acc) = this->acc[j];
203 for (
int i=0; i<njoints; i++) {
221 bool positionMove(
const int n_joint,
const int *joints,
const double *refs)
override
226 bool relativeMove(
const int n_joint,
const int *joints,
const double *deltas)
override
236 bool setRefSpeeds(
const int n_joint,
const int *joints,
const double *spds)
override
246 bool getRefSpeeds(
const int n_joint,
const int *joints,
double *spds)
override
256 bool stop(
const int n_joint,
const int *joints)
override
276 bool velocityMove(
const int n_joint,
const int *joints,
const double *spds)
override
296 for (
int i=0; i<njoints; i++) {
314 for (
int i=0; i<njoints; i++) {
333 for (
int i=0; i<njoints; i++) {
342 bool ret = getEncoder(j, encs);
349 for (
int i=0; i<njoints; i++)
351 getEncoderTimed(i, &encs[i], &time[i]);
366 for (
int i=0; i<njoints; i++) {
382 for (
int i=0; i<njoints; i++) {
400 for (
int i=0; i<njoints; i++) {
416 #endif // YARP_FAKEMOTOR_FAKEMOTOR_H
FakeMotor & operator=(const FakeMotor &)=delete
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
#define YARP_DECLARE_LOG_COMPONENT(name)
void resize(size_t size) override
Resize the vector.
A base class for nested structures that can be searched.
bool velocityMove(const int n_joint, const int *joints, const double *spds) override
Start motion at a given speed for a subset of joints.
contains the definition of a Vector type
bool velocityMove(int j, double sp) override
Start motion at a given speed, single joint.
bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
bool resetEncoder(int j) override
Reset encoder, single joint.
FakeMotor(const FakeMotor &)=delete
bool relativeMove(int j, double delta) override
Set relative position.
FakeMotor & operator=(FakeMotor &&)=delete
bool getEncoderAcceleration(int j, double *spds) override
Read the instantaneous acceleration of an axis.
FakeMotor(FakeMotor &&)=delete
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
define control board standard interfaces
bool relativeMove(const double *deltas) override
Set relative position, all joints.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool setRefSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
const yarp::os::LogComponent & FAKEMOTOR()
bool getRefAccelerations(double *accs) override
Get reference acceleration of all joints.
bool relativeMove(const int n_joint, const int *joints, const double *deltas) override
Set relative position for a subset of joints.
bool getEncoderTimed(int j, double *encs, double *time) override
Read the instantaneous acceleration of all axes.
bool positionMove(const int n_joint, const int *joints, const double *refs) override
Set new reference point for a subset of joints.
bool positionMove(const double *refs) override
Set new reference point for all axes.
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool resetEncoders() override
Reset encoders.
bool getEncoders(double *encs) override
Read the position of all axes.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
fakeMotor: A fake motor control board for testing.
bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool stop(int j) override
Stop motion, single joint.
bool checkMotionDone(bool *flag) override
Check if the current trajectory is terminated.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
~FakeMotor() override=default
bool setRefSpeeds(const double *spds) override
Set reference speed on all joints.
bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
bool getEncodersTimed(double *encs, double *time) override
Read the instantaneous acceleration of all axes.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
#define yCInfo(component,...)
bool getTargetPositions(const int n_joint, const int *joints, double *refs) override
Get the last position reference for the specified group of axes.
The main, catch-all namespace for YARP.
bool checkMotionDone(const int n_joint, const int *joints, bool *flags) override
Check if the current trajectory is terminated.
bool stop() override
Stop motion, multiple joints.
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool velocityMove(const double *sp) override
Start motion at a given speed, multiple joints.
A single value (typically within a Bottle).
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool setRefAccelerations(const double *accs) override
Set reference acceleration on all joints.
void delay(double seconds)
Wait for a certain number of seconds.
bool stop(const int n_joint, const int *joints) override
Stop motion for subset of joints.
bool getRefSpeeds(double *spds) override
Get reference speed of all joints.