Is anyone able to compile ROS_Serial Mbed using CLI compiler?

asked 2019-03-29 14:31:55 -0500

chrisalbertson gravatar image

I'd like to build a ROS Serial client on the Mbed platform using the current version of Mbed and the official Mbed CLI compiler (Or the official online compiler)

Has anyone done this? If, so would you share details?

What is currently stopping the compiler is that ROS has some *.h files that have the same name as standard system header files. For example "time.h" When building, many C++ files import time.h and the wrong header file is included. (time.h is just one example.)

The problem might be the way the Mbed CLI compiler searches for header files is broken but still, I ask if anyone has found a way to make it work.

I think the entire idea of ROS_Serial is broken if you can build software on the platform. The best solution is for ROS not to have header files with names like time.h that collide with standard header files. Read the C++ standard. Search paths for #include are "implementation-defined." So you can not count on the same behavior on all platforms. ROS_Serial is by its nature cross-platform so it cannot depend on GNU/Linux conventions. I'd go so far as to say it is poor practice as it might confure the person reading the code when s/he sees #include time.h Possibly change to "ros_time.h" Or even add "ros_" an the names of ALL header files used on ROS_Serial

Right now I'm simply asking if anyone has a working ros_serial on Mbed platform using official build tools.

Later I'll ask if cleaning the ROS Serial source tree is a good idea. I'd do it if maintainers agree.

ROS_SerialArduino gets a LOT more frequent use and this is my workaround. But there is so much utility is using a true RTOS like Mbed

edit retag flag offensive close merge delete