AuboCaps  0.6.0
waypoint_node.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_WAYPOINT_NODE_H
2 #define AUBO_SCOPE_WAYPOINT_NODE_H
3 
4 #include <vector>
7 
8 namespace arcs {
9 namespace aubo_scope {
10 
11 ARCS_CLASS_FORWARD(WaypointNode);
12 
14 {
15 public:
16  /**
17  * The configuration type used to determine which type of configuration this
18  * instance is.
19  */
20  enum ConfigType : int
21  {
22  /**
23  * <p>
24  * Fixed position has been selected (fixed waypoint).
25  * </p>
26  *
27  * The config instance can be cast to {@link
28  * FixedPositionWaypointNodeConfig}.
29  */
30  FIXED_POSITION = 0,
31 
32  /**
33  * <p>
34  * Variable position has been selected (variable waypoint).
35  * </p>
36  *
37  * The config instance can be cast to {@link
38  * VariablePositionWaypointNodeConfig}.
39  */
41 
42  /**
43  * Relative position has been selected (relative waypoint).
44  */
45  RELATIVE_POSITION
46  };
47 
48  /**
49  * The blend parameters type used to determine which type of blend
50  * parameters this instance is.
51  */
52  enum BlendType : int
53  {
54  /**
55  * No blend has been selected (the robot arm will stop at this point).
56  */
57  NO_BLEND = 0,
58 
59  /**
60  * Shared blend has been selected.
61  */
63 
64  /**
65  * <p>>
66  * Waypoint blend has been selected.
67  * </p>
68  *
69  * The blend instance can be cast to {@link WaypointBlendParameters}.
70  */
71  WAYPOINT_BLEND
72  };
73 
74  /**
75  * The blend parameters type used to determine which type of blend
76  * parameters this instance is.
77  */
78  enum MotionType : int
79  {
80  /**
81  * <p>
82  * Time motion parameters has been selected.
83  * </p>
84  *
85  * This instance can be cast to {@link TimeMotionParameters}.
86  */
88 
89  /**
90  * <p>
91  * Joint motion parameters has been selected.
92  * </p>
93  *
94  * This instance can be cast to {@link JointMotionParameters}.
95  */
97 
98  /**
99  * <p>
100  * Tool motion parameters has been selected.
101  * </p>
102  *
103  * This instance can be cast to {@link ToolMotionParameters}.
104  */
106 
107  /**
108  * Shared motion parameters has been selected.
109  */
110  SHARED_MOTION
111  };
112 
113  enum VariableType : int
114  {
115  /**
116  * This variable type pose parameters has been selected.
117  */
119 
120  /**
121  * This variable type joint parameters has been selected.
122  */
123  VARIABLE_JOINT
124  };
125 
127  {
128  /**
129  * The teaching location has been selected.
130  */
132 
133  /**
134  * The input offset has been selected.
135  */
136  INPUT
137  };
138 
140  {
141  /**
142  * Custom offset has been selected.
143  */
145 
146  /**
147  * Variable type has been selected.
148  */
149  VARIABLE
150  };
151 
152  enum class PositionDefinition : int
153  {
154  /**
155  * The position has not been defined.
156  */
157  UNDEFINED,
158 
159  /**
160  * <p>
161  * The position of the waypoint has been defined.
162  * </p>
163  *
164  * Cast this instance to {@link FixedPositionDefinedWaypointNodeConfig}.
165  */
166  DEFINED
167  };
168 
170  {
171  /**
172  * A variable has not been selected. This instance has no further
173  * information.
174  */
176 
177  /**
178  * <p>
179  * A variable has been selected making this config defined.
180  * </p>
181  *
182  * Cast this instance to {@link
183  * VariablePositionDefinedWaypointNodeConfig}.
184  */
185  DEFINED
186  };
187 
190  virtual ~WaypointNode();
191 
192  /**
193  * This method returns the type of configuration. Cast this instance
194  * appropriately to have access to specific getters.
195  *
196  * @return the type of this config.
197  */
198  ConfigType getConfigType();
199 
200  /**
201  * Get blend type of the waypoint
202  * @return the blend type.
203  */
204  BlendType getBlendType();
205 
206  MotionType getMotionType();
207 
208  /**
209  * Cast this instance appropriately to have access to specific getters.
210  *
211  * @return the position definition.
212  */
213  PositionDefinition getPositionDefinition();
214 
215  /**
216  * Cast this instance appropriately to have access to specific getters.
217  *
218  * @return the variable definition.
219  */
220  VariableDefinition getVariableDefinition();
221 
222  /**
223  * <p>
224  * Get the blend to be used for the movement.
225  * </p>
226  *
227  * Note that, if the configuration has not been applied to a waypoint node
228  * in the program tree, the blend value returned is a "suggested" value,
229  * since the blend may be (automatically) corrected depending on surrounding
230  * waypoints in the program tree (when it is applied to a waypoint node).
231  *
232  * @return the blend for the waypoint.
233  */
234  double getBlend();
235 
236  /**
237  * @return the joint speed to be achieved.
238  */
239  double getJointSpeed();
240 
241  /**
242  * @return the joint acceleration to use for the movement.
243  */
244  double getJointAcceleration();
245 
246  /**
247  * @return the time for the waypoint movement.
248  */
249  double getTime();
250 
251  /**
252  * @return the tool speed to be achieved.
253  */
254  double getToolSpeed();
255 
256  /**
257  * @return the tool acceleration to use for the movement
258  */
259  double getToolAcceleration();
260 
261  /**
262  * @return the waypoint position and orientation.
263  */
264  std::vector<double> getPose();
265 
266  /**
267  * @return the joint positions corresponding to the pose of the robot (when
268  * taking the TCP offset into account)
269  */
270  std::vector<double> getJointPositions();
271 
272  /**
273  * @return the pose for the TCP offset (used when defining the robot
274  * position)
275  */
276  std::vector<double> getTcpOffset();
277 
278  /**
279  * @return the variable for the waypoint.
280  */
281  VariablePtr getVariable();
282 
283  /**
284  * <p>
285  * Creates shared motion parameters for a waypoint.
286  * </p>
287  *
288  * Can be used for waypoints under a MoveJ, MoveL or a MoveP.
289  *
290  * @return the motion parameters for the waypoint.
291  */
292  void setSharedMotionParameters();
293 
294  /**
295  * <p></p>
296  * Creates time motion parameters for a waypoint.
297  * </p>
298  *
299  * Can be used for waypoints under a MoveJ or a MoveL.
300  *
301  * @param duration the time the movement should take, not <code>null</code>.
302  * @param errorHandler error handler for handling validation. If using
303  * {@link ErrorHandler#AUTO_CORRECT} this will clamp the value to the
304  * nearest valid time value.
305  * @return the time motion parameters for the waypoint.
306  */
307  void setTimeMotionParameters(unsigned int duration);
308 
309  /**
310  * <p>
311  * Creates joint motion parameters for a waypoint.
312  * </p>
313  *
314  * Can be used for waypoints under a MoveJ.
315  *
316  * @param jointSpeed the joint speed to be achieved, not <code>null</code>.
317  * @param jointSpeedErrorHandler error handler for handling validation. If
318  * using {@link ErrorHandler#AUTO_CORRECT} this will clamp the value to the
319  * nearest valid joint speed value.
320  * @param joint_acceleration the joint acceleration to be used for the
321  * movement, not <code>null</code>.
322  * @param joint_accelerationErrorHandler error handler for handling
323  * validation. If using {@link ErrorHandler#AUTO_CORRECT} this will clamp
324  * the value to the nearest valid joint acceleration value.
325  * @return the joint motion parameters for the waypoint.
326  */
327  void setJointMotionParameters(double joint_speed,
328  double joint_acceleration);
329 
330  /**
331  * <p>
332  * Creates tool motion parameters for a waypoint.
333  * </p>
334  *
335  * Can be used for waypoints under a MoveL or a MoveP.
336  *
337  * @param tool_speed the tool speed to be achieved, not <code>null</code>.
338  * @param tool_speedErrorHandler error handler for handling validation. If
339  * using {@link ErrorHandler#AUTO_CORRECT} this will clamp the value to the
340  * nearest valid tool speed value.
341  * @param tool_acceleration the tool acceleration to be used for the
342  * movement, not <code>null</code>.
343  * @param tool_accelerationErrorHandler error handler for handling
344  * validation. If using {@link ErrorHandler#AUTO_CORRECT} this will clamp
345  * the value to the nearest valid tool acceleration value.
346  * @return the tool motion parameters for the waypoint.
347  */
348  void setToolMotionParameters(double tool_speed, double tool_acceleration);
349 
350  /**
351  * <p>
352  * Creates a fixed position configuration with default values for a
353  * waypoint.
354  * </p>
355  *
356  * Note that these default values may change between AuboScope versions.
357  *
358  * @return the waypoint configuration.
359  */
360  void setFixedPositionConfig();
361 
362  /**
363  * <p>
364  * Creates a fixed position configuration for a waypoint with a defined
365  * pose.
366  * </p>
367  *
368  * @param pose_including_tcp the position and orientation for the waypoint,
369  * not <code>null</code>.
370  * @param qNear the joint positions that will be used for the inverse
371  * kinematics calculations as a robot configuration near the waypoint pose,
372  * not <code>null</code>.
373  * @param blendParameters the blend parameters for the waypoint, not
374  * <code>null</code>.
375  * @param waypoint_motion_parameters the motion parameters for the waypoint,
376  * not <code>null</code>.
377  * @return the waypoint configuration.
378  */
379  void setFixedPositionConfig(const std::vector<double> &pose_including_tcp,
380  const std::vector<double> &qNear);
381 
382  /**
383  * <p>
384  * Creates a variable position configuration with default values for a
385  * waypoint
386  * </p>
387  *
388  * Note that these default values may change between AuboScope versions.
389  *
390  * @return the waypoint configuration.
391  */
392  void setVariablePositionConfig();
393 
394  /**
395  * Creates a variable position configuration for a waypoint with a defined
396  * variable
397  *
398  * @param variable the variable position and orientation for the waypoint,
399  * not <code>null</code>.
400  * @param blendParameters the blend parameters for the waypoint, not
401  * <code>null</code>.
402  * @param waypoint_motion_parameters the motion parameters for the waypoint,
403  * not <code>null</code>.
404  * @return the waypoint configuration.
405  */
406  void setVariablePositionConfig(VariablePtr variable);
407 
408 private:
409  friend class DataSwitch;
410  WaypointNode();
411  void *d_{ nullptr };
412 };
413 
414 } // namespace aubo_scope
415 } // namespace arcs
416 #endif // AUBO_SCOPE_WAYPOINT_NODE_H
ARCS_CLASS_FORWARD(GripForceCapability)
BlendType
The blend parameters type used to determine which type of blend parameters this instance is...
Definition: waypoint_node.h:52
MotionType
The blend parameters type used to determine which type of blend parameters this instance is...
Definition: waypoint_node.h:78
A variable has not been selected.
This variable type pose parameters has been selected.
Shared blend has been selected.
Definition: waypoint_node.h:62
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16
The teaching location has been selected.
ConfigType
The configuration type used to determine which type of configuration this instance is...
Definition: waypoint_node.h:20
Custom offset has been selected.