C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyVehicleNearCollision.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 diguyVehicleNearCollision
30  **
31  *b Link against: libdiguy
32  */
33 
34 #ifndef __diguyVehicleNearCollision_H
35 #define __diguyVehicleNearCollision_H
36 
37 #ifdef SWIG
39 #else
40 #define CPLUSPLUS_ONLY
41 #endif
42 
43 #ifdef CPLUSPLUS_ONLY
44 #include <stdio.h> // for NULL
45 class diguyCharacter;
46 class diguyScenario;
47 class diguySceneObject;
48 #endif
49 
50 #include <declspec_diguy.h>
51 #include <diguy_constants.h>
52 
53 
54 /****************************************************************************/
55 class BDI_DECLSPEC_diguy diguyVehicleNearCollision
56 {
57 
58 public:
59 
60 /*****************************************************************************/
65  /*l
66  *b Returns:
67  **
68  ** speed of vehicle being approached in near collision, in m/s
69  **
70  *b Callable From:
71  **
72  *- - C++
73  *- - Script
74  **
75  */
76  float get_approached_vehicle_speed();
77 
78  /*l
79  *b Returns:
80  **
81  ** name of approached vehicle
82  **
83  *b Callable From:
84  **
85  *- - C++
86  *- - Script
87  **
88  */
89  const char* get_approached_vehicle_name();
90 
91  /*l
92  *b Returns:
93  **
94  ** speed of approaching vehicle, in m/s
95  **
96  *b Callable From:
97  **
98  *- - C++
99  *- - Script
100  **
101  */
102  float get_approaching_vehicle_speed();
103 
104  /*l
105  *b Returns:
106  **
107  ** name of approached vehicle
108  **
109  *b Callable From:
110  **
111  *- - C++
112  *- - Script
113  **
114  */
115  const char* get_approaching_vehicle_name();
116 
117  /*l
118  *b Description:
119  **
120  ** This function returns the suggested speed for the approaching
121  ** vehicle, to make it less likely that it will collide with the
122  ** approached vehicle.
123  **
124  *b Returns:
125  **
126  ** suggested speed, in m/s
127  **
128  *b Callable From:
129  **
130  *- - C++
131  *- - Script
132  **
133  */
134  float get_approaching_vehicle_suggested_speed();
135 
136  /*l
137  *b Description:
138  **
139  ** XXX
140  **
141  *b Returns:
142  **
143  ** Speed
144  **
145  *b Callable From:
146  **
147  *- - C++
148  *- - Script
149  **
150  */
151  float get_distance();
152 
153  /*l
154  *b Description:
155  **
156  ** XXX
157  **
158  *b Returns:
159  **
160  ** Speed
161  **
162  *b Callable From:
163  **
164  *- - C++
165  *- - Script
166  **
167  */
168  float get_time_to_next_check();
169 
170  /*l
171  *b Description:
172  **
173  ** XXX
174  **
175  *b Returns:
176  **
177  ** 1, if the collision is valid. If 0, there is not
178  **
179  *b Callable From:
180  **
181  *- - C++
182  *- - Script
183  **
184  */
185  int get_active() {return m_is_active;}
186 
187 #ifdef CPLUSPLUS_ONLY
188 
194 private:
195 
198  friend class bdiScenario;
200  friend class bdiScenarioCharacter;
201  friend class diguyCharacter;
202  friend class bdiScenarioVehicleController;
203 
204  /*l
205  ** A private constructor.
206  */
208  diguyCharacter* vehicle = NULL);
210  /*
211  * Private data members.
212  */
213  diguyScenario* m_scenario;
214  diguyCharacter* m_approached_vehicle;
215  diguyCharacter* m_approaching_vehicle;
216  float m_distance;
217  float m_suggested_approaching_speed;
218  float m_time_to_next_check;
219  int m_is_active;
220 
221 #endif
222 
223 };
224 
225 
226 #endif /* __diguyVehicleNearCollision_H */