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

Why does not catkin_make work?

asked 2019-08-21 07:47:37 -0600

updated 2019-08-21 10:26:50 -0600

I have two versions of src file in the package under the workspace. I ran one and named the other src2 (CmakeList.txt compiles the source file in src directory). Then I want to run the other version files, so src is renamed to src1 and src2 is renamed to src, and I ran catkin_make in the workspace, but there is no new file generated and when I start the node, it' s still the old one. It's so weird. Can someone explain it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-21 09:49:13 -0600

Delb gravatar image

I have two versions of src file in the package under the workspace

I understand it as both your src folder contains files with the same names and same CMakeList but only some lines of code differs between the two. That being said when you run catkin_make after swapping your folders catkin doesn't notice any change in your files (I don't really know how, probably CMake related, but if someone can enlighten me on this part) so if nothing has changed catkin won't rebuild everything as usual.

To avoid that you have two options :

  1. Delete the build and devel folder each time you change the src folder
  2. Change a little thing in a file so that catkin notice a change and rebuild the package

The best option is the first one but I would recommend for that kind of things to use a version-control tool such as GIT or SVN.

edit flag offensive delete link more

Comments

1

I think make will only rebuild a file if the source has a more recent timestamp than the last time it was built, so by renaming the same files I don't think it will pickup the change because it will still have it's original timestamp. Not 100% sure on this, but try adding a single space to update the timestamp and try it again.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-08-21 10:53:31 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-08-21 07:47:37 -0600

Seen: 834 times

Last updated: Aug 21 '19