It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.
Note that this breaks the replay format for sdlog2 replay
- voting is now at a central place instead of duplicated within the
estimators
-> this also means that estimators that did not do voting so far,
now have voting, like ekf2
- estimators requiring more than that can still subscribe to the raw
sensors
- allows sensors_combined to be 3 times smaller
- reduces logger, memcpy (cache) & RAM overhead
- all modules requiring only 1 or 2 sensor values now automatically get
the voted result
- this also adds voting to baro
Decreases the message size from 780 to 280 bytes.
In particular, all modules using sensor_combined must use the integral now.
The sensor value can easily be reconstructed by dividing with dt.
Voters now need to be moved into sensors module, because error count and
priority is removed from the topic.
Any module that requires additional data from a sensor can subscribe to
the raw sensor topics.
At two places, values are set to zero instead of subscribing to the raw
sensors (with the assumption that no one reads them):
- mavlink mavlink_highres_imu_t::abs_pressure
- sdlog2: sensor temperatures
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.
The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.
Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Using %llu or %lu will break one of the build targets. The "right way"
to print a uint64_t is via the PRIU64 macro defined in C99.
This wasn't defined for the NuttX compiler so it was added to px4_defines.h
for NuttX.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The ROS build included some files that used isfinite vs PX4_ISFINITE.
The AppState class also needed to be supported for ROS.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
In the upstream tree ringbuffer.h includes the method implementations
in the header file which causes multiple definitions in the link for
other targets. Changed so ringbuffer.cpp is build separately for other
platforms and is included by ringbuffer.h on NuttX.
uORB changes do not link without uORBTest_UnitTest.cpp enabled for
the NuttX build.
px4_getopt was not exported and wasn't visible in NuttX build.
The makefiles were restored to be as close as possible to upstream
so the NuttX build builtin's work again. The code will have to be
refactored after the merge.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>