Read-only mirror of https://github.com/ethz-asl/voxblox_ground_truth — ETHZ ASL. Issues & pull requests at the source.
  • C++ 94.8%
  • C 3.1%
  • CMake 2.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Victor Reijgwart 70364e7c4f
Merge pull request #11 from patripfr/fix/mesh_scaling
fix scaling for meshes
2020-11-09 23:24:50 +01:00
config Revert rviz config 2020-01-28 18:16:27 +01:00
include/voxblox_ground_truth Group and order includes according to Google C++ Style Guide 2020-08-25 11:56:53 +02:00
launch Clean clean clean 2020-01-28 17:42:43 +01:00
sample_data Include a sample gazebo world s.t. the demo is self-contained 2019-05-28 15:09:40 +02:00
src Merge pull request #11 from patripfr/fix/mesh_scaling 2020-11-09 23:24:50 +01:00
.clang-format Run through clang-format to make formatting consistent 2020-08-25 11:55:34 +02:00
.gitignore gitignore 2019-08-07 11:00:57 +02:00
CMakeLists.txt Remove unnecessary protobuf catkin stuff. 2020-02-10 14:45:02 +01:00
LICENSE Initial commit 2019-05-25 22:53:38 +02:00
package.xml Clean up cmake and package. 2020-01-28 17:07:37 +01:00
README.md Added usage instructions to the README 2019-05-28 15:09:40 +02:00

Voxblox Ground Truth

Create ground truth voxblox TSDF maps from

  • Gazebo worlds
  • Ply mesh files

Install

Make sure that voxblox and gazebo are installed, then run

cd ~/catkin_ws
catkin build voxblox_ground_truth
source devel/setup.bash

Gazebo plugin

Demo

Start the demo by running

roslaunch voxblox_ground_truth gazebo_plugin_demo.launch

Then wait for Gazebo and Rviz finish loading. Once they're ready, call

rosservice call /gazebo/save_voxblox_ground_truth_to_file "file_path: '$HOME/voxblox_ground_truth_demo.tsdf'"

The ground truth TSDF map will now be available in your home folder as ~/voxblox_ground_truth_demo.tsdf.

Your own world

In order to use the plugin, it must be loaded as part of your Gazebo world.

To do this, add the following line to your .world file right after the <world name='default'> tag:

<plugin name="voxblox_ground_truth_plugin" filename="libvoxblox_ground_truth_plugin.so"/>

For an example, see the provided sample.world.

Once your world is ready, launch your simulation in the same way you normally would.

Next, set the desired voxel size with

rosparam set /voxblox_ground_truth/voxel_size 0.05

And finally generate the ground truth map with

rosservice call /gazebo/save_voxblox_ground_truth_to_file "file_path: '$HOME/your_ground_truth_map.tsdf'"

Ply conversion script

Demo

Try the demo with

roslaunch voxblox_ground_truth ply_importer_demo.launch

The ground truth TSDF map will now be available in your home folder as ~/bun_zipper.tsdf.

Your own Ply file

To convert your own .ply file, run

roscore &
rosrun voxblox_ground_truth ply_to_sdf \
       [path_to_mesh_file.ply] [tsdf_output_file_path] [voxel_size] \
       [scale_factor] [X] [Y] [Z] [Qx] [Qy] [Qz] [Qw]

Note that the paths must be absolute.

The mesh can be scaled up or down using the scale_factor, translated by X Y Z and rotated with Qx Qy Qz Qw. Elements Qx Qy Qz and Qw should be set to the imaginary and real parts of a normalized quaternion. No rotation corresponds to 0 0 0 1. A convenient rotation conversion tool is available on Andre Gaschler's website.

In case you'd like to have fun with some random .ply meshes, you could download samples from Stanford's 3D Scanning Repository here.