PlatformSimulationDevice.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 ArmarXSimulation::ArmarXObjects::RobotUnitSimulation
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
31 
32 namespace armarx
33 {
34  TYPEDEF_PTRS_SHARED(PlatformSimulationDevice);
35  class PlatformSimulationDevice: virtual public SensorDeviceTemplate<SensorValueHolonomicPlatform>, virtual public ControlDevice
36  {
37  public:
39  {
41  void rtRun(const IceUtil::Time&, const IceUtil::Time&) override {}
43  {
44  return target;
45  }
46  std::string getHardwareControlMode() const override
47  {
48  return "Platform_Velocity";
49  }
50  };
51 
53  {
55  void rtRun(const IceUtil::Time&, const IceUtil::Time&) override;
57  {
58  return target;
59  }
60  const std::string& getControlMode() const override
61  {
62  return ControlModes::EmergencyStop;
63  }
64  bool rtIsTargetValid() const override
65  {
66  return true;
67  }
68  std::string getHardwareControlMode() const override
69  {
70  return "Platform_Velocity";
71  }
72  };
73 
75  {
77  void rtRun(const IceUtil::Time&, const IceUtil::Time&) override;
79  {
80  return target;
81  }
82  const std::string& getControlMode() const override
83  {
84  return ControlModes::StopMovement;
85  }
86  bool rtIsTargetValid() const override
87  {
88  return true;
89  }
90  std::string getHardwareControlMode() const override
91  {
92  return "Platform_Velocity";
93  }
94  };
95 
96 
97  PlatformSimulationDevice(const std::string& name);
98 
100 
104 
108  };
109 }
armarx::ControlTargetHolonomicPlatformVelocity
Brief description of class ControlTargetHolonomicPlatformVelocity.
Definition: ControlTargetHolonomicPlatformVelocity.h:38
armarx::PlatformSimulationDevice::jointStopMovCtrl
JointStopMovementController jointStopMovCtrl
Definition: PlatformSimulationDevice.h:107
armarx::SensorDeviceTemplate
Definition: SensorDevice.h:111
SensorDevice.h
SensorValueHolonomicPlatform.h
armarx::ControlTargetBase
Brief description of class JointControlTargetBase.
Definition: ControlTargetBase.h:47
armarx::ControlDevice
The ControlDevice class represents a logical unit accepting commands via its JointControllers.
Definition: ControlDevice.h:63
armarx::PlatformSimulationDevice::JointVelocityController::target
ControlTargetHolonomicPlatformVelocity * target
Definition: PlatformSimulationDevice.h:40
armarx::PlatformSimulationDevice::JointEmergencyStopController::rtIsTargetValid
bool rtIsTargetValid() const override
Definition: PlatformSimulationDevice.h:64
armarx::PlatformSimulationDevice::JointEmergencyStopController
Definition: PlatformSimulationDevice.h:52
armarx::PlatformSimulationDevice::JointEmergencyStopController::getHardwareControlMode
std::string getHardwareControlMode() const override
Definition: PlatformSimulationDevice.h:68
armarx::JointController
The JointController class represents one joint in one control mode.
Definition: JointController.h:51
armarx::PlatformSimulationDevice::JointEmergencyStopController::getControlTarget
ControlTargetBase * getControlTarget() override
Definition: PlatformSimulationDevice.h:56
armarx::PlatformSimulationDevice::jointEmergencyCtrl
JointEmergencyStopController jointEmergencyCtrl
Definition: PlatformSimulationDevice.h:106
armarx::PlatformSimulationDevice::target
ControlTargetHolonomicPlatformVelocity target
Definition: PlatformSimulationDevice.h:99
armarx::PlatformSimulationDevice::PlatformSimulationDevice
PlatformSimulationDevice(const std::string &name)
Definition: PlatformSimulationDevice.cpp:24
armarx::PlatformSimulationDevice::JointStopMovementController
Definition: PlatformSimulationDevice.h:74
armarx::PlatformSimulationDevice
Definition: PlatformSimulationDevice.h:35
armarx::TYPEDEF_PTRS_SHARED
TYPEDEF_PTRS_SHARED(ControlDevice)
armarx::PlatformSimulationDevice::JointStopMovementController::getControlTarget
ControlTargetBase * getControlTarget() override
Definition: PlatformSimulationDevice.h:78
armarx::PlatformSimulationDevice::JointVelocityController::getControlTarget
ControlTargetBase * getControlTarget() override
Definition: PlatformSimulationDevice.h:42
armarx::PlatformSimulationDevice::initAbsolutePositionY
float initAbsolutePositionY
Definition: PlatformSimulationDevice.h:102
ControlDevice.h
armarx::PlatformSimulationDevice::jointVel
JointVelocityController jointVel
Definition: PlatformSimulationDevice.h:105
armarx::PlatformSimulationDevice::JointStopMovementController::rtIsTargetValid
bool rtIsTargetValid() const override
Definition: PlatformSimulationDevice.h:86
armarx::PlatformSimulationDevice::JointVelocityController
Definition: PlatformSimulationDevice.h:38
ControlModes.h
armarx::PlatformSimulationDevice::JointEmergencyStopController::target
ControlTargetHolonomicPlatformVelocity * target
Definition: PlatformSimulationDevice.h:54
armarx::PlatformSimulationDevice::JointEmergencyStopController::getControlMode
const std::string & getControlMode() const override
Definition: PlatformSimulationDevice.h:60
armarx::PlatformSimulationDevice::initAbsolutePositionX
float initAbsolutePositionX
Definition: PlatformSimulationDevice.h:101
armarx::PlatformSimulationDevice::JointStopMovementController::getControlMode
const std::string & getControlMode() const override
Definition: PlatformSimulationDevice.h:82
armarx::PlatformSimulationDevice::initAbsolutePositionRotation
float initAbsolutePositionRotation
Definition: PlatformSimulationDevice.h:103
armarx::PlatformSimulationDevice::JointStopMovementController::target
ControlTargetHolonomicPlatformVelocity * target
Definition: PlatformSimulationDevice.h:76
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
ControlTargetHolonomicPlatformVelocity.h
armarx::PlatformSimulationDevice::JointStopMovementController::rtRun
void rtRun(const IceUtil::Time &, const IceUtil::Time &) override
called when this JointController is run
Definition: PlatformSimulationDevice.cpp:42
armarx::PlatformSimulationDevice::JointVelocityController::getHardwareControlMode
std::string getHardwareControlMode() const override
Definition: PlatformSimulationDevice.h:46
JointController.h
armarx::PlatformSimulationDevice::JointStopMovementController::getHardwareControlMode
std::string getHardwareControlMode() const override
Definition: PlatformSimulationDevice.h:90
armarx::PlatformSimulationDevice::JointVelocityController::rtRun
void rtRun(const IceUtil::Time &, const IceUtil::Time &) override
called when this JointController is run
Definition: PlatformSimulationDevice.h:41
armarx::PlatformSimulationDevice::JointEmergencyStopController::rtRun
void rtRun(const IceUtil::Time &, const IceUtil::Time &) override
called when this JointController is run
Definition: PlatformSimulationDevice.cpp:35
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28