DynamicsHelper.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2017, 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 ArmarX
19 * @author Mirko Waechter( mirko.waechter at kit dot edu)
20 * @date 2019
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#pragma once
25#include <Eigen/Core>
26
27#include <VirtualRobot/Dynamics/Dynamics.h>
28#include <VirtualRobot/VirtualRobot.h>
29
31
32namespace armarx::rtfilters
33{
34 class RTFilterBase;
35 using RTFilterBasePtr = std::shared_ptr<RTFilterBase>;
36} // namespace armarx::rtfilters
37
38namespace armarx
39{
40 class RobotUnit;
41
43 {
44 public:
46 {
47 DynamicsData(VirtualRobot::RobotNodeSetPtr rnsJoints,
48 VirtualRobot::RobotNodeSetPtr rnsBodies);
49
50 DynamicsData(const DynamicsData& r) = default;
51 VirtualRobot::RobotNodeSetPtr rnsJoints, rnsBodies;
52 VirtualRobot::Dynamics dynamics;
53 Eigen::VectorXd q, qDot, qDDot, tau, tauGravity;
54 std::vector<std::pair<VirtualRobot::RobotNodePtr, SensorValue1DoFActuator*>>
56 std::vector<rtfilters::RTFilterBasePtr> velocityFilter;
57 std::vector<rtfilters::RTFilterBasePtr> accelerationFilter;
58 };
59
61 ~DynamicsHelper() = default;
62 void
63 addRobotPart(VirtualRobot::RobotNodeSetPtr rnsJoints,
64 VirtualRobot::RobotNodeSetPtr rnsBodies,
67 void update(const IceUtil::Time& sensorValuesTimestamp,
68 const IceUtil::Time& timeSinceLastIteration);
69
70 protected:
72 std::map<VirtualRobot::RobotNodeSetPtr, DynamicsData> dataMap;
73 };
74
75} // namespace armarx
void addRobotPart(VirtualRobot::RobotNodeSetPtr rnsJoints, VirtualRobot::RobotNodeSetPtr rnsBodies, rtfilters::RTFilterBasePtr velocityFilter=rtfilters::RTFilterBasePtr(), rtfilters::RTFilterBasePtr accelerationFilter=rtfilters::RTFilterBasePtr())
DynamicsHelper(RobotUnit *robotUnit)
std::map< VirtualRobot::RobotNodeSetPtr, DynamicsData > dataMap
void update(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
The RobotUnit class manages a robot and its controllers.
Definition RobotUnit.h:192
The RTFilterBase class is the base class for all real time capable filters.
std::shared_ptr< RTFilterBase > RTFilterBasePtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
VirtualRobot::RobotNodeSetPtr rnsBodies
std::vector< rtfilters::RTFilterBasePtr > velocityFilter
VirtualRobot::RobotNodeSetPtr rnsJoints
std::vector< std::pair< VirtualRobot::RobotNodePtr, SensorValue1DoFActuator * > > nodeSensorVec
std::vector< rtfilters::RTFilterBasePtr > accelerationFilter
DynamicsData(const DynamicsData &r)=default
DynamicsData(VirtualRobot::RobotNodeSetPtr rnsJoints, VirtualRobot::RobotNodeSetPtr rnsBodies)