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

Add angular PID to ArcPIDController, fix issue with SettleExitCondition #89

Merged
merged 1 commit into from
Mar 23, 2024

Conversation

AndrewLuGit
Copy link
Contributor

No description provided.

@AndrewLuGit AndrewLuGit requested a review from Rocky14683 March 22, 2024 22:41
@AndrewLuGit AndrewLuGit changed the title Add angular PID to ArcPIDController, fix isue with SettleExitCondition Add angular PID to ArcPIDController, fix issue with SettleExitCondition Mar 22, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -10,9 +10,12 @@ class ArcPIDController : public AbstractController {
protected:
std::shared_ptr<ArcPIDController> p;
utils::PID linear_pid;
utils::PID angular_pid;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: member variable 'angular_pid' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

    utils::PID angular_pid;
               ^

double track_width;
double min_error;
double can_reverse;
double arc_radius;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: member variable 'arc_radius' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

    double arc_radius;
           ^

double track_width;
double min_error;
double can_reverse;
double arc_radius;
Point arc_center;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: member variable 'arc_center' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

    Point arc_center;
          ^

@@ -18,6 +18,7 @@ class ArcPIDControllerBuilder {

ArcPIDControllerBuilder& with_linear_constants(double kP, double kI,
double kD);
ArcPIDControllerBuilder& with_angular_constants(double kP, double kI, double kD);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: parameter name 'kP' is too short, expected at least 3 characters [readability-identifier-length]

    ArcPIDControllerBuilder& with_angular_constants(double kP, double kI, double kD);
                                                           ^

@@ -18,6 +18,7 @@ class ArcPIDControllerBuilder {

ArcPIDControllerBuilder& with_linear_constants(double kP, double kI,
double kD);
ArcPIDControllerBuilder& with_angular_constants(double kP, double kI, double kD);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: parameter name 'kI' is too short, expected at least 3 characters [readability-identifier-length]

    ArcPIDControllerBuilder& with_angular_constants(double kP, double kI, double kD);
                                                                      ^

.with_linear_constants(20, 0.02, 169)
.with_angular_constants(250, 0.05, 2435)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 2435 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]

               .with_angular_constants(250, 0.05, 2435)
                                                  ^

.with_min_error(5)
.with_slew(8)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]

               .with_slew(8)
                          ^

master.rumble("--");
chassis.turn(0);
printf("end\n");
odom->set_pose({0.0, 0.0, 90});
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 90 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]

            odom->set_pose({0.0, 0.0, 90});
                                      ^

chassis.turn(0);
printf("end\n");
odom->set_pose({0.0, 0.0, 90});
chassis.move({-24, 24}, arc);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 24 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]

            chassis.move({-24, 24}, arc);
                           ^

chassis.turn(0);
printf("end\n");
odom->set_pose({0.0, 0.0, 90});
chassis.move({-24, 24}, arc);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 24 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]

            chassis.move({-24, 24}, arc);
                               ^

Copy link
Member

@Rocky14683 Rocky14683 left a comment

Choose a reason for hiding this comment

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

LGTM

@Rocky14683 Rocky14683 merged commit 51a9b87 into master Mar 23, 2024
3 checks passed
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