Ask Your Question
0

SOme help with launch files

asked 2013-11-17 10:02:22 -0500

Massbuilder gravatar image

updated 2013-11-18 07:43:54 -0500

In response to a request for the launch file and the error. Here is the launch file,

<launch>
  <node pkg="newrobot" type="/src/usb.py" name='base_scan' output="screen">
  </node>

  <node pkg="newrobot" type="src/odompublish.py" name="odom" output="screen">
  </node>

  <node pkg="newrobot" type="src/odompublish.py" name="base_pos" output="screen">
  </node>
</launch>

And the error message

ERROR: cannot launch node of type [newrobot/src/usb.py]: newrobot
ROS path [0]=/opt/ros/groovy/share/ros
ROS path [1]=/opt/ros/groovy/share
ROS path [2]=/opt/ros/groovy/stacks
ERROR: cannot launch node of type [newrobot/src/odompublish.py]: newrobot
ROS path [0]=/opt/ros/groovy/share/ros
ROS path [1]=/opt/ros/groovy/share
ROS path [2]=/opt/ros/groovy/stacks
ERROR: cannot launch node of type [newrobot/src/odompublish.py]: newrobot
ROS path [0]=/opt/ros/groovy/share/ros
ROS path [1]=/opt/ros/groovy/share
ROS path [2]=/opt/ros/groovy/stacks
edit retag flag offensive close merge delete

Comments

1

Can you post the .launch file you are trying to launch and the full error you get?

Tirjen gravatar imageTirjen ( 2013-11-17 19:24:52 -0500 )edit

`type` is the binary to launch.

dornhege gravatar imagedornhege ( 2013-11-17 22:00:12 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-11-18 02:52:00 -0500

dornhege gravatar image

Remove all the paths in the type, e.g. /src/usb.py should be usb.py. ROS finds this by itself.

edit flag offensive delete link more

Comments

Also, since you are using Python-based nodes, make sure that your files have executable permissions or ROS won't find nodes of that type e.g. `chmod a+x [PATH_ON_ROS_PACKAGE_PATH]/newrobot/src/usb.py`

jarvisschultz gravatar imagejarvisschultz ( 2013-11-18 07:41:37 -0500 )edit

one question I use a class for the laser scan publisher that called within usb. Do I use usb ore the node that makes up the class?

Massbuilder gravatar imageMassbuilder ( 2013-11-18 07:49:30 -0500 )edit

IS the catkin workspace suppose to be the ROS directory? I got mine in seperate. Could be what causing the problem

Massbuilder gravatar imageMassbuilder ( 2013-11-18 09:56:41 -0500 )edit

As @dornhege mentioned above, the `type` field is the Python script to run. Regardless of how imports are structured and what classes are involved, the "top-level" script is what goes in the `type` field.

jarvisschultz gravatar imagejarvisschultz ( 2013-11-18 11:38:46 -0500 )edit

Let's say your catkin ws is at *~/catkin_ws/*, then your package should be in *~/catkin_ws/src/*. Therefore, one of your example nodes would be *~/catkin_ws/src/newrobot/src/usb.py*. If everything is working, TAB key should autocomplete both the package name, and the nodename when using `rosrun`.

jarvisschultz gravatar imagejarvisschultz ( 2013-11-18 11:41:48 -0500 )edit

Seems the tab is not working, is there another way to find the package path

Massbuilder gravatar imageMassbuilder ( 2013-11-19 01:05:58 -0500 )edit

The command `echo $ROS_PACKAGE_PATH` will print out the current package path. In the above example *~/catkin_ws/src* should be listed in that output if it's not, try `source ~/catkin_ws/devel/setup.bash`. I'm assuming you setup a workspace http://wiki.ros.org/catkin/Tutorials/create_a_workspace

jarvisschultz gravatar imagejarvisschultz ( 2013-11-19 03:59:58 -0500 )edit
0

answered 2013-11-18 02:07:14 -0500

Tirjen gravatar image

It seems like your launch file can't find your package. From the error I can also see that it is searching only in the installation directories, so it seems that you have not created any workspace. Where is located this newrobot package? To see if ROS is able to find it try to run 'rospack find newrobot' and see if it can find it.

edit flag offensive delete link more

Comments

You are on to something. I tried what you suggested and it found nothing.

Massbuilder gravatar imageMassbuilder ( 2013-11-18 07:44:01 -0500 )edit

If ROS can't find your package it means that maybe you put it into a wrong folder... Where is located your packege? You have to add its path to the ROS_PACKAGE_PATH.

Tirjen gravatar imageTirjen ( 2013-11-18 21:20:55 -0500 )edit

How do I do that?

Massbuilder gravatar imageMassbuilder ( 2013-11-19 01:17:47 -0500 )edit

If you haven't done it, create a workspace in your home folder then add to your .bashrc the following line: 'export ROS_PACKAGE_PATH=~/ros_workspace:${ROS_PACKAGE_PATH} ' Finally put your packages in the workspace folder.

Tirjen gravatar imageTirjen ( 2013-11-19 20:00:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-11-17 10:02:22 -0500

Seen: 170 times

Last updated: Nov 18 '13