Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to create ROS message from stored Mongo document #25

Closed
cburbridge opened this issue Apr 1, 2014 · 1 comment
Closed

Fail to create ROS message from stored Mongo document #25

cburbridge opened this issue Apr 1, 2014 · 1 comment

Comments

@cburbridge
Copy link
Member

The MessageStore proxy can't recreate ROS messages when they include a list of ROS types. For example, trying to store a geometry_msgs/Polygon fails because it containts a list of Point32:

geometry_msgs/Polygon tabletop
  geometry_msgs/Point32[] points
    float32 x
    float32 y
    float32 z

The message is stored ok in the database, but when recreated the points list is created as a list of python dictionaries not a list of ROS messages.

The problem is in util.py, line 150, only dicitionaries are expanded into the message. We need something like:

 elif isinstance(value, list):
            lst=[]
            for i in value:
                msg = tp_of_msg()
                fill_message(msg, i)
                lst.append(msg)
            setattr(message, slot, lst)    

finding the type of the message that should be in the list could be done by looking at the _slot_types field of the message class, but then primitive types - eg. list of ints - would need special attention....

@hawesie
Copy link
Member

hawesie commented Apr 1, 2014

If this is high priority, could you put that code in? Else I can do it once the navigation/scheduler is completed.

hawesie added a commit that referenced this issue Apr 2, 2014
[message-store] Dealing with lists in stored messages. Bug #25
@hawesie hawesie closed this as completed Apr 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants