Conversation
|
|
||
| #include "utils/angle.hpp" | ||
| #include "utils/debug.hpp" | ||
| #include "utils/flags.hpp" |
There was a problem hiding this comment.
warning: included header debug.hpp is not used directly [misc-include-cleaner]
| #include "utils/flags.hpp" | |
| #include "utils/flags.hpp" |
|
|
||
| class BoomerangController : public AbstractController { | ||
| public: | ||
| enum class ThruBehavior { // affects calculation of lin_speed on thru movements |
There was a problem hiding this comment.
warning: enum 'ThruBehavior' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class ThruBehavior { // affects calculation of lin_speed on thru movements
^| MIN_VEL, // use linear PID, but enforce a minimum velocity | ||
| FULL_SPEED // no PID, go full speed | ||
| }; | ||
| enum class CosineScaling { |
There was a problem hiding this comment.
warning: enum 'CosineScaling' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class CosineScaling {
^| MIN_ERR, // only do cosine scaling within the minimum err | ||
| ALL_THE_TIME // do cosine scaling all the time | ||
| }; | ||
| enum class MinErrBehavior { |
There was a problem hiding this comment.
warning: enum 'MinErrBehavior' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class MinErrBehavior {
^|
|
||
| double min_vel; | ||
|
|
||
| ThruBehavior thru_behavior = ThruBehavior::FULL_SPEED; |
There was a problem hiding this comment.
warning: member variable 'thru_behavior' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
ThruBehavior thru_behavior = ThruBehavior::FULL_SPEED;
^| target.theta}; | ||
| dx = carrotPoint.x - current_pos.x; | ||
| dy = carrotPoint.y - current_pos.y; | ||
| Point carrot_point; |
There was a problem hiding this comment.
warning: uninitialized record type: 'carrot_point' [cppcoreguidelines-pro-type-member-init]
| Point carrot_point; | |
| Point carrot_point{}; |
| target.theta}; | ||
| dx = carrotPoint.x - current_pos.x; | ||
| dy = carrotPoint.y - current_pos.y; | ||
| Point carrot_point; |
There was a problem hiding this comment.
warning: variable 'carrot_point' of type 'Point' can be declared 'const' [misc-const-correctness]
| Point carrot_point; | |
| Point const carrot_point; |
| dx = carrotPoint.x - current_pos.x; | ||
| dy = carrotPoint.y - current_pos.y; | ||
| Point carrot_point; | ||
| if (!reverse) { |
There was a problem hiding this comment.
warning: if with identical then and else branches [bugprone-branch-clone]
if (!reverse) {
^Additional context
src/VOSS/controller/BoomerangController.cpp:36: else branch starts here
} else {
^| if (thru) { | ||
| lin_speed = copysign(fmax(fabs(lin_speed), this->min_vel), lin_speed); | ||
| if (thru_behavior == ThruBehavior::FULL_SPEED) { | ||
| lin_speed = 100; |
There was a problem hiding this comment.
warning: 100 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
lin_speed = 100;
^| double ang_speed; | ||
| if (distance_error < min_error) { | ||
| this->can_reverse = true; | ||
| double pose_error = voss::norm_delta(target_angle - current_angle); |
There was a problem hiding this comment.
warning: variable 'pose_error' of type 'double' can be declared 'const' [misc-const-correctness]
| double pose_error = voss::norm_delta(target_angle - current_angle); | |
| double const pose_error = voss::norm_delta(target_angle - current_angle); |
No description provided.