C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguy_module_dis.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  **
30  *t DI-Guy API, VR-Link DIS Module
31  **
32  *b Link against: libdiguy_module_dis
33  **
34  *b Deprecated as of DI-Guy 9.0.0; please move to the interfaces in diguy_module_net.h.
35  */
36 
37 #pragma message("WARNING: diguy_module_dis.h is deprecated as of DI-Guy 9.0, please move to the interfaces in diguy_module_net.h")
38 
39 
40 #ifndef __diguy_module_dis_H
41 #define __diguy_module_dis_H
42 
43 #include <declspec_diguy.h>
44 #include <stdlib.h> // for NULL
45 
46 class diguyScenario;
47 class diguyCharacter;
48 
49 extern "C" {
50 
51 /*****************************************************************************/
57 #ifdef CPLUSPLUS_ONLY
58 
59 /*l
60  *b Description:
61  **
62  ** This function sets the filename of the VR-Link configuration file that
63  ** will be read by the DI-Guy software. The default is "network.cfg".
64  ** This function must be called before diguy_dis_initialize().
65  **
66  *b Arguments:
67  **
68  *a cfg_file - filename of desired configuration file
69  **
70  *b Returns:
71  **
72  ** 0 on success, -1 on failure
73  **
74  *b Callable From:
75  **
76  *- - C++
77  */
78 BDI_DECLSPEC_diguy
79 int diguy_dis_set_cfg_file(const char* cfg_file);
80 
81 /*l
82  *b Description:
83  **
84  ** This function allows VR-Link to install some callbacks so that .dss
85  ** file load and save will include VR-Link-specific info.
86  **
87  ** It should be called BEFORE the scenario object is constructed.
88  **
89  *b Returns:
90  **
91  ** 0 on success, -1 on failure
92  **
93  *b Example:
94  **
95  *e diguy_dis_initialize();
96  **
97  *b Callable From:
98  **
99  *- - C++
100  */
101 BDI_DECLSPEC_diguy
103 
104 /*l
105  *b Description:
106  **
107  ** This function allows DI-Guy networking to clean up.
108  **
109  ** It should be called once, on application shutdown, after the scenario
110  ** object has been destroyed.
111  **
112  *b Returns:
113  **
114  ** 0 on success, -1 on failure
115  **
116  *b Example:
117  **
118  *e diguy_dis_deinitialize();
119  **
120  *b Callable From:
121  **
122  *- - C++
123  */
124 BDI_DECLSPEC_diguy
126 
127 
128 #endif // CPLUSPLUS_ONLY
129 
130 
131 /*l
132  *b Description:
133  **
134  ** This function tells DI-Guy that it should
135  ** start talking over VR-Link.
136  **
137  ** It should be called when DI-Guy should join an exercise.
138  **
139  *b Arguments:
140  **
141  *a scenario - pointer to the diguyScenario which will be connected to
142  *a the network
143  *a exconn - optional pointer to an existing VR-Link exercise connection
144  *a to use
145  **
146  *b Returns:
147  **
148  ** 0 on success, -1 on failure
149  **
150  *b Example:
151  **
152  *e diguy_dis_go_online(the_scenario_app);
153  **
154  *b Callable From:
155  **
156  *- - C++
157  *- - Script
158  */
159 BDI_DECLSPEC_diguy
160 int diguy_dis_go_online(diguyScenario* scenario, void* exconn = NULL);
161 
162 /*l
163  *b Description:
164  **
165  ** This function tells DI-Guy that it should read PDUs from the
166  ** network and process them. Call this function periodically.
167  **
168  *b Returns:
169  **
170  ** 0 on success, -1 on failure
171  **
172  *b Callable From:
173  **
174  *- - C++
175  *- - Script
176  */
177 BDI_DECLSPEC_diguy
178 int diguy_dis_update();
179 
180 /*l
181  *b Description:
182  **
183  ** This function returns whether DI-Guy is using user-defined
184  ** latitude/longitude coordinates for the origin of the database,
185  ** or the coordinates that come from graphics files for
186  ** scenario scene objects.
187  **
188  *b Returns:
189  **
190  ** 0 if graphics file coordinates are used;
191  ** 1 if user-defined coordinates are used
192  **
193  *b Callable From:
194  **
195  *- - C++
196  *- - Script
197  */
198 BDI_DECLSPEC_diguy
200 
201 /*l
202  *b Description:
203  **
204  ** This function tells DI-Guy that it should stop networking with VR-Link.
205  **
206  *b Returns:
207  **
208  ** 0 on success, -1 on failure
209  **
210  *b Callable From:
211  **
212  *- - C++
213  *- - Script
214  */
215 BDI_DECLSPEC_diguy
217 
218 /*l
219  *b Description:
220  **
221  ** This function queries whether DI-Guy is talking over VR-Link.
222  **
223  *b Returns:
224  **
225  ** 1 if yes, 0 if no
226  **
227  *b Callable From:
228  **
229  *- - C++
230  *- - Script
231  */
232 BDI_DECLSPEC_diguy
234 
235 /*l
236  *b Returns:
237  **
238  ** the exercise id being used by DI-Guy Networking
239  **
240  *b Callable From:
241  **
242  *- - C++
243  *- - Script
244  */
245 BDI_DECLSPEC_diguy
247 
248 /*l
249  *b Returns:
250  **
251  ** the host id being used by DI-Guy Networking
252  **
253  *b Callable From:
254  **
255  *- - C++
256  *- - Script
257  */
258 BDI_DECLSPEC_diguy
259 int diguy_dis_get_host();
260 
261 /*l
262  *b Returns:
263  **
264  ** the site id being used by DI-Guy Networking
265  **
266  *b Callable From:
267  **
268  *- - C++
269  *- - Script
270  */
271 BDI_DECLSPEC_diguy
272 int diguy_dis_get_site();
273 
274 /*l
275  *b Description:
276  **
277  ** the port number being used for DI-Guy Networking
278  **
279  *b Callable From:
280  **
281  *- - C++
282  *- - Script
283  */
284 BDI_DECLSPEC_diguy
285 int diguy_dis_get_port();
286 
287 /*l
288  *b Description:
289  **
290  ** Gets the latitude and longitude currently being used by DI-Guy
291  ** networking for the placement of the database origin.
292  **
293  *b Arguments:
294  **
295  *a lat - latitude of origin, returned; see below
296  *a lon - longitude of origin, returned; see below
297  **
298  ** lat and lon are char**'s, into which char*'s will be
299  ** placed. These char*'s point to static data owned by DI-Guy. Do not
300  ** store these pointers, and do not modify what they point to. Copy the
301  ** strings needed out of the static buffers. (Assignment of a char* to
302  ** a Microsoft CString will work very nicely, for example.)
303  **
304  ** lat and lon are expressed as strings of the form:
305  **
306  ** [-]d [N|W|S|E] or
307  ** [-]d m [N|W|S|E] or
308  ** [-]d m s [N|W|S|E]
309  **
310  ** N and E are taken as positive. S and W will negate the value otherwise
311  ** computed. d m and s are positive, floating point values, taken as
312  ** degrees, minutes, and seconds, respectively. A leading minus sign will
313  ** negate the entire value otherwise computed (so, e.g., a '-' and a 'S' will
314  ** result in a double-negation).
315  **
316  *b Returns:
317  **
318  ** 0 on success, -1 on failure
319  **
320  *b Callable From:
321  **
322  *- - C++
323  *- - Script
324  */
325 BDI_DECLSPEC_diguy
326 int diguy_dis_get_lat_lon(double* lat, double* lon);
327 
328 /*l
329  *b Description:
330  **
331  ** Gets, in UTM coordinates, the location currently being used by
332  ** DI-Guy Networking for the placement of the database origin.
333  **
334  *b Arguments:
335  **
336  *a zone - the UTM zone, returned
337  *a southzone - return value; 1 if the origin is in the southern
338  *a hemisphere, else 0
339  *a easting - return value; normalized (positive only) easting of the
340  *a database origin within the zone
341  *a northing - return value; normalized (positive only) northing of the
342  *a database origin within the zone, returned
343  **
344  *b Returns:
345  **
346  ** 0 on success, -1 on failure
347  **
348  *b Callable From:
349  **
350  *- - C++
351  *- - Script
352  */
353 BDI_DECLSPEC_diguy
354 int diguy_dis_get_utm(int* zone,
355  int* southzone,
356  double* easting,
357  double* northing);
358 
359 /*l
360  *b Description:
361  **
362  ** Sets, in UTM coordinates, the location currently being used by
363  ** DI-Guy Networking for the placement of the database origin.
364  **
365  *b Arguments:
366  **
367  *a zone - the UTM zone
368  *a southzone - 1 if the origin is in the southern hemisphere, else 0
369  *a easting - the normalized (positive only) easting of the database
370  *a origin within the zone
371  *a northing - the normalized (positive only) northing of the
372  *a database origin within the zone
373  **
374  *b Returns:
375  **
376  ** 0 on success, -1 on failure
377  **
378  *b Callable From:
379  **
380  *- - C++
381  *- - Script
382  */
383 BDI_DECLSPEC_diguy
384 int diguy_dis_set_utm(int zone,
385  int southzone,
386  double easting,
387  double northing);
388 
389 /*l
390  *b Description:
391  **
392  ** Sets the UTM zone of the location currently being used by DI-Guy
393  ** Networking for the placement of the database origin. The easting and
394  ** northing are assumed not to change.
395  **
396  *b Arguments:
397  **
398  *a zone - the utm zone
399  *a southzone - 1 if the origin is in the southern hemisphere, else 0
400  **
401  *b Returns:
402  **
403  ** 0 if successful
404  **
405  *b Callable From:
406  **
407  *- - C++
408  *- - Script
409  */
410 BDI_DECLSPEC_diguy
411 int diguy_dis_set_utm_zone(int zone, int southzone);
412 
413 /*l
414  *b Description:
415  **
416  ** Parses a string of the form
417  **
418  ** [-]d [N|W|S|E] or
419  ** [-]d m [N|W|S|E] or
420  ** [-]d m s [N|W|S|E]
421  **
422  ** N and E are taken as positive. S and W will negate the value otherwise
423  ** computed. d m and s are positive, floating point values, taken as
424  ** degrees, minutes, and seconds, respectively. A leading minus sign will
425  ** negate the entire value otherwise computed (so, e.g., a '-' and a 'S' will
426  ** result in a double-negation).
427  **
428  *b Arguments:
429  **
430  *a dmsstring - a string of the format described above
431  **
432  *b Returns:
433  **
434  ** a double precision floating point value in radians
435  **
436  *b Callable From:
437  **
438  *- - C++
439  *- - Script
440  */
441 BDI_DECLSPEC_diguy
442 double diguy_parse_dms_to_radians(const char* dmsstring);
443 
444 /*l
445  *b Description:
446  **
447  ** Returns a string of the form
448  **
449  ** d [N|W|S|E] or
450  ** d m s [N|W|S|E]
451  **
452  ** N and E are used for positive angles. S and W are used for
453  ** negative angles. In the d m s format, d and m are integers
454  ** (degrees and minutes) and s (seconds) is a floating point value. In
455  ** the d format, d (degrees) is a floating point value.
456  **
457  *b Arguments:
458  **
459  *a outbuf - a buffer into which to copy the resulting string
460  *a value - the lat or lon value to be converted into a string
461  *a is_lat - boolean indicating latitude (North/South) rather
462  *a than longitude (East/West)
463  *a is_decimal - boolean indicating that decimal degrees are
464  *a desired, rather than degrees, minutes, and seconds
465  *a value_is_degrees - boolean indicating whether the input value is
466  *a in degrees (as opposed to radians)
467  **
468  *b Callable From:
469  **
470  *- - C++
471  *- - Script
472  */
473 BDI_DECLSPEC_diguy
474 void diguy_format_lat_or_lon(char* outbuf,
475  double value,
476  bool is_lat,
477  bool is_decimal,
478  bool value_is_degrees);
479 
480 /*l
481  *b Description:
482  **
483  ** Gets the IP address currently being used by DI-Guy
484  ** networking. This address is the address to which messages are sent.
485  ** Normally, it is some kind of broadcast or multicast address.
486  **
487  *b Arguments:
488  **
489  *a ipaddr - IP address, returned; see below
490  **
491  ** ipaddr is a char**, into which a char* will be placed. This
492  ** char* points to static data owned by DI-Guy. Do not store this
493  ** pointer, and do not modify what it points to. Copy the strings you
494  ** need out of the static buffer. (Assignment of a char* to a
495  ** Microsoft CString will work very nicely, for example.)
496  **
497  ** ipaddr is a string containing 4 integers separated by periods.
498  **
499  *b Returns:
500  **
501  ** 0 if successful
502  **
503  *b Callable From:
504  **
505  *- - C++
506  *- - Script
507  */
508 BDI_DECLSPEC_diguy
509 int diguy_dis_get_ipaddr(char** ipaddr);
510 
511 /*l
512  *b Description:
513  **
514  ** Returns whether DI-Guy Networking will publish local characters
515  ** when online.
516  **
517  *i C++, Script
518  **
519  *b Arguments:
520  **
521  ** none
522  **
523  *b Returns:
524  **
525  ** 1 if enabled, 0 if not
526  */
527 BDI_DECLSPEC_diguy
529 
530 /*l
531  *b Description:
532  **
533  ** Returns whether DI-Guy Networking will display remote characters
534  ** when online.
535  **
536  *i C++, Script
537  **
538  *b Arguments:
539  **
540  ** none
541  **
542  *b Returns:
543  **
544  ** 1 if enabled, 0 if not
545  */
546 BDI_DECLSPEC_diguy
548 
549 /*l
550  *b Description:
551  **
552  ** Sets the exercise id to be used by DI-Guy Networking.
553  **
554  ** The function will fail if DI-Guy is on-line (is participating
555  ** in an exercise).
556  **
557  *i C++, Script
558  **
559  *b Arguments:
560  **
561  *a exercise - the exercise id to use
562  **
563  *b Returns:
564  **
565  ** 0 on success, -1 on failure
566  */
567 BDI_DECLSPEC_diguy
568 int diguy_dis_set_exercise(int exercise);
569 
570 /*l
571  *b Description:
572  **
573  ** Sets the host id to be used by DI-Guy Networking.
574  **
575  ** The function will fail if DI-Guy is on-line (is participating in
576  ** an exercise).
577  **
578  *i C++, Script
579  **
580  *b Arguments:
581  **
582  *a host - the host id to use; the host id identifies the local machine
583  **
584  *b Returns:
585  **
586  ** 0 on success, -1 on failure
587  */
588 BDI_DECLSPEC_diguy
589 int diguy_dis_set_host(int host);
590 
591 /*l
592  *b Description:
593  **
594  ** Sets the site id to be used by DI-Guy Networking.
595  **
596  ** The function will fail if DI-Guy is on-line (is participating in
597  ** an exercise).
598  **
599  *i C++, Script
600  **
601  *b Arguments:
602  **
603  *a site - the site id to use; the site id identifies where the local
604  *a machine is
605  **
606  *b Returns:
607  **
608  ** 0 on success, -1 on failure
609  */
610 BDI_DECLSPEC_diguy
611 int diguy_dis_set_site(int site);
612 
613 /*l
614  *b Description:
615  **
616  ** Sets the network port number to be used by DI-Guy Networking.
617  **
618  ** The function will fail if DI-Guy is on-line (is participating in
619  ** an exercise).
620  **
621  *i C++, Script
622  **
623  *b Arguments:
624  **
625  *a port - the port number to use
626  **
627  *b Returns:
628  **
629  ** 0 on success, -1 on failure
630  */
631 BDI_DECLSPEC_diguy
632 int diguy_dis_set_port(int port);
633 
634 /*l
635  *b Description:
636  **
637  ** Sets the latitude and longitude to be used by DI-Guy Networking.
638  ** The latitude and longitude are taken as the location, on Earth, of
639  ** the origin of the database.
640  **
641  ** The function will fail if DI-Guy is on-line (is participating in
642  ** an exercise).
643  **
644  *i C++, Script
645  **
646  *b Arguments:
647  **
648  *a lat - the latitude in radians, positive north
649  *a lon - the longitude in radians, positive east
650  **
651  *b Returns:
652  **
653  ** 0 on success, -1 on failure
654  */
655 BDI_DECLSPEC_diguy
656 int diguy_dis_set_lat_lon(double lat, double lon);
657 
658 /*l
659  *b Description:
660  **
661  ** Sets the IP address to be used by DI-Guy Networking. This address
662  ** is the address to which messages are sent. Normally, it is a
663  ** broadcast or multicast address.
664  **
665  ** The function will fail if DI-Guy is on-line (is participating in
666  ** an exercise).
667  **
668  *i C++, Script
669  **
670  *b Arguments:
671  **
672  *a ipaddr - the IP address
673  **
674  ** ipaddr is a string containing 4 integers separated by periods, or
675  ** the null string, which means "let DI-Guy choose the address". An
676  ** address of "0" or "0.0.0.0" means broadcast.
677  **
678  *b Returns:
679  **
680  ** 0 on success, -1 on failure
681  */
682 BDI_DECLSPEC_diguy
683 int diguy_dis_set_ipaddr(const char* ipaddr);
684 
685 /*l
686  *b Description:
687  **
688  ** Sets whether DI-Guy Networking will display remote characters.
689  **
690  ** The function will fail if DI-Guy is on-line (is participating in
691  ** an exercise).
692  **
693  *i C++, Script
694  **
695  *b Arguments:
696  **
697  *a display - pass 1 if DI-Guy Networking should display remote characters,
698  *a 0 if not
699  **
700  *b Returns:
701  **
702  ** 0 on success, -1 on failure
703  */
704 BDI_DECLSPEC_diguy
705 int diguy_dis_set_display_remote_chars(int display);
706 
707 /*l
708  *b Description:
709  **
710  ** Sets whether DI-Guy Networking will publish local characters to the
711  ** network.
712  **
713  ** This function WILL succeed even if DI-Guy is on-line (is
714  ** participating in an exercise).
715  **
716  *i C++, Script
717  **
718  *b Arguments:
719  **
720  *a publish - pass 1 if DI-Guy Networking should publish local characters
721  *a to the network, 0 if not
722  **
723  *b Returns:
724  **
725  ** 0 on success, -1 on failure
726  */
727 BDI_DECLSPEC_diguy
728 int diguy_dis_set_publish_local_chars(int publish);
729 
730 /*l
731  *b Description:
732  **
733  ** This function gets the position offset which is currently added to each character
734  ** when it is published, and subtracted from each character when it is
735  ** reflected. The offset is useful to compensate for inter-application
736  ** database location and orientation error.
737  **
738  *b Arguments:
739  **
740  *a z - z offset in meters
741  *a yaw - orientation offset in degrees
742  *a roll - orientation offset in degrees
743  *a pitch - orientation offset in degrees
744  **
745  *b Returns:
746  **
747  ** 0 on success, -1 on failure
748  */
749 BDI_DECLSPEC_diguy
750 int diguy_dis_get_position_offset(float* z, float* yaw, float* roll, float* pitch);
751 
752 /*l
753  *b Description:
754  **
755  ** This function sets the position offset which is currently added to each character
756  ** when it is published, and subtracted from each character when it is
757  ** reflected. This is useful to compensate for inter-application location
758  ** error.
759  **
760  *i THIS FUNCTION DOES NOTHING if called while VR-Link is online.
761  **
762  *b Arguments:
763  **
764  *a z - z offset in meters
765  *a yaw - orientation offset in degrees
766  *a roll - orientation offset in degrees
767  *a pitch - orientation offset in degrees
768  **
769  *b Returns:
770  **
771  ** 0 on success, -1 on failure
772  */
773 BDI_DECLSPEC_diguy
774 int diguy_dis_set_position_offset(float z, float yaw, float roll, float pitch);
775 
776 /*l
777  *b Description:
778  **
779  ** Gets whether sync mode is enabled when online.
780  **
781  *i C++, Script
782  **
783  *b Arguments:
784  **
785  ** none
786  **
787  *b Returns:
788  **
789  ** 1 if sync mode is enabled when online, 0 if not
790  */
791 BDI_DECLSPEC_diguy
793 
794 /*l
795  *b Description:
796  **
797  ** Gets whether this machine will serve as sync master when online
798  ** and in sync mode.
799  **
800  *i C++, Script
801  **
802  *b Arguments:
803  **
804  ** none
805  **
806  *b Returns:
807  **
808  ** 1 if this machine will serve as sync master when online
809  ** and in sync mode, 0 if not
810  **
811  */
812 BDI_DECLSPEC_diguy
814 
815 
816 /*l
817  *b Description:
818  **
819  ** Gets whether this machine's camera will be slaved to a remote
820  ** master when online and in sync mode and not sync master.
821  **
822  *i C++, Script
823  **
824  *b Arguments:
825  **
826  ** none
827  **
828  *b Returns:
829  **
830  ** 1 if this machine's camera will be slaved to a remote
831  ** master when online and in sync mode and not sync master,
832  ** 0 if not
833  */
834 BDI_DECLSPEC_diguy
836 /*l
837  *b Description:
838  **
839  ** Sets whether networking should use database coordinates or
840  ** not. If database coordinates are used, the database
841  ** origin is placed at the center of the earth. This makes
842  ** coordinate conversion to and from UTM unnecessary. Using
843  ** database coordinates renders ineffective any UTM-related
844  ** settings which would position the database.
845  **
846  *i C++, Script
847  **
848  *b Arguments:
849  **
850  *a use_database_coords - 1 if database coordinates should be used, else 0
851  **
852  *b Returns:
853  **
854  ** 0 if successful, -1 on failure
855  **
856  */
857 BDI_DECLSPEC_diguy
858 int diguy_dis_set_use_database_coords(int use_database_coords);
859 /*l
860  *b Description:
861  **
862  ** Sets whether networking should use user-defined coordinates or
863  ** not. If user-defined coordinates are not used, the database
864  ** origin is placed at the earth location specified in the graphics
865  ** files for the database.
866  **
867  *i C++, Script
868  **
869  *b Arguments:
870  **
871  *a x - pass 1 if user-defined coordinates should be used, else 0
872  **
873  *b Returns:
874  **
875  ** 1 if this machine's camera will be slaved to a remote master when
876  ** online and in sync mode and not sync master; 0 if not
877  */
878 BDI_DECLSPEC_diguy
880 
881 /*l
882  *b Description:
883  **
884  ** Sets whether sync mode is enabled when online.
885  **
886  ** The function will fail if DI-Guy is on-line (is participating in an
887  ** exercise).
888  **
889  *i C++, Script
890  **
891  *b Arguments:
892  **
893  *a enabled - pass 1 if sync mode should be enabled when online, 0 if not
894  **
895  *b Returns:
896  **
897  ** 0 on success, -1 on failure
898  */
899 BDI_DECLSPEC_diguy
900 int diguy_dis_set_sync_mode_enabled(int enabled);
901 
902 /*l
903  *b Description:
904  **
905  ** Sets whether this machine will serve as sync master when online
906  ** and in sync mode.
907  **
908  *i C++, Script
909  **
910  *b Arguments:
911  **
912  *a master - pass 1 if this machine will serve as sync master when online
913  *a and in sync mode, 0 if not
914  **
915  *b Returns:
916  **
917  ** 0 on success, -1 on failure
918  */
919 BDI_DECLSPEC_diguy
920 int diguy_dis_set_sync_mode_master(int master);
921 
922 /*l
923  *b Description:
924  **
925  ** Sets whether this machine's camera will be slaved to a remote
926  ** master when online and in sync mode and not sync master.
927  **
928  ** The function will fail if DI-Guy is on-line (is participating in
929  ** an exercise).
930  **
931  *i C++, Script
932  **
933  *b Arguments:
934  **
935  ** sl_cam - pass 1 if this machine's camera will be slaved to a remote
936  ** master when online and in sync mode and not sync master,
937  ** 0 if not
938  **
939  *b Returns:
940  **
941  ** 0 on success, -1 on failure
942  */
943 BDI_DECLSPEC_diguy
944 int diguy_dis_set_sync_mode_slave_cam(int sl_cam);
945 
946 /*l
947  *b Description:
948  **
949  ** This function sets the camera orientation offset to be used in
950  ** sync_mode (when VR-Link is online).
951  **
952  *b Arguments:
953  **
954  *a offset_r - orientation offset
955  *a offset_y - orientation offset
956  *a offset_p - orientation offset
957  **
958  ** yaw and pitch represent PERCENTAGES of the camera's
959  ** horizontal and vertical field of view, respectively. The
960  ** ROLL (which is in degrees) is applied first, then the yaw,
961  ** then the pitch.
962  **
963  ** A typical two screen arrangement would use yaws of 50 and -50 for the
964  ** left screen, and right screen, respectively. For three screens, the
965  ** yaws would be -100, 0, and 100.
966  **
967  ** Using percentages this way makes the screens contiguous even if the
968  ** camera's field of view changes.
969  **
970  ** THIS FUNCTION DOES NOTHING (and returns -1) if called while VR-Link is
971  ** online
972  **
973  *b Returns:
974  **
975  ** 0 on success, -1 on failure (VR-Link is online).
976  */
977 BDI_DECLSPEC_diguy
978 int diguy_dis_set_sync_mode_camera_offset(float offset_r, float offset_y, float offset_p);
979 
980 /*l
981  *b Description:
982  **
983  ** This function gets the camera orientation offset to be used in
984  ** sync_mode (when VR-Link is online).
985  **
986  *b Arguments:
987  **
988  *a offset_r - orientation offset
989  *a offset_y - orientation offset
990  *a offset_p - orientation offset
991  **
992  ** yaw and pitch represent PERCENTAGES of the camera's
993  ** horizontal and vertical field of view, respectively. The
994  ** ROLL (which is in degrees) is applied first, then the yaw,
995  ** then the pitch.
996  **
997  ** In the orientation offset the yaw and pitch
998  ** represent PERCENTAGES of the camera's horizontal and vertical field
999  ** of view, respectively. The ROLL (which is in degrees) is applied
1000  ** first, then the yaw, then the pitch.
1001  **
1002  ** A typical two screen arrangement would use yaws of 50 and -50 for the
1003  ** left screen, and right screen, respectively. For three screens, the
1004  ** yaws would be 100, 0, and -100 going from left to right.
1005  **
1006  ** Using percentages this way makes the screens contiguous even if the
1007  ** camera's field of view changes.
1008  **
1009  *b Returns:
1010  **
1011  ** 0 on success, -1 on failure
1012  **
1013  */
1014 BDI_DECLSPEC_diguy
1015 int diguy_dis_get_sync_mode_camera_offset(float* offset_r, float* offset_y, float* offset_p);
1016 
1017 /*l
1018  *b Description:
1019  **
1020  ** This function sets whether the camera will be slaved when VR-Link is
1021  ** online, in sync mode, and not sync master.
1022  **
1023  ** It can be set even when VR-Link is online.
1024  **
1025  *b Arguments:
1026  **
1027  *a slaved - whether the camera will be slaved when VR-Link is
1028  ** online, in sync mode, and not sync master.
1029  **
1030  *b Returns:
1031  **
1032  ** 0 on success, -1 on failure
1033  */
1034 BDI_DECLSPEC_diguy
1036 
1037 /*l
1038  *b Description:
1039  **
1040  ** This function gets whether the camera is currently slaved. It does NOT
1041  ** simply return what was passed to
1042  ** diguy_dis_set_sync_mode_camera_slaved().
1043  **
1044  *b Returns:
1045  **
1046  ** Whether the camera is currently slaved. This will be 1 only if
1047  ** VR-link is online, is in sync mode, and is not the sync master, and if
1048  ** sync_mode_camera_slaved has been set to 1.
1049  **
1050  */
1051 BDI_DECLSPEC_diguy
1053 
1054 /*l
1055  *b Description:
1056  **
1057  ** This function allows iteration through the list of names remote
1058  ** VR-Link hosts that DI-Guy knows about.
1059  **
1060  *b Arguments:
1061  **
1062  *a buf - destination buffer for host name (64 bytes is plenty)
1063  *a handle - return value from last call to the function; pass NULL to
1064  *a get the first host name; pass previous return value to get
1065  *a the next host name
1066  **
1067  *b Returns:
1068  **
1069  ** void* to be passed as handle argument on the next call. NULL when end
1070  ** of list is reached.
1071  */
1072 BDI_DECLSPEC_diguy
1073 void* diguy_dis_get_next_participant_name(char* buf, void* handle);
1074 
1075 /*l
1076  *b Description:
1077  **
1078  ** Lets VR-Link know that the user has moved the camera, so that if it
1079  ** is in sync mode, and is the sync master, it can let other hosts
1080  ** know the new camera position so they can move their cameras.
1081  **
1082  *b Returns:
1083  **
1084  ** 0 on success, -1 on failure
1085  */
1086 BDI_DECLSPEC_diguy
1088 
1089 /*l
1090  *b Description:
1091  **
1092  ** Fetches what character type and what appearance should be used for a
1093  ** given DIS entity type septet.
1094  **
1095  *b Arguments:
1096  **
1097  *a chartype - address of char*, for returning a string which names
1098  *a the DI-Guy character type
1099  *a appearance - address of char*, for returning a string which names
1100  *a the DI-Guy character appearance
1101  *a septet - array of seven integers specifying the kind, domain, country,
1102  *a category, subCategory, specific, and extra of the entity
1103  *a in question
1104  **
1105  *b Returns:
1106  **
1107  ** 0 on success, -1 on failure
1108  */
1109 BDI_DECLSPEC_diguy
1110 int diguy_dis_get_model_from_septet(const char** chartype, const char** appearance, const int septet[7]);
1111 
1112 /*l
1113  *b Description:
1114  **
1115  ** Fetches what DIS entity type septet should be used for a given character
1116  ** type and appearance.
1117  **
1118  *b Arguments:
1119  **
1120  *a chartype - a string which names the DI-Guy character type
1121  *a appearance - a string which names the DI-Guy character appearance
1122  *a septet - array of seven integers, returned, indicating the kind,
1123  *a domain, country, category, subCategory, specific, and
1124  *a extra of the entity in question
1125  **
1126  *b Returns:
1127  **
1128  ** 0 on success, -1 on failure
1129  */
1130 BDI_DECLSPEC_diguy
1131 int diguy_dis_get_septet_from_model(int septet[7], const char* chartype, const char* appearance);
1132 
1133 /*l
1134  *b Description:
1135  **
1136  ** Converts a 3d database-origin-relative location into a string
1137  ** describing it in earth coordinates. This string could be in a number
1138  ** of different formats including decimal lat/lon, dms lat/lon, and UTM.
1139  **
1140  *b Arguments:
1141  **
1142  *a outbuf - buffer into which to put the output string
1143  *a x, y, z - 3 floats specifying location
1144  **
1145  *b Returns:
1146  **
1147  ** 0 on success, -1 on failure. Fails if DI-Guy Scenario is not currently
1148  ** on the network, meaning that a database-to-earth coordinate conversion
1149  ** cannot be performed.
1150  */
1151 BDI_DECLSPEC_diguy
1152 int diguy_dis_get_earth_coord(char* outbuf, const float x, const float y, const float z);
1153 
1154 /*l
1155  *b Description:
1156  **
1157  ** Changes the format of the output of diguy_dis_get_earth_coord. Toggles
1158  ** between UTM, dms lat/lon, decimal lat/lon, and "punting", meaning that
1159  ** the caller of diguy_dis_get_earth_coord should fend for itself. This
1160  ** generally means that the caller will use database-origin-relative
1161  ** coordinates.
1162  **
1163  *b Arguments:
1164  **
1165  ** none
1166  **
1167  *b Returns:
1168  **
1169  ** void
1170  */
1171 BDI_DECLSPEC_diguy
1173 
1174 /*l
1175  *b Description:
1176  **
1177  ** returns the diguyCharacter associated with the entity id specified.
1178  **
1179  *b Arguments:
1180  **
1181  *a id - entity id
1182  **
1183  ** Under HLA, two formats are permitted: the HLA object name, or
1184  ** the DIS entity identifier ("site:application:entity", where each
1185  ** is an integer).
1186  **
1187  ** Under DIS, only the DIS Entity Identifier is permitted.
1188  */
1189 BDI_DECLSPEC_diguy
1191 
1192 /*l
1193  *b Description:
1194  **
1195  ** Turns the 'never create' character bit on.
1196  */
1197 BDI_DECLSPEC_diguy
1199 
1200 /*l
1201  *b Description:
1202  **
1203  ** This function returns the name corresponding to the passed
1204  ** entity.
1205  **
1206  ** The user must not delete the returned string.
1207  **
1208  *b Arguments:
1209  **
1210  *a reflected_entity - entity to be named
1211  **
1212  *b Returns:
1213  **
1214  ** entity name
1215  */
1216 BDI_DECLSPEC_diguy
1217 char* diguy_dis_get_name_from_entity(void* reflected_entity);
1218 
1219 BDI_DECLSPEC_diguy
1220 void diguy_dis_establish_new_offsets(int deprecated = 0);
1221 
1222 BDI_DECLSPEC_diguy
1223 void diguy_dis_set_send_custom_pdus(int val);
1224 
1225 BDI_DECLSPEC_diguy
1227 
1228 BDI_DECLSPEC_diguy
1230 
1231 BDI_DECLSPEC_diguy
1233 
1234 } /* extern "C" */
1235 
1236 #endif /* __diguy_module_dis_H */
1237 
1238 /*
1239  * Copyright (C) 1992-2013 Boston Dynamics
1240  * ALL RIGHTS RESERVED.
1241  *
1242  * These coded instructions, statements, and computer programs
1243  * contain unpublished proprietary information of Boston Dynamics
1244  * and are protected by Copyright Laws of the United States.
1245  * They may not be used, duplicated, or disclosed in any form, in
1246  * whole or in part, without the prior written consent from Boston
1247  * Dynamics.
1248  *
1249  * RESTRICTED RIGHTS LEGEND
1250  * Use, duplication, or disclosure by the government is subject
1251  * to restrictions as set forth in FAR 52.227.19(c)(2) or
1252  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
1253  * Computer Software clause at DFARS 252.227-7013 and/or in
1254  * similar or successor clauses in the FAR, or the DOD or NASA
1255  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
1256  * Commercial Computer Software--Restricted Rights at 48 CFR
1257  * 52.227-19, as applicable. Unpublished-rights reserved under
1258  * the Copyright Laws of the United States.
1259  * Contractor/Manufacturer is:
1260  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
1261  */