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
41namespace armarx
42{
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
constexpr T c
std::string getName() const override
Definition jointik.h:71
void reportJointAngles(const NameValueMap &values, bool valueChanged, const Ice::Current &c)
Definition jointik.cpp:131
void reportHeadTargetChanged(const NameValueMap &targetJointAngles, const FramedPositionBasePtr &targetPosition)
Definition jointik.cpp:149
void onStop() override
Definition jointik.cpp:158
~JointIK() override
Definition jointik.h:53
void reportJointVelocities(const NameValueMap &values, bool valueChanged, const Ice::Current &c)
Definition jointik.cpp:140
void setBools(bool armar4, bool velocityBased)
Definition jointik.cpp:122
void calc() override
Definition jointik.cpp:31
void setRobot(std::string nodeSetName, std::string headIKName, RobotStateComponentInterfacePrx robotStateComponent)
Definition jointik.cpp:106
JointIK(int interval)
Definition jointik.h:48
Brief description of class ReflexCombination.
Reflex(int interval)
Definition reflex.h:40
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< FramedPosition > FramedPositionPtr
Definition FramedPose.h:149
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx