ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Cannot locate node

asked 2013-07-31 23:31:36 -0500

Flavian gravatar image

updated 2014-01-28 17:17:30 -0500

ngrennan gravatar image

I have been following the following tutorial : "urdf/Tutorials/Using urdf with robot_state_publisher", but when I run "roslaunch r2d2 r2d2.launch", I have the following error: "cannot locate node of type [r2d2/state_publisher]".

I have to admit that I overlooked the statement "(throughout this example, we assume package name "r2d2" and node name "state_publisher")", so I have no file corresponding to a state_publisher. What's the solution?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-01 03:31:06 -0500

thebyohazard gravatar image

You need to have a look at the launch file xml format for node. The line

<node name="state_publisher" pkg="r2d2" type="state_publisher" />

is likely your problem. Change type="state_publisher" to type="<insert your executable name here>"

edit flag offensive delete link more


I use .cpp to write my state_publisher and I change the type="" to type = "state_publisher.cpp" in my launch file, but it still reports ERROR: cannot launch node of type [r2d2/state_publisher.cpp]: can't locate node [state_publisher.cpp] in package [r2d2]

Please help. Thanks

Carrie Yan gravatar image Carrie Yan  ( 2017-06-06 11:08:24 -0500 )edit

I'm just seeing your message. In the future, you should ask a new question and link to related questions in your question to get better help. Usually a file with a .cpp extension contains code and a binary will not have an extension. Use whatever the add_executable argument is in your CMakeLists.txt

thebyohazard gravatar image thebyohazard  ( 2018-10-10 10:44:13 -0500 )edit

Question Tools

1 follower


Asked: 2013-07-31 23:31:36 -0500

Seen: 2,141 times

Last updated: Aug 01 '13