Isaac Sim Version
[ X ] 4.2.0
4.1.0
4.0.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):
Isaac Lab Version (if applicable)
1.3
1.1
1.0
Other (please specify):
Operating System
Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):
GPU Information
- Model: A2000
- Driver Version:
Topic Description
Detailed Description
Hi guys,
I’m new to modeling and simulating with Isaaclab.
In my project, I need to create a ground with an object above it. The ground must move up and down, while the object must follow the movement. Just as a simple platform. Currently, the ground is moving but there is no collision. If I change the physics on simulation to enable rigid body, the prims will overlap and not follow the ground movement.
I’m stuck right now and it is kinda hard to find material online about isaaclab, so I came here asking for help…
Steps to Reproduce
- Create a python file with this content:
import argparse
import math
from omni.isaac.lab.app import AppLauncher
parser = argparse.ArgumentParser(description=“Tutorial on spawning prims into the scene.”)
AppLauncher.add_app_launcher_args(parser)
args_cli = parser.parse_args()
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
“”“Rest everything follows.”“”
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.lab.sim as sim_utils
from omni.isaac.lab.utils.assets import ISAAC_NUCLEUS_DIR
def design_scene():
“”“Designs the scene by spawning ground plane, light, objects and meshes from usd files.”“”
# Ground-plane
# cfg_ground = sim_utils.GroundPlaneCfg()
# cfg_ground.func(“/World/defaultGroundPlane”, cfg_ground)
ground = prim_utils.create_prim('/World/defaultGroundPlane', usd_path='http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.2/Isaac/Environments/Grid/default_environment.usd', translation=None, orientation=None)
# spawn distant light
cfg_light_distant = sim_utils.DistantLightCfg(
intensity=3000.0,
color=(0.75, 0.75, 0.75),
)
cfg_light_distant.func("/World/lightDistant", cfg_light_distant, translation=(1, 0, 10))
return ground
def main():
“”“Main function.”“”
# Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera
sim.set_camera_view([2.0, 0.0, 2.5], [-0.5, 0.0, 0.5])
# Design scene by adding assets to it
ground = design_scene()
# Play the simulator
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
# Simulate physics
count = 0
amplitude = 0.1
oscillation_speed = 0.05
while simulation_app.is_running():
oscillation_angle = amplitude * math.sin(oscillation_speed * count)
current_position = ground.GetAttribute("xformOp:translate").Get()
new_position = (current_position[0], current_position[1], current_position[2] +oscillation_angle)
ground.GetAttribute("xformOp:translate").Set(new_position)
count += 1
sim.step()
if name == “main”:
# run the main function
main()
# close sim app
simulation_app.close()
- Run it
- Edit >> Add Shape (as a cuboid). You can also try to add new physics property, but I’ve done it without success
(Add more steps as needed)
Additional Information
What I’ve Tried
Create the prim in the code,
Use a slim cuboid as ground, instead of the GroundPlane,
Use a MeshCuboid with deformable properties