Skip to content

Commit

Permalink
fix(gripper): add GripperJawStateRequest to gripper can task & do not…
Browse files Browse the repository at this point in the history
… disable brushed motor if it was set to stay engaged (#719)

* add GripperJawStateRequest to gripper can task

* no disengaging motor in stop request
  • Loading branch information
ahiuchingau authored Sep 11, 2023
1 parent fcada6f commit ae4a7ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion include/can/core/message_handlers/motion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class BrushedMotionHandler {
using MessageType =
std::variant<std::monostate, DisableMotorRequest, EnableMotorRequest,
ReadLimitSwitchRequest, MotorPositionRequest,
SetGripperErrorToleranceRequest, GetMotorUsageRequest>;
SetGripperErrorToleranceRequest, GetMotorUsageRequest,
GripperJawStateRequest>;

BrushedMotionHandler(BrushedMotionTaskClient &motion_client)
: motion_client{motion_client} {}
Expand Down
2 changes: 1 addition & 1 deletion include/gripper/core/can_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using BrushedMotionDispatchTarget = can::dispatch::DispatchParseTarget<
can::messages::DisableMotorRequest, can::messages::EnableMotorRequest,
can::messages::ReadLimitSwitchRequest, can::messages::MotorPositionRequest,
can::messages::SetGripperErrorToleranceRequest,
can::messages::GetMotorUsageRequest>;
can::messages::GetMotorUsageRequest, can::messages::GripperJawStateRequest>;
using BrushedMoveGroupDispatchTarget = can::dispatch::DispatchParseTarget<
can::message_handlers::move_group::BrushedMoveGroupHandler<
g_tasks::QueueClient>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ class MotionController {
queue.reset();
// if we're gripping something we need to flag this so we don't drop it
if (!hardware.get_stay_enabled()) {
disable_motor();
}
if (hardware.is_timer_interrupt_running()) {
hardware.request_cancel();
if (hardware.is_timer_interrupt_running()) {
hardware.request_cancel();
}
}
}

Expand Down

0 comments on commit ae4a7ff

Please sign in to comment.