0
$\begingroup$

Rosanswers logo

I'm installing ROS Indigo on RPI 3 running Wheezy using the desktop version and following this wiki page: http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi

I get as far as compiling URDF from source and I get a bunch of compile-time errors and many more not shown.

    pi@raspberrypi ~/ros_install_ws $ cd /home/pi/ros_install_ws/build_isolated/urdf && /opt/ros/indigo/env.sh make -j4 -l4
    [100%] Building CXX object CMakeFiles/urdf.dir/src/model.cpp.o
    In file included from /usr/local/include/urdf_model/joint.h:43:0,
                     from /usr/local/include/urdf_model/link.h:44,
                     from /usr/local/include/urdf_model/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/include/urdf/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:37:
    /usr/local/include/urdf_model/pose.h: In member function 'void urdf::Vector3::init(const string&)':
    /usr/local/include/urdf_model/pose.h:78:25: error: 'stod' is not a member of 'std'
    In file included from /usr/local/include/urdf_model/joint.h:43:0,
                     from /usr/local/include/urdf_model/link.h:44,
                     from /usr/local/include/urdf_model/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/include/urdf/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:37:
    /usr/local/include/urdf_model/pose.h:90:42: error: 'to_string' is not a member of 'std'
    In file included from /usr/local/include/urdf_model/joint.h:44:0,
                     from /usr/local/include/urdf_model/link.h:44,
                     from /usr/local/include/urdf_model/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/include/urdf/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:37:
    /usr/local/include/urdf_model/types.h: At global scope:
    /usr/local/include/urdf_model/types.h:51:9: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:53:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:53:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:53:1: error: 'weak_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:54:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:54:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:54:1: error: 'weak_ptr' in namespace 'std' does not name a type

/usr/local/include/urdf_model/types.h:55:1: error: 'shared_ptr' in namespace 'std' does not name a type
/usr/local/include/urdf_model/types.h:55:1: error: 'shared_ptr' in namespace 'std' does not name a type 

I have liburdfdom-dev and liburdfdom-headers-dev installed via compiled source as per the wiki page and confirmed (with dpkg).

Something appears to be missing here as this just isn't right...

UPDATE:

I've added:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

Which now results in a single error of:

/home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:174:33: error: no match for 'operator=' in 'model = urdf::parseURDF(const string&)()'
  • Tim

Originally posted by Tardoe on ROS Answers with karma: 11 on 2016-09-14

Post score: 1


Original comments

Comment by alienmon on 2016-09-14:
open /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp , what is it in line 174? You might want to check this

Comment by Tardoe on 2016-09-14:
I don't quite understand - parseURDF() is mean to return a boost::shared_ptr which is the same type as the model object. This is line 174: model = parseURDF(xml_string); The sig for parseURDL is: boost::shared_ptr parseURDF(const std::string &xml_string)

Comment by alienmon on 2016-09-15:
According to this bug report "We believe that the bug you reported is fixed in the latest version of ros-robot-model, which is due to be installed in the Debian FTP archive.". Did you install the atest version?

Comment by nickxiang0306 on 2016-10-17:
Hello, where did you add "set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")" ? Thanks in advanced

Comment by ElGalloGringo on 2016-10-18:
Did you ever get this figured out? I am running into the exact same problem. I have tried stopping by the IRC channel, but can't seem to get any help. I was hoping that you lack of follow-up indicated that you figured it out.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I kept hammering away at this and found the solution (at least it got past that part). Apparently, ROS is moving away from boost::shared_ptr and moving toward using the std::shared_ptr available in c++11 and higher. Because the instructions at http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi are a mix of installing packages and installing from source, this caused a discrepency where urdfdom_headers was a newer version that had the conversion from boost::shared_ptr to std::shared_ptr completed, but the rest of ROS Indigo is still expecting boost::shared_ptr.

So, the solution was to go back and find the last commit at https://github.com/ros/urdfdom_headers/commits/master that still had the boost::shared_ptr in the types.h file. Interestingly enough, you and I both originally thought that we needed to add c++11 support because types.h was using std::shared_ptr. This solved the problems of the std::shared_ptr support, but introduced new ones where it was trying to assign an std::shared_ptr to a boost::shared_ptr and vice versa.

The section should become

liburdfdom-headers-dev:

cd ~/ros_catkin_ws/external_src
$ git clone https://github.com/ros/urdfdom_headers.git
$ cd urdfdom_headers
$ git reset --hard 9aed725
$ cmake .
$ sudo checkinstall make install

Here the 'git reset --hard 9aed725' moved the revision back to the point where boost::shared_ptr is still in there. This also eliminated the need to add c++11 support in the CMakeLists.txt file.


Originally posted by ElGalloGringo with karma: 26 on 2016-10-18

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by 4ronie4 on 2017-04-26:
I have replaced my ArchLinux system package urdfdom_headers by one compiled with the reverted commit, and then the build error has changed, but still build failing: it is still trying to assign std::shared_ptr to a boost::shared_ptr

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.