ERROR: cannot launch node of type [topic_publisher/simple_topic_publisher]: can’t locate node [simple_topic_publisher] in package [topic_publisher]

can someone helps me please

how can i solve this problem

ERROR: cannot launch node of type [topic_publisher/simple_topic_publisher]: can’t locate node [simple_topic_publisher] in package [topic_publisher]

this is my launchfile

<!-- My Package launch file -->

<node pkg="topic_publisher" type="simple_topic_publisher" name="topic_publisher"  output="screen">

</node>
1 Like

Hi @herrsidje,

Have you run

cakin_make
source devel/setup.bash

?
If so, then you need to review your CMakeLists.txt because it means you have not setup your C++ source file to be correctly compiled, as indicated in the notes.


Btw, welcome to the Community!

thanks for answer.
i executed the catkin_make and Source devel/setup.bash command
but it still appear the same error.
my cmakelist look like this

add_executable(simple_topic_publisher src/simple_topic_publisher.cpp)

add_dependencies(simple_topic_publisher ${simple_topic_publisher_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(simple_topic_publisher

${catkin_LIBRARIES}

)

The problem is that your C++ executable has not been compiled even if everything appears to be correctly setup. Check the following:

  1. Did catkin_make run without errors, indicating that a C++ executable was being generated from your C++ source? In any case, try removing the build and devel folders and run the following again, taking note of the messages generated by catkin_make.
# run from catkin_ws directory
rm -rf build/ devel/
cakin_make
source devel/setup.bash
  1. Did you copy CMakeLists.txt or package.xml? You should avoid copying CMakeLists.txt or package.xml - better to edit them manually, following the notes - to avoid typo errors that usually result. You should create your package with catkin_create_pkg and only copy source or launch files, if necessary. You should then manually edit the necessary sections of CMakeLists.txt and package.xml.
1 Like

thanks for your answers. it seems to work

the solution was to manually edit the Cmakelists

thank you for your support

the solution was to manually edit the Cmakelists

1 Like