Seeking clarity regarding the 'node' tag in launch files

asked 2021-06-07 12:49:34 -0600

I have added the following lines in the CMakeLists.txt file -

add_executable(abcd src/main.cpp)

target_link_libraries( abcd ${catkin_LIBRARIES} )

The node tag inside my launch file looks like this -

    <node pkg="my_explore_lite" type="explore_node" respawn="false" name="abcd_1" output="screen">       
...   
 </node>

As per my understanding, the value of type should be equal to abcd because that's what I have defined in the CMakeLists.txt. However, my launch file gets executed when I set the value of type to either abcd or explore_node.

What am I missing?

edit retag flag offensive close merge delete

Comments

1

Did you previously build the node with the explore_node name (ie add_executable(explore_node src/main.cpp))? If so it still exists in your built executables even if you change the name in the CMakeLists.txt. Try deleting your build and devel folders, rebuild, and see if you can still launch with the explore_node name.

djchopp gravatar image djchopp  ( 2021-06-07 14:20:33 -0600 )edit

Yes. I did previously use add_executable(explore_node src/main.cpp). Do you want me to delete the build folder inside my package (~/catkin_ws/src/my_explore_lite/build) or you do want me to delete the build and devel folders at the catkin workspace root(~/catkin_ws/build and ~/catkin_ws/devel)?

skpro19 gravatar image skpro19  ( 2021-06-07 14:34:52 -0600 )edit
1

You should only have build and devel from catkin_make or catkin build in your workspace root. If the build folder in your package came from catkin, then you may have ran it in the wrong directory. If you are sure the build folder in your package came from catkin then delete it. Otherwise it may be part of a locally installed dependency and it should stay.

djchopp gravatar image djchopp  ( 2021-06-07 14:40:46 -0600 )edit

Okay. Thanks!

skpro19 gravatar image skpro19  ( 2021-06-07 14:44:06 -0600 )edit