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

asked 2022-08-01 09:11:50 -0500

hansolo gravatar image

updated 2022-08-01 09:12:41 -0500

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?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by gvdhoorn
close date 2022-08-01 10:25:14.276589

Comments

Please refer to #q292912.

gvdhoorn gravatar image gvdhoorn  ( 2022-08-01 10:25:22 -0500 )edit

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

hansolo gravatar image hansolo  ( 2022-08-01 10:44:11 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2022-08-01 10:48:38 -0500 )edit

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...

hansolo gravatar image hansolo  ( 2022-08-01 10:50:44 -0500 )edit

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 ...

gvdhoorn gravatar image gvdhoorn  ( 2022-08-01 10:53:52 -0500 )edit

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.

hansolo gravatar image hansolo  ( 2022-08-01 11:03:35 -0500 )edit

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

hansolo gravatar image hansolo  ( 2022-08-02 04:14:08 -0500 )edit