In a similar vein there is this neat little script that Dave Hershberger wrote way back when for rviz: