Rviz Annotator is a ROS package that integrates rosbag player into rviz plugins for playing and annotating recorded PointCloud2 messages. The user can select points displayed in rviz for manual object clusters naming and export a new .bag file. It contains three rviz plugins:
- Rosbag player
- Annotation panel
- PointCloud2 selection tool (using PointCloud2_Segments custom messages)
The following ROS packages are used for recording their output:
yaml-cpp
library is also needed for YAML support. (Normally it is pre-installed with ROS)
Build with catkin_make install
under catkin workspace.
-
Open
plugin_params.yaml
in the config directory to set default parameters:sel_topic
: topic for publishing selected points messagemarker_array_topic
: topic for publishing marker arraycsv_name
: name of the output .csv file after rviz save (Ctrl + S
only )csv_dir
: location of the output .csv filebagfiles_dir
: directory containing .bag filespc_segments_topic
: subscriber PointCloud2_Segments topicpc2_topic
: subscriber PointCloud2 topic
-
Open
rviz
and addRosbagPlayer
panel,Annotation
panel andPointSelect
tool -
Under player panel, select a directory that contains .bag files and, under annotation panel, type PointCloud2 topic to subscribe to, or refresh to update open topics and select from the list
-
Add MarkerArray display to see annotated points
Start player by pressing Start
.
Activate PointSelect ( s
key for shortcut) tool to select points on a specific frame, after pressing Pause
button.
Annotation panel shows selection status, depending on the initial clustering ( Clean for points that belong to the same cluster/object or Dirty for different clusters). Hit Join
to create custom cluster or Divide
to separate points from previous custom cluster. Type cluster name to set it and markers visualize the created clusters ( MarkerArray
display should be active).
Holding <<
or >>
down steps continuously backwards or forward while paused.
Hit Ctrl + S
to save annotated points to csv when done.
Run rosrun rviz_annotator exportBag <initial_bagfile_name>
to export a new .bag file containing annotations.
Each custom cluster in the new .bag has its own color. Clusters that have not been selected manually are displayed grayed out.
The exporter node gives generated colors to annotated points and gray color to the rest for each frame.
It needs to take the original cluster id's into account retaining their color and adding the annotated points with new id's.
Rosbag player has backwards step as an extra feature, but does not support all the original player features.
SyncTopics
option of the player must be checked always before performing Backstep and Step ( <<
and >>
).
The name of the package ( rviz_annotator
) should not be changed, because it causes run-time errors.
The format of directory parameters must be path/to/file
and topic/name
for topic parameters (no /
on the end).
Currently only C++11 compiler is supported. Tested on ros-kinetic
version.