-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Estimate motor and joint velocities through KF #909
Conversation
// virtual bool getEncoderSpeed(int j, double* sp); | ||
// virtual bool getEncoderSpeeds(double* spds); | ||
// virtual bool getMotorEncoderSpeed(int m, double* sp); | ||
// virtual bool getMotorEncoderSpeeds(double* spds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// virtual bool getEncoderSpeed(int j, double* sp); | |
// virtual bool getEncoderSpeeds(double* spds); | |
// virtual bool getMotorEncoderSpeed(int m, double* sp); | |
// virtual bool getMotorEncoderSpeeds(double* spds); |
// 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; | ||
// } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this is a leftover
// TO BE CHANGED | ||
// For the time being instead of reading the motor acceleration we are reading the | ||
// estimated friction torques | ||
|
||
// controlBoardRemapperMeasures.motorAccelerations.noalias() | ||
// = controlBoardRemapperMeasures.remappedJointPermutationMatrix | ||
// * controlBoardRemapperMeasures.motorAccelerationsUnordered * M_PI / 180; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we are writing the friction torques instead of the motor accelerations. I commented out this to avoid doing twice the conversion * M_PI/ 180.0
which now is not needed. I also added a comment to remember to change this once there will be a different solution to send the friction torques through yarp.
Is it ok like this or do you prefer not to change sensor bridge and apply the inverse conversion where I read the joint friction torques?
Hi @isorrentino as far a I understood this pr includes also the #908. If you want you can close the other and keep only this open |
Yes, this contains the other one. We can directly merge this. |
This PR implements two KF to estimate the joint and motor velocities in the JointTorqueControlDevice.
cc @LoreMoretti