ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Cannot find .h files after catkin_make clean

asked 2016-06-22 09:21:23 -0500

thisyearspairo gravatar image

I have this package i made, that it worked, but I made a catkin_make clean, and then a catkin_make and now the code it's unable to find a .h file that was created from a .srv and it's in the include file of this package. I don't know what to do. Please help.

edit retag flag offensive close merge delete

Comments

Please add more information.. CMakeLists..etc

Your package was working before you clean catkin_make?

ROSkinect gravatar image ROSkinect  ( 2016-06-22 10:01:54 -0500 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2016-06-22 10:12:42 -0500

thisyearspairo gravatar image

updated 2016-06-22 10:21:59 -0500

I've managed to solve that thing, but now I have other problems with catkin_make and some packages that used to work just fine and I haven't modified their code, here's come code that appears in my console when i call catkin_make:

Scanning dependencies of target costmap_2d_node

[ 81%] Building CXX object navigation/costmap_2d/CMakeFiles/costmap_2d_node.dir/src/costmap_2d_node.cpp.o /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp: In constructor ‘RbcarPad::RbcarPad()’: /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:264:35: error: ‘ackermann_msgs’ was not declared in this scope this->vel_pub_ = nh_.advertise<ackermann_msgs::ackermanndrivestamped>(this->cmd_topic_vel, 1); ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:264:25: error: parse error in template argument list this->vel_pub_ = nh_.advertise<ackermann_msgs::ackermanndrivestamped>(this->cmd_topic_vel, 1); ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:264:96: error: no matching function for call to ‘ros::NodeHandle::advertise(std::string&, int)’ this->vel_pub_ = nh_.advertise<ackermann_msgs::ackermanndrivestamped>(this->cmd_topic_vel, 1); ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:264:96: note: candidates are: In file included from /opt/ros/indigo/include/ros/ros.h:45:0, from /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:34: /opt/ros/indigo/include/ros/node_handle.h:236:15: note: template<class m=""> ros::Publisher ros::NodeHandle::advertise(const string&, uint32_t, bool) Publisher advertise(const std::string& topic, uint32_t queue_size, bool latch = false) ^ /opt/ros/indigo/include/ros/node_handle.h:236:15: note: template argument deduction/substitution failed: /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:264:96: error: template argument 1 is invalid this->vel_pub_ = nh_.advertise<ackermann_msgs::ackermanndrivestamped>(this->cmd_topic_vel, 1); ^ In file included from /opt/ros/indigo/include/ros/ros.h:45:0, from /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:34: /opt/ros/indigo/include/ros/node_handle.h:302:13: note: template<class m=""> ros::Publisher ros::NodeHandle::advertise(const string&, uint32_t, const SubscriberStatusCallback&, const SubscriberStatusCallback&, const VoidConstPtr&, bool) Publisher advertise(const std::string& topic, uint32_t queue_size, ^ /opt/ros/indigo/include/ros/node_handle.h:302:13: note: template argument deduction/substitution failed: /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:264:96: error: template argument 1 is invalid this->vel_pub_ = nh_.advertise<ackermann_msgs::ackermanndrivestamped>(this->cmd_topic_vel, 1); ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp: In member function ‘void RbcarPad::ControlLoop()’: /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:346:2: error: ‘ackermann_msgs’ has not been declared ackermann_msgs::AckermannDriveStamped ref_msg; ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:346:40: error: expected ‘;’ before ‘ref_msg’ ackermann_msgs::AckermannDriveStamped ref_msg; ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:357:5: error: ‘ref_msg’ was not declared in this scope ref_msg.header.stamp = ros::Time::now(); ^ /home/claudia/catkin_ws/src/rbcar_common/rbcar_pad/src/rbcar_pad.cpp:385:5: error: ‘ref_msg’ was not declared in this scope ref_msg.header.stamp = ros::Time::now(); ^ /home/claudia/catkin_ws/src/rbcar_sim/rbcar_joystick/src/rbcar_joystick.cpp: In constructor ‘RbcarJoy::RbcarJoy()’: /home/claudia/catkin_ws/src/rbcar_sim/rbcar_joystick/src/rbcar_joystick ... (more)

edit flag offensive delete link more
0

answered 2016-06-22 09:56:21 -0500

joq gravatar image

updated 2016-06-22 09:57:38 -0500

You don't give much information, but the most likely cause is that you forgot an add_dependencies() for the relevant build target, causing it to be built before the messages.

See:

http://docs.ros.org/jade/api/catkin/h... http://docs.ros.org/jade/api/catkin/h...

edit flag offensive delete link more
0

answered 2016-06-22 09:52:59 -0500

mgruhler gravatar image

I'm guessing you have the service and the node in the same package. Thus, you need to properly define the dependencies therein:

Add the following line in the CMakeLists.txt

add_dependencies(<TARGET> ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

Where <TARGET> is the library or executable you want to build.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-06-22 09:21:23 -0500

Seen: 518 times

Last updated: Jun 22 '16