moved velocity calculations to the localizers
This commit is contained in:
@ -262,9 +262,10 @@ public class PoseUpdater {
|
|||||||
*/
|
*/
|
||||||
public Vector getVelocity() {
|
public Vector getVelocity() {
|
||||||
if (currentVelocity == null) {
|
if (currentVelocity == null) {
|
||||||
currentVelocity = new Vector();
|
// currentVelocity = new Vector();
|
||||||
currentVelocity.setOrthogonalComponents(getPose().getX() - previousPose.getX(), getPose().getY() - previousPose.getY());
|
// currentVelocity.setOrthogonalComponents(getPose().getX() - previousPose.getX(), getPose().getY() - previousPose.getY());
|
||||||
currentVelocity.setMagnitude(MathFunctions.distance(getPose(), previousPose) / ((currentPoseTime - previousPoseTime) / Math.pow(10.0, 9)));
|
// currentVelocity.setMagnitude(MathFunctions.distance(getPose(), previousPose) / ((currentPoseTime - previousPoseTime) / Math.pow(10.0, 9)));
|
||||||
|
currentVelocity = localizer.getVelocityVector();
|
||||||
return MathFunctions.copyVector(currentVelocity);
|
return MathFunctions.copyVector(currentVelocity);
|
||||||
} else {
|
} else {
|
||||||
return MathFunctions.copyVector(currentVelocity);
|
return MathFunctions.copyVector(currentVelocity);
|
||||||
|
Reference in New Issue
Block a user