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 <memory>
28 
29 #include <Eigen/Core>
30 
31 #include <VirtualRobot/IK/GenericIKSolver.h>
32 
34 
35 #include <RobotAPI/interface/core/PoseBase.h>
37 
38 #include <RobotComponents/interface/components/RobotIK.h>
39 
40 namespace armarx
41 {
43 
44  /**
45  * @brief The UserWaypoint class represents a waypoint of the trajectory.
46  */
48  {
49  private:
50  PoseBasePtr pose;
51  std::vector<double> jointAngles;
52  IKSelection iKSelection;
53  bool isTimeOptimalBreakpoint;
54  double timeOptimalTimestamp;
55  double userTimestamp;
56 
57  public:
58  /**
59  * @brief UserWaypoint
60  * @param newPose
61  */
62  UserWaypoint(PoseBasePtr newPose);
63 
65 
66  /**
67  * @brief Returns the PoseBasePtr of the UserWaypoint
68  * @return PoseBasePtr
69  */
70  PoseBasePtr getPose();
71 
72  /**
73  * @brief Returns the jointAngles of the UserWaypoint
74  * @return jointAngles
75  */
76  std::vector<double> getJointAngles() const;
77 
78  /**
79  * @brief Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint
80  * @return IKSelections
81  */
83 
84  /**
85  * @brief Returns if the UserWaypoint is breakpoint
86  * @return
87  */
88  bool getIsTimeOptimalBreakpoint() const;
89 
90  /**
91  * @brief Returns the timeOptimalTimestamp of the UserWaypoint which is calculate
92  *by the TrajectoryCalculation
93  * @return timeOptimalTimestamp
94  */
95  double getTimeOptimalTimestamp() const;
96 
97  /**
98  * @brief Returns the UserTimestamp
99  * @return userTimestamp
100  */
101  double getUserTimestamp() const;
102 
103  ////////SET///////////////////////////////////////////////////////
104  /**
105  * @brief Set the new PoseBase of the UserWaypoint
106  * @param new PoseBasePtr
107  */
108  void setPose(const PoseBasePtr& value);
109 
110  /**
111  * @brief Set the new JointAngles of the UserWaypoint
112  * @param new JointAngles
113  */
114  void setJointAngles(const std::vector<double>& value);
115 
116  /**
117  * @brief Set the new IKSelection of the UserWaypoint
118  * @param iKSelection
119  */
120  void setIKSelection(const IKSelection& value);
121 
122  /**
123  * @brief Set isTimeOptimalBreakpoint
124  * @param is breakpoint or not
125  */
127 
128  /**
129  * @brief Set the time optimal timestamp of the UserWaypoint calculate by
130  * TrajectoryCalculation
131  * @param time optimal Timestamp
132  */
133  void setTimeOptimalTimestamp(double value);
134 
135  /**
136  * @brief Set the new UserDuration and tests if its greater than timeOptimalTimestamp
137  * @param user timestamp
138  */
139  void setUserTimestamp(double value);
140  };
141 
142  using UserWaypointPtr = std::shared_ptr<UserWaypoint>;
143 } // namespace armarx
144 #endif // USERWAYPOINT_H
armarx::UserWaypointPtr
std::shared_ptr< UserWaypoint > UserWaypointPtr
Definition: UserWaypoint.h:142
armarx::UserWaypoint::getUserTimestamp
double getUserTimestamp() const
Returns the UserTimestamp.
Definition: UserWaypoint.cpp:72
armarx::UserWaypoint::setUserTimestamp
void setUserTimestamp(double value)
Set the new UserDuration and tests if its greater than timeOptimalTimestamp.
Definition: UserWaypoint.cpp:78
armarx::UserWaypoint
The UserWaypoint class represents a waypoint of the trajectory.
Definition: UserWaypoint.h:47
armarx::UserWaypoint::getTimeOptimalTimestamp
double getTimeOptimalTimestamp() const
Returns the timeOptimalTimestamp of the UserWaypoint which is calculate by the TrajectoryCalculation.
Definition: UserWaypoint.cpp:49
armarx::IKSelection
VirtualRobot::IKSolver::CartesianSelection IKSelection
Definition: UserWaypoint.h:42
armarx::UserWaypoint::setIKSelection
void setIKSelection(const IKSelection &value)
Set the new IKSelection of the UserWaypoint.
Definition: UserWaypoint.cpp:31
armarx::UserWaypoint::setTimeOptimalTimestamp
void setTimeOptimalTimestamp(double value)
Set the time optimal timestamp of the UserWaypoint calculate by TrajectoryCalculation.
Definition: UserWaypoint.cpp:55
armarx::UserWaypoint::getIsTimeOptimalBreakpoint
bool getIsTimeOptimalBreakpoint() const
Returns if the UserWaypoint is breakpoint.
Definition: UserWaypoint.cpp:37
armarx::UserWaypoint::setIsTimeOptimalBreakpoint
void setIsTimeOptimalBreakpoint(bool value)
Set isTimeOptimalBreakpoint.
Definition: UserWaypoint.cpp:43
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
FramedPose.h
armarx::UserWaypoint::getJointAngles
std::vector< double > getJointAngles() const
Returns the jointAngles of the UserWaypoint.
Definition: UserWaypoint.cpp:6
armarx::UserWaypoint::setJointAngles
void setJointAngles(const std::vector< double > &value)
Set the new JointAngles of the UserWaypoint.
Definition: UserWaypoint.cpp:12
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:661
armarx::UserWaypoint::UserWaypoint
UserWaypoint(PoseBasePtr newPose)
UserWaypoint.
Definition: UserWaypoint.cpp:103
armarx::UserWaypoint::getIKSelection
IKSelection getIKSelection() const
Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint.
Definition: UserWaypoint.cpp:25
armarx::UserWaypoint::getPose
PoseBasePtr getPose()
Returns the PoseBasePtr of the UserWaypoint.
Definition: UserWaypoint.cpp:92
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::UserWaypoint::setPose
void setPose(const PoseBasePtr &value)
Set the new PoseBase of the UserWaypoint.
Definition: UserWaypoint.cpp:98
PropagateConst.h