Add apis for getting the measured velocities of the wheels

This commit is contained in:
Erik Schembor 2017-12-13 22:04:22 -05:00
parent 3906d7954d
commit 5bc4d85177
2 changed files with 25 additions and 0 deletions

View file

@ -83,6 +83,8 @@ namespace create {
Matrix poseCovar;
float measuredLeftVel;
float measuredRightVel;
float requestedLeftVel;
float requestedRightVel;
@ -560,6 +562,18 @@ namespace create {
*/
float getRightWheelDistance() const;
/**
* \brief Get the measured velocity of the left wheel.
* \return velocity in m/s
*/
float getMeasuredLeftWheelVel() const;
/**
* \brief Get the measured velocity of the right wheel.
* \return velocity in m/s
*/
float getMeasuredRightWheelVel() const;
/**
* \brief Get the requested velocity of the left wheel.
* This value is bounded at the maximum velocity of the robot model.

View file

@ -170,6 +170,9 @@ namespace create {
deltaYaw = wheelDistDiff / model.getAxleLength();
}
measuredLeftVel = leftWheelDist / dt;
measuredRightVel = rightWheelDist / dt;
// Moving straight
if (fabs(wheelDistDiff) < util::EPS) {
deltaX = deltaDist * cos(pose.yaw);
@ -975,6 +978,14 @@ namespace create {
return totalRightDist;
}
float Create::getMeasuredLeftWheelVel() const {
return measuredLeftVel;
}
float Create::getMeasuredRightWheelVel() const {
return measuredRightVel;
}
float Create::getRequestedLeftWheelVel() const {
return requestedLeftVel;
}