UserWaypoint.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 USERWAYPOINT_H
25#define USERWAYPOINT_H
26
27#include <memory>
28
29#include <Eigen/Core>
30
31#include <VirtualRobot/IK/GenericIKSolver.h>
32
34
35#include <RobotAPI/interface/core/PoseBase.h>
37
38#include <RobotComponents/interface/components/RobotIK.h>
39
40namespace armarx
41{
42 using IKSelection = VirtualRobot::IKSolver::CartesianSelection;
43
44 /**
45 * @brief The UserWaypoint class represents a waypoint of the trajectory.
46 */
48 {
49 private:
50 PoseBasePtr pose;
51 std::vector<double> jointAngles;
52 IKSelection iKSelection;
53 bool isTimeOptimalBreakpoint;
54 double timeOptimalTimestamp;
55 double userTimestamp;
56
57 public:
58 /**
59 * @brief UserWaypoint
60 * @param newPose
61 */
62 UserWaypoint(PoseBasePtr newPose);
63
64 UserWaypoint(const UserWaypoint& source);
65
66 /**
67 * @brief Returns the PoseBasePtr of the UserWaypoint
68 * @return PoseBasePtr
69 */
70 PoseBasePtr getPose();
71
72 /**
73 * @brief Returns the jointAngles of the UserWaypoint
74 * @return jointAngles
75 */
76 std::vector<double> getJointAngles() const;
77
78 /**
79 * @brief Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint
80 * @return IKSelections
81 */
83
84 /**
85 * @brief Returns if the UserWaypoint is breakpoint
86 * @return
87 */
88 bool getIsTimeOptimalBreakpoint() const;
89
90 /**
91 * @brief Returns the timeOptimalTimestamp of the UserWaypoint which is calculate
92 *by the TrajectoryCalculation
93 * @return timeOptimalTimestamp
94 */
95 double getTimeOptimalTimestamp() const;
96
97 /**
98 * @brief Returns the UserTimestamp
99 * @return userTimestamp
100 */
101 double getUserTimestamp() const;
102
103 ////////SET///////////////////////////////////////////////////////
104 /**
105 * @brief Set the new PoseBase of the UserWaypoint
106 * @param new PoseBasePtr
107 */
108 void setPose(const PoseBasePtr& value);
109
110 /**
111 * @brief Set the new JointAngles of the UserWaypoint
112 * @param new JointAngles
113 */
114 void setJointAngles(const std::vector<double>& value);
115
116 /**
117 * @brief Set the new IKSelection of the UserWaypoint
118 * @param iKSelection
119 */
120 void setIKSelection(const IKSelection& value);
121
122 /**
123 * @brief Set isTimeOptimalBreakpoint
124 * @param is breakpoint or not
125 */
126 void setIsTimeOptimalBreakpoint(bool value);
127
128 /**
129 * @brief Set the time optimal timestamp of the UserWaypoint calculate by
130 * TrajectoryCalculation
131 * @param time optimal Timestamp
132 */
133 void setTimeOptimalTimestamp(double value);
134
135 /**
136 * @brief Set the new UserDuration and tests if its greater than timeOptimalTimestamp
137 * @param user timestamp
138 */
139 void setUserTimestamp(double value);
140 };
141
142 using UserWaypointPtr = std::shared_ptr<UserWaypoint>;
143} // namespace armarx
144#endif // USERWAYPOINT_H
PoseBasePtr getPose()
Returns the PoseBasePtr of the UserWaypoint.
void setIKSelection(const IKSelection &value)
Set the new IKSelection of the UserWaypoint.
double getTimeOptimalTimestamp() const
Returns the timeOptimalTimestamp of the UserWaypoint which is calculate by the TrajectoryCalculation.
std::vector< double > getJointAngles() const
Returns the jointAngles of the UserWaypoint.
void setUserTimestamp(double value)
Set the new UserDuration and tests if its greater than timeOptimalTimestamp.
UserWaypoint(PoseBasePtr newPose)
UserWaypoint.
double getUserTimestamp() const
Returns the UserTimestamp.
void setJointAngles(const std::vector< double > &value)
Set the new JointAngles of the UserWaypoint.
void setTimeOptimalTimestamp(double value)
Set the time optimal timestamp of the UserWaypoint calculate by TrajectoryCalculation.
void setPose(const PoseBasePtr &value)
Set the new PoseBase of the UserWaypoint.
bool getIsTimeOptimalBreakpoint() const
Returns if the UserWaypoint is breakpoint.
IKSelection getIKSelection() const
Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint.
void setIsTimeOptimalBreakpoint(bool value)
Set isTimeOptimalBreakpoint.
This file offers overloads of toIce() and fromIce() functions for STL container types.
VirtualRobot::IKSolver::CartesianSelection IKSelection
std::shared_ptr< UserWaypoint > UserWaypointPtr