72 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,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
124 yCError(
CONTROLBOARD,
"Errors while trying to execute streaming command setPidOffset()\n");
135 yCError(
CONTROLBOARD,
"Errors while trying to execute streaming command setPidFeedforward()\n");
142 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
155 yCError(
CONTROLBOARD,
"Errors while trying to execute streaming command setRefCurrent()\n");
163 yCError(
CONTROLBOARD,
"Errors while trying to execute streaming command setRefCurrents()\n");
171 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
172 yCError(
CONTROLBOARD,
"Received VOCAB_CURRENT_REF_GROUP size of joints vector or currents vector does not match the selected joint number\n");
176 for (
int i = 0; i < n_joints; i++) {
183 yCError(
CONTROLBOARD,
"Errors while trying to execute streaming command setRefCurrents() group\n");
192 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
205 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming torque direct message on single joint\n");
213 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++) {
231 yCError(
CONTROLBOARD,
"Error while trying to command a streaming toruqe direct message on joint group\n");
239 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
258 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
279 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
280 yCError(
CONTROLBOARD,
"Received VOCAB_POSITION_DIRECT_GROUP size of joints vector or positions vector does not match the selected joint number\n");
283 for (
int i = 0; i < n_joints; i++) {
288 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on joint group\n");
297 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on all joints\n");
304 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
334 if ((
static_cast<int>(
jlut->size()) != n_joints) && (
static_cast<int>(
cmdVector.size()) != n_joints)) {
335 yCError(
CONTROLBOARD,
"Received VOCAB_VELOCITY_MOVE_GROUP size of joints vector or positions vector does not match the selected joint number\n");
339 for (
int i = 0; i < n_joints; i++) {
354 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
367 yCError(
CONTROLBOARD,
"Errors while trying to command an streaming velocity direct message on joint %d\n", joint);
375 if ((
static_cast<int>(
jlut->size()) != n_joints) &&
376 (
static_cast<int>(
cmdVector.size()) != n_joints)) {
377 yCError(
CONTROLBOARD,
"Received VOCAB_VELOCITY_DIRECT_SET_GROUP size of joints vector or positions vector does not match the selected joint number\n");
380 for (
int i = 0; i < n_joints; i++) {
383 std::vector<double>
vel_list(n_joints);
384 for (
int i = 0; i < n_joints; i++) {
389 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on joint group\n");
396 std::vector<double>
vel_list(n_joints);
397 for (
int i = 0; i < n_joints; i++) {
402 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on all joints\n");
409 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
418 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_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_PIDCONTROL_SET_FEEDFORWARD
constexpr yarp::conf::vocab32_t VOCAB_PIDCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_PIDCONTROL_SET_OFFSET
constexpr yarp::conf::vocab32_t VOCAB_POSITIONCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_POSITIONDIRECTCONTROL_INTERFACE
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_TORQUECONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITYCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVES
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_DIRECT_SET_ONE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITYDIRECTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_DIRECT_SET_GROUP
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_DIRECT_SET_ALL
yarp::dev::IPositionDirect * stream_IPosDirect
void init(yarp::dev::DeviceDriver *x)
Initialization.
yarp::dev::IVelocityControl * stream_IVel
yarp::dev::ICurrentControl * stream_ICurrent
yarp::dev::IPidControl * stream_IPid
yarp::dev::IPWMControl * stream_IPWM
yarp::dev::IVelocityDirect * stream_IVelDirect
yarp::dev::ITorqueControl * stream_ITorque
yarp::dev::IPositionControl * stream_IPosCtrl
void onRead(yarp::dev::CommandMessageData &v) override
Callback function.
yarp::dev::IAxisInfo * stream_IAxis
yarp::sig::Vector body
body
yarp::os::Bottle head
header
Interface implemented by all device drivers.
bool view(T *&x)
Get an interface to the device driver.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
virtual yarp::dev::ReturnValue setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
virtual yarp::dev::ReturnValue setRefDutyCycles(const double *refs)=0
Sets the reference dutycycle for all the motors.
virtual yarp::dev::ReturnValue setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
virtual yarp::dev::ReturnValue setPidFeedforward(const PidControlTypeEnum &pidtype, int j, double v)=0
Set the feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set an offset value for a given controller.
virtual yarp::dev::ReturnValue positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue setPositions(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
virtual yarp::dev::ReturnValue setPosition(int j, double ref)=0
Set new position for a single axis.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
virtual yarp::dev::ReturnValue setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
virtual yarp::dev::ReturnValue velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
virtual yarp::dev::ReturnValue getAxes(size_t &axes)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue setRefVelocity(int jnt, double vel)=0
Set the velocity of 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.
virtual yarp::conf::vocab32_t asVocab32() const
Get 32 bit 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.