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