Ask Your Question
0

nmea_gps_driver in launch file

asked 2013-07-09 03:05:34 -0600

clungzta gravatar image

Hi, I am creating a launch file for my robot, I am trying to run the nmea_gps_driver in my launchfile this is what I have so far:

<launch> 
<node pkg="nmea_gps_driver" name="nmea_gps_launch" type="nmea_gps_driver.py" args="_port:=/dev/ttyUSB0 _baud:=9600"/>
</launch>

But when I launch it I get the following message and then error:

 File "/opt/ros/groovy/stacks/nmea_gps_driver/src/nmea_gps_driver.py", line 112, in <module>
    data = GPS.readline()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 449, in read
    buf = os.read(self.fd, size-len(read))
OSError: [Errno 11] Resource temporarily unavailable

[nmea_gps_launch-27] process has died [pid 17480, exit code 1, cmd /opt/ros/groovy/stacks/nmea_gps_driver/src/nmea_gps_driver.py _port:=/dev/ttyUSB0 _baud:=9600 __name:=nmea_gps_launch __log:=/home/alex/.ros/log/60c20282-e895-11e2-8751-6036dd23d944/nmea_gps_launch-27.log].
log file: /home/alex/.ros/log/60c20282-e895-11e2-8751-6036dd23d944/nmea_gps_launch-27*.log

It is definatly a 9600 Baud Reciever and is showing up as /dev/ttyUSB0.

The following command works perfectly in the terminal and the GPS publishes data.

$ rosrun nmea_gps_driver nmea_gps_driver.py _port:=/dev/ttyUSB0 _baud:=9600

Any Ideas?

edit retag flag offensive close merge delete

Comments

try other GPS pkg, may be gps_common, utm_odometry_node

sai gravatar imagesai ( 2013-07-09 04:24:34 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-12-12 06:01:50 -0600

joanpau gravatar image

If running the command with rosrun as in your command line example works fine, I do not see why your roslaunch fails (provided both are executed by the same user in the same environment, otherwise there might be some problem with the device file permissions, or even the gps might associated to a different /dev/ttyXXX).

However, you may try setting the parameters using <param> tags inside the <node> tags (which IMHO is a better style anyway):

<launch> 
  <node pkg="nmea_gps_driver" type="nmea_gps_driver.py" name="nmea_gps_launch">
    <param name="port" type="str" value="/dev/ttyUSB0" />
    <param name="baud" type="int" value="9600" />
  </node>
</launch>

Maybe that makes a difference.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-07-09 03:05:34 -0600

Seen: 202 times

Last updated: Dec 12 '13