C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyWaypoint.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 1992-2013 Boston Dynamics
4  * ALL RIGHTS RESERVED.
5  *
6  * These coded instructions, statements, and computer programs
7  * contain unpublished proprietary information of Boston Dynamics
8  * and are protected by Copyright Laws of the United States.
9  * They may not be used, duplicated, or disclosed in any form, in
10  * whole or in part, without the prior written consent from Boston
11  * Dynamics.
12  *
13  * RESTRICTED RIGHTS LEGEND
14  * Use, duplication, or disclosure by the government is subject
15  * to restrictions as set forth in FAR 52.227.19(c)(2) or
16  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
17  * Computer Software clause at DFARS 252.227-7013 and/or in
18  * similar or successor clauses in the FAR, or the DOD or NASA
19  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
20  * Commercial Computer Software--Restricted Rights at 48 CFR
21  * 52.227-19, as applicable. Unpublished-rights reserved under
22  * the Copyright Laws of the United States.
23  * Contractor/Manufacturer is:
24  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
25  */
26 
27 /*********************************************************************
28  **
29  *t diguyWaypoint
30  **
31  *b Link against: libdiguy
32  */
33 
34 #ifndef __diguyWaypoint_H
35 #define __diguyWaypoint_H
36 
37 #ifdef SWIG
38 %module diguyWaypoint
39 #else
40 #define CPLUSPLUS_ONLY
41 #endif
42 
43 #ifdef CPLUSPLUS_ONLY
44 class bdiBeadWaypoint;
45 #endif
46 
47 
48 #include <declspec_diguy.h>
49 
50 /****************************************************************************/
51 class BDI_DECLSPEC_diguy diguyWaypoint
52 {
53 
54 public:
55 
56 /*****************************************************************************/
67  /*l
68  *b Description:
69  **
70  ** Returns the name of the object. This pointer will never be NULL.
71  **
72  *b Returns:
73  **
74  ** name of the object
75  */
76  const char* get_name();
77 
78  /*l
79  *b Description:
80  **
81  ** All waypoints are assigned a unique identifier, or uid. This
82  ** function returns this waypoints's uid.
83  **
84  ** *Note*: unique identifiers will change between DI-Guy runs!
85  **
86  *b Returns:
87  **
88  ** unique identifier of object
89  */
90  long get_uid();
91 
92  /*l
93  *b Returns:
94  **
95  ** 1 if waypoint is selected in DI-Guy Scenario or DI-Guy Author, 0
96  ** if not.
97  */
98  int get_selected();
99 
100 
101 
102 /*****************************************************************************/
123  /*l
124  *b Description:
125  **
126  ** This function sets the x, y, z coordinates of the waypoint in
127  ** meters.
128  **
129  ** Requires subsequent call to diguyCharacterPath::update() or
130  ** diguyPathShape::update(). (See above.)
131  **
132  *b Returns:
133  **
134  ** x, y, z coordinate of waypoint in meters
135  */
136  void set_position(float x, float y, float z);
137 
138  /*l
139  *b Description:
140  **
141  ** Double precision version of set_position().
142  */
143  void set_position_double(double x, double y, double z);
144 
145  /*l
146  *b Returns:
147  **
148  ** x, y, z coordinate of waypoint in meters
149  **
150  ** Note: in Lua this will return 3 values.
151  */
152  void get_position(float* x, float* y, float* z);
153 
154  /*l
155  *b Description:
156  **
157  ** Double precision version of get_position().
158  **
159  ** Note: in Lua this will return 3 values.
160  */
161  void get_position_double(double* tx, double* ty, double* tz);
162 
163  /*l
164  *b Description:
165  **
166  ** Sets the orientation of the path entering the waypoint.
167  **
168  ** If the angles in and angles out are coupled (e.g.,
169  ** get_yaw_coupled() returns 1) this will set rz out, as well. The
170  ** new angle out will be angle in plus the angle coupling offset.
171  **
172  ** Requires subsequent call to diguyCharacterPath::update() or
173  ** diguyPathShape::update(). (See above.)
174  **
175  *b Arguments:
176  **
177  *a rz, rx, ry - orientations in degrees
178  */
179  void set_orientation_in(float rz, float rx, float ry);
180 
181  /*l
182  *b Description:
183  **
184  ** Retrieves the orientation of the path entering the waypoint.
185  **
186  *b Arguments:
187  **
188  *a rz, rx, ry - orientations in degrees counter-clockwise from the
189  *a positive X axis
190  **
191  ** Note: in Lua this will return 3 values.
192  */
193  void get_orientation_in(float* rz, float* rx, float* ry);
194 
195  /*l
196  *b Description:
197  **
198  ** Equivalent to set_orientation_in(), but for the path exiting the
199  ** waypoint.
200  */
201  void set_orientation_out(float rz, float rx, float ry);
202 
203  /*l
204  *b Description:
205  **
206  ** Equivalent to get_orientation_in(), but for the path exiting the
207  ** waypoint.
208  **
209  ** Note: in Lua this will return 3 values.
210  */
211  void get_orientation_out(float* rz, float* rx, float* ry);
212 
213  /*l
214  *b Description:
215  **
216  ** This function sets whether the yaw in and yaw out angles are
217  ** coupled together. In general, for paths to look smooth, the in and
218  ** out angles should be coupled together with 0 coupling offset.
219  **
220  ** Requires subsequent call to diguyCharacterPath::update() or
221  ** diguyPathShape::update(). (See above.)
222  **
223  *b Arguments:
224  **
225  *a yaw_coupled - pass 1 to couple yaw in to yaw out
226  */
227  void set_yaw_coupled(int yaw_coupled);
228 
229  /*l
230  *b Returns:
231  **
232  ** whether the yaw in and yaw out angles are coupled together;
233  ** see set_yaw_coupled()
234  */
235  int get_yaw_coupled();
236 
237  /*l
238  *b Description:
239  **
240  ** This function sets by how much the yaw in and yaw out angles should
241  ** be offset when they are coupled together.
242  **
243  ** Requires subsequent call to diguyCharacterPath::update() or
244  ** diguyPathShape::update(). (See above.)
245  **
246  *b Arguments:
247  **
248  *a yaw_coupling_offset - new yaw coupling offset, in degrees
249  */
250  void set_yaw_coupling_offset(float yaw_coupling_offset);
251 
252  /*l
253  *b Returns:
254  **
255  ** the offset between yaw in and yaw out when the yaw angles are
256  ** coupled together; see set_yaw_coupling_offset()
257  */
258  float get_yaw_coupling_offset();
259 
260  /*l
261  *b Description:
262  **
263  ** This function is the same as its yaw counterpart, but rotation
264  ** is about the x axis.
265  */
266  void set_roll_coupled(int roll_coupled);
267 
268  /*l
269  *b Description:
270  **
271  ** This function is the same as its yaw counterpart, but rotation
272  ** is about the x axis.
273  */
274  int get_roll_coupled();
275 
276  /*l
277  *b Description:
278  **
279  ** This function is the same as its yaw counterpart, but rotation
280  ** is about the x axis.
281  */
282  void set_roll_coupling_offset(float roll_coupling_offset);
283 
284  /*l
285  *b Description:
286  **
287  ** This function is the same as its yaw counterpart, but rotation
288  ** is about the x axis.
289  */
290  float get_roll_coupling_offset();
291 
292  /*l
293  *b Description:
294  **
295  ** This function is the same as its yaw counterpart, but rotation
296  ** is about the y axis.
297  */
298  void set_pitch_coupled(int pitch_coupled);
299 
300  /*l
301  *b Description:
302  **
303  ** This function is the same as its yaw counterpart, but rotation
304  ** is about the y axis.
305  */
306  int get_pitch_coupled();
307 
308  /*l
309  *b Description:
310  **
311  ** This function is the same as its yaw counterpart, but rotation
312  ** is about the y axis.
313  */
314  void set_pitch_coupling_offset(float pitch_coupling_offset);
315 
316  /*l
317  *b Description:
318  **
319  ** This function is the same as its yaw counterpart, but rotation
320  ** is about the y axis.
321  */
322  float get_pitch_coupling_offset();
323 
324 
325 /*****************************************************************************
326  **
327  *2 Control Point Functions
328  **
329  ** Unless otherwise noted all functions in this class section are callable from:
330  **
331  *- - C++
332  *- - Script
333  **
334  */
335 
336  /*l
337  *b Description:
338  **
339  ** This function sets the weight of the control handle heading into
340  ** the waypoint. The weights of the waypoint set how long the
341  ** "control handles" of the waypoint are, in meters. The longer the
342  ** control handle, the more the path will be stretched in the
343  ** direction of the waypoint's orientation.
344  **
345  ** If the weight in and weight out are coupled (get_weight_coupled()
346  ** returns 1) this will set weight out, as well.
347  **
348  ** Requires subsequent call to diguyCharacterPath::update() or
349  ** diguyPathShape::update(). (See above.)
350  */
351  void set_weight_in(float weight_in);
352 
353  /*l
354  *b Returns:
355  **
356  ** weight heading into the waypoint, in meters; see set_weight_in()
357  */
358  float get_weight_in();
359 
360  /*l
361  *b Description:
362  **
363  ** Similar to set_weight_in(), but for the outgoing weight.
364  */
365  void set_weight_out(float weight_out);
366 
367  /*l
368  *b Returns:
369  **
370  ** weight heading out of the waypoint, in meters; see
371  ** set_weight_out().
372  */
373  float get_weight_out();
374 
375  /*l
376  *b Description:
377  **
378  ** This function sets whether the weight in and weight out are
379  ** coupled together.
380  **
381  ** If this waypoint is part of a diguyCharacterPath or diguyPathShape,
382  ** the diguyCharacterPath::update() or diguyPathShape::update()
383  ** function must be called for changes to take effect.
384  */
385  void set_weight_coupled(int weight_coupled);
386 
387  /*l
388  *b Returns:
389  **
390  ** whether the weight in and weight out are coupled together;
391  ** see set_weight_coupled()
392  */
393  int get_weight_coupled();
394 
395  /*l
396  *b Description:
397  **
398  ** This function returns the world position of the control point
399  ** heading into the waypoint. This is derived from the waypoint's
400  ** position, orientation in, and the weights of the in control bar.
401  */
402  void get_control_point_in_position(float* x, float* y, float* z);
403 
404  /*l
405  *b Description:
406  **
407  ** Similar to get_control_point_in_position(), but for out control
408  ** point.
409  */
410  void get_control_point_out_position(float* x, float* y, float* z);
411 
412  /*l
413  *b Description:
414  **
415  ** This function returns the normal vector of the control bar heading
416  ** into the waypoint.
417  */
418  void get_forward_normal_in(float* x, float* y, float* z);
419 
420  /*l
421  *b Description:
422  **
423  ** Similar to get_forward_normal_in(), but for left normal.
424  */
425  void get_left_normal_in(float* x, float* y, float* z);
426 
427  /*l
428  *b Description:
429  **
430  ** Similar to get_out_normal_in(), but for up normal.
431  */
432  void get_up_normal_in(float* x, float* y, float* z);
433 
434  /*l
435  *b Description:
436  **
437  ** Similar to get_forward_normal_in(), but for out control bar.
438  */
439  void get_forward_normal_out(float* x, float* y, float* z);
440 
441  /*l
442  *b Description:
443  **
444  ** Similar to get_left_normal_in(), but for out control bar.
445  */
446  void get_left_normal_out(float* x, float* y, float* z);
447 
448  /*l
449  *b Description:
450  **
451  ** Similar to get_up_normal_in(), but for out control bar.
452  */
453  void get_up_normal_out(float* x, float* y, float* z);
454 
455 
456 /*****************************************************************************/
462  /*l
463  *b Description:
464  **
465  ** This function sets how many segments the path portion this waypoint
466  ** begins will be divided into. This is strictly for visualization
467  ** purposes only and will have no functional effect.
468  **
469  ** If this waypoint is part of a diguyCharacterPath or diguyPathShape,
470  ** the diguyCharacterPath::update() or diguyPathShape::update()
471  ** function must be called for changes to take effect.
472  **
473  *b Arguments:
474  **
475  *a num_segments - number of segments to divide path portion into;
476  ** default is 64
477  */
478  void set_num_segments(int num_segments);
479 
480  /*l
481  *b Returns:
482  **
483  ** how many segments the path portion this waypoint begins will be
484  ** divided into; see set_num_segments()
485  */
486  int get_num_segments();
487 
488 
489 /****************************************************************************/
490 /****************************************************************************/
491 /****************************************************************************/
502 /****************************************************************************/
503 /****************************************************************************/
504 /****************************************************************************/
505 
506  /*l
507  ** This function is deprecated. Use set_position() instead.
508  */
509  void set_x(float x);
510 
511  /*l
512  ** This function is deprecated. Use get_position() instead.
513  */
514  float get_x();
515 
516  /*l
517  ** This function is deprecated. Use set_position() instead.
518  */
519  void set_y(float y);
520 
521  /*l
522  ** This function is deprecated. Use get_position() instead.
523  */
524  float get_y();
525 
526  /*l
527  ** This function is deprecated. Use set_position() instead.
528  */
529  void set_z(float z);
530 
531  /*l
532  ** This function is deprecated. Use get_position() instead.
533  */
534  float get_z();
535 
536  /*l
537  ** This function is deprecated. Use set_orientation_in() instead.
538  */
539  void set_yaw_in(float yaw);
540 
541  /*l
542  ** This function is deprecated. Use get_orientation_in() instead.
543  */
544  float get_yaw_in();
545 
546  /*l
547  ** This function is deprecated. Use set_orientation_out() instead.
548  */
549  void set_yaw_out(float yaw);
550 
551  /*l
552  ** This function is deprecated. Use get_orientation_out() instead.
553  */
554  float get_yaw_out();
555 
556  /*l
557  ** This function is deprecated. Use get_yaw_coupled() instead.
558  */
559  int get_yaw_smooth();
560 
561  /*l
562  ** This function is deprecated. Use set_yaw_coupled() instead.
563  */
564  void set_yaw_smooth(int yaw_smooth);
565 
566  /*l
567  ** This function is deprecated. Use get_yaw_coupling_offset()
568  ** instead.
569  */
570  float get_yaw_offset();
571 
572  /*l
573  ** This function is deprecated. Use set_yaw_coupling_offset()
574  ** instead.
575  */
576  void set_yaw_offset(float yaw_offset);
577 
578  /*l
579  ** This function is deprecated. Use set_orientation_in() instead.
580  */
581  void set_roll_in(float roll);
582 
583  /*l
584  ** This function is deprecated. Use get_orientation_in() instead.
585  */
586  float get_roll_in();
587 
588  /*l
589  ** This function is deprecated. Use set_orientation_out() instead.
590  */
591  void set_roll_out(float roll);
592 
593  /*l
594  ** This function is deprecated. Use get_orientation_out() instead.
595  */
596  float get_roll_out();
597 
598  /*l
599  ** This function is deprecated. Use get_roll_coupled() instead.
600  */
601  int get_roll_smooth();
602 
603  /*l
604  ** This function is deprecated. Use set_roll_coupled() instead.
605  */
606  void set_roll_smooth(int roll_smooth);
607 
608  /*l
609  ** This function is deprecated. Use get_roll_coupling_offset()
610  ** instead.
611  */
612  float get_roll_offset();
613 
614  /*l
615  ** This function is deprecated. Use set_roll_coupling_offset()
616  ** instead.
617  */
618  void set_roll_offset(float roll_offset);
619 
620  /*l
621  ** This function is deprecated. Use set_orientation_in() instead.
622  */
623  void set_pitch_in(float pitch);
624 
625  /*l
626  ** This function is deprecated. Use get_orientation_in() instead.
627  */
628  float get_pitch_in();
629 
630  /*l
631  ** This function is deprecated. Use set_orientation_out() instead.
632  */
633  void set_pitch_out(float pitch);
634 
635  /*l
636  ** This function is deprecated. Use get_orientation_out() instead.
637  */
638  float get_pitch_out();
639 
640  /*l
641  ** This function is deprecated. Use get_pitch_coupled() instead.
642  */
643  int get_pitch_smooth();
644 
645  /*l
646  ** This function is deprecated. Use set_pitch_coupled() instead.
647  */
648  void set_pitch_smooth(int pitch_smooth);
649 
650  /*l
651  ** This function is deprecated. Use get_pitch_coupling_offset()
652  ** instead.
653  */
654  float get_pitch_offset();
655 
656  /*l
657  ** This function is deprecated. Use get_pitch_coupling_offset()
658  ** instead.
659  */
660  void set_pitch_offset(float pitch_offset);
661 
662  /*l
663  ** This function is deprecated. Use get_weight_coupled()
664  ** instead.
665  */
666  int get_distance_smooth();
667 
668  /*l
669  ** This function is deprecated. Use set_weight_coupled()
670  ** instead.
671  */
672  void set_distance_smooth(int distance_smooth);
675 /****************************************************************************/
676 /****************************************************************************/
677 
682 #ifdef CPLUSPLUS_ONLY
683 
684  bdiBeadWaypoint* get_scripted_object() {return m_scripted_object;}
685 
686 private:
687 
688  /*l
689  ** A private constructor.
690  */
691  diguyWaypoint(bdiBeadWaypoint* waypoint);
692 
693  /*l
694  ** A private destructor.
695  */
696  ~diguyWaypoint();
697 
698  /*l
699  ** A pointer to internal data.
700  */
701  bdiBeadWaypoint* m_scripted_object;
702 
703  friend class diguyScenario;
704  friend class bdiBeadWaypoint;
705 
706 #endif
707 
708 };
709 
710 
711 #endif /* __diguyWaypoint_H */