Omnigraph set primpath issue

I am working on loading lidar from isaac sim using python. However, I don’t know how to put the lidarprim in the relationship into code in the current Isaac Read Lidar Beams Node. can you give me the answer?

Hi @leejisue

Just use the inputs:lidarPrim Add target(s) button for selecting the Lidar sensor as indicated in the documentation

https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/tutorial_ros_sensors.html?highlight=lidar%20beam#graph-explained

Isaac Read Lidar Beam Node: Retrieve information about the Lidar and data. For inputs:LidarPrim, add target to point to the Lidar sensor we just added at /World/turtlebot3_burger/base_scan/Lidar.

Also, if you want to set the target prim via Python code you can use the Isaac Sim core utility function set_targets

import omni.usd
from omni.isaac.core.utils.prims import set_targets

stage = omni.usd.get_context().get_stage()

set_targets(prim=stage.GetPrimAtPath("/World/ActionGraph/isaac_read_lidar_beams_node"),
            attribute="inputs:lidarPrim",
            target_prim_paths=["/World/GenericSensor"])
1 Like

I appreciate that your reply. But When i use the set_targets function the ImportError is comeout. Did the set_target function move elsewhere?

Hi @leejisue

The set_targets() function was added to prim utils in Isaac Sim 2022.2.0

For Isaac Sim 2022.1.1 use the following function:

from omni.isaac.core_nodes.scripts.utils import set_target_prims

set_target_prims(primPath="/World/ActionGraph/isaac_read_lidar_beams_node",
                 inputName="inputs:lidarPrim",
                 targetPrimPaths=["/World/GenericSensor"])
1 Like

I set lidarprim on LidarBeamsNode in ActionGraph, but no change was made. Can you tell me what the problem is with this?


Hi @leejisue

According to the images, the Lidar Beams Node path is “/World/husky/lidar_graph/LidarBeamsNode”, but you are using “/World/lidar_graph/LidarBeamsNode” in the Python script

1 Like

when i change the command… how can i fix it?

Can I get your email forwarded? I think I can send you my code.

Hi @leejisue

You can share the code on this topic, or, if you prefer, through a direct message (in this case, just click on my profile image in any post on this topic and select Message)

1 Like

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