Skip to content

Commit

Permalink
Remove streaming of kf joint and motor velocities
Browse files Browse the repository at this point in the history
  • Loading branch information
icub committed Nov 12, 2024
1 parent 19c75c3 commit bb2fe13
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ class BipedalLocomotion::JointTorqueControlDevice
virtual bool setRefTorque(int j, double t);

// HACK MOTOR ACCELERATION TO PUBLISH FRICTION TORQUES
virtual bool getEncoderSpeed(int j, double* sp);
virtual bool getEncoderSpeeds(double* spds);
virtual bool getMotorEncoderSpeed(int m, double* sp);
virtual bool getMotorEncoderSpeeds(double* spds);
// virtual bool getEncoderSpeed(int j, double* sp);
// virtual bool getEncoderSpeeds(double* spds);
// virtual bool getMotorEncoderSpeed(int m, double* sp);
// virtual bool getMotorEncoderSpeeds(double* spds);
virtual bool getMotorEncoderAcceleration(int j, double* acc);
virtual bool getMotorEncoderAccelerations(double* accs);

Expand Down
54 changes: 27 additions & 27 deletions devices/JointTorqueControlDevice/src/JointTorqueControlDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1627,33 +1627,33 @@ bool JointTorqueControlDevice::getRefTorque(int j, double* trq)
return true;
}

bool JointTorqueControlDevice::getEncoderSpeeds(double* spds)
{
std::lock_guard<std::mutex>(this->globalMutex);
memcpy(spds, measuredJointVelocities.data(), this->axes * sizeof(double));
return true;
}

bool JointTorqueControlDevice::getEncoderSpeed(int j, double* sp)
{
std::lock_guard<std::mutex>(this->globalMutex);
*sp = measuredJointVelocities[j];
return true;
}

bool JointTorqueControlDevice::getMotorEncoderSpeeds(double* spds)
{
std::lock_guard<std::mutex>(this->globalMutex);
memcpy(spds, measuredMotorVelocities.data(), this->axes * sizeof(double));
return true;
}

bool JointTorqueControlDevice::getMotorEncoderSpeed(int j, double* sp)
{
std::lock_guard<std::mutex>(this->globalMutex);
*sp = measuredMotorVelocities[j];
return true;
}
// bool JointTorqueControlDevice::getEncoderSpeeds(double* spds)
// {
// std::lock_guard<std::mutex>(this->globalMutex);
// memcpy(spds, measuredJointVelocities.data(), this->axes * sizeof(double));
// return true;
// }

// bool JointTorqueControlDevice::getEncoderSpeed(int j, double* sp)
// {
// std::lock_guard<std::mutex>(this->globalMutex);
// *sp = measuredJointVelocities[j];
// return true;
// }

// bool JointTorqueControlDevice::getMotorEncoderSpeeds(double* spds)
// {
// std::lock_guard<std::mutex>(this->globalMutex);
// memcpy(spds, measuredMotorVelocities.data(), this->axes * sizeof(double));
// return true;
// }

// bool JointTorqueControlDevice::getMotorEncoderSpeed(int j, double* sp)
// {
// std::lock_guard<std::mutex>(this->globalMutex);
// *sp = measuredMotorVelocities[j];
// return true;
// }

// TO BE UPDATE
// We publish the friction torque by using the motor acceleration as the friction
Expand Down

0 comments on commit bb2fe13

Please sign in to comment.