DesignerTrajectory.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 DESIGNERTRAJECTORY_H
25#define DESIGNERTRAJECTORY_H
26
27
28#include <VirtualRobot/RobotNodeSet.h>
29
30#include "Transition.h"
31#include "UserWaypoint.h"
32
33namespace armarx
34{
35
37 {
38
39 private:
40 const unsigned int DERIVATION_COUNT = 2;
41 std::vector<TrajectoryPtr> interBreakpointTrajectories;
42 std::vector<UserWaypointPtr> userWaypoints;
43 std::vector<TransitionPtr> transitions;
44 VirtualRobot::RobotNodeSetPtr rns;
45
46 std::vector<std::vector<double>> getDimensionDatas();
47 std::vector<double> getAllTimestamps();
48 void setLimitless(TrajectoryPtr traj, VirtualRobot::RobotNodeSetPtr rns);
49
50
51 public:
52 DesignerTrajectory(UserWaypointPtr& firstPoint, VirtualRobot::RobotNodeSetPtr newRns);
53
54 /**
55 * @brief Deep copy constructor of designerTrajectory
56 * @param source designertrajectory to copy
57 */
59
60 /**
61 * @brief add a new first userWaypoint
62 * @param point userwaypoint
63 */
65
66 /**
67 * @brief add new last userWaypoint
68 * @param point userwaypoint
69 */
71
72 /**
73 * @brief insert userwaypoint before index
74 * @param point userwaypoint
75 * @param index index
76 */
77 void insertUserWaypoint(UserWaypointPtr& point, unsigned int index);
78
79 /**
80 * @brief delete the userwaypoint and remove all transitions including the userwaypoint.
81 * Creates new transition if necessary
82 * @param index index of userwaypoint
83 */
84 void deleteUserWaypoint(unsigned int index);
85
86 /**
87 * @brief get the number of the userwaypoints
88 * @return number
89 */
90 unsigned int getNrOfUserWaypoints() const;
91
92 /**
93 * @brief get the userWaypoint
94 * @param index index of userwaypoint
95 * @return the userwaypoint
96 */
98
99 /**
100 * @brief get the transition
101 * @param index index of transition
102 * @return the transition
103 */
104 TransitionPtr getTransition(unsigned int index);
105
106 /**
107 * @brief get the time optimal trajectory. Calculated out of all breakpoint trajectories.
108 * @return time optimal Trajectory
109 */
111
112 /**
113 * @brief get one interBreakPoint trajectory
114 * @param index the index
115 * @return interBreakpointTrajectorie
116 */
118
119 /**
120 * @brief get a copy of all userwaypoints
121 * @return all userwaypoints
122 */
123 std::vector<UserWaypointPtr> getAllUserWaypoints() const;
124
125 /**
126 * @brief get all userwaypoints
127 * @return all userwaypoints
128 */
129 std::vector<UserWaypointPtr> getAllUserWaypoints();
130
131 /**
132 * @brief get the final trajectory with the right durations
133 * @return trajectory
134 */
136
137 /**
138 * @brief get the robot node set of the designertrajectory
139 * @return robotnodeset
140 */
141 VirtualRobot::RobotNodeSetPtr getRns();
142
143 /**
144 * @brief Returns the interBreakpointTrajectories
145 * @return interBreakpointTrajectories
146 */
147 std::vector<TrajectoryPtr> getInterBreakpointTrajectories();
148
149
150 /**
151 * @brief set the robotnodeset
152 * @param value robotnodeset
153 */
154 void setRns(const VirtualRobot::RobotNodeSetPtr& value);
155
156 /**
157 * @brief set the interBreakpointTrajectories
158 * @param value interBreakpointTrajectories
159 */
160 void setInterBreakpointTrajectories(const std::vector<TrajectoryPtr>& value);
161 };
162
163 using DesignerTrajectoryPtr = std::shared_ptr<DesignerTrajectory>;
164} // namespace armarx
165
166#endif // DESIGNERTRAJECTORY_H
uint8_t index
void insertUserWaypoint(UserWaypointPtr &point, unsigned int index)
insert userwaypoint before index
void addFirstUserWaypoint(UserWaypointPtr &point)
add a new first userWaypoint
void setRns(const VirtualRobot::RobotNodeSetPtr &value)
set the robotnodeset
void setInterBreakpointTrajectories(const std::vector< TrajectoryPtr > &value)
set the interBreakpointTrajectories
DesignerTrajectory(UserWaypointPtr &firstPoint, VirtualRobot::RobotNodeSetPtr newRns)
UserWaypointPtr getUserWaypoint(unsigned int index)
get the userWaypoint
TransitionPtr getTransition(unsigned int index)
get the transition
std::vector< UserWaypointPtr > getAllUserWaypoints() const
get a copy of all userwaypoints
TrajectoryPtr getTimeOptimalTrajectory()
get the time optimal trajectory.
TrajectoryPtr getTrajectorySegment(unsigned int index)
get one interBreakPoint trajectory
VirtualRobot::RobotNodeSetPtr getRns()
get the robot node set of the designertrajectory
unsigned int getNrOfUserWaypoints() const
get the number of the userwaypoints
std::vector< TrajectoryPtr > getInterBreakpointTrajectories()
Returns the interBreakpointTrajectories.
TrajectoryPtr getFinalTrajectory()
get the final trajectory with the right durations
void deleteUserWaypoint(unsigned int index)
delete the userwaypoint and remove all transitions including the userwaypoint.
void addLastUserWaypoint(UserWaypointPtr &point)
add new last userWaypoint
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Trajectory > TrajectoryPtr
Definition Trajectory.h:52
std::shared_ptr< Transition > TransitionPtr
Definition Transition.h:143
std::shared_ptr< DesignerTrajectory > DesignerTrajectoryPtr
std::shared_ptr< UserWaypoint > UserWaypointPtr