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

rosbridge_suite: InvalidPackageException: Unable to load the manifest for package rosgraph_msgs.

asked 2016-05-06 02:46:06 -0600

SimonB gravatar image

updated 2016-05-06 04:51:33 -0600

gvdhoorn gravatar image

Hi,

I'm using the rosbridge internal library to get load the message class for a given message type:

from rosbridge_library import ros_loader
...
self.msg_class = ros_loader.get_message_class(self.msg_type)

where self.msg_type is, for example, "rosgraph_msgs/Log".

This is generating the following error:

  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/ros_loader.py", line 88, in get_message_class
    return _get_msg_class(typestring)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/ros_loader.py", line 128, in _get_msg_class
    return _get_class(typestring, "msg", _loaded_msgs, _msgs_lock)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/ros_loader.py", line 163, in _get_class
    cls = _load_class(modname, subname, classname)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/ros_loader.py", line 187, in _load_class
    raise InvalidPackageException(modname, exc)
InvalidPackageException: Unable to load the manifest for package rosgraph_msgs. Caused by: 'NoneType' object has no attribute 'strip'
<Greenlet at 0x7f1c3cc52230: <bound method RosGraphApi.launch_graph of <luxagent.ros_communication.ros_graph_api.RosGraphApi object at 0x7f1c3cc26090>>> failed with InvalidPackageException

This error is occurring on all message types, not just rosgraph_msgs/Log.

Any suggestions would be appreciated.

Thanks!

Simon

edit retag flag offensive close merge delete

Comments

I'm running on Indigo.

SimonB gravatar image SimonB  ( 2016-05-06 02:51:17 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-05-10 03:42:49 -0600

SimonB gravatar image

This turned out not to be a problem with rosbridge_library at all, but a collateral effect of using gevent in my application. It's highly unlikely that anyone else will come across this, but just in case:

I had to bury down into the depths of roslib to find out where the root exception was occurring. It was in rospkg/os_detect.py:

def _read_stdout(cmd):
    try:
        pop = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (std_out, std_err) = pop.communicate()
        # Python 2.6 compatibility
        if isinstance(std_out, str):
            return std_out.strip()
        return std_out.decode(encoding='UTF-8').strip()
    except:
        return None

The line pop.communicate() was giving an error 'module' object has no attribute 'poll'.

This led me here: https://groups.google.com/forum/embed...

gevent is a coroutine based sort-of-multitasking library. It monkey patches various system libraries (I should have known better!) and removes the poll() functionality from subprocesses.

The solution is to import gevent like so:

from gevent import monkey; monkey.patch_all(aggressive=False)

instead of:

from gevent import monkey; monkey.patch_all()

My apologies to Jihooni for taking up his time! Thanks again.

edit flag offensive delete link more

Comments

1

+1 for reporting back on the real cause (and a possible work-around).

gvdhoorn gravatar image gvdhoorn  ( 2016-05-10 04:38:16 -0600 )edit
1

answered 2016-05-07 05:14:30 -0600

jihoonl gravatar image

It looks like rosgraph_msgs is not detect in your ros package path. Make sure that correct ros environment is set in the PC. It cannot find message packages without proper ROS_PACKAGE_PATH setup.

edit flag offensive delete link more

Comments

Here's my ROS_PACKAGE_PATH:

/home/simonbirrell/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

This is created when I do the following before running my app:

source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash

Is there anything obvious missing?

SimonB gravatar image SimonB  ( 2016-05-07 13:50:42 -0600 )edit

Tried

rospack find rosgraph_msgs

/opt/ros/indigo/share/rosgraph_msgs

Which suggests that ROS_PACKAGE_PATH is ok.

Thanks for the help, Jihooni! Any further ideas appreciated.

SimonB gravatar image SimonB  ( 2016-05-07 13:53:32 -0600 )edit
jihoonl gravatar image jihoonl  ( 2016-05-09 03:22:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-06 02:46:06 -0600

Seen: 2,097 times

Last updated: May 10 '16