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 <map>
26#include <optional>
27#include <string>
28#include <vector>
29
30#include <VirtualRobot/VirtualRobot.h>
31
35
43
44#include "DrawerInterface.h"
46
47// forward declaration
49{
50 class GlobalTrajectory;
51}
52
54{
55
56 class ArvizIntrospector : virtual public IntrospectorInterface, virtual public DrawerInterface
57 {
58 public:
60 const VirtualRobot::RobotConstPtr& robot,
61 const objpose::ObjectPoseClient& objClient);
62 ~ArvizIntrospector() override = default;
63
65 void onGlobalPlannerSubdivision(const GlobalPathSubdivision& subdivision) override;
66
68 const std::optional<local_planning::LocalPlannerResult>& result) override;
69
70 void onRobotPose(const core::Pose& pose) override;
71
72 void onGoal(const core::Pose& goal) override;
73
74 void success() override;
75 void failure() override;
76
77 void onGlobalShortestPath(const std::vector<core::Pose>& path) override;
78
79 void onGlobalGraph(const core::Graph& graph) override;
80
81 void callGenericDrawFunction(std::function<void(viz::Client&)>) override;
82
83
84 // // Non-API
85 ArvizIntrospector(ArvizIntrospector&& other) noexcept;
87
88 void clear();
89
90 private:
91 void drawGlobalTrajectory(const core::GlobalTrajectory& trajectory);
92 void drawGlobalHelperTrajectory(const core::GlobalTrajectory& trajectory);
93 void drawGlobalTrajectory(const core::GlobalTrajectory& trajectory,
94 std::string layerName,
95 simox::color::Color color);
96 void drawGlobalPathSubdivision(const GlobalPathSubdivision& subdivision);
97 void drawLocalTrajectory(const std::optional<core::LocalTrajectory>& trajectory);
98 void drawRawVelocity(const core::Twist& twist);
99 void drawSafeVelocity(const core::Twist& twist);
100
101 viz::ScopedClient arviz;
102 const VirtualRobot::RobotConstPtr robot;
103
104 objpose::ObjectPoseClient objClient;
105
106 std::map<std::string, viz::Layer> layers;
107
108 // util::Visualization visualization;
109
110 std::optional<core::Pose> lastPose;
111
112 viz::Layer robotPosesLayer;
113 };
114
115} // namespace armarx::navigation::server
The Pose class.
Definition Pose.h:243
void onRobotPose(const core::Pose &pose) override
ArvizIntrospector(armarx::viz::Client arviz, const VirtualRobot::RobotConstPtr &robot, const objpose::ObjectPoseClient &objClient)
void onGlobalShortestPath(const std::vector< core::Pose > &path) override
void onGlobalGraph(const core::Graph &graph) override
void onGlobalPlannerResult(const global_planning::GlobalPlannerResult &result) override
ArvizIntrospector & operator=(ArvizIntrospector &&) noexcept
void callGenericDrawFunction(std::function< void(viz::Client &)>) override
void onGlobalPlannerSubdivision(const GlobalPathSubdivision &subdivision) override
void onGoal(const core::Pose &goal) override
void onLocalPlannerResult(const std::optional< local_planning::LocalPlannerResult > &result) override
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
uint32_t Color
RGBA color.
Definition color.h:8
This file is part of ArmarX.
Eigen::Isometry3f Pose
Definition basic_types.h:31
This file is part of ArmarX.
Definition Visu.h:48
This file is part of ArmarX.
This file is part of ArmarX.
Definition Impl.cpp:41