jointik.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-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
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 #include <Eigen/Core>
27 #include <Eigen/Geometry>
28 
29 #include <VirtualRobot/IK/GazeIK.h>
30 #include <VirtualRobot/Nodes/RobotNode.h>
31 #include <VirtualRobot/Robot.h>
32 #include <VirtualRobot/RobotNodeSet.h>
33 #include <VirtualRobot/VirtualRobot.h>
34 
37 
38 #include "ReflexCombination.h"
39 #include "reflex.h"
40 
41 namespace armarx
42 {
43  class ReflexCombination;
44 
45  class JointIK : virtual public Reflex
46  {
47  public:
49  {
50  onStop();
51  }
52 
53  ~JointIK() override
54  {
55  }
56 
57  void setRobot(std::string nodeSetName,
58  std::string headIKName,
59  RobotStateComponentInterfacePrx robotStateComponent);
60  void setBools(bool armar4, bool velocityBased);
61 
62  void
63  reportJointAngles(const NameValueMap& values, bool valueChanged, const Ice::Current& c);
64  void
65  reportJointVelocities(const NameValueMap& values, bool valueChanged, const Ice::Current& c);
66 
67  void reportHeadTargetChanged(const NameValueMap& targetJointAngles,
68  const FramedPositionBasePtr& targetPosition);
69 
70  std::string
71  getName() const override
72  {
73  return "JointIK";
74  }
75 
76  protected:
77  void onStop() override;
78 
79  void calc() override;
80 
81  private:
83  std::vector<VirtualRobot::RobotNodePtr> allRobotNodeSet;
84  RobotStateComponentInterfacePrx robotStateComponent;
85  std::string headIKName;
86 
87  std::mutex dataMutex;
88 
89  FramedPositionPtr globalPos;
90 
91  bool reportedJointAnglesBool, reportedJointVelocitiesBool;
92  bool armar4, velocityBased;
93  NameValueMap reportedJointAngles, reportedJointVelocities;
94  };
95 } // namespace armarx
armarx::JointIK::getName
std::string getName() const override
Definition: jointik.h:71
RemoteRobot.h
ReflexCombination.h
armarx::JointIK::reportJointVelocities
void reportJointVelocities(const NameValueMap &values, bool valueChanged, const Ice::Current &c)
Definition: jointik.cpp:140
armarx::JointIK::JointIK
JointIK(int interval)
Definition: jointik.h:48
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::JointIK::onStop
void onStop() override
Definition: jointik.cpp:158
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::JointIK
Definition: jointik.h:45
IceInternal::Handle< FramedPosition >
armarx::Reflex
Definition: reflex.h:37
FramedPose.h
armarx::JointIK::~JointIK
~JointIK() override
Definition: jointik.h:53
armarx::JointIK::setRobot
void setRobot(std::string nodeSetName, std::string headIKName, RobotStateComponentInterfacePrx robotStateComponent)
Definition: jointik.cpp:106
armarx::JointIK::setBools
void setBools(bool armar4, bool velocityBased)
Definition: jointik.cpp:122
armarx::JointIK::calc
void calc() override
Definition: jointik.cpp:31
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:88
armarx::JointIK::reportHeadTargetChanged
void reportHeadTargetChanged(const NameValueMap &targetJointAngles, const FramedPositionBasePtr &targetPosition)
Definition: jointik.cpp:149
reflex.h
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::JointIK::reportJointAngles
void reportJointAngles(const NameValueMap &values, bool valueChanged, const Ice::Current &c)
Definition: jointik.cpp:131
armarx::Reflex::interval
int interval
Definition: reflex.h:142
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19