Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Replacing of / into . (OCB <-> ROS Types) #6

Open
Luxxii opened this issue Nov 20, 2019 · 0 comments
Open

Replacing of / into . (OCB <-> ROS Types) #6

Luxxii opened this issue Nov 20, 2019 · 0 comments

Comments

@Luxxii
Copy link
Contributor

Luxxii commented Nov 20, 2019

Currently we replace / into . in each type-attribute (except, the first, with an id).

Here are the lines:

if hasattr(_object, '_type') and hasattr(_object, '_slot_types') and hasattr(_object, '__slots__'): # ROS-Specific Type-Declaration
### This is a special CASE for ROS!!!!
self.type = _object._type.replace("/", ".") # Needs to be replaced Fiware does not allow a '/'
self.setPythonMetaData(ipmd, "class")
# Special Case 'Image-like'-Data in ROS (very long 'int8[]'- and 'uint8[]' - arrays)
# These are converted into Base64 (escaped)

This is not correct. Sadly the OCB has some forbidden Characters, which restricts us (even some messages cannot be sent due to this.)

Iff in the future, some forbidden characters are removed, we should remove the line L122.

here is an example of a publish on something else then the OCB:

{
   "angular":{
      "type":"geometry_msgs.Vector3",
      "value":{
         "y":{
            "type":"number",
            "value":0.0
         },
         "x":{
            "type":"number",
            "value":0.0
         },
         "z":{
            "type":"number",
            "value":1.0
         }
      },
      "metadata":{...}
   },
   "linear":{
      "type":"geometry_msgs.Vector3",
      "value":{
         "y":{
            "type":"number",
            "value":0.0
         },
         "x":{
            "type":"number",
            "value":0.0
         },
         "z":{
            "type":"number",
            "value":0.0
         }
      },
      "metadata":{...}
   },
   "type":"geometry_msgs/Twist",
   "id":"/turtle1/cmd_vel"
}

It show here two different ROS-Message geometry_msgs/Twist and with a dot geometry_msgs.Vector3. (It would be great to avoid excaping dots after all.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant