Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
DiffDriveKinematics.h
1#pragma once
2
3#include "../navtypes.h"
4namespace kinematics {
5struct wheelvel_t {
6 double lVel;
7 double rVel;
8};
9
15public:
29 Proportional,
30 PreferXVel,
31 PreferThetaVel,
32 };
33
40 explicit DiffDriveKinematics(double wheelBaseWidth);
41
51 navtypes::pose_t wheelVelToRobotVel(double lVel, double rVel) const;
52
61 wheelvel_t robotVelToWheelVel(double xVel, double thetaVel) const;
62
72 navtypes::pose_t getLocalPoseUpdate(const wheelvel_t& wheelVel, double dt) const;
73
83 navtypes::pose_t getPoseUpdate(const wheelvel_t& wheelVel, double heading,
84 double dt) const;
85
96 navtypes::pose_t getNextPose(const wheelvel_t& wheelVel, const navtypes::pose_t& pose,
97 double dt) const;
98
111 navtypes::pose_t ensureWithinWheelSpeedLimit(PreferredVelPreservation preferred,
112 double xVel, double thetaVel,
113 double maxWheelSpeed) const;
114
115private:
116 double wheelBaseWidth;
117};
118} // namespace kinematics
DiffDriveKinematics(double wheelBaseWidth)
Create a new DiffDriveKinematics with the given wheel base width.
Definition DiffDriveKinematics.cpp:9
navtypes::pose_t getNextPose(const wheelvel_t &wheelVel, const navtypes::pose_t &pose, double dt) const
Calculate the next pose of the robot in the global reference frame.
Definition DiffDriveKinematics.cpp:49
navtypes::pose_t wheelVelToRobotVel(double lVel, double rVel) const
Given the left and right wheel velocities, find the robot velocity in the robot's reference frame.
Definition DiffDriveKinematics.cpp:12
PreferredVelPreservation
Proportional: The xVel and thetaVel are scaled an equal amount.
Definition DiffDriveKinematics.h:28
navtypes::pose_t getPoseUpdate(const wheelvel_t &wheelVel, double heading, double dt) const
Calculate the pose update in the global reference frame (map space) assuming the left and right wheel...
Definition DiffDriveKinematics.cpp:44
navtypes::pose_t getLocalPoseUpdate(const wheelvel_t &wheelVel, double dt) const
Calculate the pose update in the local reference frame assuming the left and right wheels have consta...
Definition DiffDriveKinematics.cpp:20
DiffDriveKinematics(double wheelBaseWidth)
Create a new DiffDriveKinematics with the given wheel base width.
Definition DiffDriveKinematics.cpp:9
wheelvel_t robotVelToWheelVel(double xVel, double thetaVel) const
Given the robot velocity in the robot's local reference frame, find the left and right tangential whe...
Definition DiffDriveKinematics.cpp:16
navtypes::pose_t ensureWithinWheelSpeedLimit(PreferredVelPreservation preferred, double xVel, double thetaVel, double maxWheelSpeed) const
Ensure that the given xVel and thetaVel translate to a wheel speed less than or equal to the max whee...
Definition DiffDriveKinematics.cpp:54
Definition DiffDriveKinematics.h:5