Skip to content

Commit

Permalink
fix pipette lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Jul 14, 2023
1 parent 3e5ab17 commit e3feadb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class MotorInterruptHandler {
public:
using MoveQueue = QueueImpl<MotorMoveMessage>;
using UpdatePositionQueue = QueueImpl<UpdatePositionMessage>;
// using PositionEstimateResponse = typename UpdatePositionMessage::Response;
MotorInterruptHandler() = delete;
MotorInterruptHandler(MoveQueue& incoming_move_queue,
StatusClient& outgoing_queue,
Expand Down Expand Up @@ -511,7 +510,7 @@ class MotorInterruptHandler {
* message and update the motor position if such a message exists.
*/
auto handle_update_position_queue() -> void {
UpdatePositionMessage msg;
UpdatePositionMessage msg = {};

if (update_position_queue.try_read_isr(&msg)) {
auto encoder_pulses = hardware.get_encoder_pulses();
Expand All @@ -533,23 +532,13 @@ class MotorInterruptHandler {
MotorPositionStatus::Flags::stepper_position_ok);
}
// We send an ack even if the position wasn't updated

// if (!hardware.has_encoder()) {
// auto ack = motor_messages::UpdateGearMotorPositionResponse{
// .message_index = msg.message_index,
// .stepper_position_counts = hardware.get_step_tracker()};
// static_cast<void>(
// status_queue_client.send_move_status_reporter_queue(ack));
// }
// else {
auto ack = UpdatePositionResponse{
.message_index = msg.message_index,
.stepper_position_counts = hardware.get_step_tracker(),
.encoder_pulses = encoder_pulses,
.position_flags = hardware.position_flags.get_flags()};
static_cast<void>(
status_queue_client.send_move_status_reporter_queue(ack));
// }
}
}

Expand All @@ -564,7 +553,7 @@ class MotorInterruptHandler {
return;
}

UpdatePositionMessage msg;
UpdatePositionMessage msg = {};
if (update_position_queue.try_read_isr(&msg)) {
auto response = can::messages::ErrorMessage{
.message_index = msg.message_index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ class MoveStatusMessageHandler {
.message_index = message.message_index,
.current_position = fixed_point_multiply(
um_per_step, message.stepper_position_counts),
// .encoder_position = fixed_point_multiply(
// um_per_encoder_pulse, message.encoder_pulses, radix_offset_0{}),
// .position_flags = message.position_flags
.encoder_position = fixed_point_multiply(
um_per_encoder_pulse, message.encoder_pulses,
radix_offset_0{}),
.position_flags = message.position_flags
};
can_client.send_can_message(can::ids::NodeId::host, msg);
}
Expand Down

0 comments on commit e3feadb

Please sign in to comment.