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

Some of the IK Fixes From CIRC #338

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Some of the IK Fixes From CIRC #338

wants to merge 11 commits into from

Conversation

Geeoon
Copy link
Member

@Geeoon Geeoon commented Nov 2, 2024

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.

Copy link
Contributor

@huttongrabiel huttongrabiel left a 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
Copy link
Contributor

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;
Copy link
Contributor

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>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this include needed?

Copy link
Member Author

@Geeoon Geeoon Nov 9, 2024

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
Copy link
Contributor

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?

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