UserWaypoint.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2015-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 ArmarXGuiPlugins::RobotTrajectoryDesigner::Model
19  * @author Lukas Christ
20  * @date 2018
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #ifndef USERWAYPOINT_H
25 #define USERWAYPOINT_H
26 
27 #include <RobotAPI/interface/core/PoseBase.h>
28 #include <Eigen/Core>
29 #include <RobotComponents/interface/components/RobotIK.h>
30 #include <memory>
31 #include <VirtualRobot/IK/GenericIKSolver.h>
34 
35 
36 namespace armarx
37 {
39  /**
40  * @brief The UserWaypoint class represents a waypoint of the trajectory.
41  */
43  {
44  private:
45  PoseBasePtr pose;
46  std::vector<double> jointAngles;
47  IKSelection iKSelection;
48  bool isTimeOptimalBreakpoint;
49  double timeOptimalTimestamp;
50  double userTimestamp;
51 
52  public:
53  /**
54  * @brief UserWaypoint
55  * @param newPose
56  */
57  UserWaypoint(PoseBasePtr newPose);
58 
60 
61  /**
62  * @brief Returns the PoseBasePtr of the UserWaypoint
63  * @return PoseBasePtr
64  */
65  PoseBasePtr getPose();
66 
67  /**
68  * @brief Returns the jointAngles of the UserWaypoint
69  * @return jointAngles
70  */
71  std::vector<double> getJointAngles() const;
72 
73  /**
74  * @brief Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint
75  * @return IKSelections
76  */
78 
79  /**
80  * @brief Returns if the UserWaypoint is breakpoint
81  * @return
82  */
83  bool getIsTimeOptimalBreakpoint() const;
84 
85  /**
86  * @brief Returns the timeOptimalTimestamp of the UserWaypoint which is calculate
87  *by the TrajectoryCalculation
88  * @return timeOptimalTimestamp
89  */
90  double getTimeOptimalTimestamp() const;
91 
92  /**
93  * @brief Returns the UserTimestamp
94  * @return userTimestamp
95  */
96  double getUserTimestamp() const;
97 
98  ////////SET///////////////////////////////////////////////////////
99  /**
100  * @brief Set the new PoseBase of the UserWaypoint
101  * @param new PoseBasePtr
102  */
103  void setPose(const PoseBasePtr& value);
104 
105  /**
106  * @brief Set the new JointAngles of the UserWaypoint
107  * @param new JointAngles
108  */
109  void setJointAngles(const std::vector<double>& value);
110 
111  /**
112  * @brief Set the new IKSelection of the UserWaypoint
113  * @param iKSelection
114  */
115  void setIKSelection(const IKSelection& value);
116 
117  /**
118  * @brief Set isTimeOptimalBreakpoint
119  * @param is breakpoint or not
120  */
122 
123  /**
124  * @brief Set the time optimal timestamp of the UserWaypoint calculate by
125  * TrajectoryCalculation
126  * @param time optimal Timestamp
127  */
128  void setTimeOptimalTimestamp(double value);
129 
130  /**
131  * @brief Set the new UserDuration and tests if its greater than timeOptimalTimestamp
132  * @param user timestamp
133  */
134  void setUserTimestamp(double value);
135 
136  };
137  using UserWaypointPtr = std::shared_ptr<UserWaypoint>;
138 }
139 #endif // USERWAYPOINT_H
armarx::UserWaypointPtr
std::shared_ptr< UserWaypoint > UserWaypointPtr
Definition: UserWaypoint.h:137
armarx::UserWaypoint::getUserTimestamp
double getUserTimestamp() const
Returns the UserTimestamp.
Definition: UserWaypoint.cpp:63
armarx::UserWaypoint::setUserTimestamp
void setUserTimestamp(double value)
Set the new UserDuration and tests if its greater than timeOptimalTimestamp.
Definition: UserWaypoint.cpp:68
armarx::UserWaypoint
The UserWaypoint class represents a waypoint of the trajectory.
Definition: UserWaypoint.h:42
armarx::UserWaypoint::getTimeOptimalTimestamp
double getTimeOptimalTimestamp() const
Returns the timeOptimalTimestamp of the UserWaypoint which is calculate by the TrajectoryCalculation.
Definition: UserWaypoint.cpp:42
armarx::IKSelection
VirtualRobot::IKSolver::CartesianSelection IKSelection
Definition: UserWaypoint.h:38
armarx::UserWaypoint::setIKSelection
void setIKSelection(const IKSelection &value)
Set the new IKSelection of the UserWaypoint.
Definition: UserWaypoint.cpp:27
armarx::UserWaypoint::setTimeOptimalTimestamp
void setTimeOptimalTimestamp(double value)
Set the time optimal timestamp of the UserWaypoint calculate by TrajectoryCalculation.
Definition: UserWaypoint.cpp:47
armarx::UserWaypoint::getIsTimeOptimalBreakpoint
bool getIsTimeOptimalBreakpoint() const
Returns if the UserWaypoint is breakpoint.
Definition: UserWaypoint.cpp:32
armarx::UserWaypoint::setIsTimeOptimalBreakpoint
void setIsTimeOptimalBreakpoint(bool value)
Set isTimeOptimalBreakpoint.
Definition: UserWaypoint.cpp:37
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
FramedPose.h
armarx::UserWaypoint::getJointAngles
std::vector< double > getJointAngles() const
Returns the jointAngles of the UserWaypoint.
Definition: UserWaypoint.cpp:5
armarx::UserWaypoint::setJointAngles
void setJointAngles(const std::vector< double > &value)
Set the new JointAngles of the UserWaypoint.
Definition: UserWaypoint.cpp:10
armarx::NJointTaskSpaceDMPControllerMode::CartesianSelection
CartesianSelection
Definition: ControllerInterface.ice:34
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
armarx::UserWaypoint::UserWaypoint
UserWaypoint(PoseBasePtr newPose)
UserWaypoint.
Definition: UserWaypoint.cpp:90
armarx::UserWaypoint::getIKSelection
IKSelection getIKSelection() const
Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint.
Definition: UserWaypoint.cpp:22
armarx::UserWaypoint::getPose
PoseBasePtr getPose()
Returns the PoseBasePtr of the UserWaypoint.
Definition: UserWaypoint.cpp:80
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::UserWaypoint::setPose
void setPose(const PoseBasePtr &value)
Set the new PoseBase of the UserWaypoint.
Definition: UserWaypoint.cpp:85
PropagateConst.h