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

Feat(pipettes): add Liquid Probe #795

Closed
wants to merge 10 commits into from
Closed
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
44 changes: 0 additions & 44 deletions .github/workflows/build_sensor_fw.yaml

This file was deleted.

116 changes: 0 additions & 116 deletions .github/workflows/cross-compile-special-sensors.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@
"binaryDir": "${sourceDir}/build-cross",
"inherits": "cross-no-directory-reqs"
},
{
"name": "cross-sensor-buffer",
"displayName": "STM32 G4 OT-3 cross-compilation with sensor data buffers",
"description": "Build application firmware for OT-3 systems that use STM32, for flashing onto boards",
"installDir": "${sourceDir}/dist-sensor",
"binaryDir": "${sourceDir}/build-cross-sensor",
"cacheVariables": {
"USE_PRESSURE_MOVE": true
},
"inherits": "cross"
},
{
"name": "host",
"displayName": "STM32 OT-3 host compilation for tests",
Expand Down Expand Up @@ -99,17 +88,6 @@
"firmware-images"
]
},
{
"name": "firmware-g4-sensors",
"displayName": "All G4 Firmwares With Sensor Data Buffers",
"description": "Environment to build all g4 firmware - see firmware-l5",
"configurePreset": "cross-sensor-buffer",
"jobs": 4,
"targets": [
"firmware-applications",
"firmware-images"
]
},
{
"name": "pipettes",
"displayName": "pipettes binaries",
Expand Down
4 changes: 0 additions & 4 deletions common/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +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})
set(TERTIARY_FLAG "'1'")
else()
set(TERTIARY_FLAG "0x00")
endif()


configure_file(${CMAKE_SOURCE_DIR}/common/core/revision.c.in ${CMAKE_CURRENT_BINARY_DIR}/${_ar_TARGET}_revision.c)
Expand Down
3 changes: 3 additions & 0 deletions gripper/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
function(target_gripper_core TARGET)
target_compile_definitions(${TARGET} PUBLIC USE_SENSOR_MOVE)
target_compile_definitions(${TARGET} PUBLIC SENSOR_BUFF_SIZE=300)
target_compile_definitions(${TARGET} PUBLIC USE_TWO_BUFFERS=true)
target_sources(${TARGET} PUBLIC
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_tasks.cpp
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/tasks.cpp
Expand Down
31 changes: 29 additions & 2 deletions gripper/core/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

static auto tasks = gripper_tasks::AllTask{};
static auto queues = gripper_tasks::QueueClient{can::ids::NodeId::gripper};
static std::array<float, SENSOR_BUFFER_SIZE> sensor_buffer;
#ifdef USE_TWO_BUFFERS
static std::array<float, SENSOR_BUFFER_SIZE> sensor_buffer_front;
#endif

static auto eeprom_task_builder =
freertos_task::TaskStarter<512, eeprom::task::EEPromTask>{};
Expand Down Expand Up @@ -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
sensor_buffer_front);
#else
sensor_buffer);
#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, sensor_buffer);

tasks.i2c2_task = &i2c2_task;
tasks.i2c3_task = &i2c3_task;
Expand Down Expand Up @@ -152,13 +161,27 @@ 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&) {}
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&) {}
Expand All @@ -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;
}
6 changes: 6 additions & 0 deletions gripper/firmware/interfaces_z_motor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_messages::Move>
motor_queue("Motor Queue");
#endif

static freertos_message_queue::FreeRTOSMessageQueue<
can::messages::UpdateMotorPositionEstimationRequest>
Expand Down
7 changes: 7 additions & 0 deletions gripper/simulator/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ static auto motor_interface =
/**
* 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_messages::Move>
motor_queue("Motor Queue");
#endif

static freertos_message_queue::FreeRTOSMessageQueue<
can::messages::UpdateMotorPositionEstimationRequest>
Expand Down
3 changes: 2 additions & 1 deletion include/bootloader/core/ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -204,6 +204,7 @@ typedef enum {
can_sensoroutputbinding_sync = 0x1,
can_sensoroutputbinding_report = 0x2,
can_sensoroutputbinding_max_threshold_sync = 0x4,
can_sensoroutputbinding_auto_baseline_report = 0x8,
} CANSensorOutputBinding;

/** How a sensor's threshold should be interpreted. */
Expand Down
5 changes: 4 additions & 1 deletion include/can/core/ids.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -193,6 +193,7 @@ enum class SensorType {
pressure_temperature = 0x4,
humidity = 0x5,
temperature = 0x6,
UNUSED = 0x7,
};

/** Sensor IDs available.
Expand All @@ -213,6 +214,8 @@ enum class SensorOutputBinding {
sync = 0x1,
report = 0x2,
max_threshold_sync = 0x4,
auto_baseline_report = 0x08,
multi_sensor_sync = 0x10,
};

/** How a sensor's threshold should be interpreted. */
Expand Down
2 changes: 1 addition & 1 deletion include/can/core/message_handlers/move_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace can::messages;
template <move_group_task::TaskClient Client>
class MoveGroupHandler {
public:
#ifdef USE_PRESSURE_MOVE
#ifdef USE_SENSOR_MOVE
using MessageType =
std::variant<std::monostate, AddLinearMoveRequest,
ClearAllMoveGroupsRequest, ExecuteMoveGroupRequest,
Expand Down
Loading
Loading