Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
laeTune.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Laelaps
4 //
5 // Library: liblaelaps
6 //
7 // File: laeTune.cxx
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2016-03-01 16:54:32 -0700 (Tue, 01 Mar 2016) $
12  * $Rev: 4333 $
13  *
14  * \brief Laelaps tuning implementation.
15  *
16  * \author Robin Knight (robin.knight@roadnarrows.com)
17  *
18  * \par Copyright
19  * \h_copy 2015-2017. RoadNarrows LLC.\n
20  * http://www.roadnarrows.com\n
21  * All Rights Reserved
22  */
23 /*
24  * @EulaBegin@
25  *
26  * Unless otherwise stated explicitly, all materials contained are copyrighted
27  * and may not be used without RoadNarrows LLC's written consent,
28  * except as provided in these terms and conditions or in the copyright
29  * notice (documents and software) or other proprietary notice provided with
30  * the relevant materials.
31  *
32  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
33  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
34  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
35  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
36  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
37  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *
39  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
40  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
41  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
42  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
43  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
44  *
45  * @EulaEnd@
46  */
47 ////////////////////////////////////////////////////////////////////////////////
48 
49 #include <string>
50 #include <map>
51 
52 #include "rnr/rnrconfig.h"
53 
54 // common
55 #include "Laelaps/laelaps.h"
56 #include "Laelaps/laeUtils.h"
57 #include "Laelaps/laeTune.h"
58 #include "Laelaps/laeDesc.h"
59 
60 // hardware
61 #include "Laelaps/laeSysDev.h"
62 #include "Laelaps/RoboClaw.h"
63 #include "Laelaps/laeMotor.h"
64 #include "Laelaps/laeI2C.h"
65 #include "Laelaps/laeI2CMux.h"
66 #include "Laelaps/laeWatchDog.h"
67 #include "Laelaps/laeWd.h"
68 #include "Laelaps/laeVL6180.h"
69 #include "Laelaps/laeImu.h"
70 #include "Laelaps/laeCams.h"
71 
72 // control and application interface
73 #include "Laelaps/laeTraj.h"
74 #include "Laelaps/laePowertrain.h"
75 #include "Laelaps/laePlatform.h"
76 #include "Laelaps/laeKin.h"
77 #include "Laelaps/laeThread.h"
78 #include "Laelaps/laeThreadImu.h"
79 #include "Laelaps/laeThreadKin.h"
80 #include "Laelaps/laeThreadRange.h"
81 
82 using namespace std;
83 using namespace laelaps;
84 
85 
86 //------------------------------------------------------------------------------
87 // Laelaps Tuning Defaults, Limits, and Fixed Values
88 //------------------------------------------------------------------------------
89 
90 namespace laelaps
91 {
92  // threads
93  const double LaeTuneThreadImuHzDft = LaeThreadImu::ThreadImuHzDft;
94  const double LaeTuneThreadKinHzDft = LaeThreadKin::ThreadKinHzDft;
95  const double LaeTuneThreadRangeHzDft=LaeThreadRange::ThreadRangeHzDft;
96  const double LaeTuneThreadHzMin = LaeThread::ThreadMinHz;
97 
98  // watchdog timeout
99  const double LaeTuneWdTimeoutDft = (double)LaeWdTimeoutDft / 1000.0;
100  const double LaeTuneWdTimeoutMin = (double)LaeWdTimeoutMin / 1000.0;
101  const double LaeTuneWdTimeoutMax = (double)LaeWdTimeoutMax / 1000.0;
102 
103  // velocity limits
104  const double LaeTuneVelDerateDft = 100.0;
105  const double LaeTuneVelDerateMin = 10.0;
106  const double LaeTuneVelDerateMax = 100.0;
107 
108  // navigation trajectory
109  const LaeNorm LaeTuneTrajNormDft = LaeNormLinf;
110  const double LaeTuneTrajEpsilonDft = 0.001;
111  const double LaeTuneTrajEpsilonMin = 0.0;
112 
113  // battery
114  const char* const LaeTuneBattType = "lithium-ion polymer";
115  const char* const LaeTuneBattChem = "NMC";
116  const double LaeTuneBattCapAh = 10.0;
117  const int LaeTuneBattCells = 3;
118  const double LaeTuneBattMaxVMax = 12.9;
119  const double LaeTuneBattMaxVDft = 12.6;
120  const double LaeTuneBattNominalV = 11.1;
121  const double LaeTuneBattMinVDft = 9.0;
122  const double LaeTuneBattMinVMin = 8.1;
123 
124  // velocity pid
125  const double LaeTuneVelPidKpDft = 2500.0;
126  const double LaeTuneVelPidKiDft = 500.0;
127  const double LaeTuneVelPidKdDft = 150.0;
128  const double LaeTuneVelPidKMin = 0.0;
129 
130  // tires
131  const double LaeTuneTireRadiusDft = 0.60;
132  const double LaeTuneTireWidthDft = 0.65;
133  const double LaeTuneTireDimMin = 0.01;
134 
135  // VL6180 Range Sensor
136  const int LaeTuneVL6180TofOffsetDft = VL6180X_FACTORY_DFT;
137  const int LaeTuneVL6180TofOffsetMin = VL6180X_RANGE_OFFSET_MIN;
138  const int LaeTuneVL6180TofOffsetMax = VL6180X_RANGE_OFFSET_MAX;
139  const int LaeTuneVL6180TofXTalkDft = VL6180X_FACTORY_DFT;
140  const int LaeTuneVL6180TofXTalkMin = VL6180X_RANGE_XTALK_MIN;
141  const int LaeTuneVL6180TofXTalkMax = VL6180X_RANGE_XTALK_MAX;
142  const double LaeTuneVL6180AlsGainDft = VL6180X_AMBIENT_GAIN_MIN;
143  const double LaeTuneVL6180AlsGainMin = VL6180X_AMBIENT_GAIN_MIN;
144  const double LaeTuneVL6180AlsGainMax = VL6180X_AMBIENT_GAIN_MAX;
145  const int LaeTuneVL6180AlsIntPeriodDft = VL6180X_AMBIENT_INT_T_REC;
146  const int LaeTuneVL6180AlsIntPeriodMin = VL6180X_AMBIENT_INT_T_MIN;
147  const int LaeTuneVL6180AlsIntPeriodMax = VL6180X_AMBIENT_INT_T_MAX;
148 
149 } // namespace laelaps
150 
151 
152 
153 //------------------------------------------------------------------------------
154 // LaeTunesBattery Class
155 //------------------------------------------------------------------------------
156 
157 LaeTunesBattery::LaeTunesBattery() :
158  m_strType(LaeTuneBattType), m_strChem(LaeTuneBattChem)
159 {
165 }
166 
168 {
169  m_strType = rhs.m_strType;
170  m_strChem = rhs.m_strChem;
171  m_fCapAh = rhs.m_fCapAh;
172  m_nCells = rhs.m_nCells;
173  m_fMaxV = rhs.m_fMaxV;
174  m_fNominalV = rhs.m_fNominalV;
175  m_fMinV = rhs.m_fMinV;
176 }
177 
178 void LaeTunesBattery::print(int indent)
179 {
180  printf("%*sBattery =\n", indent, "");
181  printf("%*s{\n", indent, "");
182  printf("%*sType = %s\n", indent+2, "", m_strType.c_str());
183  printf("%*sChemistry = %s\n", indent+2, "", m_strChem.c_str());
184  printf("%*sCapacity Ah = %.2lf\n", indent+2, "", m_fCapAh);
185  printf("%*sCells = %d\n", indent+2, "", m_nCells);
186  printf("%*sMax V = %.2lf\n", indent+2, "", m_fMaxV);
187  printf("%*sNominal V = %.2lf\n", indent+2, "", m_fNominalV);
188  printf("%*sMin V = %.2lf\n", indent+2, "", m_fMinV);
189  printf("%*s}\n", indent, "");
190 }
191 
192 
193 //------------------------------------------------------------------------------
194 // LaeTunesPowertrain Class
195 //------------------------------------------------------------------------------
196 
198 {
199  m_fVelPidKp = LaeTuneVelPidKpDft; // velocity PID proportional constant
200  m_fVelPidKi = LaeTuneVelPidKiDft; // velocity PID integral constant
201  m_fVelPidKd = LaeTuneVelPidKdDft; // velocity PID differential constant
202  m_fTireRadius = LaeTuneTireRadiusDft; // tire radius (meters)
203  m_fTireWidth = LaeTuneTireWidthDft; // tire width (meters)
204 }
205 
207 {
208  m_fVelPidKp = rhs.m_fVelPidKp;
209  m_fVelPidKi = rhs.m_fVelPidKi;
210  m_fVelPidKd = rhs.m_fVelPidKd;
211  m_fTireRadius = rhs.m_fTireRadius;
212  m_fTireWidth = rhs.m_fTireWidth;
213 }
214 
215 void LaeTunesPowertrain::print(const string &strKey, int indent)
216 {
217  printf("%*sPowertrains[%s] =\n", indent, "", strKey.c_str());
218  printf("%*s{\n", indent, "");
219 
220  printf("%*sVelocity PID =\n", indent+2, "");
221  printf("%*s{\n", indent+2, "");
222  printf("%*sKp = %.4lf\n", indent+4, "", m_fVelPidKp);
223  printf("%*sKi = %.4lf\n", indent+4, "", m_fVelPidKi);
224  printf("%*sKd = %.4lf\n", indent+4, "", m_fVelPidKd);
225  printf("%*s}\n", indent+2, "");
226 
227  printf("%*sTires =\n", indent+2, "");
228  printf("%*s{\n", indent+2, "");
229  printf("%*sRadius = %.3f\n", indent+4, "", m_fTireRadius);
230  printf("%*sWidth = %.3f\n", indent+4, "", m_fTireWidth);
231  printf("%*s}\n", indent+2, "");
232 
233  printf("%*s}\n", indent, "");
234 }
235 
236 
237 //------------------------------------------------------------------------------
238 // LaeTunesVL6180 Class
239 //------------------------------------------------------------------------------
240 
242 {
243  m_nTofOffset = LaeTuneVL6180TofOffsetDft; // ToF part-to-part offset
244  m_nTofCrossTalk = LaeTuneVL6180TofXTalkDft; // ToF cross-talk compensation
245  m_fAlsGain = LaeTuneVL6180AlsGainDft; // ALS analog gain
246  m_nAlsIntPeriod = LaeTuneVL6180AlsIntPeriodDft; // ALS integration period
247 }
248 
250 {
251  m_nTofOffset = rhs.m_nTofOffset;
252  m_nTofCrossTalk = rhs.m_nTofCrossTalk;
253  m_fAlsGain = rhs.m_fAlsGain;
254  m_nAlsIntPeriod = rhs.m_nAlsIntPeriod;
255 
256  return *this;
257 }
258 
259 void LaeTunesVL6180::print(const string &strKey, int indent)
260 {
261  printf("%*sVL6180[%s] =\n", indent, "", strKey.c_str());
262  printf("%*s{\n", indent, "");
263 
264  printf("%*sToF Offset = ", indent+2, "");
265  if( m_nTofOffset == VL6180X_FACTORY_DFT )
266  {
267  printf("factory\n");
268  }
269  else
270  {
271  printf("%d\n", m_nTofOffset);
272  }
273 
274  printf("%*sToF Cross-Talk = ", indent+2, "");
275  if( m_nTofCrossTalk == VL6180X_FACTORY_DFT )
276  {
277  printf("factory\n");
278  }
279  else
280  {
281  printf("%d\n", m_nTofCrossTalk);
282  }
283  printf("%*sALS Gain = %.1lf\n", indent+2, "", m_fAlsGain);
284  printf("%*sALS Integration Period = %d\n", indent+2, "", m_nAlsIntPeriod);
285 
286  printf("%*s}\n", indent, "");
287 }
288 
289 
290 //------------------------------------------------------------------------------
291 // LaeTunes Class
292 //------------------------------------------------------------------------------
293 
295 {
296  LaeTunesPowertrain dftPowertrain; // powertrain pair tuning defaults
297  LaeTunesVL6180 dftVL6180; // range sensor tuning defaults
298  size_t i; // working index
299 
300  m_fImuHz = LaeTuneThreadImuHzDft;
301  m_fKinematicsHz = LaeTuneThreadKinHzDft;
302  m_fRangeHz = LaeTuneThreadRangeHzDft;
303  m_fWatchDogTimeout = LaeTuneWdTimeoutDft;
304  m_fVelDerate = LaeTuneVelDerateDft / 100.0;
305  m_eTrajNorm = LaeTuneTrajNormDft;
306  m_fTrajEpsilon = degToRad(LaeTuneTrajEpsilonDft);
307 
308  for(i = 0; i < LaeNumMotorCtlrs; ++i)
309  {
310  m_mapPtp[LaeDesc::KeyMotorCtlr[i]] = dftPowertrain;
311  }
312 
313  for(i = 0; i < ToFSensorMaxNumOf; ++i)
314  {
315  m_mapVL6180[LaeDesc::KeyRangeSensorMax[i]] = dftVL6180;
316  }
317 }
318 
319 double LaeTunes::getImuHz() const
320 {
321  return m_fImuHz;
322 }
323 
325 {
326  return m_fKinematicsHz;
327 }
328 
329 double LaeTunes::getRangeHz() const
330 {
331  return m_fRangeHz;
332 }
333 
335 {
336  return m_fWatchDogTimeout;
337 }
338 
340 {
341  return m_fVelDerate;
342 }
343 
344 void LaeTunes::getTrajectoryParams(LaeNorm &eNorm, double &fEpsilon) const
345 {
346  eNorm = m_eTrajNorm;
347  fEpsilon = m_fTrajEpsilon;
348 }
349 
350 void LaeTunes::getBattOpRangeParams(double &fBattMinV, double &fBattMaxV) const
351 {
352  fBattMinV = m_battery.m_fMinV;
353  fBattMaxV = m_battery.m_fMaxV;
354 }
355 
356 void LaeTunes::getVelPidKParams(const string &strName,
357  double &fKp,
358  double &fKi,
359  double &fKd) const
360 {
361  string strKey;
362  LaeTunesMapPtp::const_iterator pos;
363 
364  strKey = mapToPtp(strName);
365 
366  if( (pos = m_mapPtp.find(strKey)) != m_mapPtp.end() )
367  {
368  fKp = pos->second.m_fVelPidKp;
369  fKi = pos->second.m_fVelPidKi;
370  fKd = pos->second.m_fVelPidKd;
371  }
372  else
373  {
374  LaeTunesPowertrain dft; // default parameters
375 
376  fKp = dft.m_fVelPidKp;
377  fKi = dft.m_fVelPidKi;
378  fKd = dft.m_fVelPidKd;
379  }
380 }
381 
382 void LaeTunes::getTireDimParams(const string &strName,
383  double &fTireRadius,
384  double &fTireWidth) const
385 {
386  string strKey;
387  LaeTunesMapPtp::const_iterator pos;
388 
389  strKey = mapToPtp(strName);
390 
391  if( (pos = m_mapPtp.find(strKey)) != m_mapPtp.end() )
392  {
393  fTireRadius = pos->second.m_fTireRadius;
394  fTireWidth = pos->second.m_fTireWidth;
395  }
396  else
397  {
398  LaeTunesPowertrain dft; // default parameters
399 
400  fTireRadius = dft.m_fTireRadius;
401  fTireWidth = dft.m_fTireWidth;
402  }
403 }
404 
405 string LaeTunes::mapToPtp(const string &strKey) const
406 {
407  if( (strKey == LaeKeyFront) || (strKey == LaeKeyRear) )
408  {
409  return strKey;
410  }
411  else if( (strKey == LaeKeyLeftFront) || (strKey == LaeKeyRightFront) )
412  {
413  return LaeKeyFront;
414  }
415  else
416  {
417  return LaeKeyRear;
418  }
419 }
420 
421 void LaeTunes::getVL6180Params(const std::string &strName,
422  int &nTofOffset,
423  int &nTofCrossTalk,
424  double &fAlsGain,
425  int &nAlsIntPeriod) const
426 {
427  LaeTunesMapVL6180::const_iterator pos;
428 
429  if( (pos = m_mapVL6180.find(strName)) != m_mapVL6180.end() )
430  {
431  nTofOffset = pos->second.m_nTofOffset;
432  nTofCrossTalk = pos->second.m_nTofCrossTalk;
433  fAlsGain = pos->second.m_fAlsGain;
434  nAlsIntPeriod = pos->second.m_nAlsIntPeriod;
435  }
436  else
437  {
438  LaeTunesVL6180 dft; // default parameters
439 
440  nTofOffset = dft.m_nTofOffset;
441  nTofCrossTalk = dft.m_nTofCrossTalk;
442  fAlsGain = dft.m_fAlsGain;
443  nAlsIntPeriod = dft.m_nAlsIntPeriod;
444  }
445 }
446 
447 void LaeTunes::print(int indent)
448 {
449  LaeTunesMapPtp::iterator iPtp;
450  LaeTunesMapVL6180::iterator iSensor;
451 
452  printf("%*sGlobals =\n", indent, "");
453  printf("%*s{\n", indent, "");
454 
455  printf("%*sThreads =\n", indent+2, "");
456  printf("%*s{\n", indent+2, "");
457  printf("%*sIMU Thread Hertz = %.1lf\n", indent+4, "", m_fImuHz);
458  printf("%*sKinematics Thread Hertz = %.1lf\n", indent+4, "",
459  m_fKinematicsHz);
460  printf("%*sRange Thread Hertz = %.1lf\n", indent+4, "", m_fRangeHz);
461  printf("%*s}\n", indent+2, "");
462 
463  printf("%*sTrajectory =\n", indent+2, "");
464  printf("%*s{\n", indent+2, "");
465  printf("%*sNorm = %d\n", indent+4, "", m_eTrajNorm);
466  printf("%*sEpsilon = %lf\n", indent+4, "", radToDeg(m_fTrajEpsilon));
467  printf("%*s}\n", indent+2, "");
468 
469  printf("%*sVelocity Derate = %.1lf\n", indent+2, "", m_fVelDerate * 100.0);
470  printf("%*s}\n", indent, "");
471 
472  m_battery.print(indent);
473 
474  for(iPtp = m_mapPtp.begin(); iPtp != m_mapPtp.end(); ++iPtp)
475  {
476  iPtp->second.print(iPtp->first, indent);
477  }
478 
479  for(iSensor = m_mapVL6180.begin(); iSensor != m_mapVL6180.end(); ++iSensor)
480  {
481  iSensor->second.print(iSensor->first, indent);
482  }
483 }
double m_fMinV
minimum operation voltage
Definition: laeTune.h:431
double m_fNominalV
nominal operation voltage
Definition: laeTune.h:430
#define VL6180X_AMBIENT_INT_T_MIN
minimum als int. period (msec)
Definition: laeVL6180.h:156
double getImuHz() const
Get IMU tasks thread cycle rate tune parameter (hertz).
Definition: laeTune.cxx:319
Laelaps thread base class interface.
const double LaeTuneVelPidKiDft
Default motor velocity PID integral constant.
Definition: laeTune.h:295
#define VL6180X_RANGE_XTALK_MIN
minimum tof cross-talk
Definition: laeVL6180.h:140
double getWatchDogTimeout() const
Get watchdog timeout (seconds).
Definition: laeTune.cxx:334
Laelaps kinodynamics thread class interface.
#define VL6180X_RANGE_OFFSET_MAX
maximum tof offset
Definition: laeVL6180.h:137
Trajectory classes interfaces.
const double LaeTuneVelDerateDft
Default Laelaps robot velocity derate (% of goal velocities).
Definition: laeTune.h:164
double getKinematicsHz() const
Get kinematics thread cycle rate tune parameter (hertz).
Definition: laeTune.cxx:324
double degToRad(double d)
Convert degrees to radians.
Definition: laeUtils.h:124
const int LaeTuneVL6180TofXTalkDft
Default Time-of-Flight cross-talk compensation.
Definition: laeTune.h:361
const double LaeTuneTrajEpsilonDft
Default trajectory distance epsilon (meters).
Definition: laeTune.h:201
#define VL6180X_AMBIENT_INT_T_MAX
maximum als int. period (msec)
Definition: laeVL6180.h:157
LaeTunesVL6180()
Default constructor.
Definition: laeTune.cxx:241
LaeTunes()
Default constructor.
Definition: laeTune.cxx:294
LaeTunesPowertrain()
Default constructor.
Definition: laeTune.cxx:197
double m_fVelPidKd
motor velocity PID derivative constant
Definition: laeTune.h:476
std::string mapToPtp(const std::string &strKey) const
Definition: laeTune.cxx:405
int m_nTofOffset
ToF part-to-part offset.
Definition: laeTune.h:522
void getTrajectoryParams(LaeNorm &eNorm, double &fEpsilon) const
Get trajectory tune parameters.
Definition: laeTune.cxx:344
void getVelPidKParams(const std::string &strName, double &fKp, double &fKi, double &fKd) const
Get motor velocity PID K tune parameters.
Definition: laeTune.cxx:356
const double LaeTuneTireRadiusDft
Default tire radius (meters).
Definition: laeTune.h:319
void print(int indent=0)
Print out tuning parameters to stdout.
Definition: laeTune.cxx:447
static const char *const LaeKeyRightFront
right front
Definition: laeMotor.h:95
const double LaeTuneBattNominalV
Fixed nominal operating voltage.
Definition: laeTune.h:262
RoboClaw motor controller class interface.
static const char *const LaeKeyRear
rear
Definition: laeMotor.h:93
const double LaeTuneBattMinVDft
Definition: laeTune.h:270
void print(const std::string &strKey, int indent=0)
Print out tuning parameters to stdout.
Definition: laeTune.cxx:215
void getBattOpRangeParams(double &fBattMinV, double &fBattMaxV) const
Get battery minimum and maximum allowed operating range voltages tune parameters. ...
Definition: laeTune.cxx:350
static const char *const LaeKeyFront
front
Definition: laeMotor.h:92
Laelaps WatchDog software class interface.
Laelaps PCA9548A I2C multiplexer switch interface.
double m_fVelPidKp
motor velocity PID proportional const
Definition: laeTune.h:474
int m_nAlsIntPeriod
ALS integration period.
Definition: laeTune.h:525
const int ToFSensorMaxNumOf
maximum number of ToF sensors
Definition: laeSysDev.h:244
Laelaps I2C class interface.
double radToDeg(double r)
Convert radians to degrees.
Definition: laeUtils.h:136
const double LaeTuneVelPidKpDft
Default motor velocity PID proportional constant.
Definition: laeTune.h:287
std::string m_strType
battery type
Definition: laeTune.h:425
double m_fCapAh
battery capacity in Amp-hours
Definition: laeTune.h:427
LaeTunesVL6180 & operator=(const LaeTunesVL6180 &rhs)
Assignment operator.
Definition: laeTune.cxx:249
#define VL6180X_RANGE_XTALK_MAX
maximum tof cross-talk
Definition: laeVL6180.h:141
double m_fTireRadius
tire radius (meters)
Definition: laeTune.h:477
Laelaps Time-of-Flight sensors. The ToFs are used as a virtual bumper for close-in obstacle detection...
LaeTunesPowertrain & operator=(const LaeTunesPowertrain &rhs)
Assignment operator.
Definition: laeTune.cxx:206
void getVL6180Params(const std::string &strName, int &nTofOffset, int &nTofCrossTalk, double &fAlsGain, int &nAlsIntPeriod) const
Get VL6180 range sensor tune parameters.
Definition: laeTune.cxx:421
const double LaeTuneThreadKinHzDft
Default kinematics thread cycle rate (Hertz).
Definition: laeTune.h:96
The <b><i>Laelaps</i></b> namespace encapsulates all <b><i>Laelaps</i></b> related constructs...
Definition: laeAlarms.h:64
Laelaps robotic base mobile platform description class interface.
double getVelocityDerate() const
Get derated velocity tune parameter (normalized).
Definition: laeTune.cxx:339
Laelaps common utilities.
#define VL6180X_AMBIENT_INT_T_REC
recommended int. period (msec)
Definition: laeVL6180.h:158
Laelaps built-in Inertial Measurement Unit class interface.
The Laelaps kinematics and dynamics class interface.
Laelaps powertrain class interfaces.
const double LaeTuneTireWidthDft
Default tire width (meters).
Definition: laeTune.h:327
int m_nTofCrossTalk
ToF cross-talk compensation.
Definition: laeTune.h:523
double m_fVelPidKi
motor velocity PID integral constant
Definition: laeTune.h:475
const double LaeTuneWdTimeoutDft
Default Laelaps watchdog timeout.
Definition: laeTune.h:132
void print(int indent=0)
Print out tuning parameters to stdout.
Definition: laeTune.cxx:178
Laelaps tuning.
Laelaps system devices.
LaeTunesBattery & operator=(const LaeTunesBattery &rhs)
Assignment operator.
Definition: laeTune.cxx:167
const double LaeTuneThreadRangeHzDft
Default range sensing thread cycle rate (Hertz).
Definition: laeTune.h:106
const double LaeTuneVelPidKdDft
Default motor velocity PID derivative constant.
Definition: laeTune.h:303
const int LaeTuneBattCells
Fixed battery cell count.
Definition: laeTune.h:244
double m_fMaxV
maximum operating voltage
Definition: laeTune.h:429
Laelaps robotic platform control and dynamics state interface.
Laelaps built-in Arduino sub-processor.
Laelaps battery tuning data class.
Definition: laeTune.h:422
double m_fTireWidth
tire width (meters)
Definition: laeTune.h:478
int m_nCells
number of battery cells
Definition: laeTune.h:428
Laelaps range sensors thread class interface.
Laelaps motors, encoder, and controllers hardware abstraction interfaces.
#define VL6180X_RANGE_OFFSET_MIN
minimum tof offset
Definition: laeVL6180.h:136
void print(const std::string &strKey, int indent=0)
Print out tuning parameters to stdout.
Definition: laeTune.cxx:259
const double LaeTuneBattMaxVDft
Definition: laeTune.h:257
static const int LaeNumMotorCtlrs
number of motor controllers
Definition: laeMotor.h:115
const LaeNorm LaeTuneTrajNormDft
Default trajectory norm.
Definition: laeTune.h:186
std::string m_strChem
battery chemistry
Definition: laeTune.h:426
static const char *const KeyMotorCtlr[]
motor controller keys
Definition: laeDesc.h:462
const int LaeTuneVL6180AlsIntPeriodDft
Default Ambient Light Sensor integration period (msec).
Definition: laeTune.h:398
Laelaps powertrain tuning data class.
Definition: laeTune.h:519
const int LaeTuneVL6180TofOffsetDft
Default Time-of-Flight part-to-part offset.
Definition: laeTune.h:343
Laelaps powertrain tuning data class.
Definition: laeTune.h:471
Laelaps IMU thread class interface.
Laelaps supported cameras.
static const char *const KeyRangeSensorMax[]
max range sensor keys
Definition: laeDesc.h:465
const double LaeTuneBattCapAh
Fixed battery capacity (Amp-hours).
Definition: laeTune.h:236
const double LaeTuneVL6180AlsGainDft
Default Ambient Light Sensor analog gain.
Definition: laeTune.h:379
void getTireDimParams(const std::string &strName, double &fTireRadius, double &fTireWidth) const
Get tire dimensions tune parameters.
Definition: laeTune.cxx:382
LaeNorm
Length/Distance Norm.
Definition: laelaps.h:356
double getRangeHz() const
Get range sensing thread cycle rate tune parameter (hertz).
Definition: laeTune.cxx:329
#define VL6180X_AMBIENT_GAIN_MIN
minimum als analog gain
Definition: laeVL6180.h:151
static const char *const LaeKeyLeftFront
left front
Definition: laeMotor.h:94
#define VL6180X_AMBIENT_GAIN_MAX
maximum als analog gain
Definition: laeVL6180.h:152
#define VL6180X_FACTORY_DFT
use factory default
Definition: laeVL6180.h:170
double m_fAlsGain
ALS analog gain.
Definition: laeTune.h:524
Top-level package include file.
const double LaeTuneThreadImuHzDft
Default IMU thread cycle rate (Hertz).
Definition: laeTune.h:86