Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Geeoon committed Nov 9, 2024
1 parent 6625039 commit 9af9303
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/TunePID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ int main(int argc, char** argv) {
int d_coeff = std::stoi(str);

can::motor::setMotorPIDConstants(serial, p_coeff, i_coeff, d_coeff);
// can::motor::setMotorPIDMaxPower(serial, 32767); // this was here from circ
can::motor::setMotorMode(serial, can::motor::motormode_t::pid);
double period = 8.0;

Expand Down Expand Up @@ -167,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 = static_cast<int32_t>(round(amplitude * prescaled_target)) + starting_angle;

can::motor::setMotorPIDTarget(serial, angle_target);

Expand Down
3 changes: 2 additions & 1 deletion src/world_interface/real_world_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ constexpr auto motorSerialIDMap = frozen::make_unordered_map<motorid_t, can::dev
constexpr auto motorPIDMap = frozen::make_unordered_map<motorid_t, pidcoef_t>(
{{motorid_t::shoulder, {200, 0, 0}},
{motorid_t::elbow, {250, 0, 0}},
// swerve constants need to be updated when firmware changes PID scaling
// FIXME: swerve constants need to be updated when firmware changes PID scaling
// Numbers should be 200
{motorid_t::frontLeftSwerve, {2, 0, 0}},
{motorid_t::frontRightSwerve, {2, 0, 0}},
{motorid_t::rearLeftSwerve, {2, 0, 0}},
Expand Down

0 comments on commit 9af9303

Please sign in to comment.