Voxel Grid

A Voxel grid is a 3D Occupancy Grid.

For planning, is a 3d voxel grid really necessary?

Generally, you start with a voxel grid. Then, you segment out the ground, since that information isn’t useful (not an obstacle).

Resources

I want something like this visualized https://github.com/ros-planning/moveit/issues/1682

Spatial-Temporal Voxel Layer (SPVL)

Resources

The issue is that imagine you’re storing a 3d occupancy grid. For a 2d occupancy, it’s basically the same as storing an image, so it’s fine. However, for a 3d occupancy grid, you end up with the problem that you get points that are very sparse. But then, it’s just storing pointclouds, so what is the issue?

In Nav2, the VoxelGrid.msg

std_msgs/Header header
uint32[] data
geometry_msgs/Point32 origin
geometry_msgs/Vector3 resolutions
uint32 size_x
uint32 size_y
uint32 size_z

In Octomap, the Octomap.msg

# A 3D map in binary format, as Octree
std_msgs/Header header

# Flag to denote a binary (only free/occupied) or full occupancy octree (.bt/.ot file)
bool binary

# Class id of the contained octree 
string id

# Resolution (in m) of the smallest octree nodes
float64 resolution

# binary serialization of octree, use conversions.h to read and write octrees
int8[] data

For visualization, just use the following:

  • “With RViz open and publish_voxel_map: true, you can visualize the underlying data structure’s 3D grid using the {local, global}_costmap/voxel_grid topics. Note: It is recommended in RViz to set the PointCloud2 Size to your voxel size and the style to Boxes with a neutral color for best visualization”

Alright, so we can just visualize the pointclouds as voxels of fixed sizes.

  • They actually just publish the voxel as a 2d pointcloud, with the intensity as a particular value.

In our case, we can just encode the intensity as various classes.

https://github.com/SteveMacenski/spatio_temporal_voxel_layer/blob/403d9ed769e78beec4c6ec437a1143943e2a4630/spatio_temporal_voxel_layer/src/spatio_temporal_voxel_layer.cpp#L149C1-L150C1