Skip to content

Commit

Permalink
Merge branch 'master' into add-drill-actuator
Browse files Browse the repository at this point in the history
  • Loading branch information
jazonshou authored Jan 28, 2025
2 parents 7c6798d + 1b6bd7f commit 8ad4deb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/TunePID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const std::map<motorid_t, std::string> motorNameMap = {
{motorid_t::wristDiffLeft, "wristDiffLeft"},
{motorid_t::hand, "hand"},
{motorid_t::activeSuspension, "activeSuspension"},
{motorid_t::drillActuator, "drillActuator"}};
{motorid_t::drillActuator, "drillActuator"},
{motorid_t::drillMotor, "drillMotor"}};

const std::map<std::string, motorid_t> nameToMotorMap = reverseMap(motorNameMap);

Expand Down
3 changes: 2 additions & 1 deletion src/world_interface/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ enum class motorid_t {
wristDiffLeft,
hand,
activeSuspension,
drillActuator
drillActuator,
drillMotor
};

/** @brief the mounted peripheral on the robot. */
Expand Down
9 changes: 6 additions & 3 deletions src/world_interface/real_world_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ constexpr auto motorSerialIDMap = frozen::make_unordered_map<motorid_t, can::dev
{motorid_t::wristDiffRight, DEVICE_SERIAL_MOTOR_WRIST_DIFF_RIGHT},
{motorid_t::hand, DEVICE_SERIAL_MOTOR_HAND},
{motorid_t::activeSuspension, DEVICE_SERIAL_LINEAR_ACTUATOR},
{motorid_t::drillActuator, DEVICE_SERIAL_DRILL_ARM_MOTOR}});
{motorid_t::drillActuator, DEVICE_SERIAL_DRILL_ARM_MOTOR},
{motorid_t::drillMotor, DEVICE_SERIAL_DRILL_MOTOR}});

/** @brief A mapping of PID controlled motors to their pid coefficients. */
constexpr auto motorPIDMap = frozen::make_unordered_map<motorid_t, pidcoef_t>(
Expand Down Expand Up @@ -134,7 +135,8 @@ constexpr auto positive_pwm_scales =
{motorid_t::rearRightSwerve, 1.0},
{motorid_t::hand, -0.75},
{motorid_t::activeSuspension, -0.5},
{motorid_t::drillActuator, -0.5}});
{motorid_t::drillActuator, -0.5},
{motorid_t::drillMotor, 1.0}});
/**
* @brief A mapping of motorids to power scale factors when commanded with negative power.
* Negative values mean that the motor is inverted.
Expand All @@ -156,6 +158,7 @@ constexpr auto negative_pwm_scales =
{motorid_t::rearRightSwerve, 1.0},
{motorid_t::hand, -0.75},
{motorid_t::activeSuspension, -0.5},
{motorid_t::drillActuator, -0.5}});
{motorid_t::drillActuator, -0.5},
{motorid_t::drillMotor, 1.0}});

} // namespace robot

0 comments on commit 8ad4deb

Please sign in to comment.