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
38namespace armarx
39{
40 /**
41 * \class ForceTorqueUnitSimulationPropertyDefinitions
42 * \brief
43 */
45 {
46 public:
49 {
51 "simulated sensor name. seperated by comma");
52 defineRequiredProperty<std::string>("AgentName", "name of the robot agent");
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
constexpr T c
Simulates a set of Force/Torque sensors.
std::map< std::string, armarx::FramedDirectionPtr > forces
void setOffset(const FramedDirectionBasePtr &forceOffsets, const FramedDirectionBasePtr &torqueOffsets, const Ice::Current &c=Ice::emptyCurrent) override
PeriodicTask< ForceTorqueUnitSimulation >::pointer_type simulationTask
PropertyDefinitionsPtr createPropertyDefinitions() override
std::map< std::string, armarx::FramedDirectionPtr > torques
void setToNull(const Ice::Current &c=Ice::emptyCurrent) override
std::string getDefaultName() const override
Retrieve default name of component.
The ForceTorqueUnit class.
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.