TMK314
January 14, 2025, 5:57pm
1
Isaac Sim Version
[ x] 4.2.0
4.1.0
4.0.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):
Operating System
Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):
GPU Information
Topic Description
Detailed Description
Hi, currently I am trying to imitate the manually setup characters(https://docs.omniverse.nvidia.com/isaacsim/latest/features/warehouse_logistics/ext_omni_anim_people.html#manually-setup-characters ) using python as an attempt to use omni.anim.people without UI. I have succeed in attach behavior scripting and add animation graph to SkelRoot but have not figured out how to input command for the character. Have anybody succeed in this task.
Processing: Omni_People_P15_Cmd_File_Example.PNG…
VickNV
January 16, 2025, 11:00pm
3
Thank you for reaching out about your Omni.Anim.People implementation. Could you share your current Python script to better assist you with your specific issue?
TMK314
January 17, 2025, 2:52am
5
Yes, here my test script
from isaacsim import SimulationApp
# Start Isaac Sim
CONFIG = {"renderer": "RayTracedLighting", "headless": False}
simulation_app = SimulationApp(CONFIG)
import omni
import carb
from pxr import Sdf, Gf
from omni.isaac.core.world import World
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.nucleus import get_assets_root_path
from omni.isaac.core.utils import extensions, prims
extensions.enable_extension("omni.anim.people")
extensions.enable_extension("omni.anim.graph.bundle")
extensions.enable_extension("omni.kit.scripting")
extensions.enable_extension("omni.anim.graph.ui")
extensions.enable_extension("omni.replicator.agent.core")
from omni.anim.people.scripts.character_behavior import CharacterBehavior
from omni.kit.scripting import BehaviorScript
from omni.anim.people import PeopleSettings
import omni.anim.graph.core as ag
from omni.anim.people.scripts.global_agent_manager import GlobalAgentManager
# Create the world
world = World()
world.scene.add_default_ground_plane()
prims.create_prim("/World/Characters", "Xform")
# Define character paths
character_name = "F_Business_02"
character_prim_path = f"/World/Characters/F_Business_02/female_adult_business_02/ManRoot/female_adult_business_02"
# Get the asset path
path = get_assets_root_path()
asset_path = f"{path}/Isaac/People/Characters/{character_name}/{character_name}.usd"
biped_path = f"{path}/Isaac/People/Characters/Biped_Setup.usd"
# Add character to the stage
# add_reference_to_stage(usd_path=asset_path, prim_path=f"/World/Characters/{character_name}")
prims.create_prim(f"/World/Characters/{character_name}", "Xform", usd_path = asset_path)
omni.kit.commands.execute("IsaacSimTeleportPrim", prim_path = f"/World/Characters/{character_name}" , rotation = [0.0, 0.0, 0.0, 0.0])
#Add Python script
omni.kit.commands.execute("ApplyScriptingAPICommand", paths=[Sdf.Path("/World/Characters/F_Business_02/female_adult_business_02/ManRoot/female_adult_business_02")])
omni.kit.commands.execute("RefreshScriptingPropertyWindowCommand")
scripts = Sdf.AssetPathArray(["/home/kien/.local/share/ov/pkg/isaac-sim-4.2.0/extscache/omni.anim.people-0.5.0/omni/anim/people/scripts/character_behavior.py"])
character_prim = world.stage.GetPrimAtPath("/World/Characters/F_Business_02/female_adult_business_02/ManRoot/female_adult_business_02")
character_prim.GetAttribute("omni:scripting:scripts").Set(scripts)
#Setup Biped setup for animation graph
prim = prims.create_prim("/World/Characters" + "/Biped_Setup", "Xform", usd_path=biped_path)
prim.GetAttribute("visibility").Set("invisible")
# Get the animation graph that we are going to add to the person
animation_graph = world.stage.GetPrimAtPath("/World/Characters/Biped_Setup/CharacterAnimation/AnimationGraph")
omni.kit.commands.execute("ApplyAnimationGraphAPICommand",
paths=[Sdf.Path("/World/Characters/F_Business_02/female_adult_business_02/ManRoot/female_adult_business_02")],
animation_graph_path=Sdf.Path(animation_graph.GetPrimPath()))
agent_manager = GlobalAgentManager()
agent = CharacterBehavior(prim_path = Sdf.Path(character_prim_path))
print(agent.init_character())
agent_manager.add_agent(agent_prim_path = character_prim_path ,agent_object=agent)
agent = agent_manager.get_agent(agent_prim_path = character_prim_path)
print(agent.get_agent_name())
agent_manager.inject_command(agent_prim_path = character_prim_path, command_list = commands)
print(agent.commands)
# agent.execute_command(agent.commands,2)
I suspect there some problem with how the F_Business_02 cannot be recognize as SelRoot
Hey, did you find any solution to add the command file to the code ?