How query the Surface Gripper instance in the current scene?

I have a scene setup in Isaac Sim 4.0 which has a robotic arm that uses a SurfaceGripper.
I want to output the state of the surface gripper (open or closed) in ROS2 similar to how JointStates are output in ROS2.

Based on what I understand I can add elements to the action graph so that on Simulation Playback Tick I read the state of gripper and send it to ROS2 output.

I most Surface Gripper tutorials such as: Surface Gripper Extension — Omniverse IsaacSim latest documentation (nvidia.com)
The surface gripper instance is known and saved to a variable in code.

Questions:

  • Given the primative I know the SurfaceGripper.parentPrimative is applied to how can I get access to the surface gripper instance?

  • If I want to output SurfaceGripper state to ROS2, is writing a custom graph node required?
    ROS 2 Python Custom OmniGraph Node — Omniverse IsaacSim latest documentation (nvidia.com)

  • What are other alternative solutions?
    I thought of creating a joint the mimics the state of the surface gripper by querying surface gripper state and applying it to join articulation controller and this allows me to leverage the native ROS2 JointStates node, but that seems like a hack and I don’t think I could have joints on non-rigid bodies that are only for visualization

If you only need to use ActionGraph I found solution and documented it here: Nvidia Isaac Sim: How to publish the state of a Surface Gripper to a ROS2 topic? | by Matt Mazzola | Aug, 2024 | Medium

The SurfaceGripper node in ActionGraph has an .outputs.Closed property you can access.
Through some manual conversion you can send it as ROS message.

However, I am still not sure how to access this surface gripper state through the Python API.

To query the Surface Gripper instance in your current scene, you can refer to the documentation for the Surface_Gripper class. This includes methods such as is_closed(), which checks if the gripper is currently closed. You can find more details in Surface_gripper [omni.isaac.surface_gripper] — isaac_sim 4.1.0-rc.7 documentation.

Ok, I will take another look at using this SurfaceGripper class with my existing solution.

I was initially concerned about having two owners or initializers of the gripper prims and their control.

  1. SurfaceGripper ActionGraph Node
  2. SurfaceGripper Python Class

I thought since the action graph solution is already working for me, if I attempted to also setup using the python class it might cause redundant initialization which could possibly decrease performance for conflict with existing operations a subtlety break something, so I didn’t invest time.

I do think your suggestion is the correct solution though I will mark it.
Thanks!

Given I have implemented the SurfaceGripper using the ActionGraph
I think appropriate method for me is to get the node attribute using:

surface_gripper_node.get_attribute(“outputs:Closed”)
Or
og.Controller.attribute(“/World/MyGraph/SurfaceGripperNode.outputs:Closed”)

Also, I was confused between the omni.isaac.manipulators.SurfaceGripper.is_closed and the omni.isaac.surface_gripper.SurfaceGripper.is_closed

To more formally answer the initial questions:

  • Given the primitive I know the SurfaceGripper.parentPrimative is applied to how can I get access to the surface gripper instance?

    It’s unclear. This might not be possible to recreate or dynamically get access to a SurfaceGripper instance.

  • If I want to output SurfaceGripper state to ROS2, is writing a custom graph node required?

    No, the Closed output already exists. You can use it and manually construct and send ROS message using ROS2Publisher node

  • What are other alternative solutions?

    As shown above, keep reference to SurfaceGripper instance when created, or query attribute of SurfaceGripperNode

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