PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.3k stars 13.43k forks source link

undeclared variable in MS5837 driver #20049

Open FlorianPix opened 2 years ago

FlorianPix commented 2 years ago

Describe the bug

../../src/drivers/barometer/ms5837/MS5837.cpp: In member function 'int MS5837::_collect()':

../../src/drivers/barometer/ms5837/MS5837.cpp:343:29: error: 'T' was not declared in this scope

343 | sensor_baro.temperature = T;

To Reproduce

  1. add ms5847 driver to CMakeLists.txt (add_subdirectory(ms5837))
  2. "activate" it in the boardconfig example: make px4_fmu-v5_rtps boardconfig
  3. build the firmware example: make px4_fmu-v5_rtps
  4. See error

Expected behavior

If I understood the state machine of the driver correctly from the comments in MS5837.hpp, T should represent the temperature that was measured in the last poll cylce.

Solution

dagar commented 2 years ago

Looks like it slipped through because we're not actively testing this driver.

Would you like to open a PR addressing this (maybe along with #20051)? We should make sure it's included in the build system going forward.

FlorianPix commented 2 years ago

https://github.com/PX4/PX4-Autopilot/pull/20061