Position
Adapter Type: "position"
This adapter maintains the link which says where the robot is in the map: a single robot.position.v1 edge from the fixed frame (usually the map frame) to the robot frame (usually the robot's base frame). The link is created once both frames are present in the map, and it is replaced if either frame changes. The position of the robot can then be found with the position/get service, and used by services such as nodes/add/currentPosition.
Only one dynamic map may have a position adapter.
Each frame is set either as a fixed node ID, or as an object which resolves the node ID from a telemetry topic as it changes:
| Setting | Type | Description | Default |
|---|---|---|---|
default | string | The node ID to use. For a frame with a source, it is used until the first message arrives. A frame with no source must have a default. | |
source | string | A telemetry topic to take the node ID from. | |
value | string | A JavaScript expression evaluated against each message, as msg, to give the node ID. If omitted the message payload is used directly. Requires source. |
| Setting | Type | Description | Default |
|---|---|---|---|
fixedFrame | string or object | The fixed frame, as above. Required. | |
robotFrame | string or object | The robot frame, as above. Required. |
The frames can also be changed while the agent is running with the adapter's position/setFrames service. A frame which has a source is set again by the next message received on it.
Example
"uniqueAdapterName": {
"enabled": true,
"type": "position",
"settings": {
"fixedFrame": "map",
"robotFrame": {
"default": "base_link",
"source": "/robot/active_frame",
"value": "msg.frame"
}
}
}