I have a python script running my simulation. I am trying to offer a reset button that will reset the positions of all objects in my scene. My scene is a warehouse scene with a Carter V2 running the ROS Bridge extension.
I’ve tried the following with no luck:
Use ROS1 teleportation service to move the cart back to the starting place
This one didn’t quite work out because it appears the positions are relative to the starting position. For example, if the cart starts at P1, and then through publishing of
/cmd_vel messages, the cart moves to the other side of the room, if I publish a teleportation to P1, it won’t move. Inspecting the cart’s position in the tree viewer on the right, it still shows it’s in P1 when it has in fact moved. So I’d have to do something like figure out the current position, subtract that from P1, and then call the teleportation service on the difference. Don’t see a way to do this either.
Using the timeline interface to stop and replay the simulator.
This would work find, as it’s how I reset the simulator when using the Isaac Sim GUI. However, when I do it in a python script, it doesn’t reset the scene and instead spams:
[Warning] [omni.isaac.core.articulations.articulation_view] Physics Simulation View is not created yet in order to use apply_action
[Warning] [omni.isaac.core.articulations.articulation_view] Physics Simulation View is not created yet in order to use get_applied_actions
Oddly, if I telnet into the device and call
omni.timeline.get_timeline_interface().play() on separate REPL instructions, it will work. But does not work when run from a script.
Is there any other way I can easily reset the position of all of my objects in the scene via the Python API?
Another failed attempt.
Using a simulation context, I tried to call the
reset function. However, the same issue appeared where the console got spammed about missing a Physics View :
from omni.isaac.core import SimulationContext
sc = SimulationContext()
sc.initialize_physics() didn’t fix the issue. Any ideas?
Bump. This is still blocking our efforts here. Thanks
Have you tried the World.reset method from the omni.isaac.core extension
You can inspect the standalone examples to see its usage…
For example, the
standalone_examples/api/omni.isaac.core/add_frankas.py script resets the world 5 times…
You want to use the teleportation service on the “chassis” rigid body, not the prim that contains the articulation. The chassis is what moves if the robot is driving around and what you want to teleport. The parent xform remains static as it has no physics apis on it.
Are you using a standalone python script (via python.sh) or isaac-sim.sh and running a script async?
World.reset is an option, but you have to set up the scene using the isaac.core interfaces so default positions etc are set and add all of the objects in the scene to the World object so it knows what to reset.
I did try that, yes. I still get a crash with the error print:
Physics Simulation View is not created yet in order to use get_applied_actions. Maybe something here I’m doing wrong?
Can you provide the script you are using?
Your suggestion to use
chassis_link worked perfectly! Thanks for catching that one.
Usually for fixed robot arms this is not an issue because the parent xform to root link transform is fixed. But for mobile robots you have to use the root/chassis for any odometry, pose, teleportation operations
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.