ROS interface compilation fail

Typically: "How do I... ", "How can I... " questions
vakker
Posts: 4
Joined: 08 Dec 2015, 20:56

ROS interface compilation fail

Post by vakker » 08 Jun 2016, 16:01

Hi

I tried using the ROS interface, but for the precompiled version it said:

Code: Select all

/opt/V-REP_PRO_EDU_V3_3_1_64_Linux/vrep: symbol lookup error: /opt/V-REP_PRO_EDU_V3_3_1_64_Linux/libv_repExtRosInterface.so: undefined symbol: _ZN3ros4initERiPPcRKSsj
so I tried to compile it, but I get an error:

Code: Select all

make[2]: *** No rule to make target 'v_repExtRosInterface/CMakeFiles/v_repExtRosInterface.dir/build'. Stop.
CMakeFiles/Makefile2:6727: recipe for target 'v_repExtRosInterface/CMakeFiles/v_repExtRosInterface.dir/all' failed
make[1]: *** [v_repExtRosInterface/CMakeFiles/v_repExtRosInterface.dir/all] Error 2
What am I doing wrong?
Thanks

coppelia
Site Admin
Posts: 7266
Joined: 14 Dec 2012, 00:25

Re: ROS interface compilation fail

Post by coppelia » 09 Jun 2016, 09:34

Hello,

what instructions do you use to build the packages? Did you make sure the ROS workspace is correctly configured?
You need to use the catkin build tools.

If you didn't modify the package source, then try with something like:

Code: Select all

source /opt/ros/indigo/setup.bash ** or source /opt/ros/jade/setup.bash, etc. **
rm -r -f ~/catkin_ws/*  ** completely clean the workspace first **
mkdir ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ..
catkin build
source devel/setup.bash
** copy v_repExtRosInterface folder (or/and the other packages) into ~/catkin_ws/src **
catkin build
Cheers

vakker
Posts: 4
Joined: 08 Dec 2015, 20:56

Re: ROS interface compilation fail

Post by vakker » 09 Jun 2016, 10:27

Thanks for the reply.
Yep, I'm doing exactly the same, except there is no catkin build in release Kinetic (or I just can't find it? see http://wiki.ros.org/ROS/Tutorials/catki ... ngPackages), so I ran catkin_make as the last step as well.
It gives an error:

Code: Select all

...
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 8 packages in topological order:
-- ~~  - ros_bubble_rob2
-- ~~  - vrep_common
-- ~~  - ros_bubble_rob
-- ~~  - vrep_joy
-- ~~  - vrep_plugin
-- ~~  - vrep_ros_interface
-- ~~  - vrep_skeleton_msg_and_srv
-- ~~  - vrep_plugin_skeleton
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'ros_bubble_rob2'
-- ==> add_subdirectory(ros_bubble_rob2)
-- +++ processing catkin package: 'vrep_common'
-- ==> add_subdirectory(vrep_common)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- vrep_common: 8 messages, 97 services
-- +++ processing catkin package: 'ros_bubble_rob'
-- ==> add_subdirectory(ros_bubble_rob)
-- +++ processing catkin package: 'vrep_joy'
-- ==> add_subdirectory(vrep_joy)
-- +++ processing catkin package: 'vrep_plugin'
-- ==> add_subdirectory(vrep_plugin)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'vrep_ros_interface'
-- ==> add_subdirectory(v_repExtRosInterface)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'vrep_skeleton_msg_and_srv'
-- ==> add_subdirectory(vrep_skeleton_msg_and_srv)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- vrep_skeleton_msg_and_srv: 0 messages, 1 services
-- +++ processing catkin package: 'vrep_plugin_skeleton'
-- ==> add_subdirectory(vrep_plugin_skeleton)
-- Configuring done
CMake Error at v_repExtRosInterface/CMakeLists.txt:36 (add_library):
  Cannot find source file:

    generated/ros_msg_io.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


CMake Error: CMake can not determine linker language for target: v_repExtRosInterface
CMake Error: Cannot determine link language for target "v_repExtRosInterface".
-- Generating done
-- Build files have been written to: /home/vince/catkin_ws/build
Invoking "cmake" failed
but if I run it the second time, it starts compiling it, compiles everything else, except the ROS interface:

Code: Select all

make[2]: *** No rule to make target 'v_repExtRosInterface/CMakeFiles/v_repExtRosInterface.dir/build'. Stop.
CMakeFiles/Makefile2:6727: recipe for target 'v_repExtRosInterface/CMakeFiles/v_repExtRosInterface.dir/all' failed
Thanks

coppelia
Site Admin
Posts: 7266
Joined: 14 Dec 2012, 00:25

Re: ROS interface compilation fail

Post by coppelia » 09 Jun 2016, 10:35

Yes, you need to install the catkin tools, then you'll be able to use catkin build.

Cheers

vakker
Posts: 4
Joined: 08 Dec 2015, 20:56

Re: ROS interface compilation fail

Post by vakker » 09 Jun 2016, 10:59

If I try to install ros-kinetic-catkin it says:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-kinetic-catkin is already the newest version (0.7.1-0xenial-20160318-144042-0700).
0 to upgrade, 0 to newly install, 0 to remove and 17 not to upgrade.
but I installed it anyway by:

Code: Select all

sudo apt-get install python-catkin-tools
Then I issued catkin build, and it gave:

Code: Select all

The build space at '/home/vakker/catkin_ws/build' was previously built by 'catkin_make'. Please remove the build space or pick a different build space.
So what should I do?

coppelia
Site Admin
Posts: 7266
Joined: 14 Dec 2012, 00:25

Re: ROS interface compilation fail

Post by coppelia » 09 Jun 2016, 15:45

Did you try to clear the workspace? This is what the message is suggesting. Have a look at the commands I previously posted for a clean build.

Cheers

vakker
Posts: 4
Joined: 08 Dec 2015, 20:56

Re: ROS interface compilation fail

Post by vakker » 09 Jun 2016, 16:18

Yes, but if I clean the workspace, and run the things again, then it will still complain, since the workspace was made by catkin_make, so I tried using catkin build only, but it also gave errors:

Code: Select all

Workspace configuration appears valid.
-------------------------------------------------------------------------
[build] Found '8' packages in 0.0 seconds.                                                                                                                                    
[build] Updating package table.                                                                                                                                               
Starting  >>> ros_bubble_rob2                                                                                                                                                 
Starting  >>> vrep_common                                                                                                                                                     
Starting  >>> vrep_joy                                                                                                                                                        
Starting  >>> vrep_ros_interface                                                                                                                                              
Finished  <<< ros_bubble_rob2                          [ 14.8 seconds ]                                                                                                       
Finished  <<< vrep_joy                                 [ 14.7 seconds ]                                                                                                       
Starting  >>> vrep_skeleton_msg_and_srv                                                                                                                                       
Finished  <<< vrep_skeleton_msg_and_srv                [ 11.1 seconds ]                                                                                                       
Starting  >>> vrep_plugin_skeleton                                                                                                                                            
______________________________________________________________________________________________________________________________________________________________________________
Errors     << vrep_plugin_skeleton:make /home/vince/catkin_ws/logs/vrep_plugin_skeleton/build.make.000.log                                                                    
/usr/bin/ld: cannot find -lroslib
/usr/bin/ld: cannot find -lrosconsole
/usr/bin/ld: cannot find -lrostime
/usr/bin/ld: cannot find -lrospack
/usr/bin/ld: cannot find -lroscpp_serialization
/usr/bin/ld: cannot find -lroscpp
collect2: error: ld returned 1 exit status
make[2]: *** [/home/vince/catkin_ws/devel/.private/vrep_plugin_skeleton/lib/libv_repExtRosSkeleton.so] Error 1
make[1]: *** [CMakeFiles/v_repExtRosSkeleton.dir/all] Error 2
make: *** [all] Error 2
cd /home/vince/catkin_ws/build/vrep_plugin_skeleton; catkin build --get-env vrep_plugin_skeleton | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
..............................................................................................................................................................................
Failed     << vrep_plugin_skeleton:make                [ Exited with code 2 ]                                                                                                 
Failed    <<< vrep_plugin_skeleton                     [ 19.0 seconds ]                                                                                                       
Abandoned <<< ros_bubble_rob                           [ Unrelated job failed ]                                                                                               
Abandoned <<< vrep_plugin                              [ Unrelated job failed ]                                                                                               
Finished  <<< vrep_common                              [ 1 minute and 28.4 seconds ]                                                                                          
______________________________________________________________________________________________________________________________________________________________________________
Errors     << vrep_ros_interface:make /home/vince/catkin_ws/logs/vrep_ros_interface/build.make.000.log                                                                        
/usr/bin/ld: cannot find -lroslib
/usr/bin/ld: cannot find -lrosconsole
/usr/bin/ld: cannot find -lrostime
/usr/bin/ld: cannot find -lrospack
/usr/bin/ld: cannot find -lroscpp_serialization
/usr/bin/ld: cannot find -lroscpp
/usr/bin/ld: cannot find -ltf
/usr/bin/ld: cannot find -limage_transport
collect2: error: ld returned 1 exit status
make[2]: *** [/home/vince/catkin_ws/devel/.private/vrep_ros_interface/lib/libv_repExtRosInterface.so] Error 1
make[1]: *** [CMakeFiles/v_repExtRosInterface.dir/all] Error 2
make: *** [all] Error 2
cd /home/vince/catkin_ws/build/vrep_ros_interface; catkin build --get-env vrep_ros_interface | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
..............................................................................................................................................................................
Failed     << vrep_ros_interface:make                  [ Exited with code 2 ]                                                                                                 
Failed    <<< vrep_ros_interface                       [ 2 minutes and 55.4 seconds ]                                                                                         
[build] Summary: 4 of 8 packages succeeded.                                                                                                                                   
[build]   Ignored:   None.                                                                                                                                                    
[build]   Warnings:  None.                                                                                                                                                    
[build]   Abandoned: 2 packages were abandoned.                                                                                                                               
[build]   Failed:    2 packages failed.                                                                                                                                       
[build] Runtime: 2 minutes and 56.1 seconds total. 
Also, I think later ROS would complain that my workspace was built by catkin and not catkin_make.

coppelia
Site Admin
Posts: 7266
Joined: 14 Dec 2012, 00:25

Re: ROS interface compilation fail

Post by coppelia » 10 Jun 2016, 07:53

Ok, I didn't realize you are using kinetic. So you will have to add following to most CMakeLists.txt files:

Code: Select all

link_directories("/opt/ros/fuerte/lib")
link_directories("/opt/ros/groovy/lib")
link_directories("/opt/ros/hydro/lib")
link_directories("/opt/ros/indigo/lib")
link_directories("/opt/ros/jade/lib")
link_directories("/opt/ros/kinetic/lib")
Cheers

prisca

Re: ROS interface compilation fail

Post by prisca » 11 Oct 2016, 10:58

Hi, I've ran into the same issue, using Ubuntu 16.04, ROS Kinetic and V-REP PRO EDU 3.3.2.

I've managed to build V-REP packages with catkin build (from package python-catkin-tools) in a dedicated workspace.

However I have linking warnings in cmake.

With vrep_plugin:
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'roslib' but neither 'roslib_INCLUDE_DIRS' nor
'roslib_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:8 (catkin_package)
with vrep_plugin_skeleton:
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'roslib' but neither 'roslib_INCLUDE_DIRS' nor
'roslib_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:8 (catkin_package)
with vrep_ros_interface:
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'brics_actuator' but neither
'brics_actuator_INCLUDE_DIRS' nor 'brics_actuator_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'control_msgs' but neither
'control_msgs_INCLUDE_DIRS' nor 'control_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'diagnostic_msgs' but neither
'diagnostic_msgs_INCLUDE_DIRS' nor 'diagnostic_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'map_msgs' but neither 'map_msgs_INCLUDE_DIRS'
nor 'map_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'nav_msgs' but neither 'nav_msgs_INCLUDE_DIRS'
nor 'nav_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'pcl_msgs' but neither 'pcl_msgs_INCLUDE_DIRS'
nor 'pcl_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'shape_msgs' but neither
'shape_msgs_INCLUDE_DIRS' nor 'shape_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'tf2_geometry_msgs' but neither
'tf2_geometry_msgs_INCLUDE_DIRS' nor 'tf2_geometry_msgs_LIBRARIES' is
defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'tf2_sensor_msgs' but neither
'tf2_sensor_msgs_INCLUDE_DIRS' nor 'tf2_sensor_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'trajectory_msgs' but neither
'trajectory_msgs_INCLUDE_DIRS' nor 'trajectory_msgs_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)


CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'visualization_msgs' but neither
'visualization_msgs_INCLUDE_DIRS' nor 'visualization_msgs_LIBRARIES' is
defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:12 (catkin_package)
Can you please tell me how to solve? Thanks.

prisca

Re: ROS interface compilation fail

Post by prisca » 11 Oct 2016, 14:03

OK, I found out that I just needed to set those variables in packages CMakeLists.txt like this:

Code: Select all

set(roslib_LIBRARIES "/opt/ros/kinetic/lib/roslib")
Also before building, I had to compile and install globally brics_actuator from Github, because it's not present in Kinetic.

The variables setting is weird, it's like catkin build is not able to recognize /opt/ros/kinetic even if I did the directory linking you suggested.

...Plus, it's still not working completely: in the tutorial here I'm not able to see the sensor data with this command:

Code: Select all

rosrun image_view image_view image:=/visionSensorData
and one of the little robots in controlTypeExamples.ttt is not able to find its plugin.

Is it possible to make V-REP fully work with ROS Kinetic, or it'd be better to switch back to Indigo for the time being?

Post Reply