RobotUnitModuleRobotData.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 * @package RobotAPI::ArmarXObjects::RobotUnit
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <VirtualRobot/VirtualRobot.h>
26
30
31#include "RobotUnitModuleBase.h"
32
33namespace armarx
34{
35 using RobotPoolPtr = std::shared_ptr<class RobotPool>;
36}
37
39{
45
46 /**
47 * @ingroup Library-RobotUnit-Modules
48 * @brief This \ref ModuleBase "Module" holds all high-level data about the robot.
49 *
50 * @see ModuleBase
51 */
52 class RobotData : virtual public ModuleBase
53 {
54 friend class ModuleBase;
55
56 public:
57 /**
58 * @brief Returns the singleton instance of this class
59 * @return The singleton instance of this class
60 */
61 static RobotData&
63 {
65 }
66
67 // //////////////////////////////////////////////////////////////////////////////////////// //
68 // ///////////////////////////////// RobotUnitModule hooks //////////////////////////////// //
69 // //////////////////////////////////////////////////////////////////////////////////////// //
70 private:
71 /// @see ModuleBase::_preOnInitRobotUnit
72 void _initVirtualRobot();
73 // //////////////////////////////////////////////////////////////////////////////////////// //
74 // /////////////////////////////////// Module interface /////////////////////////////////// //
75 // //////////////////////////////////////////////////////////////////////////////////////// //
76 public:
78
79 /**
80 * @brief Returns the name of the robot's platform
81 * @return The name of the robot's platform
82 */
83 const std::string& getRobotPlatformName() const;
84
85 /**
86 * @brief Returns the name of the robot's RobotNodeSet
87 * @return The name of the robot's RobotNodeSet
88 */
89 const std::string& getRobotNodetSeName() const;
90
91 /**
92 * @brief Returns the name of the project containing the robot's model
93 * @return The name of the project containing the robot's model
94 */
95 const std::string& getRobotProjectName() const;
96
97 /**
98 * @brief Returns the file name of the robot's model
99 * @return The file name of the robot's model
100 */
101 const std::string& getRobotFileName() const;
102
103 /**
104 * @brief Returns the robot's name
105 * @return The robot's name
106 */
107 std::string getRobotName() const;
108
109 /**
110 * @brief Returns the name of the robot platform instance. Used for the platform topic: RobotPlatformInstance + "State"
111 */
112 std::string getRobotPlatformInstanceName() const;
113
114
115 /**
116 * @brief Returns a clone of the robot's model
117 * @return A clone of the robot's model
118 */
119 VirtualRobot::RobotPtr cloneRobot(bool updateCollisionModel = false) const;
120 // //////////////////////////////////////////////////////////////////////////////////////// //
121 // ///////////////////////////////////////// Data ///////////////////////////////////////// //
122 // //////////////////////////////////////////////////////////////////////////////////////// //
123
124 private:
125 /// @brief The name of the robot's RobotNodeSet
126 std::string robotNodeSetName;
127 /// @brief The name of the project containing the robot's model
128 std::string robotProjectName;
129 /// @brief The file name of the robot's model
130 std::string robotFileName;
131 /// @brief The name of the robot's platform
132 std::string robotPlatformName;
133 /// @brief Indicates whether the robot platform unit is enabled.
134 bool _arePlatformAndLocalizationUnitsEnabled = false;
135 /// @brief The name of the robot's platform instance
136 std::string robotPlatformInstanceName;
137
138 /// @brief The robot's model.
140 RobotPoolPtr robotPool;
141 /// @brief A mutex guarding \ref robot
142 mutable std::mutex robotMutex;
143 };
144} // namespace armarx::RobotUnitModule
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
static ModuleBase & Instance()
Returns the singleton instance of this class.
This Module holds all high-level data about the robot.
const std::string & getRobotFileName() const
Returns the file name of the robot's model.
const std::string & getRobotNodetSeName() const
Returns the name of the robot's RobotNodeSet.
const std::string & getRobotProjectName() const
Returns the name of the project containing the robot's model.
const std::string & getRobotPlatformName() const
Returns the name of the robot's platform.
std::string getRobotName() const
Returns the robot's name.
VirtualRobot::RobotPtr cloneRobot(bool updateCollisionModel=false) const
Returns a clone of the robot's model.
static RobotData & Instance()
Returns the singleton instance of this class.
std::string getRobotPlatformInstanceName() const
Returns the name of the robot platform instance.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< class RobotPool > RobotPoolPtr