Kuon  1.1.3
RoadNarrows Robotics Large Outdoor Mobile Robot Project
mousebot.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: mousebot
4 //
5 // File: mousebot.h
6 //
7 /*! \file
8  *
9  * $LastChangedDate: 2012-04-26 12:16:42 -0600 (Thu, 26 Apr 2012) $
10  * $Rev: 1899 $
11  *
12  * \brief RoadNarrows MouseBot robot top-level header file.
13  *
14  * \author Robin Knight (robin.knight@roadnarrows.com)
15  * \author Rob Shiely (rob@roadnarrows.com)
16  * \author Daniel Packard (daniel@roadnarrows.com)
17  *
18  * \copyright
19  * \h_copy 2010-2017. RoadNarrows LLC.\n
20  * http://www.roadnarrows.com\n
21  * All Rights Reserved
22  */
23 // Permission is hereby granted, without written agreement and without
24 // license or royalty fees, to use, copy, modify, and distribute this
25 // software and its documentation for any purpose, provided that
26 // (1) The above copyright notice and the following two paragraphs
27 // appear in all copies of the source code and (2) redistributions
28 // including binaries reproduces these notices in the supporting
29 // documentation. Substantial modifications to this software may be
30 // copyrighted by their authors and need not follow the licensing terms
31 // described here, provided that the new terms are clearly indicated in
32 // all files where they apply.
33 //
34 // IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY MEMBERS/EMPLOYEES
35 // OF ROADNARROW LLC OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
36 // PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
37 // DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
38 // EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
39 // THE POSSIBILITY OF SUCH DAMAGE.
40 //
41 // THE AUTHOR AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
42 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
43 // FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
44 // "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
45 // PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
46 //
47 ////////////////////////////////////////////////////////////////////////////////
48 
49 #ifndef _MOUSEBOT_H
50 #define _MOUSEBOT_H
51 
52 #include "rnr/rnrconfig.h"
53 #include "rnr/units.h"
54 #include "rnr/log.h"
55 
56 #ifndef SWIG
57 C_DECLS_BEGIN
58 #endif // SWIG
59 
60 // ---------------------------------------------------------------------------
61 // Defines and Types
62 // ---------------------------------------------------------------------------
63 
64 /*!
65  * \ingroup mousebot_ecodes
66  *
67  * \{
68  */
69 #define MOUSEBOT_OK 0 ///< not an error, success
70 
71 #define MOUSEBOT_ECODE_GEN 1 ///< general, unspecified error
72 #define MOUSEBOT_ECODE_LIBKB 2 ///< libkorebot error
73 #define MOUSEBOT_ECODE_LIBKB_RECV 3 ///< libkorebot bad knet receive
74 #define MOUSEBOT_ECODE_LIBKB_SEND 4 ///< libkorebot bad knet send
75 #define MOUSEBOT_ECODE_BAD_UNITS 5 ///< unsupported or bad units
76 #define MOUSEBOT_ECODE_BAD_VAL 6 ///< bad value
77 #define MOUSEBOT_ECODE_SYS 7 ///< system (errno) error
78 #define MOUSEBOT_ECODE_INTERNAL 8 ///< internal error (bug)
79 
80 #define MOUSEBOT_ECODE_BADEC 9 ///< bad error code
81 
82 #define MOUSEBOT_ECODE_NUMOF 10 ///< number of error codes
83 /*! \} */
84 
85 
86 // Limits
87 #define MOUSEBOT_INT_MAX 2147483647 ///< integer maximum
88 #define MOUSEBOT_INT_MIN (-MOUSEBOT_INT_MAX-1) ///< integer minimum
89 
90 /*!
91  * \ingroup k3_dimensions
92  *
93  * \{
94  */
95 // Dimensions
96 #define MOUSEBOT_BASE_MAX_RADIUS_MM 65 ///< maximum base radius (mm)
97 #define MOUSEBOT_BASE_MAX_HEIGHT_MM 70 ///< maximum base height (mm)
98 #define MOUSEBOT_BASE_WHEEL_BASE_MM 90 ///< wheel-to-wheel base (mm)
99 #define MOUSEBOT_BASE_WHEEL_DIAM_MM 41 ///< wheel diameter (mm)
100 /*! \} */
101 
102 /*!
103  * \ingroup k3_motor_prop
104  *
105  * \{
106  */
107 // Motor and Odometrey Properties
108 #define MOUSEBOT_MOTOR_LEFT 0 ///< left motor id
109 #define MOUSEBOT_MOTOR_RIGHT 1 ///< right motor id
110 #define MOUSEBOT_MOTOR_NUMOF 2 ///< total number of motors
111 #define MOUSEBOT_SPEED_MIN_ABS 2000
112  ///< practical absolute minimum controlled raw spead
113 #define MOUSEBOT_SPEED_MAX_ABS 65535
114  ///< practical absolute maximum controlled raw spead
115 #define MOUSEBOT_POS_PROF_MIN_SPEED MOUSEBOT_SPEED_MIN_ABS
116  ///< move to position profile minimum raw spead
117 #define MOUSEBOT_POS_PROF_MAX_SPEED 32767
118  ///< move to position profile maximum raw spead
119 #define MOUSEBOT_POS_PROF_MIN_ACCEL 10
120  ///< move to position profile minimum acceleration to position
121 #define MOUSEBOT_POS_PROF_MAX_ACCEL 255
122  ///< move to position profile maximum acceleration to position
123 #define MOUSEBOT_OD_MIN (MOUSEBOT_INT_MIN+1)
124  ///< minimum odometer position negative raw value
125 #define MOUSEBOT_OD_MAX (MOUSEBOT_INT_MAX-1)
126  ///< maximum odometer position positve raw value
127 #define MOUSEBOT_OD_UM_PER_STEP 47 ///< micrometers per odometer step
128 #define MOUSEBOT_OD_NUMOF 2
129  ///< total number of odometers (one per motor)
130 /*! \} */
131 
132 /*!
133  * \ingroup k3_ir_prop
134  *
135  * \{
136  */
137 // Infrared Sensors Properties (degrees as viewed from top, x-axis forward)
138 #define MOUSEBOT_IR_POS_BACK_LEFT 0 ///< back left 135\h_deg infrared sensor
139 #define MOUSEBOT_IR_POS_LEFT_90 1 ///< left 90\h_deg infrared sensor
140 #define MOUSEBOT_IR_POS_LEFT_45 2 ///< left 45\h_deg infrared sensor
141 #define MOUSEBOT_IR_POS_FRONT_LEFT 3 ///< front left 10\h_deg infrared sensor
142 #define MOUSEBOT_IR_POS_FRONT_RIGHT 4 ///< front right -10\h_deg infrared sensor
143 #define MOUSEBOT_IR_POS_RIGHT_45 5 ///< right -45\h_deg infrared sensor
144 #define MOUSEBOT_IR_POS_RIGHT_90 6 ///< right -90\h_deg infrared sensor
145 #define MOUSEBOT_IR_POS_BACK_RIGHT 7 ///< back right -135\h_deg infrared sensor
146 #define MOUSEBOT_IR_POS_BACK 8 ///< back 180\h_deg infrared sensor
147 #define MOUSEBOT_IR_POS_GROUND_RIGHT 9 ///< bottom right infrared sensor
148 #define MOUSEBOT_IR_POS_GROUND_LEFT 10 ///< bottom left infrared sensor
149 #define MOUSEBOT_IR_NUMOF 11 ///< total number of ir sensors
150 #define MOUSEBOT_IR_VAL_MIN 0 ///< minimum ir sensor raw value
151 #define MOUSEBOT_IR_VAL_MAX 4095 ///< maximum ir sensor value (12-bit)
152 #define MOUSEBOT_IR_GRP_FRONT 0 ///< front infrared group [3, 4]
153 #define MOUSEBOT_IR_GRP_RIGHT 1 ///< right infrared group [5, 6, 7]
154 #define MOUSEBOT_IR_GRP_BACK 2 ///< back infrared group [0, 8, 7]
155 #define MOUSEBOT_IR_GRP_LEFT 3 ///< left infrared group [0, 1, 2]
156 #define MOUSEBOT_IR_GRP_GROUND 4 ///< bottom infrared group [9, 10]
157 /*! \} */
158 
159 /*!
160  * \ingroup k3_uss_prop
161  *
162  * \{
163  */
164 // UltraSonic Sensors Properties (degrees as viewed from top, x-axis forward)
165 #define MOUSEBOT_USS_POS_LEFT_90 0 ///< left 90\h_deg uss
166 #define MOUSEBOT_USS_POS_LEFT_45 1 ///< left 45\h_deg uss
167 #define MOUSEBOT_USS_POS_FRONT 2 ///< front 0\h_deg uss
168 #define MOUSEBOT_USS_POS_RIGHT_45 3 ///< right -45\h_deg uss
169 #define MOUSEBOT_USS_POS_RIGHT_90 4 ///< right -90\h_deg uss
170 #define MOUSEBOT_USS_NUMOF 5 ///< total number of uss sensors
171 #define MOUSEBOT_USS_ECHO_MAX_MIN 1 ///< maximum minimum echoes/measure
172 #define MOUSEBOT_USS_ECHO_MAX_MAX 5 ///< maximum maximum echoes/measure
173 #define MOUSEBOT_USS_ECHO_MAX_DFT 3 ///< default maximum echoes/measure
174 #define MOUSEBOT_USS_DIST_MIN 20 ///< minimum echo distance (cm)
175 #define MOUSEBOT_USS_DIST_MAX 400 ///< maximum echo distance (cm)
176 #define MOUSEBOT_USS_AMPL_MAX (MOUSEBOT_INT_MAX-1) ///< maximum echo amplitude (?units)
177 #define MOUSEBOT_USS_TIME_MAX (MOUSEBOT_INT_MAX-1) ///< maximum echo time (? units)
178 #define MOUSEBOT_USS_NOISE_MAX (MOUSEBOT_INT_MAX-1) ///< maximum noise value (? units)
179 #define MOUSEBOT_USS_LEFT_90_EN_DFT false
180  ///< left 90\h_deg uss disabled by default
181 #define MOUSEBOT_USS_LEFT_45_EN_DFT false
182  ///< left 45\h_deg uss disabled by default
183 #define MOUSEBOT_USS_FRONT_EN_DFT true
184  ///< front 0\h_deg enabled by default
185 #define MOUSEBOT_USS_RIGHT_45_EN_DFT false
186  ///< right -45\h_deg uss disabled by default
187 #define MOUSEBOT_USS_RIGHT_90_EN_DFT false
188  ///< right -90\h_deg uss disabled by default
189 #define MOUSEBOT_USS_HAS_BODY_DFT true ///< upper body mounted by default
190 /*! \} */
191 
192 // Firmware Operation Indices
193 #define MOUSEBOT_FWOP_INDEX_USS_MASK 0 ///< mask of enabled/disabled USSs
194 #define MOUSEBOT_FWOP_INDEX_USS_MAX_ECHOES 1 ///< max num of echoes/measurment
195 #define MOUSEBOT_FWOP_INDEX_NOT_USED_2 2 ///< not used
196 #define MOUSEBOT_FWOP_INDEX_NOT_USED_3 3 ///< not used
197 #define MOUSEBOT_FWOP_INDEX_IR_MASK 4 ///< mask of enabled/disabled IRs
198 #define MOUSEBOT_FWOP_INDEX_IR_GAIN_BRAIT 5 ///< Braitenberg IR gain
199 #define MOUSEBOT_FWOP_INDEX_UPPER_BODY 6 ///< plastic upper body [un]mounted
200 
201 // Buffers Sizes
202 #define MOUSEBOT_BUF_MAX 100 ///< command/response buffer maximum
203 
204 /*!
205  * \ingroup k3_defaults
206  *
207  * \{
208  */
209 // Default units and values
210 #define MOUSEBOT_UNITS_SPEED_DFT units_permil ///< default speed units
211 #define MOUSEBOT_SPEED_MAX_FWD_DFT 1000
212  ///< default forward maximum \h_permil speed
213 #define MOUSEBOT_SPEED_MAX_BWD_DFT -1000
214  ///< default backwrd maximum \h_permil speed
215 
216 #define MOUSEBOT_UNITS_OD_DFT units_mm ///< default odometery units
217 #define MOUSEBOT_OD_MAX_FWD_DFT 1000000
218  ///< default forward maximum odometer position in mm
219 #define MOUSEBOT_OD_MAX_BWD_DFT -1000000
220  ///< default backward maximum (most negative) odometer position in mm
221 
222 #define MOUSEBOT_UNITS_IR_DFT units_raw ///< default sensor IR units
223 #define MOUSEBOT_UNITS_USS_DFT units_mm ///< default USS sensor distance units
224 /*! \} */
225 
226 //
227 // Forward declarations
228 //
229 typedef struct knet_dev_s *knet_dev_p; ///< pointer to knet_dev_t
230 
231 /*!
232  * \ingroup mousebot_types
233  * Motor Configuration Structure
234  */
235 typedef struct
236 {
237  int m_nMaxBwdSpeed; ///< maximum backward current/raw speed limit \h_le 0
238  int m_nMaxFwdSpeed; ///< maximum forward current/raw speed limit \h_ge 0
239  int m_nMinOdometer; ///< minimum current/raw odometer position limit \h_le 0
240  int m_nMaxOdometer; ///< maximum current/raw odometer position limit \h_ge 0
242 
243 /*!
244  * \ingroup mousebot_types
245  * UltraSonic Sensor Configuration Structure
246  */
247 typedef struct
248 {
249  bool_t m_bIsEnabled[MOUSEBOT_USS_NUMOF]; ///< array of enabled/disabled USS at pos
250  uint_t m_uMaxEchoes; ///< maximum number of echoes/measure
251  bool_t m_bHasUpperBody; ///< upper plastic body is [not] installed
253 
254 /*!
255  * \ingroup mousebot_types
256  * Robot Working Units Structure
257  */
258 typedef struct
259 {
260  units_t m_unitsSpeed; ///< motor speed units
261  units_t m_unitsOdometer; ///< odometry distance units
262  units_t m_unitsIr; ///< IR distance units
263  units_t m_unitsUss; ///< USS distance units
265 
266 /*!
267  * \ingroup mousebot_types
268  * UltraSonic Sense Returned Echo Structure
269  */
270 typedef struct
271 {
272  uint_t m_uDistance; ///< echo distance in current units
273  uint_t m_uAmplitude; ///< echo signal strength (unknown units)
275 
276 /*!
277  * \ingroup mousebot_types
278  * UltraSonic Sensor Measurement Structure
279  */
280 typedef struct
281 {
282  uint_t m_uEchoCnt; ///< number of returned echoes
283  MouseBotUssEcho_T m_echo[MOUSEBOT_USS_ECHO_MAX_MAX]; ///< echo measurements
284  uint_t m_uMaxTimeTicks; ///< max measurement time (unknown units)
285  uint_t m_uNoise; ///< noise (unknown units)
287 
288 #ifndef SWIG
289 
290 /*!
291  * \ingroup mousebot_types
292  * Khepera III Robot Structure
293  */
294 typedef struct
295 {
296  //
297  // Devices
298  //
299  knet_dev_p m_pDevDSPic; ///< dsPIC device handle
300  knet_dev_p m_pDevMot[MOUSEBOT_MOTOR_NUMOF]; ///< motor device handles
301 
302  //
303  // Configuration and attributes
304  //
305  MouseBotMotorCfg_T m_cfgMotor[MOUSEBOT_MOTOR_NUMOF]; ///< motor configurations
306  MouseBotUssCfg_T m_cfgUss; ///< USS configuration
307  MouseBotAttrUnits_T m_attrUnits; ///< working units
308 
309  //
310  // Shadowed effector and sensor values in raw units (i.e. dog the robot)
311  //
312  int m_dogSpeedLeft; ///< shadowed left motor speed
313  int m_dogSpeedRight; ///< shadowed right motor speed
314  int m_dogSpeedRobot; ///< shadowed robot center speed
315  int m_dogOdometer[MOUSEBOT_MOTOR_NUMOF]; ///< shadowed motor odometery
316  uint_t m_dogIrAmbient[MOUSEBOT_IR_NUMOF]; ///< shadowed ambient sensors
317  uint_t m_dogIrProximity[MOUSEBOT_IR_NUMOF]; ///< shadowed proximity sensors
318  MouseBotUssMeas_T m_dogUss[MOUSEBOT_USS_NUMOF]; ///< shadowed USS sensors
319 } MouseBot_T;
320 
321 
322 // ---------------------------------------------------------------------------
323 // Prototypes
324 // ---------------------------------------------------------------------------
325 
326 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
327 // Utilities
328 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
329 
330 /*!
331  * \brief Convert units to short symbol name.
332  * \param u Units to look up.
333  * \return Symbol name string.
334  */
335 INLINE_IN_H const char *mousebotUnitsSym(units_t u)
336 {
337  return u==units_raw? "": units_shortname(u);
338 }
339 
340 extern const char *mousebotStrError(int ecode);
341 
342 extern int k3LibKbToMouseBotEcode(int libkb_ecode);
343 
344 extern void mousebotPrintBuf(FILE *fp,
345  const char *sPreface,
346  byte_t buf[],
347  const char *sFmt,
348  size_t uCount,
349  size_t uNLFreq,
350  uint_t uCol);
351 
352 #ifdef LOG
353 extern void mousebotLogBuf(const char *sPreface,
354  int buf[],
355  size_t uCount,
356  const char *sFmt);
357 #endif // LOG
358 
359 
360 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
361 // Initialization, Configuration, and Attribute Functions
362 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
363 
364 extern MouseBot_T *mousebotInit();
365 
366 extern void mousebotExit(MouseBot_T *pMouseBot);
367 
368 /*!
369  * \brief Get the current motor speed units.
370  * \param pMouseBot Khepera3 robot instance.
371  * \return Returns the current units. Returns units_undef on error.
372  */
373 INLINE_IN_H units_t mousebotAttrGetUnitsSpeed(MouseBot_T *pMouseBot)
374 {
375  return pMouseBot != NULL? pMouseBot->m_attrUnits.m_unitsSpeed: units_undef;
376 }
377 
378 extern units_t mousebotAttrSetUnitsSpeed(MouseBot_T *pMouseBot, units_t unitsSpeed);
379 
380 /*!
381  * \brief Get the current motor odometer units.
382  * \param pMouseBot Khepera3 robot instance.
383  * \return Returns the current units. Returns units_undef on error.
384  */
385 INLINE_IN_H units_t mousebotAttrGetUnitsOdometer(MouseBot_T *pMouseBot)
386 {
387  return pMouseBot != NULL? pMouseBot->m_attrUnits.m_unitsOdometer: units_undef;
388 }
389 
390 extern units_t mousebotAttrSetUnitsOdometer(MouseBot_T *pMouseBot, units_t unitsOdometer);
391 
392 /*!
393  * \brief Get the current InfraRed sensor units.
394  * \param pMouseBot Khepera3 robot instance.
395  * \return Returns the current units. Returns units_undef on error.
396  */
397 INLINE_IN_H units_t mousebotAttrGetUnitsIr(MouseBot_T *pMouseBot)
398 {
399  return pMouseBot != NULL? pMouseBot->m_attrUnits.m_unitsIr: units_undef;
400 }
401 
402 extern units_t mousebotAttrSetUnitsIr(MouseBot_T *pMouseBot, units_t unitsIr);
403 
404 /*!
405  * \brief Get the current UltraSonic Sensor units.
406  * \param pMouseBot Khepera3 robot instance.
407  * \return Returns the current units. Returns units_undef on error.
408  */
409 INLINE_IN_H units_t mousebotAttrGetUnitsUss(MouseBot_T *pMouseBot)
410 {
411  return pMouseBot != NULL? pMouseBot->m_attrUnits.m_unitsUss: units_undef;
412 }
413 
414 extern units_t mousebotAttrSetUnitsUss(MouseBot_T *pMouseBot, units_t unitsUss);
415 
416 extern int mousebotGetFwVer(MouseBot_T *pMouseBot, uint_t *puVersion, uint_t *puRevision);
417 
418 
419 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
420 // Motor Functions
421 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
422 
423 extern int mousebotMotorInit(MouseBot_T *pMouseBot, uint_t uWhich);
424 
425 extern int mousebotMotorGetCfg(MouseBot_T *pMouseBot,
426  uint_t uWhich,
427  MouseBotMotorCfg_T *pMotorCfg);
428 
429 extern int mousebotMotorSetCfg(MouseBot_T *pMouseBot,
430  uint_t uWhich,
431  MouseBotMotorCfg_T *pMotorCfg);
432 
433 extern int mousebotMotorGetSpeeds(MouseBot_T *pMouseBot,
434  int *pnSpeedLeft,
435  int *pnSpeedRight);
436 
437 extern int mousebotMotorSetSpeeds(MouseBot_T *pMouseBot, int nSpeedLeft, int nSpeedRight);
438 
439 /*!
440  * \brief Stop the Khepera III from moving.
441  *
442  * \param pMouseBot Khepera3 robot instance.
443  *
444  * \copydoc doc_return_std
445  */
446 INLINE_IN_H int mousebotMotorStop(MouseBot_T *pMouseBot)
447 {
448  return mousebotMotorSetSpeeds(pMouseBot, 0, 0);
449 }
450 
451 extern int mousebotMotorMoveTo(MouseBot_T *pMouseBot,
452  int nSpeed,
453  int nOdPosLeft,
454  int nOdPosRight);
455 
456 extern int mousebotMotorGetOdometry(MouseBot_T *pMouseBot,
457  int *pnOdPosLeft,
458  int *pnOdPosRight);
459 
460 extern int mousebotMotorResetOdometry(MouseBot_T *pMouseBot);
461 
462 
463 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
464 // Infrared Sensor Functions
465 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
466 
467 extern int mousebotIrInit(MouseBot_T *pMouseBot);
468 
469 extern int mousebotIrGetAmbient(MouseBot_T *pMouseBot, uint_t bufIr[]);
470 
471 extern int mousebotIrGetProximity(MouseBot_T *pMouseBot, uint_t bufIr[]);
472 
473 extern int mousebotIrGetProximityGroup(MouseBot_T *pMouseBot, int iGroup);
474 
475 
476 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
477 // UltraSonic Sensor Functions
478 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
479 
480 extern int mousebotUssInit(MouseBot_T *pMouseBot);
481 
482 /*!
483  * \brief Get the current ultrasonic sensors configuration.
484  * \param pMouseBot Khepera3 robot instance.
485  * \param [out] pUssCfg Pointer to current USS configuration.
486  * \copydoc doc_return_std
487  */
488 INLINE_IN_H int mousebotUssGetCfg(MouseBot_T *pMouseBot,
489  MouseBotUssCfg_T *pUssCfg)
490 {
491  *pUssCfg = pMouseBot->m_cfgUss;
492  return MOUSEBOT_OK;
493 }
494 
495 extern int mousebotUssSetCfg(MouseBot_T *pMouseBot, MouseBotUssCfg_T *pUssCfg);
496 
497 extern int mousebotUssPing(MouseBot_T *pMouseBot, uint_t uUssPos, MouseBotUssMeas_T *pUssMeas);
498 
499 #endif // SWIG
500 
501 
502 #ifndef SWIG
503 C_DECLS_END
504 #endif // SWIG
505 
506 
507 #endif // _MOUSEBOT_H
MouseBotAttrUnits_T m_attrUnits
working units
Definition: mousebot.h:307
uint_t m_uAmplitude
echo signal strength (unknown units)
Definition: mousebot.h:273
int m_nMaxBwdSpeed
maximum backward current/raw speed limit &le; 0
Definition: mousebot.h:237
#define MOUSEBOT_MOTOR_NUMOF
total number of motors
Definition: mousebot.h:110
int m_nMaxFwdSpeed
maximum forward current/raw speed limit &ge; 0
Definition: mousebot.h:238
INLINE_IN_H int mousebotMotorStop(MouseBot_T *pMouseBot)
Stop the Khepera III from moving.
Definition: mousebot.h:446
int m_dogSpeedLeft
shadowed left motor speed
Definition: mousebot.h:312
INLINE_IN_H units_t mousebotAttrGetUnitsSpeed(MouseBot_T *pMouseBot)
Get the current motor speed units.
Definition: mousebot.h:373
#define MOUSEBOT_IR_NUMOF
total number of ir sensors
Definition: mousebot.h:149
knet_dev_p m_pDevDSPic
dsPIC device handle
Definition: mousebot.h:299
INLINE_IN_H units_t mousebotAttrGetUnitsOdometer(MouseBot_T *pMouseBot)
Get the current motor odometer units.
Definition: mousebot.h:385
int m_nMaxOdometer
maximum current/raw odometer position limit &ge; 0
Definition: mousebot.h:240
uint_t m_uNoise
noise (unknown units)
Definition: mousebot.h:285
units_t m_unitsOdometer
odometry distance units
Definition: mousebot.h:261
bool_t m_bHasUpperBody
upper plastic body is [not] installed
Definition: mousebot.h:251
units_t m_unitsSpeed
motor speed units
Definition: mousebot.h:260
#define MOUSEBOT_USS_ECHO_MAX_MAX
maximum maximum echoes/measure
Definition: mousebot.h:172
INLINE_IN_H const char * mousebotUnitsSym(units_t u)
Convert units to short symbol name.
Definition: mousebot.h:335
int m_dogSpeedRight
shadowed right motor speed
Definition: mousebot.h:313
MouseBotUssCfg_T m_cfgUss
USS configuration.
Definition: mousebot.h:306
int m_dogSpeedRobot
shadowed robot center speed
Definition: mousebot.h:314
int m_nMinOdometer
minimum current/raw odometer position limit &le; 0
Definition: mousebot.h:239
units_t m_unitsIr
IR distance units.
Definition: mousebot.h:262
uint_t m_uEchoCnt
number of returned echoes
Definition: mousebot.h:282
units_t m_unitsUss
USS distance units.
Definition: mousebot.h:263
uint_t m_uMaxEchoes
maximum number of echoes/measure
Definition: mousebot.h:250
uint_t m_uDistance
echo distance in current units
Definition: mousebot.h:272
INLINE_IN_H units_t mousebotAttrGetUnitsUss(MouseBot_T *pMouseBot)
Get the current UltraSonic Sensor units.
Definition: mousebot.h:409
struct knet_dev_s * knet_dev_p
pointer to knet_dev_t
Definition: mousebot.h:229
INLINE_IN_H int mousebotUssGetCfg(MouseBot_T *pMouseBot, MouseBotUssCfg_T *pUssCfg)
Get the current ultrasonic sensors configuration.
Definition: mousebot.h:488
uint_t m_uMaxTimeTicks
max measurement time (unknown units)
Definition: mousebot.h:284
#define MOUSEBOT_USS_NUMOF
total number of uss sensors
Definition: mousebot.h:170
#define MOUSEBOT_OK
not an error, success
Definition: mousebot.h:69
INLINE_IN_H units_t mousebotAttrGetUnitsIr(MouseBot_T *pMouseBot)
Get the current InfraRed sensor units.
Definition: mousebot.h:397