-
Notifications
You must be signed in to change notification settings - Fork 4
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
Some of the IK Fixes From CIRC #338
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
src/TunePID.cpp
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now you can just remove this
src/TunePID.cpp
Outdated
@@ -159,7 +166,7 @@ int main(int argc, char** argv) { | |||
if (mode == targetmode_t::step) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make this a static_cast
@@ -1,5 +1,6 @@ | |||
#pragma once | |||
|
|||
#include <algorithm> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this include needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.cpp
file, which will be addressed in another PR.