Closed naterpotatoers closed 2 years ago
I noticed that speed is measured in RPM, is there away to send percentages to the motor? Or is there a max/min RPM you have in mind
Not sure about percentages, but for min/max maybe we can start out with +/-100rpm ? We can always change it later
done
Now that we have logic for SetAngle and SetSpeed we need to consider minimum and maximums. For example there is no max or minimum speed for speed so someone could theoretically set the arm speed to 9999999999999 and kill our robot or something. For angle we do have max and min defined however the logic for containing it is a bit hard to follow e.g.
calibrated_angle = units::math::min( units::math::max(calibrated_angle, minimum_angle), maximum_angle);
Ideally we should usestd::clamp()
as it is how it is done in Wheel.hpp. It looks a lot cleaner and would keep our code consistent. Once that is implemented consider writing unit tests verifying that setting the angle beyond max & min works as intended.