0
$\begingroup$

everyone.

I wish to build a forest world in Gazebo with models made from real-life tree point clouds.

I started off by obtaining 3D lidar scans of trees. This gave me point clouds for each tree in a .pcd format.

enter image description here

I then used MeshLab to convert the point clouds into a mesh with a .dae format which Gazebo understands. enter image description here

After creating the model.config and model.sdf files, when I use the model in Gazebo, it seems that the tree itself is very small while the bounding box for the tree is huge. The red box is where the tree actually is.

enter image description here

I can't figure out how to reduce the size of the bounding box or increase the size of the model.

The following are my model.config and model.sdf files.

<?xml version="1.0"?>
<model>
<name>my_point_cloud</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Your Name</name>
   <email>[email protected]</email>
  </author>
  <description>Point Cloud imported as a mesh</description>
</model>

Model.sdf file

  <?xml version="1.0" ?>
  <sdf version="1.6">
  <model name="my_point_cloud">
  <static>true</static>
  <link name="link">
  
  <!-- Visual Element with Scaling -->
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://my_point_cloud/my_cloud.obj</uri>
        <scale>1 1 1</scale> <!-- Adjust scale as needed -->
      </mesh>
    </geometry>
  </visual>

  <!-- Collision Element with Scaling -->
  <collision name="collision">
    <geometry>
      <mesh>
        <uri>model://my_point_cloud/my_cloud.obj</uri>
        <scale>0.01 0.01 0.01</scale> <!-- Adjust scale as needed -->
      </mesh>
    </geometry>
  </collision>

</link>
</model>
</sdf>

I tried messing with the scale of the visual element but all it does is scale the bounding box along with the tree, which doesn't help.

Any help in the matter would be greatly appreciated.

$\endgroup$

1 Answer 1

0
$\begingroup$

everyone.

I figured it out.

The origin of the point cloud was shifted by some amount. Using MATLAB, I was able to shift the origin to the mean position of the points on the two extremes.

This worked brilliantly.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.