Issue with subscriber launch
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:
<launch>
<node pkg="read_odometry" type="odom_subscriber.py" name="odom_sub_node" output="screen" />
</launch>
I have created my python file named odom_subscriber.py and have the following text in it:
#! /usr/bin/env python
import rospy
from nav_msgs.msg import Odometry
def callback(msg):
print msg
rospy.init_node('odom_sub_node')
sub = rospy.Subscriber('/odom', Odometry, callback)
rospy.spin()
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?
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....