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

Error Building Catkin-based Packages #32

Closed
Donny3000 opened this issue Jun 7, 2014 · 19 comments
Closed

Error Building Catkin-based Packages #32

Donny3000 opened this issue Jun 7, 2014 · 19 comments

Comments

@Donny3000
Copy link

All,

I'm trying to build the rtt_ros_integration package by following the instructions at https://github.com/orocos/rtt_ros_integration, but I get a compile error when executing the "catkin_make" step of the Catkin-based build procedure. The error I get is as follows:

[  8%] Building CXX object rtt_ros_integration/rtt_roscomm/CMakeFiles/rtt_rosservice.dir/src/rtt_rosservice_service.cpp.o
cd /home/ubuntu/catkin_ws/underlay/build/rtt_ros_integration/rtt_roscomm && /usr/bin/c++   -DOROCOS_TARGET=xenomai -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"rtt_roscomm\" -Drtt_rosservice_EXPORTS -fPIC -I/home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include -I/home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/orocos -I/usr/xenomai/include/xenomai -I/usr/xenomai/include/xenomai/posix -I/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_ros/include -I/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/include -I/opt/ros/hydro/include      -o CMakeFiles/rtt_rosservice.dir/src/rtt_rosservice_service.cpp.o -c /home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp: In member function 'RTT::base::OperationCallerBaseInvoker* ROSServiceService::get_owner_operation_caller(std::string)':
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:54:84: error: conversion from 'RTT::ServiceRequester*' to non-scalar type 'boost::shared_ptr<RTT::ServiceRequester>' requested
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:60:42: error: no match for 'operator=' in 'required = required.boost::shared_ptr<T>::operator-><RTT::ServiceRequester>()->RTT::ServiceRequester::requires((*(const string*)it.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*<std::basic_string<char>*, std::vector<std::basic_string<char> > >()))'
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:60:42: note: candidates are:
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/rtt/rtt-fwd.hpp:48,
                 from /home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/rtt/RTT.hpp:52,
                 from /home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:309:18: note: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = RTT::ServiceRequester; boost::shared_ptr<T> = boost::shared_ptr<RTT::ServiceRequester>]
/usr/include/boost/smart_ptr/shared_ptr.hpp:309:18: note:   no known conversion for argument 1 from 'RTT::ServiceRequester*' to 'const boost::shared_ptr<RTT::ServiceRequester>&'
/usr/include/boost/smart_ptr/shared_ptr.hpp:318:18: note: template<class Y> boost::shared_ptr& boost::shared_ptr::operator=(const boost::shared_ptr<Y>&) [with Y = Y; T = RTT::ServiceRequester]
/usr/include/boost/smart_ptr/shared_ptr.hpp:318:18: note:   template argument deduction/substitution failed:
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:60:42: note:   mismatched types 'const boost::shared_ptr<X>' and 'RTT::ServiceRequester*'
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/rtt/rtt-fwd.hpp:48,
                 from /home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/rtt/RTT.hpp:52,
                 from /home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:329:18: note: template<class Y> boost::shared_ptr& boost::shared_ptr::operator=(std::auto_ptr<_Tp1>&) [with Y = Y; T = RTT::ServiceRequester]
/usr/include/boost/smart_ptr/shared_ptr.hpp:329:18: note:   template argument deduction/substitution failed:
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:60:42: note:   mismatched types 'std::auto_ptr<T>' and 'RTT::ServiceRequester*'
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/rtt/rtt-fwd.hpp:48,
                 from /home/ubuntu/catkin_ws/underlay_isolated/install_isolated/include/rtt/RTT.hpp:52,
                 from /home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:338:77: note: template<class Ap> typename boost::detail::sp_enable_if_auto_ptr<Ap, boost::shared_ptr<T>&>::type boost::shared_ptr::operator=(Ap) [with Ap = Ap; T = RTT::ServiceRequester]
/usr/include/boost/smart_ptr/shared_ptr.hpp:338:77: note:   template argument deduction/substitution failed:
/usr/include/boost/smart_ptr/shared_ptr.hpp: In substitution of 'template<class Ap> typename boost::detail::sp_enable_if_auto_ptr<Ap, boost::shared_ptr<T>&>::type boost::shared_ptr::operator=(Ap) [with Ap = Ap; T = RTT::ServiceRequester] [with Ap = RTT::ServiceRequester*]':
/home/ubuntu/catkin_ws/underlay/src/rtt_ros_integration/rtt_roscomm/src/rtt_rosservice_service.cpp:60:42:   required from here
/usr/include/boost/smart_ptr/shared_ptr.hpp:338:77: error: no type named 'type' in 'struct boost::detail::sp_enable_if_auto_ptr<RTT::ServiceRequester*, boost::shared_ptr<RTT::ServiceRequester>&>'
make[2]: *** [rtt_ros_integration/rtt_roscomm/CMakeFiles/rtt_rosservice.dir/src/rtt_rosservice_service.cpp.o] Error 1
make[2]: Leaving directory `/home/ubuntu/catkin_ws/underlay/build'
make[1]: *** [rtt_ros_integration/rtt_roscomm/CMakeFiles/rtt_rosservice.dir/all] Error 2
make[1]: Leaving directory `/home/ubuntu/catkin_ws/underlay/build'
make: *** [all] Error 2
Invoking "make" failed

Does anyone know what I might be doing wrong? I've made sure that I've followed the directions closely. Also, I'm building on Ubuntu 13.04 and ROS Hydro.

@jbohren
Copy link
Contributor

jbohren commented Jun 7, 2014

What version of orocos are you building against?

@Donny3000
Copy link
Author

I'm building against the toolchain-2.7 branch of the gitorious orocos toolchain from the README.md. I'm also using the hydro-develop branch of the RTT ROS integration repo.

@Donny3000
Copy link
Author

The more that I look at these errors, the more it seems that this appears to be an issue with the boost's smart pointers (specifically shared_ptr's) and the assignment operator. Looking at the documentation for the shared_ptr on Boost's website, creation of a shared_ptr should be done with the new operator or using the reset() method of the shared_ptr so that the shared_ptr can take ownership of a pointer of the templated type.

For instance the code line generating the error is currently:

// Iterate through the tokens except for the last one (the operation name)
boost::shared_ptr<RTT::ServiceRequester> required = this->getOwner()->requires();

which, I believe should be something like the following:

// Iterate through the tokens except for the last one (the operation name)
boost::shared_ptr<RTT::ServiceRequester> required( this->getOwner()->requires() );

or

// Iterate through the tokens except for the last one (the operation name)
boost::shared_ptr<RTT::ServiceRequester> required;
required.reset( this->getOwner()->requires() );

Is this a valid observation or am I completely in left field here? If valid, this is done in serval places throughout the code on the hydro-devel branch currently at commit cd18580

@jbohren
Copy link
Contributor

jbohren commented Jun 9, 2014

There was an api change in the return value of the requires function at one point. It looks like some of the code may have been reverted in a merge. I'll look into it Monday morning.

@jbohren
Copy link
Contributor

jbohren commented Jun 9, 2014

The latest version of requires() returns a shared pointer, not a bare one, so it should be copyable: https://github.com/orocos-toolchain/rtt/blob/cd916253dd223d46ed9aa833b8a9691cae4a3b3f/rtt/ServiceRequester.hpp#L128

Meanwhile, it looks like https://github.com/orocos-toolchain/orocos_toolchain is out of date and its submodules need to be updated (it was last updated to 91f7f03 / March 14th).

Your build should work if you go into your rtt directory and checkout toolchain-2.7.

@psoetens Is it ok if I bump the versions in the orocos_toolchain repo?

@Donny3000
Copy link
Author

So, updating the RTT repo to toolchain-2.7 works and I can get past the RTT library. But, the build breaks on the OCL repo with a similar error:

/home/ubuntu/catkin_ws/underlay_isolated/src/orocos/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp: In member function 'bool OCL::TaskBrowser::printService(std::string)':
/home/ubuntu/catkin_ws/underlay_isolated/src/orocos/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:1349:44: error: cannot convert 'RTT::ServiceRequester::shared_ptr {aka boost::shared_ptr<RTT::ServiceRequester>}' to 'RTT::ServiceRequester*' in assignment
make[2]: *** [taskbrowser/CMakeFiles/orocos-ocl-taskbrowser.dir/TaskBrowser.cpp.o] Error 1
make[1]: *** [taskbrowser/CMakeFiles/orocos-ocl-taskbrowser.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'ocl':

Should I make sure all of the folders under orocos_toolchain are at the toolchain-2.7 branch?

@jbohren
Copy link
Contributor

jbohren commented Jun 9, 2014

Should I make sure all of the folders under orocos_toolchain are at the toolchain-2.7 branch?

Yeah, try that and it should work.

@Donny3000
Copy link
Author

Just confirmed this evening that making sure all repos under orocos_toolchain are on the toolchain-2.7 branch works and evening thing compiles successfully.

Many thanks for your assistance!

@jbohren
Copy link
Contributor

jbohren commented Jun 10, 2014

Many thanks for your assistance!

No problem. You can probably close this ticket now, I've created orocos-toolchain/orocos_toolchain/issues/9 to track the submodules over in orocos-toolchain.

@balasubramani3
Copy link

I have installed orocos toolchain 2.7 in indigo ros, After that i found out the version of orocos tool chain isoudated for indigo. so, I installed orocos toolchain 2.8. I have tried catkin_make_isolated --install. How to debug this error. how can i make sure all the files is in toolchain 2.8

`CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CURSES_CURSES_LIBRARY (ADVANCED)
linked by target "lua-repl" in directory /home/coe/ws/underlay_isolated/src/orocos/orocos_toolchain/ocl/lua
linked by target "lua-repl-tlsf" in directory /home/coe/ws/underlay_isolated/src/orocos/orocos_toolchain/ocl/lua

-- Configuring incomplete, errors occurred!
See also "/home/coe/ws/underlay_isolated/build_isolated/ocl/install/CMakeFiles/CMakeOutput.log".
See also "/home/coe/ws/underlay_isolated/build_isolated/ocl/install/CMakeFiles/CMakeError.log".
<== Failed to process package 'ocl':
Command '['/home/coe/ws/underlay_isolated/install_isolated/env.sh', 'cmake', '/home/coe/ws/underlay_isolated/src/orocos/orocos_toolchain/ocl', '-DCMAKE_INSTALL_PREFIX=/home/coe/ws/underlay_isolated/install_isolated', '-G', 'Unix Makefiles']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/coe/ws/underlay_isolated/build_isolated/ocl && /home/coe/ws/underlay_isolated/install_isolated/env.sh cmake /home/coe/ws/underlay_isolated/src/orocos/orocos_toolchain/ocl -DCMAKE_INSTALL_PREFIX=/home/coe/ws/underlay_isolated/install_isolated -G 'Unix Makefiles'

Command failed, exiting.
`

@ahoarau
Copy link
Contributor

ahoarau commented May 12, 2016

I seems you don't have ncurses installed : sudo apt-get install ncurses-dev and try again.

To make sure all the files are 2.8, the best is to create a new clean workspace and git clone https://github.com/orocos-toolchain/orocos-toolchain --recursive -b toolchain-2.8.

@balasubramani3
Copy link

To clean a workspace, just we have to delete the workspace only right?

@ahoarau
Copy link
Contributor

ahoarau commented May 12, 2016

You can remove build/ and devel/, delete the current orocos-toolchain folder (in src/) and redownload it.
I'd create another ws :

mkdir -p ~/orocos_ws/src 
cd ~/orocos_ws/src
git clone https://github.com/orocos-toolchain/orocos-toolchain --recursive -b toolchain-2.8

But if you don't use Xenomai, then you can just use the debians :)

sudo apt-get install ros-indigo-rtt-* ros-indigo-orocos-toolchain et voilà !

@balasubramani3
Copy link

balasubramani3 commented May 12, 2016

I am new to ros and orocos . what is xenomai?. It may be silly question to you. sorry for that.

How to remove buid and devel?

@ahoarau
Copy link
Contributor

ahoarau commented May 12, 2016

To remove build and devel, just delete them : rm -rf build/ devel/

Xenomai is a library+kernel patches to create hard realtime application. I doubt you'll need it now, so you can just install orocos via apt-get.

@balasubramani3
Copy link

Thank you. I will come back to you after I try this

@balasubramani3
Copy link

Thank you for support. It worked nicely.:)

When i want to install rtt_ros integration with this code
mkdir -p ~/ws/underlay/src cd ~/ws/underlay git clone https://github.com/orocos/rtt_ros_integration.git src/rtt_ros_integration catkin_make source devel/setup.sh

I am getting this error.
`CMake Error at rtt_ros_integration/rtt_ros/CMakeLists.txt:6 (find_package):
By not providing "FindOROCOS-RTT.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"OROCOS-RTT", but CMake did not find one.

Could not find a package configuration file provided by "OROCOS-RTT" with
any of the following names:

OROCOS-RTTConfig.cmake
orocos-rtt-config.cmake

Add the installation prefix of "OROCOS-RTT" to CMAKE_PREFIX_PATH or set
"OROCOS-RTT_DIR" to a directory containing one of the above files. If
"OROCOS-RTT" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "/home/coe/orocos_ws/underlay/src/build/CMakeFiles/CMakeOutput.log".
See also "/home/coe/orocos_ws/underlay/src/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed`

How can I solve it?

@balasubramani3
Copy link

balasubramani3 commented May 13, 2016

I have installed rtt_soem seperatel in a different folder in same workspace. i build it by using catkin_make. It is working properly. but when run this code.

sudo setcap cap_net_raw+ep bin/slaveinfo

i got output like this,

Failed to set capabilities on filebin/64:00:6A:6B:2C:30' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file`

Thank you for your support
Balasubramani

@wei1224hf
Copy link

Thank you for support. It worked nicely.:)

When i want to install rtt_ros integration with this code mkdir -p ~/ws/underlay/src cd ~/ws/underlay git clone https://github.com/orocos/rtt_ros_integration.git src/rtt_ros_integration catkin_make source devel/setup.sh

I am getting this error. `CMake Error at rtt_ros_integration/rtt_ros/CMakeLists.txt:6 (find_package): By not providing "FindOROCOS-RTT.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OROCOS-RTT", but CMake did not find one.

Could not find a package configuration file provided by "OROCOS-RTT" with any of the following names:

OROCOS-RTTConfig.cmake
orocos-rtt-config.cmake

Add the installation prefix of "OROCOS-RTT" to CMAKE_PREFIX_PATH or set "OROCOS-RTT_DIR" to a directory containing one of the above files. If "OROCOS-RTT" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/home/coe/orocos_ws/underlay/src/build/CMakeFiles/CMakeOutput.log". See also "/home/coe/orocos_ws/underlay/src/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed`

How can I solve it?

I have the same problem , how you solve it ?

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

5 participants