Robotics StackExchange | Archived questions

Cannot locate node of type [rosnode] in package [rosnode]

In ros-noetic, ubuntu 20.04, I am launching the following roslaunch file:

<?xml version="1.0"?>
<launch>

<node pkg="rosnode" type="rosnode" name="kill_all_nodes" args="kill -a" />

</launch>

However, I get this error:

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

I did chmod +x to /opt/ros/noetic/bin/rosnode, but it didn't change anything. It had the execution rights anyway.

In a comment under a related question, someone else reported having the same problem, but I could not find any solution. Following that comment, rosls rosnode produces only these:

cmake  package.xml

I can run rosnode kill -a from the terminal successfully.

What could be the cause of the error above?

Asked by hansolo on 2022-08-01 09:11:50 UTC

Comments

Please refer to #q292912.

Asked by gvdhoorn on 2022-08-01 10:25:22 UTC

Thank you for editing the answer there. I will put the solution also here as it is not exactly the same question.

Asked by hansolo on 2022-08-01 10:44:11 UTC

I will put the solution also here as it is not exactly the same question.

I'm not sure why the two questions are not the same.

Could you clarify?

Let's not duplicate content unnecessarily.

Asked by gvdhoorn on 2022-08-01 10:48:38 UTC

Oh, just noticed that you closed it for being a duplicate, but it is not. The other question asks whether they can kill a node from a launch file. The original answer (before the last edit) was actually a good answer. Except that the rosnode package has this issue. This question asks why such an error (as in the title) happens, and apparently the reason is an issue about how rosnode installs...

Asked by hansolo on 2022-08-01 10:50:44 UTC

While technically correct, I feel in this case it doesn't really matter.

Without ros/ros_comm#2262, no matter whether you use the correct syntax, you'll run into the problem you describe. The last comment on my answer to #q292912 reports the exact same problem.

If the last comment on #q292912 was merged into the original question text, we would get your question here ...

Asked by gvdhoorn on 2022-08-01 10:53:52 UTC

Thank you for creating the issue in ros_comm. Anyway, when that issue is solved this question will become obsolete, so let's keep this one closed.

Asked by hansolo on 2022-08-01 11:03:35 UTC

Unlike killing a single node, apparently, kill all causes another issue. Please refer to this issue.

Asked by hansolo on 2022-08-02 04:14:08 UTC

Answers