Skip to main content

Transforms

The Conversion Agent Component has special handling for transform data conversion from ROS and Boston Dynamics Spot.

The special handling for both ROS and BD Spot will output with the following structure:

type TransformResponseMessage struct {
ID string `json:"id"`
Parent string `json:"parent"`
Rotation vectormaths.Quaternion `json:"rot"`
Timestamp int64 `json:"tim"`
Translation vectormaths.Vector3 `json:"pos"`
}

The schema for these messages is shown below:

{
"$id": "%[1]s",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"parent": {
"type": "string"
},
"rot": {
"type": "object",
"properties": {
"x": { "type": "number" },
"y": { "type": "number" },
"z": { "type": "number" },
"w": { "type": "number" }
}
},
"tim": {
"type": "integer"
},
"pos": {
"type": "object",
"properties": {
"x": { "type": "number" },
"y": { "type": "number" },
"z": { "type": "number" }
}
}
}
}

ROS Transforms

If you have a ROS source topic publishing transforms on the /tf topic, you can setup a minimal conversion component rule that will automatically publish data to generated topics using the child identifier as the topic name.

To use the ROS transform preset, create a rule in the component settings as shown below:

...
"rules": {
...
"ros_tf": {
"enabled": true,
"preset": "ros_tf_transforms"
},
...
},
...

Boston Dynamics Spot Transforms

If you have a Spot publishing transforms over the /robotstate/kinematic_state topic, you can setup a minimal conversion component rule that will automatically publish the data to generated topics using the child identifier as the topic name.

To use the Spot transform preset, create a rule in the component settings as shown below:

...
"rules": {
...
"spot_tf": {
"enabled": false,
"preset": "spot_transforms"
}
...
},
...

The important part in both of these transform rules is the use of the preset property. The preset property is used to lookup the appropriate data internally within the conversion component. This will include the topic name generation, parsing the incoming messages, and sending the output messages to the generated topics.