controlboardinterfaces.h
来自「一个语言识别引擎」· C头文件 代码 · 共 1,367 行 · 第 1/3 页
H
1,367 行
};
/**
* @ingroup dev_iface_motor
*
* Interface for a generic control board device implementing position control.
*/
class yarp::dev::IPositionControl
{
public:
/**
* Destructor.
*/
virtual ~IPositionControl() {}
/**
* Get the number of controlled axes. This command asks the number of controlled
* axes for the current physical interface.
* @param ax pointer to storage
* @return true/false.
*/
virtual bool getAxes(int *ax) = 0;
/** Set position mode. This command
* is required by control boards implementing different
* control methods (e.g. velocity/torque), in some cases
* it can be left empty.
* return true/false on success/failure
*/
virtual bool setPositionMode()=0;
/** Set new reference point for a single axis.
* @param j joint number
* @param ref specifies the new ref point
* @return true/false on success/failure
*/
virtual bool positionMove(int j, double ref)=0;
/** Set new reference point for all axes.
* @param refs array, new reference points.
* @return true/false on success/failure
*/
virtual bool positionMove(const double *refs)=0;
/** Set relative position. The command is relative to the
* current position of the axis.
* @param j joint axis number
* @param delta relative command
* @return true/false on success/failure
*/
virtual bool relativeMove(int j, double delta)=0;
/** Set relative position, all joints.
* @param deltas pointer to the relative commands
* @return true/false on success/failure
*/
virtual bool relativeMove(const double *deltas)=0;
/** Check if the current trajectory is terminated. Non blocking.
* @return true if the trajectory is terminated, false otherwise
*/
virtual bool checkMotionDone(int j, bool *flag)=0;
/** Check if the current trajectory is terminated. Non blocking.
* @return true if the trajectory is terminated, false otherwise
*/
virtual bool checkMotionDone(bool *flag)=0;
/** Set reference speed for a joint, this is the speed used during the
* interpolation of the trajectory.
* @param j joint number
* @param sp speed value
* @return true/false upon success/failure
*/
virtual bool setRefSpeed(int j, double sp)=0;
/** Set reference speed on all joints. These values are used during the
* interpolation of the trajectory.
* @param spds pointer to the array of speed values.
* @return true/false upon success/failure
*/
virtual bool setRefSpeeds(const double *spds)=0;
/** Set reference acceleration for a joint. This value is used during the
* trajectory generation.
* @param j joint number
* @param acc acceleration value
* @return true/false upon success/failure
*/
virtual bool setRefAcceleration(int j, double acc)=0;
/** Set reference acceleration on all joints. This is the valure that is
* used during the generation of the trajectory.
* @param accs pointer to the array of acceleration values
* @return true/false upon success/failure
*/
virtual bool setRefAccelerations(const double *accs)=0;
/** Get reference speed for a joint. Returns the speed used to
* generate the trajectory profile.
* @param j joint number
* @param ref pointer to storage for the return value
* @return true/false on success or failure
*/
virtual bool getRefSpeed(int j, double *ref)=0;
/** Get reference speed of all joints. These are the values used during the
* interpolation of the trajectory.
* @param spds pointer to the array that will store the speed values.
*/
virtual bool getRefSpeeds(double *spds)=0;
/** Get reference acceleration for a joint. Returns the acceleration used to
* generate the trajectory profile.
* @param j joint number
* @param acc pointer to storage for the return value
* @return true/false on success/failure
*/
virtual bool getRefAcceleration(int j, double *acc)=0;
/** Get reference acceleration of all joints. These are the values used during the
* interpolation of the trajectory.
* @param accs pointer to the array that will store the acceleration values.
* @return true/false on success or failure
*/
virtual bool getRefAccelerations(double *accs)=0;
/** Stop motion, single joint
* @param j joint number
* @return true/false on success/failure
*/
virtual bool stop(int j)=0;
/** Stop motion, multiple joints
* @return true/false on success/failure
*/
virtual bool stop()=0;
};
/**
* @ingroup dev_iface_motor
*
* Interface for control boards implementig velocity control in encoder coordinates.
*/
class yarp::dev::IVelocityControlRaw
{
public:
/**
* Destructor.
*/
virtual ~IVelocityControlRaw() {}
/**
* Get the number of controlled axes. This command asks the number of controlled
* axes for the current physical interface.
* @param axis pointer to storage, return value
* @return true/false.
*/
virtual bool getAxes(int *axis) = 0;
/**
* Set position mode. This command
* is required by control boards implementing different
* control methods (e.g. velocity/torque), in some cases
* it can be left empty.
* @return true/false on success failure
*/
virtual bool setVelocityMode()=0;
/**
* Start motion at a given speed, single joint.
* @param j joint number
* @param sp speed value
* @return bool/false upone success/failure
*/
virtual bool velocityMoveRaw(int j, double sp)=0;
/**
* Start motion at a given speed, multiple joints.
* @param sp pointer to the array containing the new speed values
* @return true/false upon success/failure
*/
virtual bool velocityMoveRaw(const double *sp)=0;
/** Set reference acceleration for a joint. This value is used during the
* trajectory generation.
* @param j joint number
* @param acc acceleration value
* @return true/false upon success/failure
*/
virtual bool setRefAccelerationRaw(int j, double acc)=0;
/** Set reference acceleration on all joints. This is the valure that is
* used during the generation of the trajectory.
* @param accs pointer to the array of acceleration values
* @return true/false upon success/failure
*/
virtual bool setRefAccelerationsRaw(const double *accs)=0;
/** Get reference acceleration for a joint. Returns the acceleration used to
* generate the trajectory profile.
* @param j joint number
* @param acc pointer to storage for the return value
* @return true/false on success/failure
*/
virtual bool getRefAccelerationRaw(int j, double *acc)=0;
/** Get reference acceleration of all joints. These are the values used during the
* interpolation of the trajectory.
* @param accs pointer to the array that will store the acceleration values.
* @return true/false on success or failure
*/
virtual bool getRefAccelerationsRaw(double *accs)=0;
/** Stop motion, single joint
* @param j joint number
* @return true/false on success or failure
*/
virtual bool stopRaw(int j)=0;
/** Stop motion, multiple joints
* @return true/false on success or failure
*/
virtual bool stopRaw()=0;
};
/**
* @ingroup dev_iface_motor
*
* Interface for control boards implementing velocity control.
*/
class yarp::dev::IVelocityControl
{
public:
/**
* Destructor.
*/
virtual ~IVelocityControl() {}
/**
* Get the number of controlled axes. This command asks the number of controlled
* axes for the current physical interface.
* parame axes pointer to storage
* @return true/false.
*/
virtual bool getAxes(int *axes) = 0;
/**
* Set position mode. This command
* is required by control boards implementing different
* control methods (e.g. velocity/torque), in some cases
* it can be left empty.
* @return true/false on success failure
*/
virtual bool setVelocityMode()=0;
/**
* Start motion at a given speed, single joint.
* @param j joint number
* @param sp speed value
* @return bool/false upone success/failure
*/
virtual bool velocityMove(int j, double sp)=0;
/**
* Start motion at a given speed, multiple joints.
* @param sp pointer to the array containing the new speed values
* @return true/false upon success/failure
*/
virtual bool velocityMove(const double *sp)=0;
/** Set reference acceleration for a joint. This value is used during the
* trajectory generation.
* @param j joint number
* @param acc acceleration value
* @return true/false upon success/failure
*/
virtual bool setRefAcceleration(int j, double acc)=0;
/** Set reference acceleration on all joints. This is the valure that is
* used during the generation of the trajectory.
* @param accs pointer to the array of acceleration values
* @return true/false upon success/failure
*/
virtual bool setRefAccelerations(const double *accs)=0;
/** Get reference acceleration for a joint. Returns the acceleration used to
* generate the trajectory profile.
* @param j joint number
* @param acc pointer to storage for the return value
* @return true/false on success/failure
*/
virtual bool getRefAcceleration(int j, double *acc)=0;
/** Get reference acceleration of all joints. These are the values used during the
* interpolation of the trajectory.
* @param accs pointer to the array that will store the acceleration values.
* @return true/false on success or failure
*/
virtual bool getRefAccelerations(double *accs)=0;
/** Stop motion, single joint
* @param j joint number
* @return true/false on success or failure
*/
virtual bool stop(int j)=0;
/** Stop motion, multiple joints
* @return true/false on success or failure
*/
virtual bool stop()=0;
};
/**
* @ingroup dev_iface_motor
*
* Interface for control boards implementing torque control.
*/
class yarp::dev::ITorqueControlRaw
{
public:
/**
* Destructor.
*/
virtual ~ITorqueControlRaw() {}
/**
* Get the number of controlled axes. This command asks the number of controlled
* axes for the current physical interface.
* @return the number of controlled axes.
*/
virtual bool getAxes(int *ax) = 0;
/**
* Set torque control mode. This command
* is required by control boards implementing different
* control methods (e.g. velocity/torque), in some cases
* it can be left empty.
* @return true/false on success failure
*/
virtual bool setTorqueMode()=0;
/** Get the value of the torque on a given joint.
* @param j joint number
* @return torque value
*/
virtual double getRefTorqueRaw(int j)=0;
/** Get the value of the torque for all joints.
* @param t pointer to the array that will store the output
*/
virtual void getRefTorquesRaw(double *t)=0;
/** Set the reference value of the torque for all joints.
* @param t pointer to the array of torque values
* @return true/false
*/
virtual bool setTorquesRaw(const double *t)=0;
/** Set the reference value of the torque for a given joint.
* @param j joint number
* @param t new value
*/
virtual void setTorqueRaw(int j, double t)=0;
};
/**
* @ingroup dev_iface_motor
*
* Control board, encoder interface.
*/
class yarp::dev::IEncodersRaw
{
public:
/**
* Destructor.
*/
virtual ~IEncodersRaw() {}
/**
* Get the number of controlled axes. This command asks the number of controlled
* axes for the current physical interface.
* @return the number of controlled axes.
*/
virtual bool getAxes(int *ax) = 0;
/**
* Reset encoder, single joint. Set the encoder value to zero
* @param j encoder number
* @return true/false
*/
virtual bool resetEncoderRaw(int j)=0;
/**
* Reset encoders. Set the encoders value to zero
* @return true/false
*/
virtual bool resetEncodersRaw()=0;
/**
* Set the value of the encoder for a given joint.
* @param j encoder number
* @param val new value
* @return true/false
*/
virtual bool setEncoderRaw(int j, double val)=0;
/**
* Set the value of all encoders.
* @param vals pointer to the new values
* @return true/false
*/
virtual bool setEncodersRaw(const double *vals)=0;
/**
* Read the value of an encoder.
* @param j encoder number
* @param v pointer to storage for the return value
* @return true/false, upon success/failure (you knew it, uh?)
*/
virtual bool getEncoderRaw(int j, double *v)=0;
/**
* Read the position of all axes.
* @param encs pointer to the array that will contain the output
* @return true/false on success/failure
*/
virtual bool getEncodersRaw(double *encs)=0;
/**
* Read the instantaneous speed of an axis.
* @param j axis number
* @param sp pointer to storage for the output
* @return true if successful, false ... otherwise.
*/
virtual bool getEncoderSpeedRaw(int j, double *sp)=0;
/**
* Read the instantaneous acceleration of an axis.
* @param spds pointer to storage for the output values
* @return guess what? (true/false on success or failure).
*/
virtual bool getEncoderSpeedsRaw(double *spds)=0;
/**
* Read the instantaneous acceleration of an axis.
* @param j axis number
* @param spds pointer to the array that will contain the output
*/
virtual bool getEncoderAccelerationRaw(int j, double *spds)=0;
/**
* Read the instantaneous acceleration of all axes.
* @param accs pointer to the array that will contain the output
* @return true if all goes well, false if anything bad happens.
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?