ForceTorqueUnitSimulation.cpp
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
27
28#include <SimoxUtility/algorithm/string/string_tools.h>
29
31
32namespace armarx
33{
34 void
36 {
37 int intervalMs = getProperty<int>("IntervalMs").getValue();
38
39 sensorNamesList = Split(getProperty<std::string>("SensorNames").getValue(), ",");
40 for (auto& sensor : sensorNamesList)
41 {
42 simox::alg::trim(sensor);
43 }
44
45 for (std::vector<std::string>::iterator s = sensorNamesList.begin();
46 s != sensorNamesList.end();
47 s++)
48 {
50 Eigen::Vector3f(0, 0, 0), *s, getProperty<std::string>("AgentName").getValue());
52 Eigen::Vector3f(0, 0, 0), *s, getProperty<std::string>("AgentName").getValue());
53 }
54
55 ARMARX_VERBOSE << "Starting ForceTorqueUnitSimulation with " << intervalMs
56 << " ms interval";
58 this,
60 intervalMs,
61 false,
62 "ForceTorqueUnitSimulation",
63 false);
64 }
65
66 void
71
72 void
77
78 void
80 {
81
82 for (auto& sensor : sensorNamesList)
83 {
84 listenerPrx->reportSensorValues(sensor, forces[sensor], torques[sensor]);
85 }
86
87 //listenerPrx->reportSensorValues(forces);
88 //listenerPrx->reportSensorValues(torques);
89 }
90
91 void
92 ForceTorqueUnitSimulation::setOffset(const FramedDirectionBasePtr& forceOffsets,
93 const FramedDirectionBasePtr& torqueOffsets,
94 const Ice::Current& c)
95 {
96 // Ignore
97 }
98
99 void
101 {
102 // Ignore
103 }
104
111} // namespace armarx
constexpr T c
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
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
ForceTorqueUnitListenerPrx listenerPrx
FramedDirection is a 3 dimensional direction vector with a reference frame.
Definition FramedPose.h:87
The periodic task executes one thread method repeatedly using the time period specified in the constr...
#define ARMARX_VERBOSE
The logging level for verbose information.
Definition Logging.h:187
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.