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();
142 if (iJntEnc && iJntCoupling) {
144 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
146 *v = physJointsPos[
j];
156 if (iJntEnc && iJntCoupling) {
158 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
160 std::copy(physJointsPos.
begin(), physJointsPos.
end(), encs);
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];
190 if (iJntEnc && iJntCoupling) {
192 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsPos(actAxesPos, physJointsPos);
194 *v = physJointsPos[
j];
206 if (iJntEnc && iJntCoupling) {
209 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsVel(actAxesPos, actAxesVel, physJointsVel);
211 *
sp = physJointsVel[
j];
221 if (iJntEnc && iJntCoupling) {
224 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsVel(actAxesPos, actAxesVel, physJointsVel);
226 std::copy(physJointsVel.
begin(), physJointsVel.
end(),
spds);
236 if (iJntEnc && iJntCoupling) {
240 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsAcc(actAxesPos, actAxesVel, actAxesAcc, physJointsAcc);
242 *acc = physJointsAcc[
j];
252 if (iJntEnc && iJntCoupling) {
256 ok = ok && iJntCoupling->convertFromActuatedAxesToPhysicalJointsAcc(actAxesPos, actAxesVel, actAxesAcc, physJointsAcc);
258 std::copy(physJointsAcc.
begin(), physJointsAcc.
end(),
accs);
285 ok = iJntCoupling->getPhysicalJointName(
j, name);
const yarp::os::LogComponent & CONTROLBOARDCOUPLINGHANDLER()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_coupling_device
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
bool getEncoders(double *encs) override
Read the position of all axes.
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool getAxisName(int j, std::string &name) override
bool attach(yarp::dev::PolyDriver *poly) override
Attach to another object.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool close() override
Close the device driver by deallocating all resources and closing ports.
bool resetEncoders() override
Reset encoders.
bool detach() override
Detach the object (you must have first called attach).
bool getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool resetEncoder(int j) override
ControlBoard methods.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
bool view(T *&x)
Get an interface to the device driver.
virtual bool getEncodersTimed(double *encs, double *time)=0
Read the instantaneous acceleration of all axes.
virtual bool getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual bool getEncoders(double *encs)=0
Read the position of all axes.
virtual bool getEncoderSpeeds(double *spds)=0
Read the instantaneous speed 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.
void resize(size_t size) override
Resize the vector.
iterator begin() noexcept
Returns an iterator to the beginning of the VectorOf.
T * data()
Return a pointer to the first element of the vector.
iterator end() noexcept
Returns an iterator to the end of the VectorOf.
#define yCError(component,...)
For streams capable of holding different kinds of content, check what they actually have.
@ VOCAB_JOINTTYPE_REVOLUTE
An interface to the operating system, including Port based communication.