catkin_make is rebuilding, but variable outputs are not updating.
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!
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/nodeFor example, if you were sourcing the
install/setup.bash
file, but only runningcatkin_make
and notcatkin_make install
it's possible that your environment variables wouldn't even be considering the new binary built in thedevel/
directory.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: 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.
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.