[Question] Objects not spawning in the correct terrain environment #2229
Replies: 11 comments
-
Thanks for posting this question. This requires a closer look from our side. Thanks for your patience. |
Beta Was this translation helpful? Give feedback.
-
@RandomOakForest a quick followup question. Is it possible to spawn one big rough environment like the standard plane where all robots spawn on the same plane instead of every robot spawning in an own environment like the method I tried before? |
Beta Was this translation helpful? Give feedback.
-
Following up, there is a |
Beta Was this translation helpful? Give feedback.
-
Hey,
Interestingly I do not need this for the simple plane-environment. After I implemented a similar addition like |
Beta Was this translation helpful? Give feedback.
-
It seems like you're trying to create a single procedural ground mesh and then spawn your 10 environments, each in the correct position on that mesh. to get a really good quadruped motion policy you're going to want to create more like 4,000 environments and this method probably won't scale very well. that's why it's probably better to use the _reset_idx function. In this one, you would write code that generates each environment randomly so that you can generate as many random environments as you need. That said, I haven't done this myself just yet so I'm not sure if you can add additional meshes and rigid bodies in this function or if you can only write to the articulation's state. I've got a sample project (the leatherback I talk about in the Isaac lab office hours) And spawning rigid bodies upon reset is one of the next tasks I'm going to try to tackle. |
Beta Was this translation helpful? Give feedback.
-
@StrainFlow Thanks for your reply. I am aware of the number of environments. I have only been using 10 to visualize the environments and check if everything looks good, normally I am using 4096. When looking at the locomotion examples the ground meshes are generated in the EnvCfg-class and I think generating the ground mesh once is enough for my use case. Generating a new mesh on every reset sounds computationally expensive =) |
Beta Was this translation helpful? Give feedback.
-
Could you add a clone operation here to make sure the tensor is getting copied? Something like: default_root_state = self._robot.data.default_root_state[env_ids].clone()
default_root_state[:, :3] += self._terrain.env_origins[env_ids]
self._robot.write_root_link_pose_to_sim(default_root_state[:, :7], env_ids)
self._robot.write_root_com_velocity_to_sim(default_root_state[:, 7:], env_ids)
self._robot.write_joint_state_to_sim(
position=self._robot.data.default_joint_pos[env_ids],
velocity=self._robot.data.default_joint_vel[env_ids],
joint_ids=None, env_ids=env_ids
) Also to check |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Can you share your _reset_idx function? |
Beta Was this translation helpful? Give feedback.
-
That is the relevant part, after that I do some task reset and logging |
Beta Was this translation helpful? Give feedback.
-
Thank you for following up. I will move this post to our Discussions section for the team to continue. Let us know if you have made any inroads. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I wanted to change from a plane terrain to a TerrainImporter terrain for better sim2real capabilities. In each of the environments I am spawning a robot and one RigidObject. Before everything worked fine but now I get the problem that the robots spawn correctly in each environment but the rigid objects are spawning in the global coordinate system (see screenshot).
I am using a DirectRLEnv, havent updated yet (isaacsim==4.2.0.2) because of some other bugs in the new version.
Code:
Beta Was this translation helpful? Give feedback.
All reactions