ForceTorqueUnitSimulation.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package RobotAPI::units
19  * @author Peter Kaiser (peter dot kaiser at kit dot edu)
20  * @date 2014
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <string>
28 
29 #include <IceUtil/Time.h>
30 
33 
35 
36 #include "ForceTorqueUnit.h"
37 
38 namespace armarx
39 {
40  /**
41  * \class ForceTorqueUnitSimulationPropertyDefinitions
42  * \brief
43  */
45  {
46  public:
49  {
50  defineRequiredProperty<std::string>("SensorNames",
51  "simulated sensor name. seperated by comma");
52  defineRequiredProperty<std::string>("AgentName", "name of the robot agent");
53  defineOptionalProperty<int>(
54  "IntervalMs",
55  50,
56  "The time in milliseconds between two calls to the simulation method.");
57  }
58  };
59 
60  /**
61  * \class ForceTorqueUnitSimulation
62  * \brief Simulates a set of Force/Torque sensors.
63  * \ingroup RobotAPI-SensorActorUnits-simulation
64  *
65  * The unit is given a list of sensor names as a property. It then publishes force/torque values under these names.
66  * The published values will always be zero.
67  */
69  {
70  public:
71  std::string
72  getDefaultName() const override
73  {
74  return "ForceTorqueUnitSimulation";
75  }
76 
77  void onInitForceTorqueUnit() override;
78  void onStartForceTorqueUnit() override;
79  void onExitForceTorqueUnit() override;
80 
81  void simulationFunction();
82 
83  /**
84  * \warning Not implemented yet
85  */
86  void setOffset(const FramedDirectionBasePtr& forceOffsets,
87  const FramedDirectionBasePtr& torqueOffsets,
88  const Ice::Current& c = Ice::emptyCurrent) override;
89 
90  /**
91  * \warning Not implemented yet
92  */
93  void setToNull(const Ice::Current& c = Ice::emptyCurrent) override;
94 
95  /**
96  * \see PropertyUser::createPropertyDefinitions()
97  */
99 
100  protected:
101  std::map<std::string, armarx::FramedDirectionPtr> forces;
102  std::map<std::string, armarx::FramedDirectionPtr> torques;
103  Ice::StringSeq sensorNamesList;
105  };
106 } // namespace armarx
armarx::ForceTorqueUnitSimulation::torques
std::map< std::string, armarx::FramedDirectionPtr > torques
Definition: ForceTorqueUnitSimulation.h:102
armarx::ForceTorqueUnitSimulationPropertyDefinitions
Definition: ForceTorqueUnitSimulation.h:44
armarx::ForceTorqueUnitSimulation::onInitForceTorqueUnit
void onInitForceTorqueUnit() override
Definition: ForceTorqueUnitSimulation.cpp:35
armarx::ForceTorqueUnitSimulation::onStartForceTorqueUnit
void onStartForceTorqueUnit() override
Definition: ForceTorqueUnitSimulation.cpp:67
armarx::ForceTorqueUnitSimulation
Simulates a set of Force/Torque sensors.
Definition: ForceTorqueUnitSimulation.h:68
armarx::ForceTorqueUnitSimulation::simulationFunction
void simulationFunction()
Definition: ForceTorqueUnitSimulation.cpp:79
armarx::ForceTorqueUnitSimulationPropertyDefinitions::ForceTorqueUnitSimulationPropertyDefinitions
ForceTorqueUnitSimulationPropertyDefinitions(std::string prefix)
Definition: ForceTorqueUnitSimulation.h:47
armarx::ForceTorqueUnitPropertyDefinitions
Definition: ForceTorqueUnit.h:43
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
PeriodicTask.h
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::ForceTorqueUnitSimulation::onExitForceTorqueUnit
void onExitForceTorqueUnit() override
Definition: ForceTorqueUnitSimulation.cpp:73
armarx::ForceTorqueUnitSimulation::forces
std::map< std::string, armarx::FramedDirectionPtr > forces
Definition: ForceTorqueUnitSimulation.h:101
armarx::ForceTorqueUnit
The ForceTorqueUnit class.
Definition: ForceTorqueUnit.h:76
armarx::ForceTorqueUnitSimulation::simulationTask
PeriodicTask< ForceTorqueUnitSimulation >::pointer_type simulationTask
Definition: ForceTorqueUnitSimulation.h:104
FramedPose.h
ForceTorqueUnit.h
armarx::ForceTorqueUnitSimulation::sensorNamesList
Ice::StringSeq sensorNamesList
Definition: ForceTorqueUnitSimulation.h:103
armarx::ForceTorqueUnitSimulation::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ForceTorqueUnitSimulation.cpp:106
IceUtil::Handle
Definition: forward_declarations.h:30
armarx::ForceTorqueUnitSimulation::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: ForceTorqueUnitSimulation.h:72
armarx::ForceTorqueUnitSimulation::setToNull
void setToNull(const Ice::Current &c=Ice::emptyCurrent) override
Definition: ForceTorqueUnitSimulation.cpp:100
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::ForceTorqueUnitSimulation::setOffset
void setOffset(const FramedDirectionBasePtr &forceOffsets, const FramedDirectionBasePtr &torqueOffsets, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ForceTorqueUnitSimulation.cpp:92
ImportExportComponent.h