Transition.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 TRANSITION_H
25 #define TRANSITION_H
26 
28 
29 #include "../Interpolation/InterpolationType.h"
30 #include "UserWaypoint.h"
31 
32 namespace armarx
33 {
35 
36  class Transition
37  {
38 
39  private:
40  UserWaypointPtr start;
41  UserWaypointPtr end;
42  double timeOptimalDuration;
43  double userDuration;
44  InterpolationType interpolationType;
45  TrajectoryPtr trajectory = TrajectoryPtr(new Trajectory());
46 
47 
48  public:
49  /**
50  * @brief Transition
51  * @param newStart
52  * @param newEnd
53  */
54  Transition(UserWaypointPtr& newStart, UserWaypointPtr& newEnd);
55  /**
56  * @brief Deep copy constructor of the class Transition.
57  * @param source to copy
58  */
60  const UserWaypointPtr newStart,
61  const UserWaypointPtr newEnd);
62 
63  ///////GET///////////////////////////////////////////////////////////////////////
64  /**
65  * @brief Returns the user duration of the transition.
66  * @return user duration
67  */
68  double getUserDuration() const;
69 
70  /**
71  * @brief Returns the time optimal duration calculated by TrajectoryCalculation
72  * @return time optimal duration
73  */
74  double getTimeOptimalDuration() const;
75 
76  /**
77  * @brief Returns the interpolation type of the transition.
78  * @see InterpolationType
79  * @return
80  */
82 
83  /**
84  * @brief Returns the armarx::Trajectory of the transition
85  * @return trajectory
86  */
88 
89  /**
90  * @brief Returns the start UserWaypoint of the transition
91  * @return start user waypoint
92  */
94 
95  /**
96  * @brief Returns the end UserWaypoint of the transition
97  * @return end user waypoint
98  */
100 
101 
102  ////////SET//////////////////////////////////////////////////////////////////////
103  /**
104  * @brief Set the user duration of the transition and tests if it is greater than
105  * the time optimal duration. Updates the user timestamps of the start and end
106  * UserWaypoint.
107  * @param value
108  */
109  void setUserDuration(double value);
110 
111  /**
112  * @brief set the time optimal duration and set the userDuration
113  * if its less than time optimal duration
114  * @param value time
115  */
116  void setTimeOptimalDuration(double value);
117 
118  /**
119  * @brief Set the intpolation type of the transition
120  * @param vlaue interpolation type
121  */
123 
124  /**
125  * @brief set the time optimal trajectory of the transition
126  * @param value trajectory
127  */
128  void setTrajectory(const TrajectoryPtr& value);
129 
130  /**
131  * @brief set the start userwaypoint of the transition
132  * @param value start
133  */
134  void setStart(const UserWaypointPtr& value);
135 
136  /**
137  * @brief set the end userwaypoint of the transition
138  * @param value end
139  */
140  void setEnd(const UserWaypointPtr& value);
141  };
142 
143  using TransitionPtr = std::shared_ptr<Transition>;
144 
145 } // namespace armarx
146 
147 
148 #endif // TRANSITION_H
armarx::Transition::getTrajectory
TrajectoryPtr getTrajectory()
Returns the armarx::Trajectory of the transition.
Definition: Transition.cpp:71
armarx::UserWaypointPtr
std::shared_ptr< UserWaypoint > UserWaypointPtr
Definition: UserWaypoint.h:142
armarx::Transition::setTimeOptimalDuration
void setTimeOptimalDuration(double value)
set the time optimal duration and set the userDuration if its less than time optimal duration
Definition: Transition.cpp:40
armarx::Transition::setStart
void setStart(const UserWaypointPtr &value)
set the start userwaypoint of the transition
Definition: Transition.cpp:89
armarx::Transition::setInterpolationType
void setInterpolationType(const InterpolationType &value)
Set the intpolation type of the transition.
Definition: Transition.cpp:65
armarx::Transition::setEnd
void setEnd(const UserWaypointPtr &value)
set the end userwaypoint of the transition
Definition: Transition.cpp:108
armarx::Transition::setTrajectory
void setTrajectory(const TrajectoryPtr &value)
set the time optimal trajectory of the transition
Definition: Transition.cpp:77
armarx::Transition::getEnd
UserWaypointPtr getEnd()
Returns the end UserWaypoint of the transition.
Definition: Transition.cpp:102
IceInternal::Handle< Trajectory >
armarx::Transition::getTimeOptimalDuration
double getTimeOptimalDuration() const
Returns the time optimal duration calculated by TrajectoryCalculation.
Definition: Transition.cpp:34
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::InterpolationType
InterpolationType
The InterpolationType enum lists all available interpolation types eLinearInterpolation: represents l...
Definition: InterpolationType.h:32
armarx::TransitionPtr
std::shared_ptr< Transition > TransitionPtr
Definition: Transition.h:143
armarx::Transition
Definition: Transition.h:36
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
armarx::TrajectoryPtr
IceInternal::Handle< Trajectory > TrajectoryPtr
Definition: Trajectory.h:52
armarx::VariantType::Trajectory
const VariantTypeId Trajectory
Definition: Trajectory.h:44
Trajectory.h
armarx::Transition::Transition
Transition(UserWaypointPtr &newStart, UserWaypointPtr &newEnd)
Transition.
Definition: Transition.cpp:120
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::Transition::getInterpolationType
InterpolationType getInterpolationType() const
Returns the interpolation type of the transition.
Definition: Transition.cpp:59
UserWaypoint.h
armarx::Transition::getUserDuration
double getUserDuration() const
Returns the user duration of the transition.
Definition: Transition.cpp:6
armarx::Transition::setUserDuration
void setUserDuration(double value)
Set the user duration of the transition and tests if it is greater than the time optimal duration.
Definition: Transition.cpp:12
armarx::Transition::getStart
UserWaypointPtr getStart()
Returns the start UserWaypoint of the transition.
Definition: Transition.cpp:83