Calculates forward and inverse drivebase kinematics for a 4-wheel swerve drivebase with specifiable width and length.
More...
#include <SwerveDriveKinematics.h>
|
| SwerveDriveKinematics (double baseWidth, double baseLength) |
| Create a new SwerveDriveKinematics with the given wheel base width and length from rear of robot.
|
|
swervewheelvel_t | robotVelToWheelVel (double xVel, double yVel, double thetaVel) const |
| Given the robot's translational and angular velocity in the robot's reference frame, find the speeds and angles of the robot's wheels in the robot's reference frame.
|
|
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 translational velocity and angular velocity in the robot's reference frame.
|
|
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 the time step.
|
|
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 and the time step.
|
|
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.
|
|
Calculates forward and inverse drivebase kinematics for a 4-wheel swerve drivebase with specifiable width and length.
◆ SwerveDriveKinematics()
kinematics::SwerveDriveKinematics::SwerveDriveKinematics |
( |
double | baseWidth, |
|
|
double | baseLength ) |
|
explicit |
Create a new SwerveDriveKinematics with the given wheel base width and length from rear of robot.
- Parameters
-
baseWidth | The width of the wheelbase. The units themselves don't matter, as long as you're consistent. |
baseLength | The length of the wheelbase. The units themselves don't matter, as long as you're consistent. |
◆ getLocalPoseUpdate()
pose_t kinematics::SwerveDriveKinematics::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 the time step.
- Parameters
-
wheelVel | The velocities of the wheels. |
dt | The elapsed time in seconds for which the update is calculated. The robot has been moving at the specified velocity for this much time. |
- Returns
- The pose update in the robot's local reference frame.
◆ getNextPose()
pose_t kinematics::SwerveDriveKinematics::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.
(map space)
- Parameters
-
wheelVel | The velocities of the wheels. |
pose | The current pose of the robot, in the global reference frame. |
dt | The elapsed time in seconds for which the update is calculated. The robot has been moving at the specified velocity for this much time. |
- Returns
- The next pose of the robot in the global reference frame after having moved at the specified velocity for the specified time.
◆ getPoseUpdate()
pose_t kinematics::SwerveDriveKinematics::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 and the time step.
- Parameters
-
wheelVel | The velocities of the wheels. |
heading | The heading of the robot, in radians. |
dt | The elapsed time in seconds for which the update is calculated. The robot has been moving at the specified velocity for this much time. |
- Returns
- The pose update in the global reference frame.
◆ robotVelToWheelVel()
swervewheelvel_t kinematics::SwerveDriveKinematics::robotVelToWheelVel |
( |
double | xVel, |
|
|
double | yVel, |
|
|
double | thetaVel ) const |
Given the robot's translational and angular velocity in the robot's reference frame, find the speeds and angles of the robot's wheels in the robot's reference frame.
- Parameters
-
xVel | the forward velocity component of the robot, in the robot's reference frame. (positive = front) |
yVel | the left/right velocity component of the robot, in the robot's reference frame. (positive = left) |
thetaVel | the angular velocity of the robot in the robot's reference frame, in rad/sec. (positive = CCW) |
- Returns
- the speeds and angles of the robot's wheels in the robot's reference frame.
◆ wheelVelToRobotVel()
pose_t kinematics::SwerveDriveKinematics::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 translational velocity and angular velocity in the robot's reference frame.
- Parameters
-
wheelVel | the struct containing the speeds and angles of the robot's wheels in the robot's reference frame. |
- Returns
- the robot's translational and angular velocity in the robot's reference frame.
The documentation for this class was generated from the following files: