How to subscribe to different ROS2 topic types?

In the ROS2 Bridge extension, only clock, joint state, and twist message can be subscribed.

I need to subscribe to a float message. How do I achieve that?

My assumption is that I need to create a custom node to do that. Is there any guide or documentation about it?

hi @lee43 , the std_msgs package has a float32 message type which can be leveraged directly. If you want to use Custom messages with Python scripts and Isaac Sim refer to this tutorial

Hope this answers your question, thanks!

Hi, I have no problem importing the std_msg library in Isaac Sim. The problem I’m facing is how do I incorporate a ROS subscriber in it.

I have a robot that has a different driving dynamics. Hence the action graph provided by this tutorial is not suitable anymore 7.2.2. Driving TurtleBot via ROS2 messages — Omniverse IsaacSim latest documentation. I need to be able to control each wheel individually hence I need to subscribe to a float message, which is the speed of the wheel.

I tried to create my own node based of this tutorial Part Three: Create Your Own Nodes — Omniverse Extensions latest documentation

This is how my node graph looks like

This is the code of my custom node

# Array or tuple values are accessed as numpy arrays so you probably need this import
import numpy
import rclpy
from rclpy.node import Node
from std_msgs.msg import Float32

try:
    rclpy.init()
except:
    pass

class FloatSubscriber():
    
    @staticmethod
    def compute(db) -> bool:
        
        def callback(msg):
            db.outputs.float = msg.data
            print(msg.data)

        """Compute the outputs from the current input"""
        try:
            # With the compute in a try block you can fail the compute by raising an exception
            topic_name = db.inputs.topic_name
            node = Node('minimal_subscriber')
            node.create_subscription(Float32, topic_name, callback, 10)
            node
            pass
        except Exception as error:
            db.log_error(str(error))
            return False

        return True

There is no error message but it is not driving the robot.

@lee43 , in the code you have pasted above, you are creating a subscriber to the Float32 message but this is not being used to set the joint velocities for your robot (these need to be passed into the articulation controller for the robot which will then be responsible for driving it). This snippet here provides a sample for doing so. This will have to be integrated with your ROS 2 subscriber. All the best!

Hi,

which isaac sim version did you use to create a custom node in omnigraph. Isaac sim 4.0.0 and 4.1.0 do not have node description editor tool. Coule you please confirm how you did it ?

@kaushalkumar.patel is this still an issue with Isaac Sim 4.5?

I have stop working on the simulation at the moment. Therefore no idea.