68 yCError(
CONTROLBOARD,
"Received command vector with number of elements bigger than axis controlled by this wrapper (cmd: %s requested jnts: %d received jnts: %d)\n", str.c_str(),
stream_nJoints, (
int)
cmdVector.size());
109 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming current message on single joint\n");
117 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming current message on all joints\n");
125 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
126 yCError(
CONTROLBOARD,
"Received VOCAB_CURRENT_REF_GROUP size of joints vector or currents vector does not match the selected joint number\n");
130 for (
int i = 0;
i < n_joints;
i++) {
137 yCError(
CONTROLBOARD,
"Error while trying to command a streaming current message on joint group\n");
146 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
153 yCError(
CONTROLBOARD,
"Received VOCAB_POSITION_MODE this is an send invalid message on streaming port");
168 yCError(
CONTROLBOARD,
"Received VOCAB_VELOCITY_MODE this is an send invalid message on streaming port");
203 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming torque direct message on single joint\n");
212 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming torque direct message on all joints\n");
221 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
222 yCError(
CONTROLBOARD,
"Received VOCAB_TORQUES_DIRECT_GROUP size of joints vector or torques vector does not match the selected joint number\n");
226 for (
int i = 0;
i < n_joints;
i++) {
233 yCError(
CONTROLBOARD,
"Error while trying to command a streaming toruqe direct message on joint group\n");
244 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
245 yCError(
CONTROLBOARD,
"Received VOCAB_POSITION_DIRECT_GROUP size of joints vector or positions vector does not match the selected joint number\n");
249 for (
int i = 0;
i < n_joints;
i++) {
256 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on joint group\n");
267 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on all joints\n");
276 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
277 yCError(
CONTROLBOARD,
"Received VOCAB_VELOCITY_MOVE_GROUP size of joints vector or positions vector does not match the selected joint number\n");
281 for (
int i = 0;
i < n_joints;
i++) {
297 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
const yarp::os::LogComponent & CONTROLBOARD()
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MODE
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MODE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVES
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVES
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REFS
constexpr yarp::conf::vocab32_t VOCAB_CURRENTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
yarp::dev::IPositionDirect * stream_IPosDirect
void init(yarp::dev::DeviceDriver *x)
Initialization.
yarp::dev::IVelocityControl * stream_IVel
yarp::dev::ICurrentControl * stream_ICurrent
void onRead(CommandMessage &v) override
Callback function.
yarp::dev::IPWMControl * stream_IPWM
yarp::dev::ITorqueControl * stream_ITorque
yarp::dev::IPositionControl * stream_IPosCtrl
yarp::dev::IAxisInfo * stream_IAxis
Interface implemented by all device drivers.
bool view(T *&x)
Get an interface to the device driver.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
virtual bool setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
virtual bool setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
virtual bool setRefDutyCycles(const double *refs)=0
Sets the reference dutycycle for all the motors.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual bool setPositions(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
virtual bool setPosition(int j, double ref)=0
Set new position for a single axis.
virtual bool setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
virtual bool setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool getAxes(int *axes)=0
Get the number of controlled axes.
virtual bool velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
A simple collection of objects that can be described and transmitted in a portable way.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A mini-server for performing network communication in the background.
Group a pair of objects to be sent and received together.
BODY body
An object of the second type (BODY).
HEAD head
An object of the first type (HEAD).
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual Bottle * asList() const
Get list value.
#define yCError(component,...)
#define yCTrace(component,...)
For streams capable of holding different kinds of content, check what they actually have.
std::string decode(NetInt32 code)
Convert a vocabulary identifier into a string.
An interface to the operating system, including Port based communication.