From bcf34f7e7f32825e40fa2edd1eaa4c3532d2d2de Mon Sep 17 00:00:00 2001 From: henrykotze Date: Tue, 5 Dec 2023 14:32:46 +0200 Subject: [PATCH] uorb topic name: sensor_wind -> sensor_airflow --- msg/CMakeLists.txt | 2 +- msg/{SensorWind.msg => SensorAirflow.msg} | 4 ++-- .../wind_sensor/ft_technologies/ft7_technologies.cpp | 12 ++++++------ .../wind_sensor/ft_technologies/ft7_technologies.hpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) rename msg/{SensorWind.msg => SensorAirflow.msg} (58%) diff --git a/msg/CMakeLists.txt b/msg/CMakeLists.txt index 4d81c503982b..cf37ec339f22 100644 --- a/msg/CMakeLists.txt +++ b/msg/CMakeLists.txt @@ -182,7 +182,7 @@ set(msg_files SensorsStatus.msg SensorsStatusImu.msg SensorUwb.msg - SensorWind.msg + SensorAirflow.msg SystemPower.msg TakeoffStatus.msg TaskStackInfo.msg diff --git a/msg/SensorWind.msg b/msg/SensorAirflow.msg similarity index 58% rename from msg/SensorWind.msg rename to msg/SensorAirflow.msg index e3752e89af46..dd55ad0b0c70 100644 --- a/msg/SensorWind.msg +++ b/msg/SensorAirflow.msg @@ -1,5 +1,5 @@ uint64 timestamp # time since system start (microseconds) uint32 device_id # unique device ID for the sensor that does not change between power cycles -float32 wind_speed # the speed being reported by the wind sensor -float32 wind_direction # the direction bein report by the wind sensor +float32 speed # the speed being reported by the wind / airflow sensor +float32 direction # the direction bein report by the wind / airflow sensor uint8 status # Status code from the sensor diff --git a/src/drivers/wind_sensor/ft_technologies/ft7_technologies.cpp b/src/drivers/wind_sensor/ft_technologies/ft7_technologies.cpp index 063ebe7db6d3..ef3f1fbd11d4 100644 --- a/src/drivers/wind_sensor/ft_technologies/ft7_technologies.cpp +++ b/src/drivers/wind_sensor/ft_technologies/ft7_technologies.cpp @@ -165,11 +165,11 @@ int Ft7Technologies::collect() _checksum = (uint32_t)atoi((char *)_raw_checksum); _hex_checksum = 0; - sensor_wind_s sensor_wind{}; - sensor_wind.timestamp = hrt_absolute_time(); - sensor_wind.wind_speed = (float)atoi((char *)_raw_speed) / 10.0f; - sensor_wind.wind_direction = ((float)atoi((char *)_raw_angle) - 180.0f) * M_PI_F / 180.0f; - sensor_wind.status = (uint8_t)atoi((char *)_raw_status); + sensor_airflow_s sensor_airflow{}; + sensor_airflow.timestamp = hrt_absolute_time(); + sensor_airflow.speed = (float)atoi((char *)_raw_speed) / 10.0f; + sensor_airflow.direction = ((float)atoi((char *)_raw_angle) - 180.0f) * M_PI_F / 180.0f; + sensor_airflow.status = (uint8_t)atoi((char *)_raw_status); if (_checksum_counter == 2) { _hex_checksum = hex2int(_raw_checksum[0]) << 4 | hex2int(_raw_checksum[1]); @@ -181,7 +181,7 @@ int Ft7Technologies::collect() // checksum is verified if (checksum(_readbuf, _hex_checksum)) { - _wind_sensor_pub.publish(sensor_wind); + _sensor_airflow_pub.publish(sensor_airflow); valid = true; } diff --git a/src/drivers/wind_sensor/ft_technologies/ft7_technologies.hpp b/src/drivers/wind_sensor/ft_technologies/ft7_technologies.hpp index 91a58aaca428..816942797347 100644 --- a/src/drivers/wind_sensor/ft_technologies/ft7_technologies.hpp +++ b/src/drivers/wind_sensor/ft_technologies/ft7_technologies.hpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -73,7 +73,7 @@ class Ft7Technologies : public px4::ScheduledWorkItem bool checksum(char *buf, uint32_t checksum); uint8_t hex2int(char ch); - uORB::Publication _wind_sensor_pub{ORB_ID(sensor_wind)}; + uORB::Publication _sensor_airflow_pub{ORB_ID(sensor_airflow)}; char _port[20] {}; char _readbuf[30] {};