diff --git a/.github/workflows/cross-compile-special-sensors.yaml b/.github/workflows/cross-compile-special-sensors.yaml index ff1038851..355e067ac 100644 --- a/.github/workflows/cross-compile-special-sensors.yaml +++ b/.github/workflows/cross-compile-special-sensors.yaml @@ -24,6 +24,7 @@ jobs: pipettes-single, pipettes-multi, pipettes-96, + gripper, ] fail-fast: false name: Build ${{ matrix.target }} @@ -89,6 +90,7 @@ jobs: matrix: target: [ pipettes, + gripper, ] steps: - name: Checkout ot3-firmware repo diff --git a/CMakePresets.json b/CMakePresets.json index 6dbf1c62d..44b3d417d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -42,7 +42,7 @@ "installDir": "${sourceDir}/dist-sensor", "binaryDir": "${sourceDir}/build-cross-sensor", "cacheVariables": { - "USE_PRESSURE_MOVE": true + "USE_SENSOR_MOVE": true }, "inherits": "cross" }, diff --git a/common/core/CMakeLists.txt b/common/core/CMakeLists.txt index 2cb65af42..1f6564e5a 100644 --- a/common/core/CMakeLists.txt +++ b/common/core/CMakeLists.txt @@ -54,7 +54,7 @@ function(add_revision) message(STATUS "add_revision has target ${_ar_TARGET} and revision ${_ar_REVISION}") string(SUBSTRING ${_ar_REVISION} 0 1 PRIMARY_REVISION) string(SUBSTRING ${_ar_REVISION} 1 1 SECONDARY_REVISION) - if (${USE_PRESSURE_MOVE}) + if (${USE_SENSOR_MOVE}) set(TERTIARY_FLAG "'1'") else() set(TERTIARY_FLAG "0x00") diff --git a/gripper/core/CMakeLists.txt b/gripper/core/CMakeLists.txt index fb8705cbf..9089fc917 100644 --- a/gripper/core/CMakeLists.txt +++ b/gripper/core/CMakeLists.txt @@ -1,4 +1,9 @@ function(target_gripper_core TARGET) + if(${USE_SENSOR_MOVE}) + target_compile_definitions(${TARGET} PUBLIC USE_SENSOR_MOVE) + target_compile_definitions(${TARGET} PUBLIC P_BUFF_SIZE=1700) + target_compile_definitions(${TARGET} PUBLIC USE_TWO_BUFFERS=true) + endif() target_sources(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_tasks.cpp ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/tasks.cpp diff --git a/gripper/core/tasks.cpp b/gripper/core/tasks.cpp index cd16770c6..da192c96d 100644 --- a/gripper/core/tasks.cpp +++ b/gripper/core/tasks.cpp @@ -16,6 +16,10 @@ static auto tasks = gripper_tasks::AllTask{}; static auto queues = gripper_tasks::QueueClient{can::ids::NodeId::gripper}; +static std::array p_buff; +#ifdef USE_TWO_BUFFERS +static std::array p_buff_front; +#endif static auto eeprom_task_builder = freertos_task::TaskStarter<512, eeprom::task::EEPromTask>{}; @@ -95,11 +99,16 @@ void gripper_tasks::start_tasks( auto& capacitive_sensor_task_front = capacitive_sensor_task_builder_front.start( 5, "cap sensor S1", i2c2_task_client, i2c2_poll_client, - sensor_hardware, queues); + sensor_hardware, queues, +#ifdef USE_TWO_BUFFERS + p_buff_front); +#else + p_buff); +#endif auto& capacitive_sensor_task_rear = capacitive_sensor_task_builder_rear.start( 5, "cap sensor S0", i2c3_task_client, i2c3_poll_client, - sensor_hardware, queues); + sensor_hardware, queues, p_buff); tasks.i2c2_task = &i2c2_task; tasks.i2c3_task = &i2c3_task; @@ -152,6 +161,16 @@ void gripper_tasks::QueueClient::send_capacitive_sensor_queue_rear( capacitive_sensor_queue_rear->try_write(m); } +void gripper_tasks::QueueClient::send_capacitive_sensor_queue_front_isr( + const sensors::utils::TaskMessage& m) { + std::ignore = capacitive_sensor_queue_front->try_write_isr(m); +} + +void gripper_tasks::QueueClient::send_capacitive_sensor_queue_rear_isr( + const sensors::utils::TaskMessage& m) { + std::ignore = capacitive_sensor_queue_rear->try_write_isr(m); +} + // gripper does not have environment nor pressure sensor void gripper_tasks::QueueClient::send_environment_sensor_queue( const sensors::utils::TaskMessage&) {} @@ -159,6 +178,10 @@ void gripper_tasks::QueueClient::send_pressure_sensor_queue_front( const sensors::utils::TaskMessage&) {} void gripper_tasks::QueueClient::send_pressure_sensor_queue_rear( const sensors::utils::TaskMessage&) {} +void gripper_tasks::QueueClient::send_pressure_sensor_queue_front_isr( + const sensors::utils::TaskMessage&) {} +void gripper_tasks::QueueClient::send_pressure_sensor_queue_rear_isr( + const sensors::utils::TaskMessage&) {} void gripper_tasks::QueueClient::send_tip_notification_queue_rear( const sensors::tip_presence::TaskMessage&) {} @@ -176,3 +199,7 @@ auto gripper_tasks::get_all_tasks() -> AllTask& { return tasks; } * @return */ auto gripper_tasks::get_main_queues() -> QueueClient& { return queues; } + +auto sensor_tasks::get_queues() -> gripper_tasks::QueueClient& { + return queues; +} diff --git a/gripper/firmware/interfaces_z_motor.cpp b/gripper/firmware/interfaces_z_motor.cpp index c9c43c9a9..69405dfde 100644 --- a/gripper/firmware/interfaces_z_motor.cpp +++ b/gripper/firmware/interfaces_z_motor.cpp @@ -150,8 +150,14 @@ static tmc2130::configs::TMC2130DriverConfig MotorDriverConfigurations{ /** * The pending move queue */ +#ifdef USE_SENSOR_MOVE +static freertos_message_queue::FreeRTOSMessageQueue< + motor_messages::SensorSyncMove> + motor_queue("Motor Queue"); +#else static freertos_message_queue::FreeRTOSMessageQueue motor_queue("Motor Queue"); +#endif static freertos_message_queue::FreeRTOSMessageQueue< can::messages::UpdateMotorPositionEstimationRequest> diff --git a/include/bootloader/core/ids.h b/include/bootloader/core/ids.h index b3c7ae1b9..10e6078b9 100644 --- a/include/bootloader/core/ids.h +++ b/include/bootloader/core/ids.h @@ -114,7 +114,7 @@ typedef enum { can_messageid_peripheral_status_request = 0x8c, can_messageid_peripheral_status_response = 0x8d, can_messageid_baseline_sensor_response = 0x8e, - can_messageid_send_accumulated_pressure_data = 0x8f, + can_messageid_send_accumulated_sensor_data = 0x8f, can_messageid_set_hepa_fan_state_request = 0x90, can_messageid_get_hepa_fan_state_request = 0x91, can_messageid_get_hepa_fan_state_response = 0x92, diff --git a/include/can/core/ids.hpp b/include/can/core/ids.hpp index dad0695f5..8bcee3c42 100644 --- a/include/can/core/ids.hpp +++ b/include/can/core/ids.hpp @@ -116,7 +116,7 @@ enum class MessageId { peripheral_status_request = 0x8c, peripheral_status_response = 0x8d, baseline_sensor_response = 0x8e, - send_accumulated_pressure_data = 0x8f, + send_accumulated_sensor_data = 0x8f, set_hepa_fan_state_request = 0x90, get_hepa_fan_state_request = 0x91, get_hepa_fan_state_response = 0x92, @@ -193,6 +193,7 @@ enum class SensorType { pressure_temperature = 0x4, humidity = 0x5, temperature = 0x6, + UNUSED = 0x7, }; /** Sensor IDs available. diff --git a/include/can/core/message_handlers/move_group.hpp b/include/can/core/message_handlers/move_group.hpp index b29d54fce..55b5f2492 100644 --- a/include/can/core/message_handlers/move_group.hpp +++ b/include/can/core/message_handlers/move_group.hpp @@ -11,7 +11,7 @@ using namespace can::messages; template class MoveGroupHandler { public: -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE using MessageType = std::variant bool = default; }; -struct SendAccumulatedPressureDataRequest - : BaseMessage { +struct SendAccumulatedSensorDataRequest + : BaseMessage { uint32_t message_index = 0; uint8_t sensor_id = 0; + uint8_t sensor_type = 0; template static auto parse(Input body, Limit limit) - -> SendAccumulatedPressureDataRequest { + -> SendAccumulatedSensorDataRequest { uint32_t msg_ind = 0; uint8_t sensor_id = 0; + uint8_t sensor_type = 0; body = bit_utils::bytes_to_int(body, limit, msg_ind); body = bit_utils::bytes_to_int(body, limit, sensor_id); - return SendAccumulatedPressureDataRequest{.message_index = msg_ind, - .sensor_id = sensor_id}; + body = bit_utils::bytes_to_int(body, limit, sensor_type); + return SendAccumulatedSensorDataRequest{.message_index = msg_ind, + .sensor_id = sensor_id, + .sensor_type = sensor_type}; } - auto operator==(const SendAccumulatedPressureDataRequest& other) const + auto operator==(const SendAccumulatedSensorDataRequest& other) const -> bool = default; }; @@ -1737,6 +1741,7 @@ struct AddSensorMoveRequest : BaseMessage { mm_per_tick velocity; uint8_t request_stop_condition; can::ids::SensorId sensor_id{}; + can::ids::SensorType sensor_type{}; template static auto parse(Input body, Limit limit) -> AddSensorMoveRequest { @@ -1748,6 +1753,7 @@ struct AddSensorMoveRequest : BaseMessage { uint8_t request_stop_condition = 0; uint32_t msg_ind = 0; uint8_t sensor_id = 0; + uint8_t sensor_type = 0; body = bit_utils::bytes_to_int(body, limit, msg_ind); body = bit_utils::bytes_to_int(body, limit, group_id); @@ -1757,6 +1763,7 @@ struct AddSensorMoveRequest : BaseMessage { body = bit_utils::bytes_to_int(body, limit, velocity); body = bit_utils::bytes_to_int(body, limit, request_stop_condition); body = bit_utils::bytes_to_int(body, limit, sensor_id); + body = bit_utils::bytes_to_int(body, limit, sensor_type); return AddSensorMoveRequest{ .message_index = msg_ind, .group_id = group_id, @@ -1766,6 +1773,7 @@ struct AddSensorMoveRequest : BaseMessage { .velocity = velocity, .request_stop_condition = request_stop_condition, .sensor_id = static_cast(sensor_id), + .sensor_type = static_cast(sensor_type), }; } diff --git a/include/common/core/sensor_buffer.hpp b/include/common/core/sensor_buffer.hpp new file mode 100644 index 000000000..978d86cca --- /dev/null +++ b/include/common/core/sensor_buffer.hpp @@ -0,0 +1,7 @@ +#pragma once + +#ifdef USE_SENSOR_MOVE +constexpr size_t SENSOR_BUFFER_SIZE = P_BUFF_SIZE; +#else +constexpr size_t SENSOR_BUFFER_SIZE = 0; +#endif diff --git a/include/gripper/core/can_task.hpp b/include/gripper/core/can_task.hpp index 88fd98ca2..e3b3f294c 100644 --- a/include/gripper/core/can_task.hpp +++ b/include/gripper/core/can_task.hpp @@ -19,12 +19,22 @@ using MotorDispatchTarget = can::dispatch::DispatchParseTarget< can::messages::ReadMotorDriverRegister, can::messages::WriteMotorDriverRegister, can::messages::WriteMotorCurrentRequest>; +#ifdef USE_SENSOR_MOVE +using MoveGroupDispatchTarget = can::dispatch::DispatchParseTarget< + can::message_handlers::move_group::MoveGroupHandler, + can::messages::AddLinearMoveRequest, + can::messages::ClearAllMoveGroupsRequest, + can::messages::ExecuteMoveGroupRequest, can::messages::GetMoveGroupRequest, + can::messages::HomeRequest, can::messages::StopRequest, + can::messages::AddSensorMoveRequest>; +#else using MoveGroupDispatchTarget = can::dispatch::DispatchParseTarget< can::message_handlers::move_group::MoveGroupHandler, can::messages::AddLinearMoveRequest, can::messages::ClearAllMoveGroupsRequest, can::messages::ExecuteMoveGroupRequest, can::messages::GetMoveGroupRequest, can::messages::HomeRequest, can::messages::StopRequest>; +#endif using MotionControllerDispatchTarget = can::dispatch::DispatchParseTarget< can::message_handlers::motion::MotionHandler, can::messages::DisableMotorRequest, can::messages::EnableMotorRequest, @@ -65,7 +75,7 @@ using GripperInfoDispatchTarget = can::dispatch::DispatchParseTarget< using SensorDispatchTarget = can::dispatch::DispatchParseTarget< sensors::handlers::SensorHandler, can::messages::TipStatusQueryRequest, can::messages::ReadFromSensorRequest, - can::messages::SendAccumulatedPressureDataRequest, + can::messages::SendAccumulatedSensorDataRequest, can::messages::WriteToSensorRequest, can::messages::BaselineSensorRequest, can::messages::SetSensorThresholdRequest, can::messages::BindSensorOutputRequest, diff --git a/include/gripper/core/tasks.hpp b/include/gripper/core/tasks.hpp index 74d58a7ea..c61ef164b 100644 --- a/include/gripper/core/tasks.hpp +++ b/include/gripper/core/tasks.hpp @@ -67,11 +67,24 @@ struct QueueClient : can::message_writer::MessageWriter { void send_capacitive_sensor_queue_rear( const sensors::utils::TaskMessage& m); + void send_capacitive_sensor_queue_front_isr( + const sensors::utils::TaskMessage& m); + + void send_capacitive_sensor_queue_rear_isr( + const sensors::utils::TaskMessage& m); + void send_environment_sensor_queue(const sensors::utils::TaskMessage& m); void send_pressure_sensor_queue_front(const sensors::utils::TaskMessage& m); + void send_pressure_sensor_queue_rear(const sensors::utils::TaskMessage& m); + void send_pressure_sensor_queue_front_isr( + const sensors::utils::TaskMessage& m); + + void send_pressure_sensor_queue_rear_isr( + const sensors::utils::TaskMessage& m); + void send_tip_notification_queue_rear( const sensors::tip_presence::TaskMessage& m); void send_tip_notification_queue_front( @@ -258,3 +271,7 @@ struct QueueClient : can::message_writer::MessageWriter { } // namespace g_tasks } // namespace gripper_tasks + +namespace sensor_tasks { +[[nodiscard]] auto get_queues() -> gripper_tasks::QueueClient&; +} // namespace sensor_tasks diff --git a/include/motor-control/core/motor_messages.hpp b/include/motor-control/core/motor_messages.hpp index d012507f5..0f77c5dc7 100644 --- a/include/motor-control/core/motor_messages.hpp +++ b/include/motor-control/core/motor_messages.hpp @@ -90,6 +90,7 @@ struct SensorSyncMove { // NOLINT(cppcoreguidelines-pro-type-member-init) int32_t start_encoder_position; uint16_t usage_key; can::ids::SensorId sensor_id; + can::ids::SensorType sensor_type; auto build_ack(uint32_t position, int32_t pulses, uint8_t flags, AckMessageId _id) -> Ack { @@ -119,6 +120,7 @@ struct GearMotorMove // NOLINT(cppcoreguidelines-pro-type-member-init) can::ids::PipetteTipActionType action; can::ids::GearMotorId gear_motor_id; can::ids::SensorId sensor_id; + can::ids::SensorType sensor_type; auto build_ack(uint32_t position, int32_t pulses, uint8_t flags, AckMessageId _id) -> GearMotorAck { return GearMotorAck{message_index, group_id, diff --git a/include/motor-control/core/stepper_motor/motion_controller.hpp b/include/motor-control/core/stepper_motor/motion_controller.hpp index 78d6d9006..9cd1e9c4f 100644 --- a/include/motor-control/core/stepper_motor/motion_controller.hpp +++ b/include/motor-control/core/stepper_motor/motion_controller.hpp @@ -25,7 +25,7 @@ template class MotionController { public: using GenericQueue = -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE freertos_message_queue::FreeRTOSMessageQueue; #else freertos_message_queue::FreeRTOSMessageQueue; @@ -63,7 +63,7 @@ class MotionController { -> const lms::LinearMotionSystemConfig& { return linear_motion_sys_config; } -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE void move(const can::messages::AddSensorMoveRequest& can_msg) { steps_per_tick velocity_steps = fixed_point_multiply(steps_per_mm, can_msg.velocity); @@ -79,7 +79,8 @@ class MotionController { can_msg.request_stop_condition, 0, hardware.get_usage_eeprom_config().get_distance_key(), - can_msg.sensor_id}; + can_msg.sensor_id, + can_msg.sensor_type}; if (!enabled) { enable_motor(); } @@ -100,7 +101,8 @@ class MotionController { .seq_id = can_msg.seq_id, .stop_condition = can_msg.request_stop_condition, .usage_key = hardware.get_usage_eeprom_config().get_distance_key(), - .sensor_id = can::ids::SensorId::UNUSED}; + .sensor_id = can::ids::SensorId::UNUSED, + .sensor_type = can::ids::SensorType::UNUSED}; if (!enabled) { enable_motor(); } @@ -120,7 +122,8 @@ class MotionController { .stop_condition = static_cast(MoveStopCondition::limit_switch), .usage_key = hardware.get_usage_eeprom_config().get_distance_key(), - .sensor_id = can::ids::SensorId::UNUSED}; + .sensor_id = can::ids::SensorId::UNUSED, + .sensor_type = can::ids::SensorType::UNUSED}; if (!enabled) { enable_motor(); } @@ -318,7 +321,8 @@ class PipetteMotionController { hardware.get_step_tracker(), can_msg.action, gear_motor_id, - can::ids::SensorId::UNUSED}; + can::ids::SensorId::UNUSED, + can::ids::SensorType::UNUSED}; if (!enabled) { enable_motor(); diff --git a/include/motor-control/core/stepper_motor/motor.hpp b/include/motor-control/core/stepper_motor/motor.hpp index 20b111fef..b9ff17ee6 100644 --- a/include/motor-control/core/stepper_motor/motor.hpp +++ b/include/motor-control/core/stepper_motor/motor.hpp @@ -18,7 +18,11 @@ using namespace freertos_message_queue; template struct Motor { +#ifdef USE_SENSOR_MOVE + using GenericQueue = FreeRTOSMessageQueue; +#else using GenericQueue = FreeRTOSMessageQueue; +#endif using UpdatePositionQueue = FreeRTOSMessageQueue< can::messages::UpdateMotorPositionEstimationRequest>; diff --git a/include/motor-control/core/stepper_motor/motor_interrupt_handler.hpp b/include/motor-control/core/stepper_motor/motor_interrupt_handler.hpp index 01cb4e881..577d1cb41 100644 --- a/include/motor-control/core/stepper_motor/motor_interrupt_handler.hpp +++ b/include/motor-control/core/stepper_motor/motor_interrupt_handler.hpp @@ -9,9 +9,14 @@ #include "motor-control/core/motor_messages.hpp" #include "motor-control/core/stall_check.hpp" #include "motor-control/core/tasks/move_status_reporter_task.hpp" -#ifdef USE_PRESSURE_MOVE +#include "motor-control/core/tasks/tmc_motor_driver_common.hpp" +#ifdef USE_SENSOR_MOVE +#ifdef PIPETTE_TYPE_DEFINE #include "pipettes/core/sensor_tasks.hpp" -#endif +#else +#include "gripper/core/tasks.hpp" +#endif // PIPETTE_TYPE_DEFINE +#endif // USE_SENSOR_MOVE namespace motor_handler { using namespace motor_messages; @@ -371,17 +376,27 @@ class MotorInterruptHandler { */ return tick_count < buffered_move.duration; } -#ifdef USE_PRESSURE_MOVE - auto send_bind_message(can::ids::SensorId sensor, uint8_t binding) -> void { +#ifdef USE_SENSOR_MOVE + auto send_bind_message(can::ids::SensorType sensor_type, + can::ids::SensorId sensor_id, uint8_t binding) + -> void { auto msg = can::messages::BindSensorOutputRequest{ .message_index = buffered_move.message_index, - .sensor = can::ids::SensorType::pressure, - .sensor_id = sensor, + .sensor = sensor_type, + .sensor_id = sensor_id, .binding = binding}; - if (sensor == can::ids::SensorId::S0) { - send_to_pressure_sensor_queue_rear(msg); - } else { - send_to_pressure_sensor_queue_front(msg); + if (sensor_type == can::ids::SensorType::pressure) { + if (sensor_id == can::ids::SensorId::S0) { + send_to_pressure_sensor_queue_rear(msg); + } else { + send_to_pressure_sensor_queue_front(msg); + } + } else if (sensor_type == can::ids::SensorType::capacitive) { + if (sensor_id == can::ids::SensorId::S0) { + send_to_capacitive_sensor_queue_rear(msg); + } else { + send_to_capacitive_sensor_queue_front(msg); + } } } #endif @@ -391,14 +406,17 @@ class MotorInterruptHandler { hardware.enable_encoder(); buffered_move.start_encoder_position = hardware.get_encoder_pulses(); -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE if (buffered_move.sensor_id != can::ids::SensorId::UNUSED) { auto binding = static_cast(0x3); // sync and report if (buffered_move.sensor_id == can::ids::SensorId::BOTH) { - send_bind_message(can::ids::SensorId::S0, binding); - send_bind_message(can::ids::SensorId::S1, binding); + send_bind_message(buffered_move.sensor_type, + can::ids::SensorId::S0, binding); + send_bind_message(buffered_move.sensor_type, + can::ids::SensorId::S1, binding); } else { - send_bind_message(buffered_move.sensor_id, binding); + send_bind_message(buffered_move.sensor_type, + buffered_move.sensor_id, binding); } } #endif @@ -484,15 +502,18 @@ class MotorInterruptHandler { tick_count = 0x0; stall_handled = false; build_and_send_ack(ack_msg_id); -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE if (buffered_move.sensor_id != can::ids::SensorId::UNUSED) { - auto binding = - static_cast(can::ids::SensorOutputBinding::sync); + auto binding = static_cast( + can::ids::SensorOutputBinding::sync); // make none?! if (buffered_move.sensor_id == can::ids::SensorId::BOTH) { - send_bind_message(can::ids::SensorId::S0, binding); - send_bind_message(can::ids::SensorId::S1, binding); + send_bind_message(buffered_move.sensor_type, + can::ids::SensorId::S0, binding); + send_bind_message(buffered_move.sensor_type, + can::ids::SensorId::S1, binding); } else { - send_bind_message(buffered_move.sensor_id, binding); + send_bind_message(buffered_move.sensor_type, + buffered_move.sensor_id, binding); } } #endif @@ -638,18 +659,26 @@ class MotorInterruptHandler { hardware.set_step_tracker( static_cast(position_tracker >> 31)); } -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE void send_to_pressure_sensor_queue_rear( can::messages::BindSensorOutputRequest& m) { - std::ignore = sensor_tasks::get_queues() - .pressure_sensor_queue_rear->try_write_isr(m); + sensor_tasks::get_queues().send_pressure_sensor_queue_rear_isr(m); } void send_to_pressure_sensor_queue_front( can::messages::BindSensorOutputRequest& m) { // send to both queues, they will handle their own gating based on // sensor id - std::ignore = sensor_tasks::get_queues() - .pressure_sensor_queue_front->try_write_isr(m); + sensor_tasks::get_queues().send_pressure_sensor_queue_front_isr(m); + } + void send_to_capacitive_sensor_queue_rear( + can::messages::BindSensorOutputRequest& m) { + sensor_tasks::get_queues().send_capacitive_sensor_queue_rear_isr(m); + } + void send_to_capacitive_sensor_queue_front( + can::messages::BindSensorOutputRequest& m) { + // send to both queues, they will handle their own gating based on + // sensor id + sensor_tasks::get_queues().send_pressure_sensor_queue_front_isr(m); } #endif uint64_t tick_count = 0x0; diff --git a/include/motor-control/core/tasks/messages.hpp b/include/motor-control/core/tasks/messages.hpp index 1f273da04..759a28308 100644 --- a/include/motor-control/core/tasks/messages.hpp +++ b/include/motor-control/core/tasks/messages.hpp @@ -6,7 +6,7 @@ namespace motor_control_task_messages { -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE using MotionControlTaskMessage = std::variant< std::monostate, can::messages::AddLinearMoveRequest, can::messages::DisableMotorRequest, can::messages::EnableMotorRequest, diff --git a/include/motor-control/core/tasks/motion_controller_task.hpp b/include/motor-control/core/tasks/motion_controller_task.hpp index 2e8e1d0dc..f8838703b 100644 --- a/include/motor-control/core/tasks/motion_controller_task.hpp +++ b/include/motor-control/core/tasks/motion_controller_task.hpp @@ -95,7 +95,7 @@ class MotionControllerMessageHandler { controller.move(m); } -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE void handle(const can::messages::AddSensorMoveRequest& m) { LOG("Received add linear move request: velocity=%d, acceleration=%d, " "groupid=%d, seqid=%d, duration=%d, stopcondition=%d", diff --git a/include/motor-control/core/tasks/move_group_task.hpp b/include/motor-control/core/tasks/move_group_task.hpp index 828c370b2..7930d2f25 100644 --- a/include/motor-control/core/tasks/move_group_task.hpp +++ b/include/motor-control/core/tasks/move_group_task.hpp @@ -14,7 +14,7 @@ namespace move_group_task { constexpr std::size_t max_groups = 3; constexpr std::size_t max_moves_per_group = 12; -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE using MoveGroupType = move_group::MoveGroupManager< max_groups, max_moves_per_group, can::messages::AddLinearMoveRequest, can::messages::HomeRequest, can::messages::AddSensorMoveRequest>; @@ -126,7 +126,7 @@ class MoveGroupMessageHandler { mc_client.send_motion_controller_queue(m); } -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE void visit_move(const can::messages::AddSensorMoveRequest& m) { mc_client.send_motion_controller_queue(m); } diff --git a/include/pipettes/core/dispatch_builder.hpp b/include/pipettes/core/dispatch_builder.hpp index 225ef6f1e..e5d0950c6 100644 --- a/include/pipettes/core/dispatch_builder.hpp +++ b/include/pipettes/core/dispatch_builder.hpp @@ -39,7 +39,7 @@ using GearMotorDispatchTarget = can::dispatch::DispatchParseTarget< can::messages::GearWriteMotorDriverRegister, can::messages::GearWriteMotorCurrentRequest>; -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE using MoveGroupDispatchTarget = can::dispatch::DispatchParseTarget< can::message_handlers::move_group::MoveGroupHandler< linear_motor_tasks::QueueClient>, @@ -92,7 +92,7 @@ using SystemDispatchTarget = can::dispatch::DispatchParseTarget< using SensorDispatchTarget = can::dispatch::DispatchParseTarget< sensors::handlers::SensorHandler, can::messages::TipStatusQueryRequest, can::messages::ReadFromSensorRequest, - can::messages::SendAccumulatedPressureDataRequest, + can::messages::SendAccumulatedSensorDataRequest, can::messages::WriteToSensorRequest, can::messages::BaselineSensorRequest, can::messages::SetSensorThresholdRequest, can::messages::BindSensorOutputRequest, diff --git a/include/pipettes/core/interfaces.hpp b/include/pipettes/core/interfaces.hpp index 1912d942e..999e5f7ea 100644 --- a/include/pipettes/core/interfaces.hpp +++ b/include/pipettes/core/interfaces.hpp @@ -6,7 +6,7 @@ #include "motor-control/core/tasks/motor_hardware_task.hpp" namespace interfaces { -#ifdef USE_PRESSURE_MOVE +#ifdef USE_SENSOR_MOVE using MoveQueue = freertos_message_queue::FreeRTOSMessageQueue< motor_messages::SensorSyncMove>; #else diff --git a/include/pipettes/core/motor_interrupt_handler.hpp b/include/pipettes/core/motor_interrupt_handler.hpp deleted file mode 100644 index 94e54ef07..000000000 --- a/include/pipettes/core/motor_interrupt_handler.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include "motor-control/core/stepper_motor/motor_interrupt_handler.hpp" -#include "pipettes/core/sensor_tasks.hpp" - -namespace pipettes { -using namespace motor_messages; -template