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

rosrun cannot find specified node file

asked 2012-08-04 20:08:43 -0500

DocSmiley gravatar image

Using electric on Ubuntu 11.10

I recently created a new package and node. Something I have done before with no problems.

roscreate-pkg my_package rospy std_msgs

There were no errors with rosmake.

When I go to run the node I wrote via

rosrun my_package my_node.py

I get "No such file or directory" despite the file being in /my_workspace/my_package/nodes/my_node.py

The file is in place and set as executable, ros can find and build the package but will not run my node.

The only edits I made to the CMakeList.txt file were to uncomment the rosbuild_genmsg() and rosbuild_gensrv() lines.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-08-04 22:33:01 -0500

updated 2012-08-04 22:34:08 -0500

I've had this problem before, it's bizarre and I'm not sure what causes the problem, but I do think that I know how to solve it. For me at least, the problem was specific to the file; other files in the package could run fine. My solution was to re-create the node file, and copy-paste the contents. You will (hopefully) find that it now works.

edit flag offensive delete link more
2

answered 2012-08-04 23:04:46 -0500

KruseT gravatar image

If rosrun does not find an executable, it reports:

[rosrun] Couldn't find executable named test below

and not:

No such file or directory

rosrun is a short bash script that you can examine for debugging:

 cat /opt/ros/electric/ros/bin/rosrun

You can copy the rosrun file and modify the copy for debugging. I would guess the error should be reproducable with

exec /home/path/to/your/node/my_node.py

which is the last line of rosrun. You can add the line:

echo $exepath

before the last line in rosrun to see whether there is any problem with the path.

Also you can run the find command in isolation:

find -L `${ROS_ROOT}/bin/rospack find my_package` -name my_node.py -type f  -perm +111 ! -regex ".*$pkgdir\/build\/.*"

To see whether that returns something weird (replace my_package and my_node.py if you have different names).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-04 20:08:43 -0500

Seen: 1,828 times

Last updated: Aug 04 '12