CartesianVelocityControllerWithRamp.h
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),
5 * Karlsruhe Institute of Technology (KIT), all rights reserved.
6 *
7 * ArmarX is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * ArmarX is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * @author Sonja Marahrens (sonja dot marahrens)
20 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21 * GNU General Public License
22 */
23
24#pragma once
25
26#include <Eigen/Dense>
27
28#include <VirtualRobot/IK/IKSolver.h>
29#include <VirtualRobot/RobotNodeSet.h>
30
33#include "JointVelocityRamp.h"
34
35namespace armarx
36{
39 std::shared_ptr<CartesianVelocityControllerWithRamp>;
40
42 {
43 public:
44 CartesianVelocityControllerWithRamp(const VirtualRobot::RobotNodeSetPtr& rns,
45 const Eigen::VectorXf& currentJointVelocity,
46 VirtualRobot::IKSolver::CartesianSelection mode,
47 float maxPositionAcceleration,
48 float maxOrientationAcceleration,
49 float maxNullspaceAcceleration,
50 const VirtualRobot::RobotNodePtr& tcp = nullptr);
51
55
56 [[deprecated("computed null space velocity does not match pseudo inverse svd method in "
57 "simox. never use this function.")]] void
58 setCurrentJointVelocity(const Eigen::Ref<const Eigen::VectorXf>& currentJointVelocity);
59
60 void switchMode(const Eigen::VectorXf& currentJointVelocity,
61 VirtualRobot::IKSolver::CartesianSelection mode);
62 VirtualRobot::IKSolver::CartesianSelection getMode();
63
64 Eigen::VectorXf
65 calculate(const Eigen::VectorXf& cartesianVel, float jointLimitAvoidanceScale, float dt);
66 Eigen::VectorXf calculate(const Eigen::VectorXf& cartesianVel,
67 const Eigen::VectorXf& nullspaceVel,
68 float dt);
69
70 void setMaxAccelerations(float maxPositionAcceleration,
71 float maxOrientationAcceleration,
72 float maxNullspaceAcceleration);
73
77
78
80
81 private:
82 VirtualRobot::IKSolver::CartesianSelection mode;
83 CartesianVelocityRamp cartesianVelocityRamp;
84 JointVelocityRamp nullSpaceVelocityRamp;
85 };
86} // namespace armarx
constexpr T dt
Eigen::VectorXf calculate(const Eigen::VectorXf &cartesianVel, float jointLimitAvoidanceScale, float dt)
void setCurrentJointVelocity(const Eigen::Ref< const Eigen::VectorXf > &currentJointVelocity)
CartesianVelocityControllerWithRamp(CartesianVelocityControllerWithRamp &&)=default
void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration)
VirtualRobot::IKSolver::CartesianSelection getMode()
CartesianVelocityControllerWithRamp & operator=(CartesianVelocityControllerWithRamp &&)=default
CartesianVelocityControllerWithRamp(const VirtualRobot::RobotNodeSetPtr &rns, const Eigen::VectorXf &currentJointVelocity, VirtualRobot::IKSolver::CartesianSelection mode, float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration, const VirtualRobot::RobotNodePtr &tcp=nullptr)
void switchMode(const Eigen::VectorXf &currentJointVelocity, VirtualRobot::IKSolver::CartesianSelection mode)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< CartesianVelocityControllerWithRamp > CartesianVelocityControllerWithRampPtr