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

couldn't rosrun new executable after changing the source code

asked 2015-02-17 16:57:38 -0500

guodi gravatar image

updated 2015-02-17 16:58:26 -0500

I am trying to sending head move command to pr2 robot, and in my CMakeLists.txt file, I have add_executable(point_head src/point_head.cpp), after catkin_make, I can use rosrun simple_head point_head to move the head of pr2.

Then I changed the head position in point_head.cpp and catkin_make again. But when I rosrun simple_head point_head again, the head of pr2 stills goes to the position unchanged. While when I manually run point_head in ~/catkin_ws/devel/lib/simple_head/, it goes to the new position correctly.

Is there anyone know why I couldn't run the new changed executable? Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-02-17 17:36:58 -0500

William gravatar image

It sounds like you have multiple copies of point_head on your systems and you're running one that is different than the one you are building.

You need to make sure you source the setup.bash file which is generated by catkin_make (which should be at ~/catkin_ws/devel/setup.bash based on your question) before trying to use rosrun simple_head point_head. You probably have simple_head installed somewhere else either in an ~/catkin_ws/install folder or you've installed it from .deb's perhaps. You can look at your ROS_PACKAGE_PATH to see what folders simple_head is being searched for in to try and debug which one it is finding.

edit flag offensive delete link more

Comments

I've checked the ROS_PACKAGE_PATH and ~/catkin_ws/src is in it. And when I roscd simple_head, it goes to the correct package. while I don't have a ~/catkin_ws/install folder....

guodi gravatar image guodi  ( 2015-02-17 18:10:52 -0500 )edit

~/catkin_ws/install was just a guess, I think it is more likely that /opt/ros/indigo or something like that is on the ROS_PACKAGE_PATH. You can also just try to locate all instances of simple_head to track down which one might be getting executed.

William gravatar image William  ( 2015-02-17 18:33:55 -0500 )edit

That works. There is a copy of it in another package ... Thank you!

guodi gravatar image guodi  ( 2015-02-17 19:11:30 -0500 )edit

Question Tools

Stats

Asked: 2015-02-17 16:57:38 -0500

Seen: 77 times

Last updated: Feb 17 '15