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

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

@Luxxii

Description

@Luxxii

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions