Add curvature drive#486
Conversation
baylessj
left a comment
There was a problem hiding this comment.
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.
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. |
baylessj
left a comment
There was a problem hiding this comment.
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.
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