Isaac Sim support rclpy, but how can I read my custom message with my system ROS humble?

Isaac Sim Version: 5.0.0

Operating System: Ubuntu 22.04

Topic Description

Detailed Description

(Describe the issue in detail, including what you were trying to do, what you expected to happen, and what actually happened)

Steps to Reproduce

  1. Follow ROS 2 Python Custom Messages — Isaac Sim Documentation

  2. But the msg file has different name and is identical to SampleMsg.msg
    std_msgs/String my_string
    int64 my_num

  3. export isaac_sim_package_path=“path_to_isaacsim5.0”

    export ROS_DISTRO=humble

    export RMW_IMPLEMENTATION=rmw_fastrtps_cpp

    # Can only be set once per terminal.

    # Setting this command multiple times will append the internal library path again potentially leading to conflicts

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$isaac_sim_package_path/exts/isaacsim.ros2.bridge/humble/lib

    # Run Isaac Sim

    $isaac_sim_package_path/isaac-sim.sh

  4. in the same terminal I cannot run ros2

  5. If I open another terminal and source system ros humble, then source the msg package, then try echo the message,

    source …/IsaacSim-ros_workspaces/build_ws/humble/isaac_sim_ros_ws/install/local_setup.bash
    ros2 topic echo /raycast_data

  6. I will get the following error

    ```
    Traceback (most recent call last):
    File “/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py”, line 46, in import_type_support
    return importlib.import_module(module_name, package=pkg_name)
    File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File “”, line 1050, in _gcd_import
    File “”, line 1027, in _find_and_load
    File “”, line 1004, in _find_and_load_unlocked
    ModuleNotFoundError: No module named ‘custom_message.custom_message_s__rosidl_typesupport_c’

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “/opt/ros/humble/bin/ros2”, line 33, in
    sys.exit(load_entry_point(‘ros2cli==0.18.12’, ‘console_scripts’, ‘ros2’)())
    File “/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py”, line 91, in main
    rc = extension.main(parser=parser, args=args)
    File “/opt/ros/humble/lib/python3.10/site-packages/ros2topic/command/topic.py”, line 41, in main
    return extension.main(args=args)
    File “/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/echo.py”, line 235, in main
    self.subscribe_and_spin(
    File “/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/echo.py”, line 258, in subscribe_and_spin
    node.create_subscription(
    File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/node.py”, line 1374, in create_subscription
    check_is_valid_msg_type(msg_type)
    File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/type_support.py”, line 35, in check_is_valid_msg_type
    check_for_type_support(msg_type)
    File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/type_support.py”, line 29, in check_for_type_support
    msg_or_srv_type.class.import_type_support()
    File “/mnt/nvme/huy/Documents/isaac-sim-standalone-5.0.0/projects/ROAS_ext/IsaacSim-ros_workspaces/build_ws/humble/isaac_sim_ros_ws/install/custom_message/local/lib/python3.11/dist-packages/custom_message/msg/_ray_cast.py”, line 29, in import_type_support
    module = import_type_support(‘custom_message’)
    File “/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py”, line 48, in import_type_support
    raise UnsupportedTypeSupport(pkg_name)
    rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import ‘rosidl_typesupport_c’ for package ‘custom_message’
    ```

  7. In addition, my workflow is Extension, the physic callback is on_physics_step()

Does the example script work on your side?

import rclpy
from custom_message.msg import SampleMsg

# Create message
sample_msg = SampleMsg()

# assign data in the string part and integer part of the message
sample_msg.my_string.data = "hello from Isaac Sim!"
sample_msg.my_num = 23

print("Message assignment completed!")

Yes, this work on my side. So the problem is the ROS nodes in IsaacSim use/ compatible with python 3.11 but my system ROS humble use python 3.10.

1 Like

Thank you for confirming the solution. The core issue was indeed a Python version mismatch between your system’s ROS Humble (Python 3.10) and NVIDIA Isaac Sim (Python 3.11). Since the issue is resolved, I will now close this topic.

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