UserWaypoint.cpp
Go to the documentation of this file.
1 #include "UserWaypoint.h"
2 
3 using namespace armarx;
4 
5 std::vector<double>
7 {
8  return jointAngles;
9 }
10 
11 void
12 UserWaypoint::setJointAngles(const std::vector<double>& value)
13 {
14  if (value.size() != 0)
15  {
16  jointAngles = value;
17  }
18  else
19  {
20  throw InvalidArgumentException("Can not setJointAngles with empty vector");
21  }
22 }
23 
26 {
27  return iKSelection;
28 }
29 
30 void
32 {
33  iKSelection = value;
34 }
35 
36 bool
38 {
39  return isTimeOptimalBreakpoint;
40 }
41 
42 void
44 {
45  isTimeOptimalBreakpoint = value;
46 }
47 
48 double
50 {
51  return timeOptimalTimestamp;
52 }
53 
54 void
56 {
57  if (value >= 0)
58  {
59  timeOptimalTimestamp = value;
60  if (timeOptimalTimestamp > userTimestamp)
61  {
62  userTimestamp = timeOptimalTimestamp;
63  }
64  }
65  else
66  {
67  throw InvalidArgumentException("TimeOptimal timestamp must be greater than or equal 0");
68  }
69 }
70 
71 double
73 {
74  return userTimestamp;
75 }
76 
77 void
79 {
80  if (value >= timeOptimalTimestamp)
81  {
82  userTimestamp = value;
83  }
84  else
85  {
86  throw InvalidArgumentException(
87  "User timestamp must be greater than or equal timeOptimal timestamp");
88  }
89 }
90 
91 PoseBasePtr
93 {
94  return pose;
95 }
96 
97 void
98 UserWaypoint::setPose(const PoseBasePtr& value)
99 {
100  pose = value;
101 }
102 
103 UserWaypoint::UserWaypoint(PoseBasePtr newPose) :
104  iKSelection(VirtualRobot::IKSolver::CartesianSelection::All),
105  isTimeOptimalBreakpoint(false),
106  timeOptimalTimestamp(0),
107  userTimestamp(0)
108 {
109  pose = newPose;
110 }
111 
113  pose(IceInternal::Handle<PoseBase>(new Pose(*PosePtr::dynamicCast(source.pose)))),
115  iKSelection(source.iKSelection),
116  isTimeOptimalBreakpoint(source.isTimeOptimalBreakpoint),
117  timeOptimalTimestamp(source.timeOptimalTimestamp),
118  userTimestamp(source.userTimestamp)
119 {
120 }
armarx::UserWaypoint::getUserTimestamp
double getUserTimestamp() const
Returns the UserTimestamp.
Definition: UserWaypoint.cpp:72
VirtualRobot
Definition: FramedPose.h:42
armarx::UserWaypoint::setUserTimestamp
void setUserTimestamp(double value)
Set the new UserDuration and tests if its greater than timeOptimalTimestamp.
Definition: UserWaypoint.cpp:78
armarx::UserWaypoint
The UserWaypoint class represents a waypoint of the trajectory.
Definition: UserWaypoint.h:47
armarx::UserWaypoint::getTimeOptimalTimestamp
double getTimeOptimalTimestamp() const
Returns the timeOptimalTimestamp of the UserWaypoint which is calculate by the TrajectoryCalculation.
Definition: UserWaypoint.cpp:49
armarx::IKSelection
VirtualRobot::IKSolver::CartesianSelection IKSelection
Definition: UserWaypoint.h:42
armarx::UserWaypoint::setIKSelection
void setIKSelection(const IKSelection &value)
Set the new IKSelection of the UserWaypoint.
Definition: UserWaypoint.cpp:31
armarx::UserWaypoint::setTimeOptimalTimestamp
void setTimeOptimalTimestamp(double value)
Set the time optimal timestamp of the UserWaypoint calculate by TrajectoryCalculation.
Definition: UserWaypoint.cpp:55
IceInternal::Handle< Pose >
armarx::UserWaypoint::getIsTimeOptimalBreakpoint
bool getIsTimeOptimalBreakpoint() const
Returns if the UserWaypoint is breakpoint.
Definition: UserWaypoint.cpp:37
armarx::UserWaypoint::setIsTimeOptimalBreakpoint
void setIsTimeOptimalBreakpoint(bool value)
Set isTimeOptimalBreakpoint.
Definition: UserWaypoint.cpp:43
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::UserWaypoint::getJointAngles
std::vector< double > getJointAngles() const
Returns the jointAngles of the UserWaypoint.
Definition: UserWaypoint.cpp:6
armarx::UserWaypoint::setJointAngles
void setJointAngles(const std::vector< double > &value)
Set the new JointAngles of the UserWaypoint.
Definition: UserWaypoint.cpp:12
armarx::NJointTaskSpaceDMPControllerMode::CartesianSelection
CartesianSelection
Definition: ControllerInterface.ice:34
IceInternal
This file is part of ArmarX.
Definition: InstrumentationI.h:16
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
armarx::UserWaypoint::UserWaypoint
UserWaypoint(PoseBasePtr newPose)
UserWaypoint.
Definition: UserWaypoint.cpp:103
armarx::UserWaypoint::getIKSelection
IKSelection getIKSelection() const
Returns the VirtualRobot::IKSolver::CartesianSelection of the UserWaypoint.
Definition: UserWaypoint.cpp:25
armarx::channels::KinematicUnitObserver::jointAngles
const KinematicUnitDatafieldCreator jointAngles("jointAngles")
armarx::Pose
The Pose class.
Definition: Pose.h:242
armarx::UserWaypoint::getPose
PoseBasePtr getPose()
Returns the PoseBasePtr of the UserWaypoint.
Definition: UserWaypoint.cpp:92
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
UserWaypoint.h
armarx::UserWaypoint::setPose
void setPose(const PoseBasePtr &value)
Set the new PoseBase of the UserWaypoint.
Definition: UserWaypoint.cpp:98