Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Add curvature drive#486

Merged
Octogonapus merged 4 commits into
OkapiLib:masterfrom
Ryan4253:master
Jun 6, 2022
Merged

Add curvature drive#486
Octogonapus merged 4 commits into
OkapiLib:masterfrom
Ryan4253:master

Conversation

@Ryan4253
Copy link
Copy Markdown
Contributor

@Ryan4253 Ryan4253 commented Jun 3, 2022

Description of the Change

Adds curvature drive (aka cheesy drive) into OkapiLib. It is similar to arcade, but instead of having the right stick control the rate of heading change, it controls the curvature of the path the robot drives in. This allows the robot to turn at a constant rate regardless of how fast your robot is moving, which allows better control under high speeds. A quick demo can be found here.

The implementation is mostly adapted from wpilib (DifferentialDrive.cpp)

Motivation

From our team's year long usage curvature drive is very nice to drive with especially with high speed chassis. I think a lot of teams will find it useful.

Possible Drawbacks

Not that I can think of.

Verification Process

Unit tests were added and passed.
The same code were used on our robot last year and no issues occurred.

Applicable Issues

None, this is a new feature

Copy link
Copy Markdown
Member

@baylessj baylessj left a comment

Choose a reason for hiding this comment

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

Added a few requests for cleanup to this PR.

I don't intend this as a requirement for completing this PR or anything, but I'm curious about your opinions on difference in performance between WPILib's curvature drive here and 254's Cheesy Drive (an example implementation for VEX here: https://github.com/purduesigbots/forkner-public/blob/62e1328b7902715035357622d81e4a35cb15ff2f/src/libforkner/drive.cpp#L303). Cheesy Drive is quite a bit more complicated, but I found it to drive really nicely when I competed. I never gave WPILib's more basic curvature drive a shot though, so I'd be interested in your feedback if you could compare the two at some point.

Comment thread src/api/chassis/model/hDriveModel.cpp Outdated
Comment thread src/api/chassis/model/hDriveModel.cpp Outdated
Comment thread src/api/chassis/model/hDriveModel.cpp
@jazonshou
Copy link
Copy Markdown
Contributor

WPILib's curvature drive here and 254's Cheesy Drive

Yeah, I agree, they certainly are different. I'm not 100% certain about this, but I'm pretty sure cheesy drive first originated as the current WPILib implementation of the curvature drive. Then, as seasons progressed, 254 added extra features like slew controllers to make driving smoother.

I think it could be interesting to see how much improvement the extra features from cheesy drive make. But being someone who has both driven VEX and FRC robots, I will say that FRC robots are much harder to control. So there is a possibility that cheesy drive might be too much for VEX robots.

Copy link
Copy Markdown
Member

@baylessj baylessj left a comment

Choose a reason for hiding this comment

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

The changes look good to me! Looks like there were a number of places in the project that hadn't gotten clang-format run on them recently... not sure if it matters that those changes are being added in this PR vs. a dedicated formatting one.

@Octogonapus Octogonapus added the enhancement New feature or request label Jun 6, 2022
@Octogonapus Octogonapus enabled auto-merge (squash) June 6, 2022 22:21
@Octogonapus Octogonapus merged commit d92f307 into OkapiLib:master Jun 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants