Get bounding box from mujoco

Discussion in 'Modeling' started by Alex Ray, Jan 30, 2017.

  1. Does mujoco provide a way to get the bounding box (in world coordinates) of a (world)body?

    This would be useful for placing objects in environments.

    Thanks,
    ~Alex
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    There is no bounding box function currently, but each geom has a bounding sphere with radius given by mjModel.geom_rbound. So you can get the geom position in world coordinates from mjData.geom_xpos, and add/subtract rbound to each coordinate. Note that planes are infinite (for collision purposes) and in that case rbound is set to 0. These bounding spheres are used internally in the collision detector to prune geom-geom pairs quickly.