Compilation error when moving a package to an other workspace [closed]

asked 2016-12-20 11:38:03 -0600

aymar111 gravatar image

updated 2017-01-04 05:29:04 -0600

EDIT Solved with this answer

Hi,

I have written a package in c++ that compile in my workspace ("catkin") but throw the error shown at the end when compiled in a different freshly created workspace ("catkin_ws").

I think I have properly configured my new "catkin_ws" as the first lines of catkin_make look correct :

Base path: /home/ubuntu/catkin_ws
Source space: /home/ubuntu/catkin_ws/src
Build space: /home/ubuntu/catkin_ws/build
Devel space: /home/ubuntu/catkin_ws/devel
Install space: /home/ubuntu/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ubuntu/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/ubuntu/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/ubuntu/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout    
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on

I'm working with ROS Indigo on Ubuntu 14.04, my package files can be found here.

I've found this related question with a similar compilation error, I know I am publishing a double on a topic that takes in std_msgs::Float64 (see the following line) but I don't understand why this code compile and work on my "catkin" workspace but not in the "catkin_ws" one, has anyone got an idea about that ?

if(hand_brake_state_.data==1) {hand_brake_=0; hand_brake.publish(hand_brake_);}

I also tried to clean CMakeCache that I thought could create the error, according to this question, but it still doesn't compile.

Thanks for your time and help.

Error message :

[100%] Built target cmd_xp9000_generate_messages
In file included from /opt/ros/indigo/include/ros/serialization.h:37:0,
             from /opt/ros/indigo/include/ros/publisher.h:34,
             from /opt/ros/indigo/include/ros/node_handle.h:32,
             from /opt/ros/indigo/include/ros/ros.h:45,
             from /home/ubuntu/catkin_ws/src/cmd_xp9000/src/cmd_xp9000_node.cpp:1:
/opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char*    ros::message_traits::MD5Sum<M>::value(const M&) [with M = double]’:
/opt/ros/indigo/include/ros/message_traits.h:255:104:   required from ‘const char* ros::message_traits::md5sum(const M&) [with M = double]’
/opt/ros/indigo/include/ros/publisher.h:112:7:   required from ‘void ros::Publisher::publish(const M&) const [with M = double]’
/home/ubuntu/catkin_ws/src/cmd_xp9000/src/cmd_xp9000_node.cpp:170:79:   required from here
/opt/ros/indigo/include/ros/message_traits.h:126:34: error: request for member ‘__getMD5Sum’ in ‘m’, which is of non-class type ‘const double’
 return m.__getMD5Sum().c_str();
                              ^
/opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType<M>::value(const M&) [with M = double]’:
/opt/ros/indigo/include/ros/message_traits.h:264:106:   required from ‘const char* ros::message_traits::datatype(const M&) [with M = double]’
/opt/ros/indigo/include/ros/publisher.h:112:7:   required from ‘void ros::Publisher ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by aymar111
close date 2017-01-04 05:24:58.874521

Comments

Off-topic, but: are you automating a Krups XP9000?

gvdhoorn gravatar image gvdhoorn  ( 2016-12-20 11:47:18 -0600 )edit

Almost, i am trying to automate the polaris xp900 from the DRCSimulation in gazebo !

aymar111 gravatar image aymar111  ( 2016-12-21 02:16:20 -0600 )edit