Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS Kinect build failure on raspbian #37

Closed
cambesol opened this issue Jul 3, 2017 · 5 comments
Closed

ROS Kinect build failure on raspbian #37

cambesol opened this issue Jul 3, 2017 · 5 comments

Comments

@cambesol
Copy link

cambesol commented Jul 3, 2017

Built urdfdom_headers as an external build for Raspbian version:
Linux raspberrypi 4.9.28+ #998 Mon May 15 16:50:35 BST 2017 armv6l GNU/Linux

Version of urdfdom_headers:
pi@raspberrypi:~/ros_catkin_ws/external_src/urdfdom_headers $ git log
commit 5cb0b6b
Merge: 76da8dc 9d2b421
Author: Steven Peters [email protected]
Date: Wed Jul 20 10:47:51 2016 -0700

Merge pull request #23 from scpeters/unboost

Use c++11 instead of boost, bump version to 1.0.0

Obtained ROS packages to build as follows:

rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
rosinstall_generator ros_comm ros_control joystick_drivers laser_geometry tf --rosdistro kinect --deps --wet-only --exclude roslisp --tar > kinect-custom_ros.kinect

Resolved package dependencies:
assimp-3.1.1
collada-dom-2.4.0
console-bridge-0.3.2
urdfdom
urdfdom_headers -> renamed as:

apt list --installed | grep urd
liburdfdom-dev/now 20170703-1 armhf [installed,local]
liburdfdom-headers-dev/now 20170703-1 armhf [installed,local]

Tried to build ROS as follows:
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic -j1

After many hours, it failed building robot_state_publisher. Here is a snippet:
/opt/ros/kinetic/include/urdf/urdfdom_compatibility.h:93:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr ModelInterfaceSharedPtr;
^
/opt/ros/kinetic/include/urdf/urdfdom_compatibility.h:94:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr ModelInterfaceConstSharedPtr;
^
/opt/ros/kinetic/include/urdf/urdfdom_compatibility.h:95:14: error: ‘weak_ptr’ in namespace ‘std’ does not name a template type
typedef std::weak_ptr ModelInterfaceWeakPtr;
^
/opt/ros/kinetic/include/urdf/urdfdom_compatibility.h:100:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr ModelSharedPtr;
^
/opt/ros/kinetic/include/urdf/urdfdom_compatibility.h:101:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr ModelConstSharedPtr;
^
/opt/ros/kinetic/include/urdf/urdfdom_compatibility.h:102:14: error: ‘weak_ptr’ in namespace ‘std’ does not name a template type
typedef std::weak_ptr ModelWeakPtr;
^
/home/pi/ros_catkin_ws/src/robot_state_publisher/src/robot_state_publisher.cpp: In member function ‘virtual void robot_state_publisher::RobotStatePublisher::addChildren(std::map<std::basic_string, KDL::TreeElement>::const_iterator)’:
/home/pi/ros_catkin_ws/src/robot_state_publisher/src/robot_state_publisher.cpp:68:20: error: ‘const class urdf::Model’ has no member named ‘getJoint’
if (model_.getJoint(child.getJoint().getName()) && model_.getJoint(child.getJoint().getName())->type == urdf::Joint::FLOATING){
^
/home/pi/ros_catkin_ws/src/robot_state_publisher/src/robot_state_publisher.cpp:68:67: error: ‘const class urdf::Model’ has no member named ‘getJoint’
if (model_.getJoint(child.getJoint().getName()) && model_.getJoint(child.getJoint().getName())->type == urdf::Joint::FLOATING){
^
CMakeFiles/robot_state_publisher_solver.dir/build.make:62: recipe for target 'CMakeFiles/robot_state_publisher_solver.dir/src/robot_state_publisher.cpp.o' failed
make[2]: *** [CMakeFiles/robot_state_publisher_solver.dir/src/robot_state_publisher.cpp.o] Error 1
CMakeFiles/Makefile2:573: recipe for target 'CMakeFiles/robot_state_publisher_solver.dir/all' failed
make[1]: *** [CMakeFiles/robot_state_publisher_solver.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'robot_state_publisher':

Now I have dug into this and it appears to be when the Boost pointers where removed for C++11 with a compatibility header. I have the latest version of the headers and urdf and it is not clear what I should try next. Do you have any hints? I need to run Kinetic, I had a functioning version of Indigo, but I will be working with the Nvidia Jetson TX2 which runs Kinetic so want the two to be compatible.
Thank you for any help you can offer and if you need further details, please don't hesitate to ask.

@cambesol
Copy link
Author

cambesol commented Jul 4, 2017

Apologies for raising this issue. I fixed it by adding the following in:
ros_catkin_ws/src/robot_state_publisher/CMakeLists.txt

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-std=c++11 HAS_STD_CPP11_FLAG)
if(HAS_STD_CPP11_FLAG)
  add_compile_options(-std=c++11)
endif()

There is an issue raised on robot_state_publisher https://github.com/ros/robot_state_publisher/issues/76
On a Raspberry Pi 1 model B it takes more than five hours to build all the packages I have included so it was a bit slow to fix.

@sloretz
Copy link
Contributor

sloretz commented Aug 10, 2017

I think the core issue here was urdfdom_headers 1.0.0 requires c++11, but being header only there are no targets to depend on to get the required compile options

How about adding a dummy target add_library(urdfdom_headers INTERFACE)? I think it would allow set_property(TARGET urdfdom_headers PROPERTY CXX_STANRDARD_REQUIRED 11) . Then robot_state_publisher could have its targets depend on urdfdom_headers and get the required compile options for free.

@sloretz
Copy link
Contributor

sloretz commented Aug 10, 2017

Possibly same issue as #32

@sloretz
Copy link
Contributor

sloretz commented Oct 26, 2017

I'll close this since the original issue is solved by ros/robot_state_publisher#76, and there is another ticket about build issues due to not setting the compiler flag for c++11 downstream #32. Feel free to reopen if there's more on this ticket that needs resolution.

@traversaro
Copy link
Contributor

@sloretz I guess you wrote the comment to close the issue, but then forgot to close the issue itself?

@sloretz sloretz closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants