Ask Your Question

Issue with subscriber launch

asked 2020-08-18 11:07:44 -0600

jimc91 gravatar image

updated 2020-08-18 11:09:12 -0600

I am working through tutorials and am having issues with launching my subscriber launch file.

I have created a launch file named odom_subscriber.launch and have the following text in the launch file:

    <node pkg="read_odometry" type="" name="odom_sub_node" output="screen" />

I have created my python file named and have the following text in it:

    #! /usr/bin/env python

    import rospy

    from nav_msgs.msg import Odometry

    def callback(msg): 

      print msg 


sub = rospy.Subscriber('/odom', Odometry, callback)


However, when I try to launch the launch file I get an error. I know I am not subscribing to anything just yet but I wanted to test it to see if all was good at this stage.

To launch the file I used the command:

roslaunch odom_subscriber.launch

I then get the error:

[odom_subscriber.launch] is not a launch file name
The traceback for the exception was written to the log file

Does anyone know where I have gone wrong?

edit retag flag offensive close merge delete


I actually had this in my notes that I had taken and never spotted that I had to add the package also, how silly of me....

jimc91 gravatar image jimc91  ( 2020-08-19 03:50:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-08-19 03:45:35 -0600

rfn123 gravatar image

updated 2020-08-19 04:37:38 -0600

EDIT: as corrected by @gvdhoorn

The syntax for running a launchfile is

roslaunch <package_name> <launchfile_name>


roslaunch /path/to/file.launch

So in your case it would be sth like this:

roslaunch your_package odom_subscriber.launch or roslaunch /path/to/odom_subscriber.launch

See the roslaunch wiki

edit flag offensive delete link more



It could be this helped the OP, but for completeness: roslaunch does support launching .launch files not hosted by packages. So you could actually roslaunch /path/to/my.launch.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-19 04:11:49 -0600 )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


Asked: 2020-08-18 11:07:44 -0600

Seen: 105 times

Last updated: Aug 19 '20