Skip to content

Commit 2b4540a

Browse files
authored
Merge pull request #18 from ethz-asl/pr-port-vanes
Port si7210 driver with new driver framework
2 parents d20f353 + 389a096 commit 2b4540a

24 files changed

+1138
-908
lines changed

ROMFS/px4fmu_common/init.d/rc.sensors

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,57 @@ then
114114
adis16448 -S start
115115
fi
116116

117+
# Hall effect sensors si7210
118+
# Potentially remove the -k option if possible and improve the startup if possible
119+
if param greater CAL_AV_AOA_ID -1
120+
then
121+
set AOA_I2C_ID 0
122+
if param compare CAL_AV_AOA_ID 48
123+
then
124+
set AOA_I2C_ID 48
125+
fi
126+
if param compare CAL_AV_AOA_ID 49
127+
then
128+
set AOA_I2C_ID 49
129+
fi
130+
if param compare CAL_AV_AOA_ID 50
131+
then
132+
set AOA_I2C_ID 50
133+
fi
134+
if param compare CAL_AV_AOA_ID 51
135+
then
136+
set AOA_I2C_ID 51
137+
fi
138+
139+
si7210 start -X -k -a ${AOA_I2C_ID}
140+
unset AOA_I2C_ID
141+
fi
142+
143+
if param greater CAL_AV_SLIP_ID -1
144+
then
145+
set SLIP_I2C_ID 0
146+
if param compare CAL_AV_SLIP_ID 48
147+
then
148+
set SLIP_I2C_ID 48
149+
fi
150+
if param compare CAL_AV_SLIP_ID 49
151+
then
152+
set SLIP_I2C_ID 49
153+
fi
154+
if param compare CAL_AV_SLIP_ID 50
155+
then
156+
set SLIP_I2C_ID 50
157+
fi
158+
if param compare CAL_AV_SLIP_ID 51
159+
then
160+
set SLIP_I2C_ID 51
161+
fi
162+
163+
si7210 start -X -k -a ${SLIP_I2C_ID}
164+
unset SLIP_I2C_ID
165+
fi
166+
167+
117168
# probe for optional external I2C devices
118169
if param compare SENS_EXT_I2C_PRB 1
119170
then

boards/px4/fmu-v3/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ px4_add_board(
4141
magnetometer # all available magnetometer drivers
4242
optical_flow # all available optical flow drivers
4343
osd
44+
si7210
4445
pca9685
4546
pca9685_pwm_out
4647
#power_monitor/ina226

msg/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ set(msg_files
3939
actuator_controls.msg
4040
actuator_outputs.msg
4141
adc_report.msg
42+
airflow_aoa.msg
43+
airflow_slip.msg
4244
airspeed.msg
4345
airspeed_validated.msg
4446
airspeed_wind.msg

msg/airflow_aoa.msg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
uint64 timestamp # time since system start (microseconds)
2+
float32 aoa_rad # angle of attack in radians
3+
bool valid # true if measurement is within sensor/calibration range, false otherwise

msg/airflow_slip.msg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
uint64 timestamp # time since system start (microseconds)
2+
float32 slip_rad # sideslip angle in radians
3+
bool valid # true if measurement is within sensor/calibration range, false otherwise

msg/tools/uorb_rtps_message_ids.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ rtps:
342342
id: 158
343343
- msg: estimator_event_flags
344344
id: 159
345+
- msg: sensor_hall
346+
id: 160
345347
########## multi topics: begin ##########
346348
- msg: actuator_controls_0
347349
id: 170

src/drivers/drv_hall.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#ifndef _DRV_HALL_H
4141
#define _DRV_HALL_H
4242

43-
#include <px4_defines.h>
4443
#include <stdint.h>
4544
#include <sys/ioctl.h>
4645

@@ -53,7 +52,5 @@
5352
#define HALL2_DEVICE_PATH "/dev/hall2"
5453
#define HALL3_DEVICE_PATH "/dev/hall3"
5554

56-
#include <uORB/topics/sensor_hall.h>
57-
#define si7210_report sensor_hall_s
5855

5956
#endif /* _DRV_HALL_H */

src/drivers/si7210/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ px4_add_module(
3434
MODULE drivers__si7210
3535
MAIN si7210
3636
COMPILE_FLAGS
37-
-O0
3837
SRCS
38+
si7210_main.cpp
3939
si7210.cpp
4040
DEPENDS
41-
px4_work_queue
41+
drivers__vane
42+
mathlib
4243
)
44+
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

0 commit comments

Comments
 (0)