This error happened when run cartographer with velodyne in 3D:
[ERROR] [1591174235.117906145]: PluginlibFactory: The plugin for class 'Submaps' failed to load. Error: According to the loaded plugin descriptions the class Submaps with base class type rviz::Display does not exist. Declared types are moveit_rviz_plugin/MotionPlanning moveit_rviz_plugin/PlanningScene moveit_rviz_plugin/RobotState moveit_rviz_plugin/Trajectory rviz/Axes rviz/Camera rviz/DepthCloud rviz/Effort rviz/FluidPressure rviz/Grid rviz/GridCells rviz/Illuminance rviz/Image rviz/InteractiveMarkers rviz/LaserScan rviz/Map rviz/Marker rviz/MarkerArray rviz/Odometry rviz/Path rviz/PointCloud rviz/PointCloud2 rviz/PointStamped rviz/Polygon rviz/Pose rviz/PoseArray rviz/PoseWithCovariance rviz/Range rviz/RelativeHumidity rviz/RobotModel rviz/TF rviz/Temperature rviz/WrenchStamped rviz_map_plugin/ClusterLabel rviz_map_plugin/Map3D rviz_map_plugin/Mesh rviz_plugin_tutorials/Imu
Solved:
$ sudo apt install ros-melodic-cartographer-rviz