How to create obstacles in legged_gym without adding them to the actors?

I want to add some boxes to the plane terrain, but I don’t want to introduce them as part of the agent. The create_box method will add new dimensions to the agent, but I just want them to be part of the environment, specified when creating the task. Could anyone please give an example on how to do that? Many thanks.
PS: I am also very curious about the basic realization of isaacgym.gymapi functions, since directly modifying them would be a lot easier

I have figured this out. To my knowledge, there are currently two methods of adding objects to the environment:

  1. To add terrains using in-built functions such as _create_trimesh()
  2. Add objects using create_box and create_actor. However, this changes the number of actors in the environment, and you can use self.gym.get_sim_actor_count(self.sim) in most cases to see how many actors you have created in total. However, I strongly suggest you store the root_states for the robot in another vector, say root_robot_states, and refer to them in most cases needed. A tough part of the problem is when you reset the robot state, in self.gym.set_dof_state_tensor_indexed(self.sim, arg1, arg2, num_envs). The first argument arg1 should be the reset states only of the robots, the size of which should be, say (num_envs, 2). The second argument is the indices of these robots. For example, there are 1 robot and 4 obstacles in each environment, then arg2 should be [0,5,10,…]. This is particularly important, since incorrect assignment of the values will cause errors that are very hard to debug (which took me several days :-( ).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.