KinematicUnitSimulation.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 ArmarXCore::units
19  * @author Christian Boege (boege at kit dot edu)
20  * @date 2011
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 
27 
28 #include <VirtualRobot/VirtualRobot.h>
29 #include <VirtualRobot/XML/RobotIO.h>
30 #include <VirtualRobot/RobotNodeSet.h>
31 #include <VirtualRobot/Nodes/RobotNode.h>
32 #include <VirtualRobot/VirtualRobotException.h>
36 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
37 
38 
39 #include <algorithm>
40 
41 using namespace armarx;
42 
43 
46 {
47  defineOptionalProperty<int>("IntervalMs", 10, "The time in milliseconds between two calls to the simulation method.");
48  defineOptionalProperty<float>("Noise", 0.0f, "Gaussian noise is added to the velocity. Value in Degree");
49  defineOptionalProperty<bool>("UsePDControllerForJointControl", true, "If true a PD controller is also used in Position Mode instead of setting the joint angles instantly");
50  defineOptionalProperty<float>("Kp", 3, "proportional gain of the PID position controller.");
51  defineOptionalProperty<float>("Ki", 0.001f, "integral gain of the PID position controller.");
52  defineOptionalProperty<float>("Kd", 0.0, "derivative gain of the PID position controller.");
53 
54 }
55 
56 
58 {
60  ARMARX_INFO << "Init Simulation";
61  usePDControllerForPosMode = getProperty<bool>("UsePDControllerForJointControl").getValue();
62  for (std::vector<VirtualRobot::RobotNodePtr>::iterator it = robotNodes.begin(); it != robotNodes.end(); it++)
63  {
64  std::string jointName = (*it)->getName();
65  jointInfos[jointName].limitLo = (*it)->getJointLimitLo();
66  jointInfos[jointName].limitHi = (*it)->getJointLimitHi();
67 
68  if ((*it)->isRotationalJoint())
69  {
70  if (jointInfos[jointName].limitHi - jointInfos[jointName].limitLo >= float(M_PI * 2))
71  {
72  jointInfos[jointName].reset();
73  }
74  }
75 
76  ARMARX_VERBOSE << jointName << " with limits: lo: " << jointInfos[jointName].limitLo << " hi: " << jointInfos[jointName].limitHi;
77  }
79  {
80  // duplicate the loop because of locking
81  std::unique_lock lock(jointStatesMutex);
82 
83  // initialize JoinStates
84  for (std::vector<VirtualRobot::RobotNodePtr>::iterator it = robotNodes.begin(); it != robotNodes.end(); it++)
85  {
86  std::string jointName = (*it)->getName();
88  jointStates[jointName].init();
90  getProperty<float>("Kp").getValue(),
91  getProperty<float>("Ki").getValue(),
92  getProperty<float>("Kd").getValue()));
93  }
94  }
96  noise = getProperty<float>("Noise").getValue() / 180.f * M_PI;
97  if (noise > 0)
98  {
99  // Aborts due to assertion when noise <= 0.
100  distribution = std::normal_distribution<double>(0, noise);
101  }
102  intervalMs = getProperty<int>("IntervalMs").getValue();
103  ARMARX_VERBOSE << "Starting kinematic unit simulation with " << intervalMs << " ms interval";
105 }
106 
108 {
110  simulationTask->start();
111 }
112 
113 
115 {
116  simulationTask->stop();
117 }
118 
119 
121 {
122  // the time it took until this method was called again
123  double timeDeltaInSeconds = (TimeUtil::GetTime() - lastExecutionTime).toMilliSecondsDouble() / 1000.0;
125 
126  // name value maps for reporting
127  std::lock_guard guard {sensorDataMutex};
128  sensorAngles.clear();
129  sensorVelocities.clear();
130 
131  bool aPosValueChanged = false;
132  bool aVelValueChanged = false;
133  auto signedMin = [](float newValue, float minAbsValue)
134  {
135  return std::copysign(std::min<float>(fabs(newValue), fabs(minAbsValue)), newValue);
136  };
137 
138  {
139 
140  std::unique_lock lock(jointStatesMutex);
141 
142  for (KinematicUnitSimulationJointStates::iterator it = jointStates.begin(); it != jointStates.end(); it++)
143  {
144 
145  float newAngle = 0.0f;
146  float newVelocity = 0.0f;
147  KinematicUnitSimulationJointInfo& jointInfo = jointInfos[it->first];
148  // calculate joint positions if joint is in velocity control mode
149  if (it->second.controlMode == eVelocityControl)
150  {
151  double change = (it->second.velocity * timeDeltaInSeconds);
152  newVelocity = it->second.velocity;
153  if (noise > 0)
154  {
155  double randomNoiseValue = distribution(generator);
156  change *= 1 + randomNoiseValue;
157  }
158  newAngle = it->second.angle + change;
159  // check if velocities have changed
160  if (std::fabs(previousJointStates[it->first].velocity - newVelocity) > 0.00000001f)
161  {
162  aVelValueChanged = true;
163  }
164  }
165  else if (it->second.controlMode == ePositionControl)
166  {
168  {
169  newAngle = it->second.angle;
170  }
171  else
172  {
174  if (pid)
175  {
176  float velValue = (it->second.velocity != 0.0f ? signedMin(pid->getControlValue(), it->second.velocity) : pid->getControlValue()); //restrain to max velocity
177  if (noise > 0)
178  {
179  velValue *= 1 + distribution(generator);
180  }
181 
182  pid->update(it->second.angle);
183  newAngle = it->second.angle +
184  velValue *
185  timeDeltaInSeconds;
186  if (fabs(previousJointStates[it->first].velocityActual - velValue) > 0.00000001)
187  {
188  aVelValueChanged = true;
189  }
190  it->second.velocityActual = newVelocity = velValue;
191  }
192  }
193  }
194 
195  // constrain the angle
196  if (!jointInfo.continuousJoint())
197  {
198  float maxAngle = (jointInfo.hasLimits()) ? jointInfo.limitHi : M_PI;
199  float minAngle = (jointInfo.hasLimits()) ? jointInfo.limitLo : -M_PI;
200 
201  newAngle = std::max<float>(newAngle, minAngle);
202  newAngle = std::min<float>(newAngle, maxAngle);
203  }
204 
205  // Check if joint existed before
206  KinematicUnitSimulationJointStates::iterator itPrev = previousJointStates.find(it->first);
207 
208  if (itPrev == previousJointStates.end())
209  {
210  aPosValueChanged = aVelValueChanged = true;
211  }
212 
213  // check if the angle has changed
214  if (fabs(previousJointStates[it->first].angle - newAngle) > 0.00000001)
215  {
216  aPosValueChanged = true;
217  // set the new joint angle locally for the next simulation iteration
218  it->second.angle = newAngle;
219  }
220 
221 
222 
223  if (jointInfo.continuousJoint())
224  {
225  if (newAngle < 0)
226  {
227  newAngle = fmod(newAngle - M_PI, 2 * M_PI) + M_PI;
228  }
229  else
230  {
231  newAngle = fmod(newAngle + M_PI, 2 * M_PI) - M_PI;
232  }
233 
234  }
235 
236  sensorAngles[it->first] = newAngle;
237  sensorVelocities[it->first] = newVelocity;
238  }
239 
241  }
242  auto timestamp = TimeUtil::GetTime().toMicroSeconds();
243  listenerPrx->reportJointAngles(sensorAngles, timestamp, aPosValueChanged);
244  listenerPrx->reportJointVelocities(sensorVelocities, timestamp, aVelValueChanged);
245 }
246 
247 void KinematicUnitSimulation::switchControlMode(const NameControlModeMap& targetJointModes, const Ice::Current& c)
248 {
249  bool aValueChanged = false;
250  NameControlModeMap changedControlModes;
251  {
252  std::unique_lock lock(jointStatesMutex);
253 
254  for (NameControlModeMap::const_iterator it = targetJointModes.begin(); it != targetJointModes.end(); it++)
255  {
256  // target values
257  std::string targetJointName = it->first;
258  ControlMode targetControlMode = it->second;
259 
260  KinematicUnitSimulationJointStates::iterator iterJoints = jointStates.find(targetJointName);
261 
262  // check whether there is a joint with this name and set joint angle
263  if (iterJoints != jointStates.end())
264  {
265  if (iterJoints->second.controlMode != targetControlMode)
266  {
267  aValueChanged = true;
268  }
269 
270  iterJoints->second.controlMode = targetControlMode;
271  changedControlModes.insert(*it);
272  }
273  else
274  {
275  ARMARX_WARNING << "Could not find joint with name " << targetJointName;
276  }
277  }
278  }
279  // only report control modes which have been changed
280  listenerPrx->reportControlModeChanged(changedControlModes, aValueChanged, TimeUtil::GetTime().toMicroSeconds());
281 }
282 
283 
284 void KinematicUnitSimulation::setJointAngles(const NameValueMap& targetJointAngles, const Ice::Current& c)
285 {
286 
287  std::unique_lock lock(jointStatesMutex);
288  // name value maps for reporting
289  NameValueMap actualJointAngles;
290  bool aValueChanged = false;
291 
292  for (NameValueMap::const_iterator it = targetJointAngles.begin(); it != targetJointAngles.end(); it++)
293  {
294  // target values
295  std::string targetJointName = it->first;
296  float targetJointAngle = it->second;
297 
298  // check whether there is a joint with this name and set joint angle
299  KinematicUnitSimulationJointStates::iterator iterJoints = jointStates.find(targetJointName);
300 
301  if (iterJoints != jointStates.end())
302  {
303  if (fabs(iterJoints->second.angle - targetJointAngle) > 0)
304  {
305  aValueChanged = true;
306  }
307  KinematicUnitSimulationJointInfo& jointInfo = jointInfos[targetJointName];
308  if (jointInfo.hasLimits() && !jointInfo.continuousJoint())
309  {
310  targetJointAngle = std::max<float>(targetJointAngle, jointInfo.limitLo);
311  targetJointAngle = std::min<float>(targetJointAngle, jointInfo.limitHi);
312  }
313 
315  {
316  iterJoints->second.angle = targetJointAngle;
317  actualJointAngles[targetJointName] = iterJoints->second.angle;
318  }
319  else
320  {
322  if (pid)
323  {
324  pid->reset();
325  if (jointInfo.continuousJoint())
326  {
327  float delta = targetJointAngle - iterJoints->second.angle;
328  float signedSmallestDelta = atan2(sin(delta), cos(delta));
329  targetJointAngle = iterJoints->second.angle + signedSmallestDelta;
330  }
331 
332  pid->setTarget(targetJointAngle);
333 
334 
335  }
336  }
337  }
338  else
339  {
340  ARMARX_WARNING << deactivateSpam(1) << "Joint '" << targetJointName << "' not found!";
341  }
342  }
343 
344  if (aValueChanged)
345  {
346  listenerPrx->reportJointAngles(actualJointAngles, aValueChanged, TimeUtil::GetTime().toMicroSeconds());
347  }
348 }
349 
350 void KinematicUnitSimulation::setJointVelocities(const NameValueMap& targetJointVelocities, const Ice::Current&)
351 {
352  std::unique_lock lock(jointStatesMutex);
353  NameValueMap actualJointVelocities;
354  bool aValueChanged = false;
355 
356  for (NameValueMap::const_iterator it = targetJointVelocities.begin(); it != targetJointVelocities.end(); it++)
357  {
358  // target values
359  std::string targetJointName = it->first;
360  float targetJointVelocity = it->second;
361 
362  KinematicUnitSimulationJointStates::iterator iterJoints = jointStates.find(targetJointName);
363 
364  // check whether there is a joint with this name and set joint angle
365  if (iterJoints != jointStates.end())
366  {
367  if (fabs(iterJoints->second.velocity - targetJointVelocity) > 0)
368  {
369  aValueChanged = true;
370  }
371 
372  iterJoints->second.velocity = targetJointVelocity;
373  actualJointVelocities[targetJointName] = iterJoints->second.velocity;
374  }
375  }
376 
377  if (aValueChanged)
378  {
379  listenerPrx->reportJointVelocities(actualJointVelocities, aValueChanged, TimeUtil::GetTime().toMicroSeconds());
380  }
381 }
382 
383 void KinematicUnitSimulation::setJointTorques(const NameValueMap& targetJointTorques, const Ice::Current&)
384 {
385  std::unique_lock lock(jointStatesMutex);
386  NameValueMap actualJointTorques;
387  bool aValueChanged = false;
388 
389  for (NameValueMap::const_iterator it = targetJointTorques.begin(); it != targetJointTorques.end(); it++)
390  {
391  // target values
392  std::string targetJointName = it->first;
393  float targetJointTorque = it->second;
394 
395  KinematicUnitSimulationJointStates::iterator iterJoints = jointStates.find(targetJointName);
396 
397  // check whether there is a joint with this name and set joint angle
398  if (iterJoints != jointStates.end())
399  {
400  if (fabs(iterJoints->second.torque - targetJointTorque) > 0)
401  {
402  aValueChanged = true;
403  }
404 
405  iterJoints->second.torque = targetJointTorque;
406  actualJointTorques[targetJointName] = iterJoints->second.torque;
407  }
408  }
409 
410  if (aValueChanged)
411  {
412  listenerPrx->reportJointTorques(actualJointTorques, aValueChanged, TimeUtil::GetTime().toMicroSeconds());
413  }
414 }
415 
416 NameControlModeMap KinematicUnitSimulation::getControlModes(const Ice::Current&)
417 {
418  NameControlModeMap result;
419 
420  for (KinematicUnitSimulationJointStates::iterator it = jointStates.begin(); it != jointStates.end(); it++)
421  {
422  result[it->first] = it->second.controlMode;
423  }
424 
425  return result;
426 }
427 
428 void KinematicUnitSimulation::setJointAccelerations(const NameValueMap& targetJointAccelerations, const Ice::Current&)
429 {
430  (void) targetJointAccelerations;
431 }
432 
433 void KinematicUnitSimulation::setJointDecelerations(const NameValueMap& targetJointDecelerations, const Ice::Current&)
434 {
435  (void) targetJointDecelerations;
436 }
437 
438 void KinematicUnitSimulation::stop(const Ice::Current& c)
439 {
440 
441  std::unique_lock lock(jointStatesMutex);
442 
443  for (KinematicUnitSimulationJointStates::iterator it = jointStates.begin(); it != jointStates.end(); it++)
444  {
445  it->second.velocity = 0;
446  }
447 
449 }
450 
451 
453 {
454  return PropertyDefinitionsPtr(
456 }
457 
459 {
460  std::lock_guard<std::mutex> guard {sensorDataMutex};
461  return sensorAngles;
462 }
463 
465 {
466  std::lock_guard<std::mutex> guard {sensorDataMutex};
467  return sensorVelocities;
468 }
469 
470 Ice::StringSeq KinematicUnitSimulation::getJoints(const Ice::Current& c) const
471 {
472  std::lock_guard<std::mutex> guard {sensorDataMutex};
473  return getMapKeys(sensorAngles);
474 }
475 
476 DebugInfo KinematicUnitSimulation::getDebugInfo(const Ice::Current& c) const
477 {
478  std::lock_guard g{jointStatesMutex};
479 
480  DebugInfo debugInfo;
481  for(const auto& [jointName, info]: jointStates)
482  {
483  debugInfo.jointAngles[jointName] = info.angle;
484  debugInfo.jointVelocities[jointName] = info.velocity;
485 
486  debugInfo.jointMotorTemperatures[jointName] = info.temperature;
487 
488  debugInfo.jointTorques[jointName] = info.torque;
489  debugInfo.jointModes[jointName] = info.controlMode;
490  };
491 
492  return debugInfo;
493 }
494 
495 
496 
497 bool mapEntryEqualsString(std::pair<std::string, KinematicUnitSimulationJointState> iter, std::string compareString)
498 {
499  return (iter.first == compareString);
500 }
501 
502 void KinematicUnitSimulation::requestJoints(const Ice::StringSeq& joints, const Ice::Current& c)
503 {
504  // if one of the joints belongs to this unit, lock access to this unit for other components except for the requesting one
505  KinematicUnitSimulationJointStates::const_iterator it = std::find_first_of(jointStates.begin(), jointStates.end(), joints.begin(), joints.end(), mapEntryEqualsString);
506 
507  if (jointStates.end() != it)
508  {
510  }
511 }
512 
513 void KinematicUnitSimulation::releaseJoints(const Ice::StringSeq& joints, const Ice::Current& c)
514 {
515  // if one of the joints belongs to this unit, unlock access
516  KinematicUnitSimulationJointStates::const_iterator it = std::find_first_of(jointStates.begin(), jointStates.end(), joints.begin(), joints.end(), mapEntryEqualsString);
517 
518  if (jointStates.end() != it)
519  {
521  }
522 }
armarx::KinematicUnitSimulation::switchControlMode
void switchControlMode(const NameControlModeMap &targetJointModes, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:247
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
algorithm.h
armarx::KinematicUnitSimulation::requestJoints
void requestJoints(const Ice::StringSeq &joints, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:502
mapEntryEqualsString
bool mapEntryEqualsString(std::pair< std::string, KinematicUnitSimulationJointState > iter, std::string compareString)
Definition: KinematicUnitSimulation.cpp:497
armarx::KinematicUnitSimulation::setJointDecelerations
void setJointDecelerations(const NameValueMap &targetJointDecelerations, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:433
armarx::SensorActorUnit::release
void release(const Ice::Current &c=Ice::emptyCurrent) override
Release exclusive access to current unit.
Definition: SensorActorUnit.cpp:141
armarx::KinematicUnitSimulation::getJoints
Ice::StringSeq getJoints(const Ice::Current &c) const override
Definition: KinematicUnitSimulation.cpp:470
armarx::KinematicUnitSimulation::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: KinematicUnitSimulation.cpp:452
armarx::PIDControllerPtr
std::shared_ptr< PIDController > PIDControllerPtr
Definition: PIDController.h:92
armarx::SensorActorUnit::request
void request(const Ice::Current &c=Ice::emptyCurrent) override
Request exclusive access to current unit.
Definition: SensorActorUnit.cpp:123
armarx::KinematicUnitSimulation::releaseJoints
void releaseJoints(const Ice::StringSeq &joints, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:513
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::navigation::platform_controller::platform_global_trajectory::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformGlobalTrajectoryController.h:93
armarx::KinematicUnitSimulation::setJointAccelerations
void setJointAccelerations(const NameValueMap &targetJointAccelerations, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:428
armarx::KinematicUnitSimulation::getDebugInfo
DebugInfo getDebugInfo(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KinematicUnitSimulation.cpp:476
armarx::KinematicUnitSimulation::stop
void stop(const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:438
armarx::KinematicUnitSimulation::sensorAngles
NameValueMap sensorAngles
Definition: KinematicUnitSimulation.h:183
armarx::KinematicUnitSimulation::jointStatesMutex
std::mutex jointStatesMutex
Definition: KinematicUnitSimulation.h:172
armarx::KinematicUnitSimulationJointInfo::limitHi
float limitHi
Definition: KinematicUnitSimulation.h:106
armarx::KinematicUnitSimulation::onStartKinematicUnit
void onStartKinematicUnit() override
Definition: KinematicUnitSimulation.cpp:107
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
KinematicUnitSimulation.h
armarx::KinematicUnitSimulationJointInfo::limitLo
float limitLo
Definition: KinematicUnitSimulation.h:105
M_PI
#define M_PI
Definition: MathTools.h:17
armarx::SensorActorUnit::stop
void stop(const Ice::Current &c=Ice::emptyCurrent) override
Set execution state to eStopped.
Definition: SensorActorUnit.cpp:91
armarx::KinematicUnitSimulation::setJointTorques
void setJointTorques(const NameValueMap &targetJointTorques, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:383
armarx::PIDController
Definition: PIDController.h:43
armarx::KinematicUnitSimulation::simulationFunction
void simulationFunction()
Definition: KinematicUnitSimulation.cpp:120
armarx::KinematicUnitSimulation::getControlModes
NameControlModeMap getControlModes(const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:416
armarx::KinematicUnitSimulation::sensorDataMutex
std::mutex sensorDataMutex
Definition: KinematicUnitSimulation.h:182
armarx::KinematicUnit::robotNodes
std::vector< VirtualRobot::RobotNodePtr > robotNodes
Definition: KinematicUnit.h:147
armarx::KinematicUnitSimulation::usePDControllerForPosMode
bool usePDControllerForPosMode
Definition: KinematicUnitSimulation.h:178
armarx::KinematicUnitSimulationJointState
State of a joint.
Definition: KinematicUnitSimulation.h:48
armarx::KinematicUnitPropertyDefinitions
Definition: KinematicUnit.h:44
armarx::KinematicUnitSimulation::simulationTask
PeriodicTask< KinematicUnitSimulation >::pointer_type simulationTask
Definition: KinematicUnitSimulation.h:180
armarx::KinematicUnitSimulation::setJointVelocities
void setJointVelocities(const NameValueMap &targetJointVelocities, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:350
armarx::KinematicUnitSimulation::intervalMs
int intervalMs
Definition: KinematicUnitSimulation.h:175
armarx::KinematicUnitSimulation::sensorVelocities
NameValueMap sensorVelocities
Definition: KinematicUnitSimulation.h:184
armarx::TimeUtil::GetTime
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Definition: TimeUtil.cpp:42
armarx::KinematicUnitSimulationPropertyDefinitions::KinematicUnitSimulationPropertyDefinitions
KinematicUnitSimulationPropertyDefinitions(std::string prefix)
Definition: KinematicUnitSimulation.cpp:44
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::KinematicUnitSimulation::onInitKinematicUnit
void onInitKinematicUnit() override
Definition: KinematicUnitSimulation.cpp:57
armarx::KinematicUnit::listenerPrx
KinematicUnitListenerPrx listenerPrx
Definition: KinematicUnit.h:141
TimeUtil.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::KinematicUnitSimulation::distribution
std::normal_distribution< double > distribution
Definition: KinematicUnitSimulation.h:176
armarx::KinematicUnitSimulation::getJointAngles
armarx::NameValueMap getJointAngles(const Ice::Current &c) const override
Definition: KinematicUnitSimulation.cpp:458
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::KinematicUnitSimulationJointInfo::continuousJoint
bool continuousJoint() const
Definition: KinematicUnitSimulation.h:100
armarx::KinematicUnitSimulation::noise
float noise
Definition: KinematicUnitSimulation.h:174
armarx::KinematicUnitSimulationPropertyDefinitions
Definition: KinematicUnitSimulation.h:114
armarx::KinematicUnitSimulation::jointStates
KinematicUnitSimulationJointStates jointStates
Definition: KinematicUnitSimulation.h:169
armarx::Logging::deactivateSpam
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
Definition: Logging.cpp:92
armarx::KinematicUnitSimulation::onExitKinematicUnit
void onExitKinematicUnit() override
Definition: KinematicUnitSimulation.cpp:114
armarx::KinematicUnitSimulation::jointInfos
KinematicUnitSimulationJointInfos jointInfos
Definition: KinematicUnitSimulation.h:171
armarx::PeriodicTask
Definition: ArmarXManager.h:70
armarx::KinematicUnitSimulation::lastExecutionTime
IceUtil::Time lastExecutionTime
Definition: KinematicUnitSimulation.h:173
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx::KinematicUnitSimulation::generator
std::default_random_engine generator
Definition: KinematicUnitSimulation.h:177
armarx::KinematicUnitSimulationJointInfo
Definition: KinematicUnitSimulation.h:83
armarx::KinematicUnitSimulation::positionControlPIDController
std::map< std::string, PIDControllerPtr > positionControlPIDController
Definition: KinematicUnitSimulation.h:179
ArmarXDataPath.h
armarx::KinematicUnitSimulationJointInfo::hasLimits
bool hasLimits() const
Definition: KinematicUnitSimulation.h:96
armarx::KinematicUnitSimulation::getJointVelocities
armarx::NameValueMap getJointVelocities(const Ice::Current &c) const override
Definition: KinematicUnitSimulation.cpp:464
signedMin
float signedMin(float newValue, float minAbsValue)
Definition: ControlPlatform.cpp:39
armarx::getMapKeys
void getMapKeys(const MapType &map, OutputIteratorType it)
Definition: algorithm.h:157
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::KinematicUnitSimulation::setJointAngles
void setJointAngles(const NameValueMap &targetJointAngles, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KinematicUnitSimulation.cpp:284
armarx::KinematicUnitSimulation::previousJointStates
KinematicUnitSimulationJointStates previousJointStates
Definition: KinematicUnitSimulation.h:170