This RViz plugin and associated tools enable easy viewing of Voxelgrids in RViz.
You can:
- change the scale, origin, and frame
- change the color, and opacity (alpha) directly from RViz without needing to republish or edit code
- view data as binary or with independent alpha per voxel, again without needing to republish
- hide/show the voxelgrid from RViz without needing to republish
This adds a new display-type to RViz which enables voxelgrid messages
Prereqs:
- ROS, with RViz. Tested on noetic
- python 3 (maybe 2 still works?)
Installation:
- Clone this repo into your catkin workspace
- Build
catkin_make
orcatkin build
- Re-source your catkin
devel
workspace! - Launch
rviz
and open theexample_voxelgrid.rviz
config file. Be sure you have re-sourced yourdevel
workspace first, from the same terminal where you launch rviz. - Run the
quick_publish_demo.py
script:rosrun rviz_voxelgrid_visuals quick_publish_demo.py
You should see the images above. Try changing the color, opacity, and hiding and re-showing:
Check out the script for how to publish in your projects: e.g.
pub_1.publish(conversions.vox_to_voxelgrid_stamped(voxelgrid, # Numpy or Tensorflow
scale=0.01, # Each voxel is a 1cm cube
frame_id='world', # In frame "world", same as rviz fixed frame
origin=(0,0,0))) # Bottom left corner