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