Conversation
huttongrabiel
left a comment
There was a problem hiding this comment.
Nice! Just a couple super minor things. I think it would be smart to test this on hardware if possible (though it may not be because things have changed).
| can::motor::setMotorMode(serial, can::motor::motormode_t::pid); | ||
| can::motor::setMotorPIDConstants(serial, p_coeff, i_coeff, d_coeff); | ||
|
|
||
| // can::motor::setMotorPIDMaxPower(serial, 32767); // this was here from circ |
There was a problem hiding this comment.
For now you can just remove this
| prescaled_target = round(prescaled_target); | ||
| } | ||
| angle_target = (int32_t) round(amplitude * prescaled_target) + starting_angle; | ||
| angle_target = (int32_t)round(amplitude * prescaled_target) + starting_angle; |
There was a problem hiding this comment.
can you make this a static_cast
| @@ -1,5 +1,6 @@ | |||
| #pragma once | |||
|
|
|||
| #include <algorithm> | |||
There was a problem hiding this comment.
Is this include needed?
There was a problem hiding this comment.
The std::transform function is from the algorithm header. It should have been there to begin with, and I assume that one of the other headers includes it, but we probably shouldn't rely on other headers to include what we want
| {{motorid_t::shoulder, {70, 0, 0}}, | ||
| {{motorid_t::shoulder, {200, 0, 0}}, | ||
| {motorid_t::elbow, {250, 0, 0}}, | ||
| // swerve constants need to be updated when firmware changes PID scaling |
There was a problem hiding this comment.
Can you mark this a FIXME and then also state that the numbers should be in the 100s?
Most of the changes from the IK fixes from CIRC 723c6fd are addressed in this PR. The exception is with the sleep function in the
TunePID.cppfile, which will be addressed in another PR.