Open matthew-reynolds opened 5 years ago
It appears the #include_next
issues are a result of diff_drive_controller
's unusual CMakeLists.txt. Fix proposed in https://github.com/ros-controls/ros_controllers/pull/425.
Leaving this issue open until a new release of ros_controllers
is released containing the fix to 2. and 3.
🐛 Bug Report
Currently, the following extra steps have to be taken to cross-compile the roscore: 1) Manually delete the
gazebo_ros
source directory 2) Change#include_next
to#include
in~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cstdlib:75
3) Change#include_next
to#include
in~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cmath:45
How to fix: 1) ackerman_steering_controller (Part of ros_controllers) has
gazebo_ros
listed as a dependency since it is used for tests. We do not want anything to do with Gazebo when we cross compile. Can be fixed by adding--exclude gazebo_ros
to therosinstall_generator
command. 2) Fix cmake toolchain. Need to look into this further. I believe the correct behaviour would be to include~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/math.h
. I'm not sure what file is being included right now when I switch from#include_next
to #include`. 3) As above.To elaborate on 2 and 3, here is my (limited) understanding. The following applies to both
cstdlib
andcmath
, it's just quicker to type math than stdlib :)GNU ISO C++ defines the following two files:
[...]/usr/include/c++/6.3.0/cmath
[...]/usr/include/c++/6.3.0/math.h
As is typical in C++, the latter is just a compatability layer, includingcmath
and stripping the namespaces.Additionally, GNU ISO C defines the following file:
[...]/usr/include/math.h
C++
cmath
contains the following, outside of include guards:Similarly, C++
math.h
includes the following, outside of include guards:Clearly, the intent here is to include the C
math.h
. I do not know why#include_next
incmath
fails but#include_next
in C++math.h
seems to succeed. But my understanding is that the Cmath.h
should be included. Sounds like a configuration issue with the cmake toolchain.