pyros-dev / pyros

Python interfacing for multiprocess software - A Python blanket for ROS to hide inside
BSD 3-Clause "New" or "Revised" License
24 stars 4 forks source link

improve serialization usage #119

Open asmodehn opened 7 years ago

asmodehn commented 7 years ago

It seems some people are having trouble grasping how serialization between JSON and ROS work.

It is currently too much "magic"

It would help to expose tools to th use that directly do the conversion.

Also some (tested) doc about it wouldn't hurt, people don't usually look into test code :

>>> import pyros.rosinterface.message_conversion as msg_conv
>>> test_data = { 'data': 'testing' }
>>> import std_msgs.msg as std_msgs
>>> rosstr = std_msgs.String()
>>> rosstr
data: ''
>>> rosstr._type
'std_msgs/String'
>>> msg_conv.populate_instance( test_data, rosstr)
data: testing
>>> msg_conv.extract_values(rosstr)
{'data': 'testing'}
asmodehn commented 7 years ago

This is actually a good reason to have a separated library for ROS <-> python message conversion...

asmodehn commented 7 years ago

Also : https://www.youtube.com/watch?v=7cC3_jGwl_U