Hello,
I am trying to publish my own custom ROS messages from Omniverse and I am running into a problem.
I defined the following dummy message inside of my package my_custom_msgs
called `CharacterInfo.msg’ like so:
uint64 xpos
uint64 ypos
uint64 zpos
I then created an extension in Omniverse called my.custom.msgs
, where I have a folder called packages
where I copied the contents of $ROS_WORKSPACE/install/my_custom_msgs/lib/python3.8/site-packages/my_custom_msgs
after building the package.
My extension adds this folder to the python path like so:
import os
import sys
import omni.ext
class Extension(omni.ext.IExt):
def on_startup(self, ext_id):
self._extension_path = None
ext_manager = omni.kit.app.get_app().get_extension_manager()
self._extension_path = ext_manager.get_extension_path(ext_id)
sys.path.append(
os.path.join(
self._extension_path, "my", "custom", "msgs", "packages"))
if os.environ.get("LD_LIBRARY_PATH"):
os.environ["LD_LIBRARY_PATH"] = os.environ.get(
"LD_LIBRARY_PATH") + ":{}/bin".format(self._extension_path)
else:
os.environ["LD_LIBRARY_PATH"] = "{}/bin".format(
self._extension_path)
def on_shutdown(self):
if self._extension_path is not None:
sys.path.remove(
os.path.join(
self._extension_path, "my", "custom", "msgs", "packages"))
self._extension_path = None
If I go then to Omniverse and activate my extension I can import the message in the Script editor without an issue like so:
from my_custom_msgs.msg import CharacterInfo
msg = CharacterInfo()
msg.xpos = 1
msg.ypos = 2
msg.zpos = 3
The problem comes when I define a publisher that uses this type of message:
import rclpy
node = rclpy.create_node('my_publisher')
pub = node.create_publisher(CharacterInfo, 'chatter', 10)
This gives me the following error:
2022-04-29 08:08:50 [1,925,474ms] [Error] [omni.kit.app.plugin] [py stderr]: UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'my_custom_msgs'
At:
/home/user/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/omni/isaac/rclpy/rosidl_generator_py/import_type_support_impl.py(48): import_type_support
/home/user/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/omni/isaac/rclpy/my_custom_msgs/msg/_character_info.py(35): __import_type_support__
/home/user/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/omni/isaac/rclpy/rclpy/type_support.py(29): check_for_type_support
/home/user/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/omni/isaac/rclpy/rclpy/node.py(1140): create_publisher
executing: Python 0...(12): <module>
Here’s my extension.toml
file for context:
[package]
# Semantic Versionning is used: https://semver.org/
version = "1.0.0"
# The title and description fields are primarily for displaying extension info in UI
title = "Simple UI Extension Template"
description="The simplest python extension example. Use it as a starting point for your extensions."
# Path (relative to the root) or content of readme markdown file for UI.
readme = "docs/README.md"
# URL of the extension source repository.
repository = ""
# One of categories for UI.
category = "Example"
# Keywords for the extension
keywords = ["kit", "example"]
# Use omni.ui to build simple UI
[dependencies]
"omni.kit.uiapp" = {}
# Main python module this extension provides, it will be publicly available as "import omni.hello.world".
[[python.module]]
name = "my.custom.msgs"
Any help would be highly appreciated.