RobotUnitModuleUnits.ipp
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
26
28 {
30 {
32 }
33
34 inline KinematicUnitInterfacePrx Units::getKinematicUnit(const Ice::Current&) const
35 {
36 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
38 }
39 inline ForceTorqueUnitInterfacePrx Units::getForceTorqueUnit(const Ice::Current&) const
40 {
41 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
43 }
44 inline InertialMeasurementUnitInterfacePrx Units::getInertialMeasurementUnit(const Ice::Current&) const
45 {
46 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
48 }
49 inline PlatformUnitInterfacePrx Units::getPlatformUnit(const Ice::Current&) const
50 {
51 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
53 }
54 inline TCPControlUnitInterfacePrx Units::getTCPControlUnit(const Ice::Current&) const
55 {
56 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
58 }
59 inline TrajectoryPlayerInterfacePrx Units::getTrajectoryPlayer(const Ice::Current&) const
60 {
61 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
63 }
64
65 template<class T>
66 inline typename T::PointerType Units::getUnit() const
67 {
68 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
69 return T::PointerType::dynamicCast(getUnit(T::ice_staticId()));
70 }
71
72 template<class T>
73 inline typename T::ProxyType Units::getUnitPrx() const
74 {
75 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
76 return T::ProxyType::uncheckedCast(getUnit(T::ice_staticId(), Ice::emptyCurrent));
77 }
78
79 inline KinematicUnitInterfacePtr Units::getKinematicUnit() const
80 {
81 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
83 }
84 inline ForceTorqueUnitInterfacePtr Units::getForceTorqueUnit() const
85 {
86 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
88 }
89 inline InertialMeasurementUnitInterfacePtr Units::getInertialMeasurementUnit() const
90 {
91 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
93 }
94 inline PlatformUnitInterfacePtr Units::getPlatformUnit() const
95 {
96 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
98 }
99 inline TCPControlUnitInterfacePtr Units::getTCPControlUnit() const
100 {
101 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
103 }
104 inline TrajectoryPlayerInterfacePtr Units::getTrajectoryPlayer() const
105 {
106 throwIfInControlThread(BOOST_CURRENT_FUNCTION);
108 }
109 }
void throwIfInControlThread(const std::string &fnc) const
Throws if the current thread is the ControlThread.
static ModuleBase & Instance()
Returns the singleton instance of this class.
This Module manages all Units of a RobotUnit.
TCPControlUnitInterfacePtr getTCPControlUnit() const
Returns a pointer to the TCPControlUnit.
T::PointerType getUnit() const
Returns a pointer to the Unit for the given type (or null if there is none)
InertialMeasurementUnitInterfacePtr getInertialMeasurementUnit() const
Returns a pointer to the InertialMeasurementUnit.
ForceTorqueUnitInterfacePtr getForceTorqueUnit() const
Returns a pointer to the ForceTorqueUnit.
T::ProxyType getUnitPrx() const
Returns a proxy to the Unit for the given type (or null if there is none)
TrajectoryPlayerInterfacePtr getTrajectoryPlayer() const
Returns a pointer to the TrajectoryPlayer.
static Units & Instance()
Returns the singleton instance of this class.
KinematicUnitInterfacePtr getKinematicUnit() const
Returns a pointer to the KinematicUnit.
PlatformUnitInterfacePtr getPlatformUnit() const
Returns a pointer to the PlatformUnit.