Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fb3f27c
added temp sensor parsing
adambrett40 Mar 22, 2025
6a65963
Adding Website integration tests (#416)
FireBoyAJ24 Mar 22, 2025
e98ad27
added the other sensors to parser
adambrett40 Mar 22, 2025
37226d7
added temporary callbacks
adambrett40 Mar 22, 2025
db05f21
added ros topics and callbacks for new sensors and rudder data
adambrett40 Mar 29, 2025
2e329a7
added callback for rudder frame
adambrett40 Apr 5, 2025
6bc5c24
Merge branch 'main' of https://github.com/UBCSailbot/sailbot_workspac…
adambrett40 Apr 5, 2025
1bee912
Merge remote-tracking branch 'origin/main' into user/adambrett40/462-…
adambrett40 Apr 10, 2025
8381e5a
enable can fd
adambrett40 May 24, 2025
2b5eb3b
Merge branch 'main' into user/adambrett40/462-Add-New-Sensors
adambrett40 May 31, 2025
5876a3c
register all new frame callbacks, test new frame callbacks
adambrett40 May 31, 2025
8036947
added tests for constructing new sensors
adambrett40 Jun 1, 2025
0e54c11
updated callbacks to include new frame arrays
adambrett40 Jun 4, 2025
987fc09
fix minor copy/paste error
ubcsailbotsoftware Jun 5, 2025
9eb454d
Merge branch 'main' into user/adambrett40/462-Add-New-Sensors
Jun 5, 2025
9ee9027
change float iterator to int iterator
Jun 6, 2025
4f4f569
change other iterators from float to int
Jun 6, 2025
2dd3129
remove unnecessary debug info and fix static cast
adambrett40 Jun 7, 2025
4c75fd7
Merge branch 'main' into user/adambrett40/462-Add-New-Sensors
adambrett40 Jun 7, 2025
b8cc460
Merge branch 'main' into user/adambrett40/462-Add-New-Sensors
adambrett40 Jun 9, 2025
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
12 changes: 12 additions & 0 deletions src/custom_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ set(common_msg
"msg/SailCmd.msg"
"msg/WindSensor.msg"
"msg/WindSensors.msg"
"msg/TempSensor.msg"
"msg/TempSensors.msg"
"msg/PhSensor.msg"
"msg/PhSensors.msg"
"msg/SalinitySensor.msg"
"msg/SalinitySensors.msg"
"msg/PressureSensor.msg"
"msg/PressureSensors.msg"

# internal
"msg/HelperAISShip.msg"
Expand All @@ -37,6 +45,10 @@ set(common_msg
"msg/HelperLatLon.msg"
"msg/HelperROT.msg"
"msg/HelperSpeed.msg"
"msg/HelperTemp.msg"
"msg/HelperPh.msg"
"msg/HelperSalinity.msg"
"msg/HelperPressure.msg"
"msg/HelperObstacle.msg"
)

Expand Down
2 changes: 2 additions & 0 deletions src/custom_interfaces/msg/HelperPh.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# unit : pH
float32 ph
2 changes: 2 additions & 0 deletions src/custom_interfaces/msg/HelperPressure.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#unit : PSI
float32 pressure
2 changes: 2 additions & 0 deletions src/custom_interfaces/msg/HelperSalinity.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# unit : conductivity in microSiemens / cm
float32 salinity
2 changes: 2 additions & 0 deletions src/custom_interfaces/msg/HelperTemp.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# unit: degrees Celsius
float32 temp
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/PhSensor.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HelperPh ph
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/PhSensors.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PhSensor[16] ph_sensors
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/PressureSensor.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HelperPressure pressure
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/PressureSensors.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PressureSensor[16] pressure_sensors
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/SalinitySensor.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HelperSalinity salinity
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/SalinitySensors.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SalinitySensor[16] salinity_sensors
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/TempSensor.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HelperTemp temp
1 change: 1 addition & 0 deletions src/custom_interfaces/msg/TempSensors.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TempSensor[16] temp_sensors
44 changes: 44 additions & 0 deletions src/network_systems/lib/cmn_hdrs/shared_constants.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once

#include <custom_interfaces/msg/batteries.hpp>
#include <custom_interfaces/msg/ph_sensors.hpp>
#include <custom_interfaces/msg/pressure_sensors.hpp>
#include <custom_interfaces/msg/salinity_sensors.hpp>
#include <custom_interfaces/msg/temp_sensors.hpp>
#include <custom_interfaces/msg/wind_sensors.hpp>
#include <string>

Expand Down Expand Up @@ -29,6 +33,30 @@ constexpr int NUM_WIND_SENSORS = []() constexpr
return sizeof(wind_sensors_arr) / sizeof(custom_interfaces::msg::WindSensor);
}
();
constexpr int NUM_TEMP_SENSORS = []() constexpr
{
using temp_sensors_arr = custom_interfaces::msg::TempSensors::_temp_sensors_type;
return sizeof(temp_sensors_arr) / sizeof(custom_interfaces::msg::TempSensor);
}
();
constexpr int NUM_PH_SENSORS = []() constexpr
{
using ph_sensors_arr = custom_interfaces::msg::PhSensors::_ph_sensors_type;
return sizeof(ph_sensors_arr) / sizeof(custom_interfaces::msg::PhSensor);
}
();
constexpr int NUM_PRESSURE_SENSORS = []() constexpr
{
using pressure_sensors_arr = custom_interfaces::msg::PressureSensors::_pressure_sensors_type;
return sizeof(pressure_sensors_arr) / sizeof(custom_interfaces::msg::PressureSensor);
}
();
constexpr int NUM_SALINITY_SENSORS = []() constexpr
{
using salinity_sensors_arr = custom_interfaces::msg::SalinitySensors::_salinity_sensors_type;
return sizeof(salinity_sensors_arr) / sizeof(custom_interfaces::msg::SalinitySensor);
}
();

/****** Upper and lower bounds ******/

Expand Down Expand Up @@ -64,3 +92,19 @@ constexpr float BATT_CURR_UBND = 200.0; // Placeholder number
/***** Bounds for Wind Sensor ******/
constexpr int WIND_DIRECTION_LBND = -180;
constexpr int WIND_DIRECTION_UBND = 179;

/***** Bounds for Temp Sensor ******/
constexpr float TEMP_LBND = -32.768; // smallest value to fit in int16_t when * 1000
constexpr float TEMP_UBND = 32.767; // largest value to fit in int16_t when * 1000

/***** Bounds for Ph Sensor ******/
constexpr float PH_LBND = -1.6; // lbnd of sensor being used
constexpr float PH_UBND = 15.6; // ubnd of sensor being used

/***** Bounds for Salinity Sensor ******/
constexpr float SALINITY_LBND = 0; // lbnd of sensor being used is 0.07
constexpr float SALINITY_UBND = 1000000; // ubnd of sensor being used is 500000+

/***** Bounds for Pressure Sensor ******/
constexpr float PRESSURE_LBND = -100; // lowest lbnd of pressure sensors under consideration is -14.5 psi
constexpr float PRESSURE_UBND = 1000; // highest lbnd of pressure sensors is 8702 psi
Loading
Loading