JointSimulationDevice.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(JointSimulationDevice);
35  class JointSimulationDevice: virtual public SensorDeviceTemplate<SensorValue1DoFActuator>, virtual public ControlDevice
36  {
37  static const float nullFloat;
38  public:
40  {
42  const float* val;
43  const float* sensVal;
44  float* mapVal;
45  void rtRun(const IceUtil::Time&, const IceUtil::Time&) override;
46  };
47  template<class TargT>
49  {
50  JointSimController(std::string hwMode) : hwMode {hwMode} {}
51 
52  TargT targ;
53  const std::string hwMode;
55  {
56  return &targ;
57  }
58  std::string getHardwareControlMode() const override
59  {
60  return hwMode;
61  }
62  };
63 
64  JointSimulationDevice(const std::string& name, NameValueMap& ctrlpos, NameValueMap& ctrlvel, NameValueMap& ctrltor);
65  void rtSetActiveJointController(JointController* jointCtrl) override;
66 
72  };
73 }
74 
armarx::JointSimulationDevice::JointSimController::hwMode
const std::string hwMode
Definition: JointSimulationDevice.h:53
armarx::JointSimulationDevice::rtSetActiveJointController
void rtSetActiveJointController(JointController *jointCtrl) override
Activates the given JointController for this device.
Definition: JointSimulationDevice.cpp:56
armarx::JointSimulationDevice::jointCtrlTor
JointSimController< ControlTarget1DoFActuatorTorque > jointCtrlTor
Definition: JointSimulationDevice.h:69
armarx::SensorDeviceTemplate
Definition: SensorDevice.h:111
SensorDevice.h
armarx::ControlTargetBase
Brief description of class JointControlTargetBase.
Definition: ControlTargetBase.h:47
armarx::JointSimulationDevice::JointSimControllerBase::mapVal
float * mapVal
Definition: JointSimulationDevice.h:44
armarx::ControlDevice
The ControlDevice class represents a logical unit accepting commands via its JointControllers.
Definition: ControlDevice.h:63
armarx::JointSimulationDevice::jointCtrlESt
JointSimController< DummyControlTargetEmergencyStop > jointCtrlESt
Definition: JointSimulationDevice.h:70
armarx::JointSimulationDevice::JointSimController::targ
TargT targ
Definition: JointSimulationDevice.h:52
armarx::JointController
The JointController class represents one joint in one control mode.
Definition: JointController.h:51
armarx::JointSimulationDevice::JointSimController
Definition: JointSimulationDevice.h:48
armarx::JointSimulationDevice
Definition: JointSimulationDevice.h:35
armarx::JointSimulationDevice::jointCtrlVel
JointSimController< ControlTarget1DoFActuatorVelocity > jointCtrlVel
Definition: JointSimulationDevice.h:68
armarx::JointSimulationDevice::JointSimController::JointSimController
JointSimController(std::string hwMode)
Definition: JointSimulationDevice.h:50
armarx::JointSimulationDevice::jointCtrlPos
JointSimController< ControlTarget1DoFActuatorPosition > jointCtrlPos
Definition: JointSimulationDevice.h:67
armarx::JointSimulationDevice::JointSimControllerBase::sensVal
const float * sensVal
Definition: JointSimulationDevice.h:43
armarx::TYPEDEF_PTRS_SHARED
TYPEDEF_PTRS_SHARED(ControlDevice)
ControlDevice.h
armarx::JointSimulationDevice::jointCtrlMSt
JointSimController< DummyControlTargetStopMovement > jointCtrlMSt
Definition: JointSimulationDevice.h:71
armarx::JointSimulationDevice::JointSimControllerBase::map
NameValueMap * map
Definition: JointSimulationDevice.h:41
ControlModes.h
ControlTarget1DoFActuator.h
armarx::JointSimulationDevice::JointSimulationDevice
JointSimulationDevice(const std::string &name, NameValueMap &ctrlpos, NameValueMap &ctrlvel, NameValueMap &ctrltor)
Definition: JointSimulationDevice.cpp:28
armarx::JointSimulationDevice::JointSimControllerBase
Definition: JointSimulationDevice.h:39
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::JointSimulationDevice::JointSimController::getHardwareControlMode
std::string getHardwareControlMode() const override
Definition: JointSimulationDevice.h:58
armarx::JointSimulationDevice::JointSimControllerBase::rtRun
void rtRun(const IceUtil::Time &, const IceUtil::Time &) override
called when this JointController is run
Definition: JointSimulationDevice.cpp:70
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:91
JointController.h
armarx::JointSimulationDevice::JointSimController::getControlTarget
ControlTargetBase * getControlTarget() override
Definition: JointSimulationDevice.h:54
armarx::JointSimulationDevice::JointSimControllerBase::val
const float * val
Definition: JointSimulationDevice.h:42
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
SensorValue1DoFActuator.h