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 "reflex.h"
27 #include "ReflexCombination.h"
28 #include <Eigen/Core>
29 #include <Eigen/Geometry>
30 
31 #include <VirtualRobot/VirtualRobot.h>
32 #include <VirtualRobot/Robot.h>
33 #include <VirtualRobot/Nodes/RobotNode.h>
34 #include <VirtualRobot/RobotNodeSet.h>
35 #include <VirtualRobot/IK/GazeIK.h>
36 
39 
40 namespace armarx
41 {
42  class ReflexCombination;
43  class JointIK : virtual public Reflex
44  {
45  public:
47  {
48  onStop();
49  }
50  ~JointIK() override {}
51 
52  void setRobot(std::string nodeSetName, std::string headIKName, RobotStateComponentInterfacePrx robotStateComponent);
53  void setBools(bool armar4, bool velocityBased);
54 
55  void reportJointAngles(const NameValueMap& values, bool valueChanged, const Ice::Current& c);
56  void reportJointVelocities(const NameValueMap& values, bool valueChanged, const Ice::Current& c);
57 
58  void reportHeadTargetChanged(const NameValueMap& targetJointAngles, const FramedPositionBasePtr& targetPosition);
59 
60 
61  std::string getName() const override
62  {
63  return "JointIK";
64  }
65 
66  protected:
67 
68  void onStop() override;
69 
70  void calc() override;
71 
72  private:
74  std::vector< VirtualRobot::RobotNodePtr > allRobotNodeSet;
75  RobotStateComponentInterfacePrx robotStateComponent;
76  std::string headIKName;
77 
78  std::mutex dataMutex;
79 
80  FramedPositionPtr globalPos;
81 
82  bool reportedJointAnglesBool, reportedJointVelocitiesBool;
83  bool armar4, velocityBased;
84  NameValueMap reportedJointAngles, reportedJointVelocities;
85 
86  };
87 }
armarx::JointIK::getName
std::string getName() const override
Definition: jointik.h:61
RemoteRobot.h
ReflexCombination.h
armarx::JointIK::reportJointVelocities
void reportJointVelocities(const NameValueMap &values, bool valueChanged, const Ice::Current &c)
Definition: jointik.cpp:134
armarx::JointIK::JointIK
JointIK(int interval)
Definition: jointik.h:46
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::JointIK::onStop
void onStop() override
Definition: jointik.cpp:151
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::JointIK
Definition: jointik.h:43
IceInternal::Handle< FramedPosition >
armarx::Reflex
Definition: reflex.h:36
FramedPose.h
armarx::JointIK::~JointIK
~JointIK() override
Definition: jointik.h:50
armarx::JointIK::setRobot
void setRobot(std::string nodeSetName, std::string headIKName, RobotStateComponentInterfacePrx robotStateComponent)
Definition: jointik.cpp:105
armarx::JointIK::setBools
void setBools(bool armar4, bool velocityBased)
Definition: jointik.cpp:117
armarx::JointIK::calc
void calc() override
Definition: jointik.cpp:30
armarx::JointIK::reportHeadTargetChanged
void reportHeadTargetChanged(const NameValueMap &targetJointAngles, const FramedPositionBasePtr &targetPosition)
Definition: jointik.cpp:144
reflex.h
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::JointIK::reportJointAngles
void reportJointAngles(const NameValueMap &values, bool valueChanged, const Ice::Current &c)
Definition: jointik.cpp:125
armarx::Reflex::interval
int interval
Definition: reflex.h:134
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18