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