25 #ifndef DESIGNERTRAJECTORYMANAGER_H
26 #define DESIGNERTRAJECTORYMANAGER_H
32 #include <RobotAPI/interface/core/PoseBase.h>
33 #include <RobotComponents/interface/components/RobotIK.h>
35 #include <MotionPlanning/Planner/BiRrt.h>
36 #include <MotionPlanning/CSpace/CSpaceSampled.h>
38 #include "../Interpolation/InterpolationType.h"
39 #include "../Model/DesignerTrajectory.h"
40 #include "../KinematicSolver.h"
41 #include "../Environment.h"
42 #include "../Interpolation/InterpolationSegmentFactory.h"
43 #include "../TrajectoryCalculation/DesignerTrajectoryCalculator.h"
61 struct ManipulationInterval
64 std::list<UserWaypointPtr> userWaypointsList;
65 std::list<TransitionPtr> transitionsList;
67 std::set<int> breakpointIndicesSet;
80 unsigned int upperIntervalLimit;
81 unsigned int lowerIntervalLimit;
83 std::vector<UserWaypointPtr> userWaypoints;
84 std::vector<TransitionPtr> transitions;
91 std::vector<unsigned int> breakpointIndices;
94 std::vector<std::vector<PoseBasePtr>> interpolatedTransitions;
97 std::vector<unsigned int> newIndexOfUserWaypoint;
102 void addBreakpointIndex(
int index);
109 TransitionPtr getTransitionByRealIndex(
unsigned int i)
const;
110 TransitionPtr getTransitionByZeroBasedIndex(
unsigned int i)
const;
112 std::vector<std::vector<double>> getUserWaypointsIKSolutions(
113 std::vector<std::vector<double>>& ikSolutions,
114 unsigned int intervalStart,
115 unsigned int intervalEnd);
116 void applyJointAnglesOfUserWaypoints(std::vector<std::vector<double>> ikSolution);
119 struct InsertTransition
122 unsigned int transitionIndex;
126 unsigned int insertionIndex;
131 std::list<DesignerTrajectoryPtr> mementoList;
132 unsigned int currentMemento = 0;
138 VirtualRobot::RobotNodeSetPtr rns;
141 bool isInitialized =
false;
143 static const unsigned int MEMENTO_MAX = 20;
144 static const unsigned int DEFAULT_FRAME_COUNT = 100;
145 static constexpr
double MAX_DEVIATION = 0.0001;
193 ManipulationInterval calculateManipulationInterval(
194 unsigned int manipulationIndex);
204 std::vector<AbstractInterpolationPtr> getInterpolationObjects(
205 ManipulationInterval& mi);
214 void calculateInterpolatedPoints(
215 std::vector<AbstractInterpolationPtr> interpolationObjects,
217 ManipulationInterval& mi);
226 bool checkTransitionReachability(ManipulationInterval& mi,
unsigned int transitionIndex);
251 std::vector<std::vector<double>> calculateIKSolutions(
252 ManipulationInterval& mi
261 std::vector<TimedTrajectory> calculateTimeOptimalTrajectories(
262 std::vector<std::vector<double>> ikSolutions,
263 ManipulationInterval& mi);
265 void theUniversalMethod(
unsigned int index);
267 std::vector<double> getNewIkSolutionOfFirstPoint(PoseBasePtr oldStart, PoseBasePtr newStart, std::vector<double> jointAnglesOldStart);
405 #endif // DESIGNERTRAJECTORYMANAGER_H