[Error] [omni.graph] Unable to set simple value from AttributeData 'inputs:targetPrim' of type 'rel'

I wrote the code to translate /World/Cubes/Cube1 to /World/Cubes/Cube2

To translate Cube1 to Cube 2, I used action graph and ‘TranslateToTarget’ Node.

Below is the code:

controller = action_og.Controller()
keys = controller.Keys
controller.edit(
    {"graph_path": "/controller_graph", "evaluator_name": "execution"},
    {
        keys.CREATE_NODES: [
            ("OnTick", "omni.graph.action.OnTick"),
            ("TranslateToTarget", "omni.graph.nodes.TranslateToTarget"),
        ],
        keys.SET_VALUES: [
            ("OnTick.inputs:onlyPlayback", True),
            ("TranslateToTarget.inputs:sourcePrim", "/World/Cubes/Cube1"),
            ("TranslateToTarget.inputs:targetPrim", "/World/Cubes/Cube2"),

        ],
        keys.CONNECT: [
            ("OnTick.outputs:tick", "TranslateToTarget.inputs:execIn"),
        ],
    },
)

However, when I ran the code, the following error still appears:
[Error] [omni.graph] Unable to set simple value from AttributeData ‘inputs:targetPrim’ of type ‘rel’

It seems that the value for sourcePrim and targetPrim should be the path, but the values written in each node is path, as least I think.

Is there any way to solve this issue?

Thanks in advance!

Something like this should work (untested with your example, but I hope it makes sense)

from omni.isaac.core_nodes.scripts.utils import set_target_prims
set_target_prims(
            primPath=graph_path + "TranslateToTarget", inputName="inputs:sourcePrim", targetPrimPaths=["/World/Cubes/Cube1"]
        )

I also meet the same problem when I use “omni.isaac.ros_bridge.ROS1PublishTransformTree” in omni.graph,and I search the api documents to find that the type of “inputs:targetPrims” is bundle .But I don’t know how to give it the value by python script.
Anyone help?

Hi @wuxu12 , does the previous message from Hammad doesn’t work for you if having the same issue?