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

ROS + Morse launch error 8

asked 2018-02-13 13:25:50 -0500

mrphaell gravatar image

updated 2018-02-14 07:55:19 -0500

Hi, I just picked up ROS and Morse and I'm trying to follow the Morse's tutorial on ROS Navigation. The tutorial can be found here. On the part that say to edit the file nav.launch, I followed what is said there, but when I run the command roslaunch morse_2dnav nav.launch I get a error OSError: [Errno 8] Exec format error and I'm having a hard time solving this issue. Any help? I'm using Ubuntu 16.04.3, Morse Simulator v 1.2, ROS Lunar.

Edit:

Traceback (most recent call last):
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/__init__.py", line 318, in main
    p.start()
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/parent.py", line 271, in start
    self._start_infrastructure()
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/parent.py", line 220, in _start_infrastructure
    self._load_config()
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/parent.py", line 135, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
    loader.load(f, config, verbose=verbose)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 750, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 722, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 666, in _recurse_load
    self._param_tag(tag, context, ros_config, verbose=verbose)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
    return f(*args, **kwds)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 266, in _param_tag
    value = self.param_value(verbose, name, ptype, *vals)
  File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/loader.py", line 492, in param_value
    p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

My launch file, as described on the tutorial:

<launch>
  <param name="robot_description" command="$(find morse_mcl)/robot.urdf" />
   <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
</launch>

The lsb_release -a output is:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
edit retag flag offensive close merge delete

Comments

Can you please be a bit more specific? What exactly are you changing, and please copy-paste the entire error message (including the stack trace) into your question. Use the edit button/link.

Know that ROS+Morse is not a frequently used combination, so getting answers may take a while.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-13 14:37:41 -0500 )edit

The changes are the one the tutorial specify (create the launch file and write the launch tags). I'll edit my question and post the exact launch file and the trace of the error. I'm trying to implement Monte Carlo Localization, do you know a better/easier combination to use?

mrphaell gravatar image mrphaell  ( 2018-02-13 14:55:00 -0500 )edit

Don't use <pre> tags for code, but indent it by 4 spaces. Use the Preformatted Text button for that (the one with 101010 on it). Select the code, press the button (or ctrl+k).

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 02:10:37 -0500 )edit

Were you instructed to create any Python scripts? If so: are they executable? Do they start with #!/usr/bin/env python?

If not: how did you install ROS? Where did the robot_state_publisher come from?

(also: state_publisher is deprecated, please use robot_state_publisher)

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 02:15:07 -0500 )edit

To run the simulation only on Morse it's needed a Python script, but it already have the #!/usr/bin/env python. I followed the instructions on ROS wiki to install ROS. I'll look if can be an error with the state_publisher being deprecated.

mrphaell gravatar image mrphaell  ( 2018-02-14 06:48:55 -0500 )edit

I'll look if can be an error with the state_publisher being deprecated

no, that shouldn't be the problem.

The Exec format error is typically seen if you try to start a script (with bash or another shell) and that doesn't specify which interpreter should be used. RSP is a C++ program.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 06:50:41 -0500 )edit

I see. The files listed on the error (__init__.py, parent.py, config.py, xmlloader.py, loader.py and subprocess.py) don't have that. Could that be it?

mrphaell gravatar image mrphaell  ( 2018-02-14 06:59:00 -0500 )edit

No. They are all Python modules, not top-level scripts.

The problem is most likely with something that the launch file is trying to start (ie: a node or a script started as a node). You could remove and add single lines to see which one is causing the problem.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 07:09:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-02-14 07:47:03 -0500

gvdhoorn gravatar image
<param name="robot_description" command="$(find morse_mcl)/robot.urdf" />

This is most likely your problem.

roslaunch expects an actual command in the command attribute (ie: a program it can start).

find will return the absolute path to the urdf, and the urdf is not a program. Hence the error.

Note btw that the tutorial you link actually has the following in command:

<param name="robot_description" command="cat $(find morse_2dnav)/pr2.urdf"/>

note the cat there. That is a program, and should work.

However, I would recommend the following, which is a bit more 'modern':

<param name="robot_description" textfile="$(find morse_2dnav)/pr2.urdf" />

Note that this only works because pr2.urdf is an actual urdf. If it were a xacro, you'd need command again (to start xacro).

See also the roslaunch/xml/param documentation.

edit flag offensive delete link more

Comments

Btw, I just looked at the tutorial you link and it is very old. Most of the instructions there are outdated (rosbuild vs catkin, manifest.xml vs package.xml, editing ROS_PACKAGE_PATH by hand, etc). It can probably still be made to work, but following those instructions literally may ..

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 07:47:39 -0500 )edit

.. cause you some trouble.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 07:47:53 -0500 )edit

I'm aware of that, but I'm making some modifications to make it work, since the tutorial is providing me the base to build what I need.

mrphaell gravatar image mrphaell  ( 2018-02-14 08:05:24 -0500 )edit

Would perhaps be nice to also update the tutorial page then?

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 08:06:52 -0500 )edit

Yeah, I'll look into it.

mrphaell gravatar image mrphaell  ( 2018-02-14 08:11:13 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-02-13 13:25:50 -0500

Seen: 1,177 times

Last updated: Feb 14 '18