iml130 / firos

Firos helps to connect ROS-based robots to the Fiware Ecosystem...
MIT License
12 stars 9 forks source link

Improving Conversion of Array-like Ros-Messages #1

Open iml-dlux opened 5 years ago

iml-dlux commented 5 years ago

Firos currently cannot convert an object into the correct Ros-Message, which look like:

Header header

unit8[] x
float64[] y
MyVeryOwnMsg[] mvom

It looks like the implementation is missing for such cases in: https://github.com/iml130/firos/blob/36e1e7e789984c887fe54474b718d33c69f79ba8/scripts/include/ros/rosutils.py#L36-L53

Also the 'Definition file class' which is loaded on line https://github.com/iml130/firos/blob/36e1e7e789984c887fe54474b718d33c69f79ba8/scripts/include/ros/topicHandler.py#L166 might be errorneos in this case

Debugging to the Point, where the data of msg is replaced by the actual values (obj2Ros) shows, that the actual msg on that point is a empty list, but the obj still contains information.

iml-dlux commented 5 years ago

Setting a Breakpoint on the added Lines in 332fe5a shows that the msgInstance is empty and the obj still contains content.

iml-dlux commented 5 years ago

In commit e4093cee4cec9493409149eb98ed83d4c9d98654 the Objects received from CB are parsed differently now. With the Object-Converter 'Type'-Information are saved on the CB, so that the parsing to a ROS-class can happen without prior knowledge about the actual ROS-class.

This parsing still needs to be tested..

( for linking)

Luxxii commented 5 years ago

In StackOverflow, the following (alternative) representation of arrays is shown:

Here the alternative representation:

"pressure": {
    "value": [720, 500],
    "type": "Integer"
}

Instead of using Integer, we should use standard json-DataTypes. In Addition to that, we should find more documentation about such a representation before Implementation.