Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gripper): gripper simulator #726

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading