Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiffDriveKinematics: Scale wheel velocity to stay below max speed #285

Merged
merged 10 commits into from
Dec 30, 2023

Conversation

huttongrabiel
Copy link
Contributor

Sometimes we want to scale the wheel velocity so that we focus more on rotational velocity or linear velocity. There are cases where the given theta velocity and linear velocity result in a wheel speed too great for the rover.

@huttongrabiel huttongrabiel force-pushed the ensure-drive-kinematics branch 3 times, most recently from dc61c63 to f2d42a9 Compare November 28, 2023 02:34
src/kinematics/DiffDriveKinematics.h Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
@huttongrabiel huttongrabiel force-pushed the ensure-drive-kinematics branch from f2d42a9 to 29b99c6 Compare December 5, 2023 02:39
@huttongrabiel huttongrabiel requested a review from abhaybd December 5, 2023 02:40
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, just some quick fixes needed

src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.h Outdated Show resolved Hide resolved
tests/kinematics/DiffDriveKinematicsTest.cpp Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
@huttongrabiel huttongrabiel force-pushed the ensure-drive-kinematics branch from 50d3a95 to 023b712 Compare December 25, 2023 23:00
@huttongrabiel huttongrabiel marked this pull request as ready for review December 25, 2023 23:20
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! Everything mostly looks good, just some notes about using std::abs instead of abs, and then some minor nitpicks beyond that.

src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
tests/kinematics/DiffDriveKinematicsTest.cpp Outdated Show resolved Hide resolved
tests/kinematics/DiffDriveKinematicsTest.cpp Outdated Show resolved Hide resolved
tests/kinematics/DiffDriveKinematicsTest.cpp Outdated Show resolved Hide resolved
tests/kinematics/DiffDriveKinematicsTest.cpp Show resolved Hide resolved
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just I think a minor thing then should be good to go

src/kinematics/DiffDriveKinematics.cpp Outdated Show resolved Hide resolved
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice job on this!

@abhaybd abhaybd merged commit ae16c8b into master Dec 30, 2023
3 checks passed
@abhaybd abhaybd deleted the ensure-drive-kinematics branch December 30, 2023 02:22
Geeoon pushed a commit that referenced this pull request Jan 8, 2024
* DiffDriveKinematics: Scale wheel velocity to stay below max speed

Sometimes we want to scale the wheel velocity so that we focus more on
rotational velocity or linear velocity. There are cases where the given
theta velocity and linear velocity result in a wheel speed too great for
the rover.

* Make corrections to math + implement proportional + tests

* remove trailing comma to maybe fix clang-format

* add comma back

* Correct proportional scaling + cleanup + some work on tests

* Tests: Add tests for preferxvel diff drive kinematic scaling

* Tests: Add tests for preferthetavel in diffdrive kinematics

* Kinematics: Remove unnecessary include

* DiffDriveKinematics: Clean up + add test for thetaVel being too large

* Add missing break + make immutable values const
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants