submaps_display.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_RVIZ_SRC_SUBMAPS_DISPLAY_H_
18 #define CARTOGRAPHER_RVIZ_SRC_SUBMAPS_DISPLAY_H_
19 
20 #include <memory>
21 #include <vector>
22 
25 #include "cartographer_ros_msgs/SubmapList.h"
28 #include "tf2_ros/buffer.h"
30 
31 namespace cartographer_rviz {
32 
33 // RViz plugin used for displaying maps which are represented by a collection of
34 // submaps.
35 //
36 // We show an X-ray view of the map which is achieved by shipping textures for
37 // every submap containing pre-multiplied alpha and grayscale values, these are
38 // then alpha blended together.
40  : public ::rviz::MessageFilterDisplay<::cartographer_ros_msgs::SubmapList> {
41  Q_OBJECT
42 
43  public:
45  ~SubmapsDisplay() override;
46 
47  SubmapsDisplay(const SubmapsDisplay&) = delete;
48  SubmapsDisplay& operator=(const SubmapsDisplay&) = delete;
49 
50  private Q_SLOTS:
51  void Reset();
52  void AllEnabledToggled();
53 
54  private:
55  void CreateClient();
56 
57  // These are called by RViz and therefore do not adhere to the style guide.
58  void onInitialize() override;
59  void reset() override;
60  void processMessage(
61  const ::cartographer_ros_msgs::SubmapList::ConstPtr& msg) override;
62  void update(float wall_dt, float ros_dt) override;
63 
70  using Trajectory = std::pair<std::unique_ptr<::rviz::Property>,
71  std::vector<std::unique_ptr<DrawableSubmap>>>;
72  std::vector<Trajectory> trajectories_ GUARDED_BY(mutex_);
73  ::cartographer::common::Mutex mutex_;
76 };
77 
78 } // namespace cartographer_rviz
79 
80 #endif // CARTOGRAPHER_RVIZ_SRC_SUBMAPS_DISPLAY_H_
::rviz::Property * submaps_category_
::cartographer::common::Mutex mutex_
::rviz::StringProperty * tracking_frame_property_
std::vector< Trajectory > trajectories_ GUARDED_BY(mutex_)
void processMessage(const ::cartographer_ros_msgs::SubmapList::ConstPtr &msg) override
SubmapsDisplay & operator=(const SubmapsDisplay &)=delete
std::pair< std::unique_ptr<::rviz::Property >, std::vector< std::unique_ptr< DrawableSubmap >>> Trajectory
::rviz::StringProperty * submap_query_service_property_
::tf2_ros::TransformListener tf_listener_
::rviz::StringProperty * map_frame_property_
::rviz::BoolProperty * visibility_all_enabled_
void update(float wall_dt, float ros_dt) override


cartographer_rviz
Author(s):
autogenerated on Mon Jun 10 2019 12:59:49