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
30#include "UserWaypoint.h"
31
32namespace armarx
33{
35
37 {
38
39 private:
40 UserWaypointPtr start;
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 */
59 Transition(const Transition& source,
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 */
122 void setInterpolationType(const InterpolationType& value);
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
The Trajectory class represents n-dimensional sampled trajectories.
Definition Trajectory.h:77
UserWaypointPtr getStart()
Returns the start UserWaypoint of the transition.
void setInterpolationType(const InterpolationType &value)
Set the intpolation type of the transition.
double getTimeOptimalDuration() const
Returns the time optimal duration calculated by TrajectoryCalculation.
Transition(UserWaypointPtr &newStart, UserWaypointPtr &newEnd)
Transition.
void setUserDuration(double value)
Set the user duration of the transition and tests if it is greater than the time optimal duration.
void setEnd(const UserWaypointPtr &value)
set the end userwaypoint of the transition
double getUserDuration() const
Returns the user duration of the transition.
Definition Transition.cpp:6
InterpolationType getInterpolationType() const
Returns the interpolation type of the transition.
void setTrajectory(const TrajectoryPtr &value)
set the time optimal trajectory of the transition
TrajectoryPtr getTrajectory()
Returns the armarx::Trajectory of the transition.
UserWaypointPtr getEnd()
Returns the end UserWaypoint of the transition.
void setStart(const UserWaypointPtr &value)
set the start userwaypoint of the transition
void setTimeOptimalDuration(double value)
set the time optimal duration and set the userDuration if its less than time optimal duration
This file offers overloads of toIce() and fromIce() functions for STL container types.
TrajectoryPtr TrajectoryConstPtr
Definition Transition.h:34
IceInternal::Handle< Trajectory > TrajectoryPtr
Definition Trajectory.h:52
InterpolationType
The InterpolationType enum lists all available interpolation types eLinearInterpolation: represents l...
std::shared_ptr< Transition > TransitionPtr
Definition Transition.h:143
std::shared_ptr< UserWaypoint > UserWaypointPtr