Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
SwerveDriveKinematics.h
1#pragma once
2
3#include "../navtypes.h"
4
5namespace kinematics {
6
12 double lfVel;
13 double lfRot;
14 double rfVel;
15 double rfRot;
16 double lbVel;
17 double lbRot;
18 double rbVel;
19 double rbRot;
20};
21
27public:
37 explicit SwerveDriveKinematics(double baseWidth, double baseLength);
38
52 swervewheelvel_t robotVelToWheelVel(double xVel, double yVel, double thetaVel) const;
53
63 navtypes::pose_t wheelVelToRobotVel(swervewheelvel_t wheelVel) const;
64
74 navtypes::pose_t getLocalPoseUpdate(const swervewheelvel_t& wheelVel, double dt) const;
75
86 navtypes::pose_t getPoseUpdate(const swervewheelvel_t& wheelVel, double heading,
87 double dt) const;
88
99 navtypes::pose_t getNextPose(const swervewheelvel_t& wheelVel,
100 const navtypes::pose_t& pose, double dt) const;
101
102private:
103 double baseWidth;
104 double baseLength;
105
111 Eigen::Matrix<double, 8, 3> getIKMatrix() const;
112
123 Eigen::Matrix<double, 8, 1> getSwerveVelComponents(swervewheelvel_t wheelVel) const;
124};
125} // namespace kinematics
navtypes::pose_t getLocalPoseUpdate(const swervewheelvel_t &wheelVel, double dt) const
Calculate the pose update in the local reference frame given the velocities of the robot's wheels and...
Definition SwerveDriveKinematics.cpp:57
swervewheelvel_t robotVelToWheelVel(double xVel, double yVel, double thetaVel) const
Given the robot's translational and angular velocity in the robot's reference frame,...
Definition SwerveDriveKinematics.cpp:43
navtypes::pose_t wheelVelToRobotVel(swervewheelvel_t wheelVel) const
Given the speeds and angles of the robot's wheels in the robot's reference frame, find the robot's tr...
Definition SwerveDriveKinematics.cpp:38
SwerveDriveKinematics(double baseWidth, double baseLength)
Create a new SwerveDriveKinematics with the given wheel base width and length from rear of robot.
Definition SwerveDriveKinematics.cpp:10
navtypes::pose_t getPoseUpdate(const swervewheelvel_t &wheelVel, double heading, double dt) const
Calculate the pose update in the global reference frame given the velocities of the robot's wheels an...
Definition SwerveDriveKinematics.cpp:63
navtypes::pose_t getNextPose(const swervewheelvel_t &wheelVel, const navtypes::pose_t &pose, double dt) const
Calculate the next pose of the robot in the global reference frame.
Definition SwerveDriveKinematics.cpp:68
Represents robot wheel velocities in robot reference frame, in polar form (wheel speed and angle)
Definition SwerveDriveKinematics.h:11