Skip to content

[Question] cfg_cone_rigid.func vs RigidObject(RigidObjectCfg) #318

Closed
@VladimirFokow

Description

@VladimirFokow

Question

Why in the world is this new syntax necessary?
(the classes RigidObject and RigidObjectConf)
It's counter-intuitive for beginners (like myself) who are reading the docs.

(scroll in the code snippets below to see the whole snippet)

https://github.com/NVIDIA-Omniverse/orbit/blob/95a4927c64578f136ea064bb33a9c704a76f8c5d/source/standalone/tutorials/01_assets/run_rigid_object.py#L63-L76

The tutorial:

https://github.com/NVIDIA-Omniverse/orbit/blob/95a4927c64578f136ea064bb33a9c704a76f8c5d/docs/source/tutorials/01_assets/run_rigid_object.rst?plain=1#L46-L62

doesn't explain the functional advantage of it over the method introduced just in the previous tutorial: spawn_prims.py,
doesn't help understand the necessity / purpose of this design over the previous method.



In other words, why not have simply this,
instead of using the RigidObject and RigidObjectCfg classes:

# Rigid Object
cone_cfg = sim_utils.ConeCfg( 
    radius=0.1, 
    height=0.2, 
    rigid_props=sim_utils.RigidBodyPropertiesCfg(), 
    mass_props=sim_utils.MassPropertiesCfg(mass=1.0), 
    collision_props=sim_utils.CollisionPropertiesCfg(), 
    visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0), metallic=0.2), 
)
cfg_cone_rigid.func(
    "/World/Origin.*/Cone", cfg_cone_rigid
 )

The only thing that's missing here is: init_state=RigidObjectCfg.InitialStateCfg().

But is it really the only reason to use a completely new syntax for rigid object definition?
Can't the init_state be passed into sim_utils.ConeCfg or cfg_cone_rigid.func for example?

If really the RigidObject(RigidObjectCfg) method should be used - then maybe put a warning into the spawn_prims.py tutorial, saying that rigid body created like that would be missing critical abilities?


Acceptance criteria

Either:

  • The docs explain this
  • API is simplified / the tutorial doesn't use the verbose method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions