Skip to content

Commit

Permalink
fix(gripper): gripper simulator (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Sep 20, 2023
1 parent fb65580 commit ad507bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class BrushedMotorInterruptDriver {
}
handler.run_interrupt();

} while (handler.motor_state ==
brushed_motor_handler::ControlState::ACTIVE);
} while (iface.get_motor_state() ==
BrushedMotorState::FORCE_CONTROLLING);
LOG("Move completed. Stopping interrupt simulation..");
}
}
Expand Down
4 changes: 4 additions & 0 deletions include/motor-control/simulation/sim_motor_hardware_iface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ class SimBrushedMotorHardwareIface
void disable_encoder() final {}
void enable_encoder() final {}

void set_motor_state(BrushedMotorState state) final { motor_state = state; }
auto get_motor_state() -> BrushedMotorState final { return motor_state; }

private:
bool stay_enabled = false;
bool limit_switch_status = false;
Expand All @@ -199,6 +202,7 @@ class SimBrushedMotorHardwareIface
MoveMessageHardware _id;
bool estop_detected = false;
std::atomic<bool> cancel_request = false;
BrushedMotorState motor_state = BrushedMotorState::UNHOMED;
motor_hardware::UsageEEpromConfig eeprom_config{
std::array<UsageRequestSet, 1>{UsageRequestSet{
.eeprom_key = 0,
Expand Down

0 comments on commit ad507bf

Please sign in to comment.