Skip to content

Commit

Permalink
addressing nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Nov 7, 2024
1 parent 124658f commit 911b4da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions stm32-modules/include/common/core/linear_motion_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@

namespace lms {

class BeltConfig {
public:
struct BeltConfig {
static constexpr auto mm_per_rev(float pulley_diameter) -> float {
return static_cast<float>(pulley_diameter * std::numbers::pi);
}
};

class LeadScrewConfig {
public:
struct LeadScrewConfig {
static constexpr auto mm_per_rev(float lead_screw_pitch,
float gear_reduction_ratio) -> float {
return lead_screw_pitch / gear_reduction_ratio;
}
};

class GearBoxConfig {
public:
struct GearBoxConfig {
static constexpr auto mm_per_rev(float gear_diameter,
float gear_reduction_ratio) -> float {
return static_cast<float>((gear_diameter * std::numbers::pi) /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class MotorTask {
// sent from the driver task so we know we've written to driver
// successfully
motor_state(m.motor_id).lms_config.microstep =
static_cast<float>(pow(2, m.microsteps_power));
pow(2, m.microsteps_power);
auto response = messages::AcknowledgePrevious{.responding_to_id = m.id};
static_cast<void>(_task_registry->send_to_address(
response, Queues::HostCommsAddress));
Expand Down

0 comments on commit 911b4da

Please sign in to comment.