ArvizIntrospector.h
Go to the documentation of this file.
1 /**
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @author Christian R. G. Dreher ( c dot dreher at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <mutex>
26 
27 #include <VirtualRobot/VirtualRobot.h>
28 
32 
40 
41 #include "IntrospectorInterface.h"
42 
43 // forward declaration
45 {
46  class GlobalTrajectory;
47 }
48 
50 {
51 
53  {
54  public:
56  const VirtualRobot::RobotPtr& robot,
57  const objpose::ObjectPoseClient& objClient);
58  ~ArvizIntrospector() override = default;
59 
62  const std::optional<local_planning::LocalPlannerResult>& result) override;
63 
64  void onRobotPose(const core::Pose& pose) override;
65 
66  void onGoal(const core::Pose& goal) override;
67 
68  void success() override;
69  void failure() override;
70 
71  void onGlobalShortestPath(const std::vector<core::Pose>& path) override;
72 
73  void onGlobalGraph(const core::Graph& graph) override;
74 
75 
76  // // Non-API
77  ArvizIntrospector(ArvizIntrospector&& other) noexcept;
79 
80  void clear();
81 
82  private:
83  void drawGlobalTrajectory(const core::GlobalTrajectory& trajectory);
84  void drawLocalTrajectory(const std::optional<core::LocalTrajectory>& trajectory);
85  void drawRawVelocity(const core::Twist& twist);
86  void drawSafeVelocity(const core::Twist& twist);
87 
88  viz::ScopedClient arviz;
89  const VirtualRobot::RobotPtr robot;
90 
91  objpose::ObjectPoseClient objClient;
92 
93  std::map<std::string, viz::Layer> layers;
94 
95  // util::Visualization visualization;
96 
97  std::optional<core::Pose> lastPose;
98 
99  viz::Layer robotPosesLayer;
100  };
101 
102 } // namespace armarx::navigation::server
armarx::navigation::core::GlobalTrajectory
Definition: Trajectory.h:68
armarx::navigation::server::ArvizIntrospector::onRobotPose
void onRobotPose(const core::Pose &pose) override
Definition: ArvizIntrospector.cpp:132
armarx::navigation::server::ArvizIntrospector::onGlobalShortestPath
void onGlobalShortestPath(const std::vector< core::Pose > &path) override
Definition: ArvizIntrospector.cpp:157
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
TrajectoryController.h
basic_types.h
armarx::navigation::server::ArvizIntrospector::success
void success() override
Definition: ArvizIntrospector.cpp:367
Visualization.h
ScopedClient.h
LocalPlanner.h
armarx::navigation::server::ArvizIntrospector::ArvizIntrospector
ArvizIntrospector(armarx::viz::Client arviz, const VirtualRobot::RobotPtr &robot, const objpose::ObjectPoseClient &objClient)
Definition: ArvizIntrospector.cpp:60
Layer.h
armarx::navigation::core
This file is part of ArmarX.
Definition: aron_conversions.cpp:13
armarx::viz::ScopedClient
viz::Client that will delete (clear) committed layers when destroyed.
Definition: ScopedClient.h:42
armarx::navigation::server::ArvizIntrospector::failure
void failure() override
Definition: ArvizIntrospector.cpp:375
armarx::navigation::server::ArvizIntrospector::clear
void clear()
Definition: ArvizIntrospector.cpp:303
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:18
armarx::navigation::server::ArvizIntrospector::~ArvizIntrospector
~ArvizIntrospector() override=default
IntrospectorInterface.h
armarx::navigation::core::Twist
Definition: basic_types.h:53
armarx::navigation::server
This file is part of ArmarX.
Definition: EventPublishingInterface.h:10
armarx::navigation::server::ArvizIntrospector::onLocalPlannerResult
void onLocalPlannerResult(const std::optional< local_planning::LocalPlannerResult > &result) override
Definition: ArvizIntrospector.cpp:85
armarx::navigation::core::Graph
Definition: Graph.h:88
ObjectPoseClient.h
GlobalPlanner.h
armarx::navigation::global_planning::GlobalPlannerResult
Definition: GlobalPlanner.h:38
armarx::navigation::server::ArvizIntrospector::onGlobalPlannerResult
void onGlobalPlannerResult(const global_planning::GlobalPlannerResult &result) override
Definition: ArvizIntrospector.cpp:73
armarx::navigation::server::ArvizIntrospector::onGoal
void onGoal(const core::Pose &goal) override
Definition: ArvizIntrospector.cpp:118
armarx::navigation::server::IntrospectorInterface
Definition: IntrospectorInterface.h:35
armarx::navigation::server::ArvizIntrospector::operator=
ArvizIntrospector & operator=(ArvizIntrospector &&) noexcept
Definition: ArvizIntrospector.cpp:320
armarx::navigation::server::ArvizIntrospector::onGlobalGraph
void onGlobalGraph(const core::Graph &graph) override
Definition: ArvizIntrospector.cpp:326
armarx::viz::Client
Definition: Client.h:109
armarx::viz::Layer
Definition: Layer.h:12
armarx::navigation::server::ArvizIntrospector
Definition: ArvizIntrospector.h:52
types.h
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
SafetyController.h