Ask Your Question
0

catkin is compiling c++ with python

asked 2015-02-02 03:43:49 -0600

imuguruza gravatar image

updated 2015-02-02 05:13:09 -0600

gvdhoorn gravatar image

Hi everyone,

I'm a newbie in ROS, and after making the tutorials I'm trying to rosificate a C++ project that already is running in my BeagleBone Black.

My problem is that, when I compile the code using catkin_make_isolated, my main.cpp is not being properly built up:in the compilation process, pythonis being used, instead of gcc compiler. This means that I cannot execute the node using rosrun <package> main even if I have done source devel/setup.bash witihin catkin_ws.

This is the print out of the command line in the compilation process:

-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()

And this is how the CMakeLists.txt looks like:

cmake_minimum_required(VERSION 2.8.3)
project(ros_erle_ubled)

find_package(catkin REQUIRED COMPONENTS
  roscpp
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ros_erle_ubled
  CATKIN_DEPENDS roscpp
)

 include_directories(include)
 include_directories(
 ${catkin_INCLUDE_DIRS}
)

add_executable(main src/GPIO_BBB.cpp src/DycoLEDDriver.cpp src/DycoLED_Linux.cpp src/main.cpp)
target_link_libraries(main ${catkin_LIBRARIES})
add_dependencies(main ros_erle_ubled_main_cpp)

I have also tried to force to use gcc compiler executing the next command (with little success):

catkin_make_isolated -DCMAKE_CXX_COMPILER=/usr/bin/gcc --pkg ros_ubled

Any idea how can I proceed??

Thanks in advance!


Edit: console output of running catkin_make_isolated:

root@beaglebone:~/ros_catkin_ws#  catkin_make_isolated -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/gcc-4.7  --pkg ros_ubled
Base path: /root/ros_catkin_ws
Source space: /root/ros_catkin_ws/src
Build space: /root/ros_catkin_ws/build_isolated
Devel space: /root/ros_catkin_ws/devel_isolated
Install space: /root/ros_catkin_ws/install_isolated
Additional CMake Arguments: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/gcc-4.7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~  traversing 48 packages in topological order:
~~  - catkin
~~  - genmsg
~~  - gencpp
~~  - genlisp
~~  - genpy
~~  - console_bridge (plain cmake)
~~  - cpp_common
~~  - message_generation
~~  - message_runtime
~~  - mk
~~  - ros
~~  - ros_comm
~~  - rosbash
~~  - rosboost_cfg
~~  - rosbuild
~~  - rosclean
~~  - roscpp_traits
~~  - roscreate
~~  - rosgraph
~~  - roslang
~~  - rosmake
~~  - rosmaster
~~  - rosmsg
~~  - rospack
~~  - roslib
~~  - rosparam
~~  - rospy
~~  - rosservice
~~  - rostime
~~  - roscpp_serialization
~~  - rosbag_storage
~~  - roslaunch
~~  - rosunit
~~  - rosconsole
~~  - rostest
~~  - std_msgs
~~  - rosgraph_msgs
~~  - std_srvs
~~  - xmlrpcpp
~~  - roscpp
~~  - ros_ubled
~~  - rosout
~~  - message_filters
~~  - rosnode
~~  - rostopic
~~  - roswtf
~~  - topic_tools
~~  - rosbag
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Skipping package: 'catkin'
Skipping package: 'genmsg'
Skipping package: 'gencpp'
Skipping package: 'genlisp'
Skipping package: 'genpy'
Skipping package: 'console_bridge'
Skipping package: 'cpp_common'
Skipping package: 'message_generation'
Skipping package: 'message_runtime'
Skipping package: 'mk'
Skipping package: 'ros'
Skipping package: 'ros_comm'
Skipping package: 'rosbash'
Skipping package: 'rosboost_cfg'
Skipping package: 'rosbuild'
Skipping package: 'rosclean'
Skipping package: 'roscpp_traits'
Skipping package: 'roscreate'
Skipping package: 'rosgraph'
Skipping package: 'roslang'
Skipping package: 'rosmake'
Skipping package: 'rosmaster'
Skipping package: 'rosmsg'
Skipping package: 'rospack'
Skipping package: 'roslib'
Skipping package: 'rosparam'
Skipping package: 'rospy'
Skipping package: 'rosservice'
Skipping package: 'rostime'
Skipping package: 'roscpp_serialization'
Skipping package: 'rosbag_storage'
Skipping package: 'roslaunch'
Skipping package: 'rosunit'
Skipping package: 'rosconsole'
Skipping package: 'rostest'
Skipping package: 'std_msgs'
Skipping package: 'rosgraph_msgs'
Skipping package: 'std_srvs'
Skipping package: 'xmlrpcpp'
Skipping package: 'roscpp'

==> Processing catkin package: 'ros_ubled'
==> Building with env: '/root/ros_catkin_ws/devel_isolated/roscpp/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/root/ros_catkin_ws/build_isolated/ros_ubled'
-- Using CATKIN_DEVEL_PREFIX: /root/ros_catkin_ws/build_isolated/ros_ubled/devel
-- Using CMAKE_PREFIX_PATH: /root/ros_catkin_ws/devel_isolated/roscpp;/root/ros_catkin_ws/devel_isolated/xmlrpcpp;/root/ros_catkin_ws/devel_isolated/std_srvs;/root/ros_catkin_ws/devel_isolated/rosgraph_msgs;/root/ros_catkin_ws/devel_isolated/std_msgs;/root/ros_catkin_ws/devel_isolated/rostest;/root/ros_catkin_ws/devel_isolated/rosconsole;/root/ros_catkin_ws/devel_isolated/rosunit;/root/ros_catkin_ws/devel_isolated ...
(more)
edit retag flag offensive close merge delete

Comments

1

I'm pretty sure it is not using python as a c++ compiler. The message just means that this is the python executable path being used for python. Please post the full catkin_make output.

dornhege gravatar imagedornhege ( 2015-02-02 03:53:24 -0600 )edit

I was just going to post the same @dornhege: that message just tells you which version of Python catkin has found. It does not mean that your c++ is being 'compiled' by python.

gvdhoorn gravatar imagegvdhoorn ( 2015-02-02 03:54:46 -0600 )edit

add_dependencies(main ros_erle_ubled_main_cpp)

@imuguraza: could you tell us what this line is for?

gvdhoorn gravatar imagegvdhoorn ( 2015-02-02 04:05:16 -0600 )edit

Here the commandline output: http://pastebin.com/VpggzZjT

imuguruza gravatar imageimuguruza ( 2015-02-02 04:55:24 -0600 )edit
1

According to that everything worked fine.

dornhege gravatar imagedornhege ( 2015-02-02 05:13:10 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-02-02 05:14:52 -0600

gvdhoorn gravatar image

According to:

==> make -j1 -l1 in '/root/ros_catkin_ws/build_isolated/ros_ubled'
Linking CXX executable devel/lib/ros_ubled/main
[100%] Built target main
<== Finished processing package [41 of 48]: 'ros_ubled'

your C++ target has been built. Could you check the contents of /root/ros_catkin_ws/devel_isolated/lib/ros_ubled? If I'm not mistaked, there should be a binary called main in there.

edit flag offensive delete link more

Comments

Yes, the main.elf is there! Thanks, but why is not appearing when I type rosrun ros_ubled and press tab key??

imuguruza gravatar imageimuguruza ( 2015-02-02 08:45:27 -0600 )edit

After you've ran catkin_make_isolated, source devel/setup.bash in a new terminal. If rosrun can't find your binary, try a rospack profile in the same terminal. If it still can't find it, something is not right. Btw, why is it main.elf? Are you cross-compiling?

gvdhoorn gravatar imagegvdhoorn ( 2015-02-02 08:55:59 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-02-02 03:41:47 -0600

Seen: 562 times

Last updated: Feb 02 '15