65 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());
68 if (cmdVector.
data() ==
nullptr) {
106 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming current message on single joint\n");
114 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming current message on all joints\n");
122 if ((
static_cast<int>(jlut->
size()) != n_joints) && (
static_cast<int>(cmdVector.
size()) != n_joints)) {
123 yCError(
CONTROLBOARD,
"Received VOCAB_CURRENT_REF_GROUP size of joints vector or currents vector does not match the selected joint number\n");
126 int* joint_list =
new int[n_joints];
127 for (
int i = 0; i < n_joints; i++) {
134 yCError(
CONTROLBOARD,
"Error while trying to command a streaming current message on joint group\n");
143 yCError(
CONTROLBOARD,
"Unrecognized message while receiving on command port (%s)\n", str.c_str());
150 yCError(
CONTROLBOARD,
"Received VOCAB_POSITION_MODE this is an send invalid message on streaming port");
165 yCError(
CONTROLBOARD,
"Received VOCAB_VELOCITY_MODE this is an send invalid message on streaming port");
195 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming torque direct message on single joint\n");
204 yCError(
CONTROLBOARD,
"Errors while trying to command a streaming torque direct message on all joints\n");
213 if ((
static_cast<int>(jlut->
size()) != n_joints) && (
static_cast<int>(cmdVector.
size()) != n_joints)) {
214 yCError(
CONTROLBOARD,
"Received VOCAB_TORQUES_DIRECT_GROUP size of joints vector or torques vector does not match the selected joint number\n");
217 int* joint_list =
new int[n_joints];
218 for (
int i = 0; i < n_joints; i++) {
225 yCError(
CONTROLBOARD,
"Error while trying to command a streaming toruqe direct message on joint group\n");
236 if ((
static_cast<int>(jlut->
size()) != n_joints) && (
static_cast<int>(cmdVector.
size()) != n_joints)) {
237 yCError(
CONTROLBOARD,
"Received VOCAB_POSITION_DIRECT_GROUP size of joints vector or positions vector does not match the selected joint number\n");
240 int* joint_list =
new int[n_joints];
241 for (
int i = 0; i < n_joints; i++) {
248 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on joint group\n");
259 yCError(
CONTROLBOARD,
"Error while trying to command a streaming position direct message on all joints\n");
268 if ((
static_cast<int>(jlut->
size()) != n_joints) && (
static_cast<int>(cmdVector.
size()) != n_joints)) {
269 yCError(
CONTROLBOARD,
"Received VOCAB_VELOCITY_MOVE_GROUP size of joints vector or positions vector does not match the selected joint number\n");
272 int* joint_list =
new int[n_joints];
273 for (
int i = 0; i < n_joints; i++) {
289 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
Interface implemented by all device drivers.
bool view(T *&x)
Get an interface to the device driver.
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 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.
size_type size() const
Gets the number of elements in the bottle.
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.
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.
std::string toString(int precision=-1, int width=-1) const
Creates a string object containing a text representation of the object.
T * data()
Return a pointer to the first element of the vector.
#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.