Extend ROS2 bridge / new ROS prims

Hi,

I would like to implement new functionality on top of ROS2 bridge. I need something similar to the ROS differential base prim that lets me send odom messages and perhaps receive command messages, but in a much simpler way.

My robot has no wheels and I want to get the odom information directly from the translation/rotation of the base link.

Can someone give me a hint how I can approach this? I have no idea how to implement new ROS Prim types

Thanks a lot
Bruno

Hi @bruno.vetter

An approach for implementing a new ROS2 prim is to create a class that inherits from the RosBridgeComponent class…

In addition, it is necessary to implement (at least) the following static methods (Define, Get and GetSchemaAttributeNames). Refer to Universal Scene Description: UsdGeomXform Class Reference to identify the expected parameters and return, for example…


However, the prim will only let you store persistent data (among other functionalities) in the .usd, such as the ROS2 topic name

From the usd glossary: prim

A Prim is the primary container object in USD: prims can contain (and order) other prims, creating a “namespace hierarchy” on a Stage, and prims can also contain (and order) properties that hold meaningful data. Prims, along with their associated, computed indices, are the only persistent scenegraph objects that a Stage retains in memory, and the API for interacting with prims is provided by the UsdPrim class. Prims always possess a resolved Specifier that determines the prim’s generic role on a stage, and a prim may possess a schema typeName that dictates what kind of data the prim contains. Prims also provide the granularity at which we apply scene-level instancing, load/unload behavior, and deactivation.


In order to implement a new functionality, you will need to program an interface (e.g. a user extension) to manage the communication (publisher, subscriber, services, actions)…

Thanks toni.sm,

again you are very helpful. I checked your ROS extension code in GitHub again and was able to create a new ROS prim type. I can also publish to odom/tf in a way similar to RosDifferentialBase.

My main problem currently is that I am not able to retrieve the time the RosClock uses in order to set the correct timestamp in my messages (See my other new topic: How to get ros time within extension)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.