my task is to send telemetry Data from one Pixhawk 2.4. to another via CAN. I decided to use UAVCAN, cause it’s already intagrated in px4 Firmware. I build two modules containing publisher and subscriber example from UAVCAN.org (https://uavcan.org/Implementations/Libuavcan/Tutorials/3._Publishers_and_subscribers/).
When I try to compile the code with command make px4_fmu-v3_default, I got followoing error:
fatal error: iostream: No such file or directory
Then I included uClibc++ library from https://bitbucket.org/nuttx/uclibc/src/master/, as recomended by Nuttx. However I got this message again.
Does someone know how to fix that problem and succesfully compilate UAVCAN examples?
Or might it be better to use another CAN protocol for my porpouses?
With NuttX we currently don’t have support for the C++ STL. I once got it to work but it was a big endevour taking multiple days.
@PavelKirienko what would be easiest way to enable the use case mentioned above?
C++ STL is needed for compiling the subscriber example (e.g. lambda functions). I also tried to compile cpp_03 example at the bottom of the site, but I got this error message:
error: 'string' in namespace 'std' does not name a type
Node(uavcan::NodeID self_node_id, const std::string& self_node_name) :
std:string is part of string header from C++ STL and not included in PX4 header string. Is there a way to replace
std::stringby an different data type without causing definition conflicts?
Sorry, got my notifications set up wrong.
Lambda functions have nothing to do with STL. Neither does Libuavcan – it is usable without STL as described in the documentation. The examples are not intended to be copy-pasted into an embedded codebase, it won’t work; instead, they are intended to be a high-level API usage demonstration.