-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(gripper): add stay engaged param to grip message #711
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1005,26 +1005,34 @@ struct GripperGripRequest : BaseMessage<MessageId::gripper_grip_request> { | |
uint8_t seq_id; | ||
brushed_timer_ticks duration; | ||
uint32_t duty_cycle; | ||
int32_t encoder_position_um; | ||
uint8_t stay_engaged; | ||
|
||
template <bit_utils::ByteIterator Input, typename Limit> | ||
static auto parse(Input body, Limit limit) -> GripperGripRequest { | ||
uint8_t group_id = 0; | ||
uint8_t seq_id = 0; | ||
brushed_timer_ticks duration = 0; | ||
uint32_t duty_cycle = 0; | ||
int32_t encoder_position_um = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we adding this here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's always part of the payload of the generic gripper move messages, but we never defined it because it is always 0 for the gripper grip request |
||
uint8_t stay_engaged = 0; | ||
uint32_t msg_ind = 0; | ||
|
||
body = bit_utils::bytes_to_int(body, limit, msg_ind); | ||
body = bit_utils::bytes_to_int(body, limit, group_id); | ||
body = bit_utils::bytes_to_int(body, limit, seq_id); | ||
body = bit_utils::bytes_to_int(body, limit, duration); | ||
body = bit_utils::bytes_to_int(body, limit, duty_cycle); | ||
body = bit_utils::bytes_to_int(body, limit, encoder_position_um); | ||
body = bit_utils::bytes_to_int(body, limit, stay_engaged); | ||
|
||
return GripperGripRequest{.message_index = msg_ind, | ||
.group_id = group_id, | ||
.seq_id = seq_id, | ||
.duration = duration, | ||
.duty_cycle = duty_cycle}; | ||
.duty_cycle = duty_cycle, | ||
.encoder_position_um = encoder_position_um, | ||
.stay_engaged = stay_engaged}; | ||
} | ||
|
||
auto operator==(const GripperGripRequest& other) const -> bool = default; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we adding this in the request from host?