Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Spawning 3D model mesh to proper scale with SDF

Hi,

I am trying to build a parking lot scene in Gazebo and spawn static models of different cars in different parking spots like below.

image description

From, Google 3D Warehouse, I have downloaded a bunch of collada (.dae) models of different cars. However, I am having some trouble spawning them in the world to proper scale and pose using an SDF file (my sample SDF file). The scale and center of mass seems to be different for different models and that makes it diificult for me to automate model spawning with a simple plugin. In the above image, models 1, 2 and 3 are spawned in gui with the same sdf file with scale <1 1 1> and link pose <0 0 0 0 0 0>

I have the following questions:

  1. If I know the corresponding L X W X H of the car bounding box in 'm', is itpossible to spawn the .dae mesh in the gazebo world to that size ?

  2. If not, is there a way, I can get the size of the bounding box of the .dae mesh in units specified inside the .dae file ? I can scale it myself then.

  3. Is there a way to know the center of mass of the model inside that bounding box from the file ?

I am looking for solutions that does not require my opening every model in a 3D model editor and exporting it to another format. Ideally, I want to figure this out from the .dae file itself.

Thanks,

Prasanna

Spawning 3D model mesh to proper scale with SDF

Hi,

I am trying to build a parking lot scene in Gazebo and spawn static models of different cars in different parking spots like below.

image description

From, Google 3D Warehouse, I have downloaded a bunch of collada (.dae) models of different cars. However, I am having some trouble spawning them in the world to proper scale and pose using an SDF file (my sample SDF file). The scale and center of mass seems to be different for different models and that makes it diificult for me to automate model spawning with a simple plugin. In the above image, models 1, 2 and 3 are spawned in gui with the same sdf file with scale <1 1 1> and link pose <0 0 0 0 0 0>

I have the following questions:

  1. If I know the corresponding L X W X H of the car bounding box in 'm', is itpossible to spawn the .dae mesh in the gazebo world to that size ?

  2. If not, is there a way, I can get the size of the bounding box of the .dae mesh in units specified inside the .dae file ? I can scale it myself then.

  3. Is there a way to know the center of mass of the model inside that bounding box from the file ?

I am looking for solutions that does not require my opening every model in a 3D model editor and exporting it to another format. Ideally, I want to figure this out from the .dae file itself.

Thanks,

Prasanna

Spawning 3D model mesh to proper scale with SDF

Hi,

I am trying to build a parking lot scene in Gazebo and spawn static models of different cars in different parking spots like below.

image description

From, Google 3D Warehouse, I have downloaded a bunch of collada (.dae) models of different cars. However, I am having some trouble spawning them in the world to proper scale and pose using an SDF file (my sample SDF file). The scale and center of mass seems to be different for different models and that makes it diificult for me to automate model spawning with a simple plugin. In the above image, models 1, 2 and 3 are spawned in gui with the same sdf file with scale <1 1 1> and link pose <0 0 0 0 0 0>

I have the following questions:

  1. If I know the corresponding L X W X H of the car bounding box in 'm', is itpossible to spawn the .dae mesh in the gazebo world to that size ?

  2. If not, is there a way, I can get the size of the bounding box of the .dae mesh in units specified inside the .dae file ? I can scale it myself then.

  3. Is there a way to know the center of mass of the model inside that bounding box from the file ?

I am looking for solutions that does not require my opening every model in a 3D model editor and exporting it to another format. Ideally, I want to figure this out from the .dae file itself.

Thanks,

Prasanna Prasanna