Skip to content

Commit

Permalink
uorb topic name: sensor_wind -> sensor_airflow
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykotze committed Dec 5, 2023
1 parent ea2adeb commit bcf34f7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ set(msg_files
SensorsStatus.msg
SensorsStatusImu.msg
SensorUwb.msg
SensorWind.msg
SensorAirflow.msg
SystemPower.msg
TakeoffStatus.msg
TaskStackInfo.msg
Expand Down
4 changes: 2 additions & 2 deletions msg/SensorWind.msg → msg/SensorAirflow.msg
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions src/drivers/wind_sensor/ft_technologies/ft7_technologies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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;

}
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/wind_sensor/ft_technologies/ft7_technologies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <uORB/Publication.hpp>
#include <uORB/topics/sensor_wind.h>
#include <uORB/topics/sensor_airflow.h>
#include <drivers/drv_hrt.h>
#include <drivers/device/device.h>
#include <lib/parameters/param.h>
Expand Down Expand Up @@ -73,7 +73,7 @@ class Ft7Technologies : public px4::ScheduledWorkItem
bool checksum(char *buf, uint32_t checksum);
uint8_t hex2int(char ch);

uORB::Publication<sensor_wind_s> _wind_sensor_pub{ORB_ID(sensor_wind)};
uORB::Publication<sensor_airflow_s> _sensor_airflow_pub{ORB_ID(sensor_airflow)};

char _port[20] {};
char _readbuf[30] {};
Expand Down

0 comments on commit bcf34f7

Please sign in to comment.