45 if(!jointCouplingHandler.
view(iJntCoupling)) {
66 ok = poly->
view(iJntEnc);
67 ok = ok && poly->
view(iAxInfo);
78void ControlBoardCouplingHandler::configureBuffers() {
107 iJntCoupling =
nullptr;
108 jointCouplingHandler.
close();
141 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
142 if (iJntEnc && iJntCoupling) {
144 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
146 *v = physJointsPos[j];
155 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
156 if (iJntEnc && iJntCoupling) {
158 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
160 std::copy(physJointsPos.
begin(), physJointsPos.
end(), encs);
169 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
170 if (iJntEnc && iJntCoupling) {
173 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
175 std::copy(physJointsPos.
begin(), physJointsPos.
end(), encs);
176 for(
size_t i = 0; i < physJointsTime.
size(); i++)
179 t[i] = actAxesTime[0];
189 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
190 if (iJntEnc && iJntCoupling) {
192 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
194 *v = physJointsPos[j];
205 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
206 if (iJntEnc && iJntCoupling) {
209 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsVel(actAxesPos, actAxesVel, physJointsVel);
211 *sp = physJointsVel[j];
220 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
221 if (iJntEnc && iJntCoupling) {
224 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsVel(actAxesPos, actAxesVel, physJointsVel);
226 std::copy(physJointsVel.
begin(), physJointsVel.
end(), spds);
235 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
236 if (iJntEnc && iJntCoupling) {
240 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsAcc(actAxesPos, actAxesVel, actAxesAcc, physJointsAcc);
242 *acc = physJointsAcc[j];
251 ReturnValue ok = ReturnValue::return_code::return_value_error_generic;
252 if (iJntEnc && iJntCoupling) {
256 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsAcc(actAxesPos, actAxesVel, actAxesAcc, physJointsAcc);
258 std::copy(physJointsAcc.
begin(), physJointsAcc.
end(), accs);
269 ReturnValue ok{ReturnValue::return_code::return_value_error_generic};
283 ReturnValue ok{ReturnValue::return_code::return_value_error_generic};
285 ok = iJntCoupling->getPhysicalJointName(j, name);
293 ReturnValue ok{ReturnValue::return_code::return_value_error_generic};
295 type = JointTypeEnum::VOCAB_JOINTTYPE_REVOLUTE;
const yarp::os::LogComponent & CONTROLBOARDCOUPLINGHANDLER()
#define YARP_METHOD_NOT_YET_IMPLEMENTED()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_coupling_device
yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue getJointType(int j, yarp::dev::JointTypeEnum &type) override
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
bool attach(yarp::dev::PolyDriver *poly) override
Attach to another object.
bool close() override
Close the device driver by deallocating all resources and closing ports.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
yarp::dev::ReturnValue getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
bool detach() override
Detach the object (you must have first called attach).
yarp::dev::ReturnValue resetEncoder(int j) override
ControlBoard methods.
yarp::dev::ReturnValue getAxisName(int j, std::string &name) override
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
bool view(T *&x)
Get an interface to the device driver.
virtual yarp::dev::ReturnValue getEncodersTimed(double *encs, double *time)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all axes.
virtual yarp::dev::ReturnValue getEncoders(double *encs)=0
Read the position of all axes.
A container for a device driver.
bool close() override
Close the DeviceDriver.
bool isValid() const
Check if device is valid.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
A base class for nested structures that can be searched.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
Scalar * data()
Return a pointer to the first element of the vector.
size_t size() const
Returns the number of elements in the vector.
iterator begin() noexcept
Returns an iterator to the beginning of the Vector.
void resize(size_t size)
Resize the vector.
#define yCError(component,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.