Inverse Reachability Map in Omniverse

Hello.

I am trying to implement Inverse Reachability Map(IRM) in Omniverse, and got some problems.

In Extension mode, I implemented the basic method for IRM.

I intended that the IsaacSim IK solver can compute the fact whether the solution exist or not at each grid points.

However, it is very slow because of the step size or redering issue.

I know that Standalone mode provides the acceleration of rendering or time step, but it could be slow to compute the huge size of grid data.

I just want the rapid computation of IRM without every rendering process.

This is the main part of code and video below.

class M1013(BaseSample):
    def __init__(self) -> None:

        self._controller = None
        self._articulation_controller = None
        super().__init__()
        return

    def setup_scene(self):
        
        self.draw = _debug_draw.acquire_debug_draw_interface()
        x = np.linspace(-5, 14, 100)
        y = np.linspace(-10, 8, 100)
        xx, yy = np.meshgrid(x, y)
        self.grid_array = np.vstack((xx.ravel(), yy.ravel())).T
        self.i = 0

        ...
        return

    async def setup_post_load(self):

        ...

        self.target_name = task_params["target_name"]["value"]
        self.denso_name = task_params["robot_name"]["value"]

        self.my_denso = world.scene.get_object(self.denso_name)

        self._controller = KinematicsSolver(self.my_denso)
        self._articulation_controller = self.my_denso.get_articulation_controller()

        self._world.add_physics_callback("sim_step", callback_fn=self._on_sim_step)
        await self._world.play_async()
        
        return
    

    def _on_sim_step(self, step_size):
        
        if self.i < len(self.grid_array):
            x, y = self.grid_array[self.i]
        
        observations = self._world.get_observations()

        robot_pos = get_prim_property(prim_path = "/World/M1013", property_name =  "xformOp:translate")
        IRM_point = np.array(robot_pos)

        actions, succ = self._controller.compute_inverse_kinematics(            #Dist Base 2 Link6      #Dist EE 2 Tip 
            target_position=observations[self.target_name]["position"] - robot_pos, #+np.array([0,0,1.8927]), # Calibration for the manipulator's translation
            target_orientation=observations[self.target_name]["orientation"],
        )

        if succ:
            self.my_denso.set_joint_positions(actions.get_dict()['joint_positions'])
            self.draw.draw_points([(IRM_point[0],IRM_point[1],IRM_point[2])], [(0, 1, 0, 1)], [10])
        else:
            self.draw.draw_points([(IRM_point[0],IRM_point[1],IRM_point[2])], [(1, 0, 0, 1)], [10])
            carb.log_warn("IK did not converge to a solution. No action is being taken.")
        
      
        set_prim_property(prim_path="/World/M1013", property_name="xformOp:translate", property_value=Gf.Vec3d(x, y, 6.9655))

        self.i += 1
        return

How can I accelerate the computation of IRM in Omniverse ?

Should I make the additional external python code for it ?

I referenced this ROS package(reuleaux - ROS Wiki), but I do not want to connect this to Omniverse.

Thank you.

Hi @swimpark - Sincere apologies for the delay in response. Please let us know if you still have any questions or concerns after using the latest Isaac Sim release.