ERROR: cannot launch node of type [topic_pub/ topic_publisher ]: Cannot locate node of type [ topic_publisher ] in package [topic_pub]. Make sure file exists in package path and permission is set to executable (chmod +x)

@bitcloude ,

I think I finally see the error.
Your actual C++ file name is different from what you have on CMakeLists.txt.
You have named the files differently than what is specified in the tutorial.

Ok, so send me the cpp file name and your launch file name in full please.

Good news! I can fix your problem!

Regards,
Girish

1 Like

@girishkumar.kannan

simple_topic_publisher.cpp

publish.launch

Perfect!

Change your launch file contents to this:

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

This should definitely work.

Let me know if it worked for you!

Regards,
Girish

It does work now thanks! I see that I was supposed to make the “type” the same name as the executable that I created in the CMakeList.txt file.

1 Like

@bitcloude

AH! GREAT! FINALLY! YOU DID IT!

So the problem was your launch file had incorrect naming.
Also remove the comma in the launch file <node> line just before output=
That was my typo by mistake.

Anyways, glad you got it working!
You can now launch your program like this roslaunch topic_pub publish.launch.

Cheers,
Girish

@girishkumar.kannan thank you so much. Now I can move on.

1 Like

@bitcloude ,

Now that your problem is resolved, please add [SOLVED] tag by editing this issues title.

Change this title:
[ERROR: cannot launch node of type [topic_pub/ topic_publisher ]: Cannot locate node of type [ topic_publisher ] in package [topic_pub]. Make sure file exists in package path and permission is set to executable (chmod +x)]

To this:
[SOLVED] [ERROR: cannot launch node of type [topic_pub/ topic_publisher ]: Cannot locate node of type [ topic_publisher ] in package [topic_pub]. Make sure file exists in package path and permission is set to executable (chmod +x)]

So that website admins and moderators can close this issue.

Regards,
Girish

1 Like

How can I edit this issue? I dont see an option for it.

@bitcloude ,

Scroll this page all the way to the top and there will be a pencil icon next to the title.
Click on that and you can edit the title.
Just add [SOLVED] in front of the title before the words ERROR: cannot launch …

@girishkumar.kannan

This is what I see when I click the pencil

@bitcloude ,

You clicked on “Edit History” button.
You should click on the pencil symbol next to the title of this post. It will be at the very top of the page and at the very end of the title sentence.

If you still cannot fine it, it is fine. This post will eventually close in a few days.

This topic was automatically closed after 16 hours. New replies are no longer allowed.