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

catkin_make is rebuilding, but variable outputs are not updating.

asked 2018-06-01 14:19:45 -0500

yukelele gravatar image

updated 2020-09-28 17:32:15 -0500

jayess gravatar image

I'm in a weird situation that whenever I catkin_make at the root of my catkin workspace, catkin_make will build the code successfully, but the output from a modified cpp file by running roslaunch is not changing ...

for example: (before)

void DoStateProve()
{
  ROS_INFO("probe camera");
}

Then, I would run roslaunch g6_ri.launch and the output will show the following:

[ INFO] [1527878630.076124857]: probe camera

Just to check how the code will respond to the changes, I modified the line into: (after)

void DoStateProve()
{
  ROS_INFO("probe cameraaaaa");
}

(* NOTE: this is the only line in the program that has the line '"probe camera" *)

So then, I catkin_make to rebuild the program in order to get the changes. Here is the last portion of the output from catkin_make: (camera_commander_RI.cc is the file that I modified in)

Scanning dependencies of target g6_camera_ri
[100%] Built target udp_input_generate_messages
[100%] Built target udp_input
[100%] Built target dji_sdk_web_groundstation_generate_messages
[100%] Built target ublox_gps
[100%] Building CXX object G6_camera/g6_camera_RI/CMakeFiles/g6_camera_ri.dir/src/camera_commander_RI.cc.o
[100%] Built target dji_sdk_web_client
[100%] Built target ublox_gps_node
[100%] Linking CXX shared library /home/conti/ecalROS/ros/kinetic/devel/lib/libg6_camera_ri.so
[100%] Built target g6_camera_ri

Although catkin_make indeeds built the code successfully, the output from running roslaunch g6_ri.launch is still the same as before:

[ INFO] [1527878630.076124857]: probe camera

I also tried catkin_make after removing the build and devel directory, and it still outputs the same result ....

I know that catkin_make is recompiling 'camera_commander_RI.cc' because whenever I purposely write in a error-produce line (such as int v = "hello"), catkin_make does recognize the error and will give an error message:

error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
     int v = "hello";

So then, I would delete this error-produce line, and catkin_make will build successfully again.

What is confusing is that sometime I will randomly do something else such as closing the terminal or work on other project or catkin_make in a different project, and when I come back to the problem, the changes will suddenly happen! But then, when I tried to change it back to the original code, the output will stay as the modified string.

Has anyone dealt with this situation before? If you have any idea what is the cause of this problem or know a possible solution, feel free to share your thoughts!

It took me a while to word all of this together, so let me know if you need any clarification.

Thanks in advance!

edit retag flag offensive close merge delete

Comments

2

My best guess is that the version of the node run when launching is a different version that the one that was freshly re-compiled. You might want to take a look at your ROS environment variables (env |grep ROS)to see if maybe there is more than one place that roslaunch could find your package/node

jarvisschultz gravatar image jarvisschultz  ( 2018-06-01 15:27:52 -0500 )edit
1

For example, if you were sourcing the install/setup.bash file, but only running catkin_make and not catkin_make install it's possible that your environment variables wouldn't even be considering the new binary built in the devel/ directory.

jarvisschultz gravatar image jarvisschultz  ( 2018-06-01 15:28:58 -0500 )edit

I have exactly the same problem. The first time I desperately erased and rebuild my workspace and it worked, anyway that should not be the way to deal with this. Now it is happening once again on another system. Any progress on this?

teawolf gravatar image teawolf  ( 2018-08-23 02:06:53 -0500 )edit

@teawolf: without more information on what your exact workflow is, we're not going to be able to determine whether this is a usage issue, a bug in catkin_make, file system caching or something else.

I would suggest to open a new question, clearly describe your workflow and refer to this one.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-23 02:24:01 -0500 )edit

Deleting the execuables in <workspace_dir>/devel/lib/<project_name> before doing catkin_make works as well, though I don't like to handle it that way. I will open a new question, thanks for replying.

teawolf gravatar image teawolf  ( 2018-08-23 02:27:03 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-28 07:07:14 -0500

LucasGoei gravatar image

same thing happen to me today. All I did was delete devel and build folder. Then rebuild ./src. This works for me

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-06-01 14:19:45 -0500

Seen: 2,485 times

Last updated: Sep 28 '20