This file is indexed.

/usr/include/Aria/ArRobotParams.h is in libaria-dev 2.8.0+repack-1.2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
/*
Adept MobileRobots Robotics Interface for Applications (ARIA)
Copyright (C) 2004, 2005 ActivMedia Robotics LLC
Copyright (C) 2006, 2007, 2008, 2009, 2010 MobileRobots Inc.
Copyright (C) 2011, 2012, 2013 Adept Technology

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

If you wish to redistribute ARIA under different terms, contact 
Adept MobileRobots for information about a commercial version of ARIA at 
robots@mobilerobots.com or 
Adept MobileRobots, 10 Columbia Drive, Amherst, NH 03031; +1-603-881-7960
*/
#ifndef ARROBOTPARAMS_H
#define ARROBOTPARAMS_H

#include "ariaTypedefs.h"
#include "ArConfig.h"
#include <vector>

#ifndef SWIG

/// Stores a set of video device parameters read from one of the video sections of a robot parameter file.
/// @internal
/// @swigomit
class ArVideoParams
{
public:
	std::string type;
	bool connect; bool connectSet;
	int imageWidth;
	int imageHeight;
	int deviceIndex;
	std::string deviceName;
	int channel; 
	std::string analogSignalFormat;
	std::string address;
	int tcpPort; bool tcpPortSet;
	bool inverted; bool invertedSet;
	ArVideoParams() :
		type("unknown"),
		connect(false),
		connectSet(false),
		imageWidth(-1),
		imageHeight(-1),
		deviceIndex(-1),
		deviceName("none"),
		channel(1),
		analogSignalFormat(""),
		address("192.168.0.90"),
		tcpPort(80),
		tcpPortSet(false),
		inverted(false),
		invertedSet(false)
	{}
	/// Copy values of any parameters in @a other into @a this, if given in @a other
	AREXPORT void merge(const ArVideoParams& other);
	void setType(const std::string& t) { type = t; }
	void setConnect(bool c) { connect = c; connectSet = true; }
	void setImageSize(int w, int h) { imageWidth = w; imageHeight = h; }
	void setInverted(bool i) { inverted = i; invertedSet = true; }
	void setDevice(const std::string& name, int idx, int chan) 
	{
		deviceName = name;
		deviceIndex = idx;
		channel = chan;
	}
	void setAddress(const std::string& a) { address = a; }
	void setTCPPort(int p) { tcpPort = p; tcpPortSet = true; }
};

/// Stores a set of PTZ/PTU device parameters read from one of the PTZ sections of a robot parameter file.
/// @internal
/// @swigomit
class ArPTZParams
{
public:
	std::string type;
	bool connect; bool connectSet;
	std::string serialPort;
	int robotAuxPort;
	std::string address;
	int tcpPort; bool tcpPortSet;
	bool inverted; bool invertedSet;
	ArPTZParams() :
		type("unknown"),
		connect(false),
		connectSet(false),
		serialPort("none"),
		robotAuxPort(-1),
		address("192.168.0.90"),
		tcpPort(80),
		tcpPortSet(false),
		inverted(false),
		invertedSet(false)
	{}
	/// Copy values of any parameters in @a other into @a this, if given in @a other
	void merge(const ArPTZParams& other);
	void setType(const std::string& t) { type = t; }
	void setConnect(bool c) { connect = c; connectSet = true; }
	void setSerialPort(const std::string& sp) { serialPort = sp; }
	void setTcpPort(int p) { tcpPort = p; tcpPortSet = true; }
	void setRobotAuxPort(int p) { robotAuxPort = p; }
	void setInverted(bool i) { inverted = i; invertedSet = true; }
	void setAddress(const std::string& a) { address = a; }
};

#endif // ifndef SWIG

///Stores parameters read from the robot's parameter files
/** 
    Use ArRobot::getRobotParams() after a successful robot 
    connection to obtain a pointer to an ArRobotParams instance containing the
    values read from the files.  

    See @ref ParamFiles for a description of the robot parameter files.

    ArRobotParams is a subclass of ArConfig which contains some useful methods
    and features.
*/
class ArRobotParams : public ArConfig
{
public:
  /// Constructor
  AREXPORT ArRobotParams();
  /// Destructor
  AREXPORT virtual ~ArRobotParams();
  /// Returns the class from the parameter file
  const char *getClassName(void) const { return myClass; }
  /// Returns the subclass from the parameter file
  const char *getSubClassName(void) const { return mySubClass; }
  /// Returns the robot's radius
  double getRobotRadius(void) const { return myRobotRadius; }
  /// Returns the robot diagonal (half-height to diagonal of octagon)
  double getRobotDiagonal(void) const { return myRobotDiagonal; }
  /// Returns the robot's width
  double getRobotWidth(void) const { return myRobotWidth; }
  /// Returns the robot's length
  double getRobotLength(void) const { return myRobotLength; }
  /// Returns the robot's length to the front of the robot
  double getRobotLengthFront(void) const { return myRobotLengthFront; }
  /// Returns the robot's length to the rear of the robot
  double getRobotLengthRear(void) const { return myRobotLengthRear; }
  /// Returns whether the robot is holonomic or not
  bool isHolonomic(void) const { return myHolonomic; }
  /// Returns if the robot has a built in move command
  bool hasMoveCommand(void) const { return myHaveMoveCommand; }
  /// Returns the max velocity of the robot
  int getAbsoluteMaxVelocity(void) const { return myAbsoluteMaxVelocity; }
  /// Returns the max rotational velocity of the robot
  int getAbsoluteMaxRotVelocity(void) const { return myAbsoluteMaxRVelocity; }
  /// Returns the max lateral velocity of the robot
  int getAbsoluteMaxLatVelocity(void) const 
    { return myAbsoluteMaxLatVelocity; }
  /// Returns true if IO packets are automatically requested upon connection to the robot.
  bool getRequestIOPackets(void) const { return myRequestIOPackets; }
  /// Returns true if encoder packets are automatically requested upon connection to the robot.
  bool getRequestEncoderPackets(void) const { return myRequestEncoderPackets; }
  /// Returns the baud rate set in the param to talk to the robot at
  int getSwitchToBaudRate(void) const { return mySwitchToBaudRate; }
  /// Returns the angle conversion factor 
  double getAngleConvFactor(void) const { return myAngleConvFactor; }
  /// Returns the distance conversion factor
  double getDistConvFactor(void) const { return myDistConvFactor; }
  /// Returns the velocity conversion factor
  double getVelConvFactor(void) const { return myVelConvFactor; }
  /// Returns the sonar range conversion factor
  double getRangeConvFactor(void) const { return myRangeConvFactor; }
  /// Returns the wheel velocity difference to angular velocity conv factor
  double getDiffConvFactor(void) const { return myDiffConvFactor; }
  /// Returns the multiplier for VEL2 commands
  double getVel2Divisor(void) const { return myVel2Divisor; }
  /// Returns the multiplier for the Analog Gyro
  double getGyroScaler(void) const { return myGyroScaler; }
  /// Returns true if the robot has table sensing IR
  bool haveTableSensingIR(void) const { return myTableSensingIR; }
  /// Returns true if the robot's table sensing IR bits are sent in the 4th-byte of the IO packet
  bool haveNewTableSensingIR(void) const { return myNewTableSensingIR; }
  /// Returns true if the robot has front bumpers
  bool haveFrontBumpers(void) const { return myFrontBumpers; }
  /// Returns the number of front bumpers
  int numFrontBumpers(void) const { return myNumFrontBumpers; }
  /// Returns true if the robot has rear bumpers
  bool haveRearBumpers(void) const { return myRearBumpers; }
  /// Returns the number of rear bumpers
  int numRearBumpers(void) const { return myNumRearBumpers; }
  /// Returns the number of IRs
  int getNumIR(void) const { return myNumIR; }
  /// Returns if the IR of the given number is valid
  bool haveIR(int number) const
    {
      if (myIRMap.find(number) != myIRMap.end())
	return true;
      else
	return false;
    }
  /// Returns the X location of the given numbered IR
  int getIRX(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = myIRMap.find(number)) == myIRMap.end())
	return 0;
      if ((it2 = (*it).second.find(IR_X)) == (*it).second.end())

	return 0;
      return (*it2).second;
    }
  /// Returns the Y location of the given numbered IR
  int getIRY(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = myIRMap.find(number)) == myIRMap.end())
	return 0;
      if ((it2 = (*it).second.find(IR_Y)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
  int getIRType(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = myIRMap.find(number)) == myIRMap.end())
	return 0;
      if ((it2 = (*it).second.find(IR_TYPE)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
  int getIRCycles(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = myIRMap.find(number)) == myIRMap.end())
	return 0;
      if ((it2 = (*it).second.find(IR_CYCLES)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }

  /// Returns the number of sonar
  int getNumSonar(void) const { return myNumSonar; }


  /// Returns if the robot has a laser (according to param file)
  /**
     @deprecated
  **/
  bool getLaserPossessed(void) const 
    { 
      ArLog::log(ArLog::Normal, "Something called ArRobotParams::getLaserPossessed, but this is obsolete and doesn't mean anything.");
      return false; 
    }

  /// What type of laser this is
  const char *getLaserType(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserType; 
      else
	return NULL;
    }
  /// What type of port the laser is on
  const char *getLaserPortType(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserPortType; 
      else
	return NULL;
    }
  /// What port the laser is on
  const char *getLaserPort(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserPort; 
      else
	return NULL;
    }
  /// If the laser should be auto connected
  bool getConnectLaser(int laserNumber = 1) const 
    {       
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserAutoConnect; 
      else
	return false;
    }
  /// If the laser is flipped on the robot
  bool getLaserFlipped(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserFlipped; 
      else
	return false;
    }
  /// If the laser power is controlled by the serial port lines
  bool getLaserPowerControlled(int laserNumber = 1) const 
    {       
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserPowerControlled; 
      else
	return false;
    }
  /// The max range to use the laser
  int getLaserMaxRange(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserMaxRange; 
      else
	return 0;
    }
  /// The cumulative buffer size to use for the laser
  int getLaserCumulativeBufferSize(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserCumulativeBufferSize; 
      else
	return 0;
    }
  /// The X location of the laser
  int getLaserX(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserX; 
      else
	return 0;
    }
  /// The Y location of the laser 
  int getLaserY(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserY; 
      else
	return 0;
    }
  /// The rotation of the laser on the robot
  double getLaserTh(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserTh; 
      else
	return 0;
    }
  /// The height of the laser off of the ground (0 means unknown)
  int getLaserZ(int laserNumber = 1) const 
    { 
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserZ; 
      else
	return 0;
    }
  /// Gets the string that is the readings the laser should ignore
  const char *getLaserIgnore(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserIgnore; 
      else
	return NULL;
    }
  /// Gets the string that is the degrees the laser should start on
  const char *getLaserStartDegrees(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserStartDegrees; 
      else
	return NULL;
    }
  /// Gets the string that is the degrees the laser should end on
  const char *getLaserEndDegrees(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserEndDegrees; 
      else
	return NULL;
    }
  /// Gets the string that is choice for the number of degrees the laser should use
  const char *getLaserDegreesChoice(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserDegreesChoice; 
      else
	return NULL;
    }
  /// Gets the string that is choice for the increment the laser should use
  const char *getLaserIncrement(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserIncrement; 
      else
	return NULL;
    }
  /// Gets the string that is choice for increment the laser should use
  const char *getLaserIncrementChoice(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserIncrementChoice; 
      else
	return NULL;
    }
  /// Gets the string that is choice for units the laser should use
  const char *getLaserUnitsChoice(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserUnitsChoice; 
      else
	return NULL;
    }
  /// Gets the string that is choice for reflectorBits the laser should use
  const char *getLaserReflectorBitsChoice(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserReflectorBitsChoice; 
      else
	return NULL;
    }
  /// Gets the string that is choice for starting baud the laser should use
  const char *getLaserStartingBaudChoice(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserStartingBaudChoice; 
      else
	return NULL;
    }
  /// Gets the string that is choice for auto baud the laser should use
  const char *getLaserAutoBaudChoice(int laserNumber = 1) const 
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserAutoBaudChoice; 
      else
	return NULL;
    }

  /// Gets the name of the section the laser information is in (this
  /// mostly doesn't mean anything except for commercial)
  const char *getLaserSection(int laserNumber = 1) const
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->mySection; 
      else
	return NULL;
    }

  /// Gets which power output that turns the laser on/off 
  const char *getLaserPowerOutput(int laserNumber = 1) const
    {
      if (getLaserData(laserNumber) != NULL)
	return getLaserData(laserNumber)->myLaserPowerOutput; 
      else
	return NULL;
    }

	/// PS 8/21/12 - new code to support BatteryMTX
	/// What type of battery this is
	const char *getBatteryMTXBoardType (int batteryNumber = 1) const
	{
		if (getBatteryMTXBoardData (batteryNumber) != NULL)
			return getBatteryMTXBoardData (batteryNumber)->myBatteryMTXBoardType;
		else
			return NULL;
	}
	/// What type of port the battery is on
	const char *getBatteryMTXBoardPortType (int batteryNumber = 1) const
	{
		if (getBatteryMTXBoardData (batteryNumber) != NULL)
			return getBatteryMTXBoardData (batteryNumber)->myBatteryMTXBoardPortType;
		else
			return NULL;
	}
	/// What port the battery is on
	const char *getBatteryMTXBoardPort (int batteryNumber = 1) const
	{
		if (getBatteryMTXBoardData (batteryNumber) != NULL)
			return getBatteryMTXBoardData (batteryNumber)->myBatteryMTXBoardPort;
		else
			return NULL;
	}
	/// Gets the int that is the baud for the battery
	int getBatteryMTXBoardBaud (int batteryNumber = 1) const
	{
		if (getBatteryMTXBoardData (batteryNumber) != NULL)
			return getBatteryMTXBoardData (batteryNumber)->myBatteryMTXBoardBaud;
		else
			return 0;
	}
	/// Gets a bool that specifies weather to auto connect or not
	bool getBatteryMTXBoardAutoConn (int batteryNumber = 1) const
	{
		if (getBatteryMTXBoardData (batteryNumber) != NULL)
			return getBatteryMTXBoardData (batteryNumber)->myBatteryMTXBoardAutoConn;
		else
			return false;
	}


	/// PS 9/4/12 - new code to support LCDMTX
	/// What type of LCD this is
	const char *getLCDMTXBoardType (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
			return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardType;
		else
			return NULL;
	}
	/// What type of port the lcd is on
	const char *getLCDMTXBoardPortType (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
			return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardPortType;
		else
			return NULL;
	}
	/// What port the lcd is on
	const char *getLCDMTXBoardPort (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
			return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardPort;
		else
			return NULL;
	}
	/// Gets the int that is the baud for the lcd
	int getLCDMTXBoardBaud (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
			return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardBaud;
		else
			return 0;
	}
	/// Gets a bool that specifies weather to auto connect or not
	bool getLCDMTXBoardAutoConn (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
			return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardAutoConn;
		else
			return false;
	}
	/// Gets a bool that specifies weather to disconnect on conn failure or not
	bool getLCDMTXBoardConnFailOption (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
			return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardConnFailOption;
		else
			return false;
	}

	/// Gets which power controls this LCD
	const char * getLCDMTXBoardPowerOutput (int lcdNumber = 1) const
	{
		if (getLCDMTXBoardData (lcdNumber) != NULL)
		  return getLCDMTXBoardData (lcdNumber)->myLCDMTXBoardPowerOutput;
		else
		  return NULL;
	}



	/// PS 8/21/12 - new code to support SonarMTX
	/// What type of sonar this is
	const char *getSonarMTXBoardType (int sonarNumber = 1) const
	{
		if (getSonarMTXBoardData (sonarNumber) != NULL)
			return getSonarMTXBoardData (sonarNumber)->mySonarMTXBoardType;
		else
			return NULL;
	}
	/// What type of port the sonar is on
	const char *getSonarMTXBoardPortType (int sonarNumber = 1) const
	{
		if (getSonarMTXBoardData (sonarNumber) != NULL)
			return getSonarMTXBoardData (sonarNumber)->mySonarMTXBoardPortType;
		else
			return NULL;
	}
	/// What port the sonar is on
	const char *getSonarMTXBoardPort (int sonarNumber = 1) const
	{
		if (getSonarMTXBoardData (sonarNumber) != NULL)
			return getSonarMTXBoardData (sonarNumber)->mySonarMTXBoardPort;
		else
			return NULL;
	}
	/// Gets the int that is the baud for the sonar
	int getSonarMTXBoardBaud (int sonarNumber = 1) const
	{
		if (getSonarMTXBoardData (sonarNumber) != NULL)
			return getSonarMTXBoardData (sonarNumber)->mySonarMTXBoardBaud;
		else
			return 0;
	}
	/// Gets a bool that specifies weather to auto connect or not
	bool getSonarMTXBoardAutoConn (int sonarNumber = 1) const
	{
		if (getSonarMTXBoardData (sonarNumber) != NULL)
			return getSonarMTXBoardData (sonarNumber)->mySonarMTXBoardAutoConn;
		else
			return false;
	}

  /// What delay the sonar board has
  int getSonarMTXBoardDelay(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarDelay; 
      else
	return 0;
    }

  /// What default gain the sonar board has
  int getSonarMTXBoardGain(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarGain; 
      else
	return 0;
    }

	/*
  /// What delay the sonar has
  int getSonarMTXBoardNoiseDelta(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarGain; 
      else
	return 0;
    }
	*/

  /// What delay the sonar has
  int getSonarMTXBoardDetectionThreshold(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarDetectionThreshold; 
      else
	return 0;
    }

  /// What max range the sonar has
  int getSonarMTXBoardMaxRange(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarMaxRange; 
      else
	return 0;
    }

  /// What autonomous driving flage the sonar has
  int getSonarMTXBoardUseForAutonomousDriving(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarUseForAutonomousDriving; 
      else
	return 0;
    }

  /// Gets which power output turns the sonar board on or off
  const char *getSonarMTXBoardPowerOutput(int sonarBoardNum = 1) const 
    { 
      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->mySonarMTXBoardPowerOutput; 
      else
	return NULL;
    }

  /// get number of units (ie transducers) configured on a specific board 
  int getNumSonarOnMTXBoard(int sonarBoardNum = 1) const 
    { 

      if (getSonarMTXBoardData(sonarBoardNum) != NULL)
	return getSonarMTXBoardData(sonarBoardNum)->myNumSonarTransducers; 
      else
	return 0;
    }

  /// get number of units (ie transducers) configued 
  int getNumSonarUnits() const 
    { 
      return myNumSonarUnits;
    }

  /// MPL TODO discuss boardNum here?
  /// Returns if the sonar of the given number is valid
  bool haveSonar(int boardNum) const
    {
      if (mySonarMap.find(boardNum) != mySonarMap.end())
	return true;
      else
	return false;
    }
  /// Returns the X location of the given numbered sonar disc
  int getSonarX(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_X)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
  /// Returns the Y location of the given numbered sonar disc
  int getSonarY(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_Y)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
  /// Returns the heading of the given numbered sonar disc
  int getSonarTh(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_TH)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
  /// Returns the gain of the given numbered sonar disc (only
  /// valid for MTX sonar)
  int getSonarGain(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_GAIN)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
  /// Returns the noise delta of the given numbered sonar disk (only
  /// valid for MTX sonar)
	/*
  int getSonarNoiseDelta(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_NOISE_DELTA)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }
	*/
  /// Returns the detection threshold of the given numbered sonar disc (only
  /// valid for MTX sonar)
  int getSonarDetectionThreshold(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_DETECTION_THRESHOLD)) == 
	  (*it).second.end())
	return 0;
      return (*it2).second;
    }
  /// Returns the thres med of the given numbered sonar disc (only
  /// valid for MTX sonar)
  int getSonarMaxRange(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_MAX_RANGE)) == 
	  (*it).second.end())
	return 0;
      return (*it2).second;
    }

  /// Returns the useforautonomousdriving of the given numbered sonar disc (only
  /// valid for MTX sonar)
  int getSonarUseForAutonomousDriving(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_USE_FOR_AUTONOMOUS_DRIVING)) == 
	  (*it).second.end())
	return 0;
      return (*it2).second;
    }

  /// Returns the board a sonar is on
  int getSonarMTXBoard(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_BOARD)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }

  /// Returns the unit on the board a sonar transducer is on
  int getSonarMTXBoardUnitPosition(int number) const
    {
      std::map<int, std::map<int, int> >::const_iterator it;
      std::map<int, int>::const_iterator it2;
      if ((it = mySonarMap.find(number)) == mySonarMap.end())
	return 0;
      if ((it2 = (*it).second.find(SONAR_BOARDUNITPOSITION)) == (*it).second.end())
	return 0;
      return (*it2).second;
    }



  /// Gets whether the VelMax values are settable or not
  bool hasSettableVelMaxes(void) const { return mySettableVelMaxes; }
  /// Gets the max trans vel from param file (0 uses microcontroller param)
  int getTransVelMax(void) const { return myTransVelMax; }
  /// Gets the max rot vel from param file (0 uses microcontroller param)
  int getRotVelMax(void) const { return myRotVelMax; }
  /// Whether the accelerations and decelerations are settable or not
  bool hasSettableAccsDecs(void) const { return mySettableAccsDecs; }
  /// Gets the trans accel from param file (0 uses microcontroller param)
  int getTransAccel(void) const { return myTransAccel; }
  /// Gets the trans decel from param file (0 uses microcontroller param)
  int getTransDecel(void) const { return myTransDecel; }
  /// Gets the rot accel from param file (0 uses microcontroller param)
  int getRotAccel(void) const { return myRotAccel; }
  /// Gets the rot decel from param file (0 uses microcontroller param)
  int getRotDecel(void) const { return myRotDecel; }
  /// Whether we have lateral control or not
  bool hasLatVel(void) const { return myHasLatVel; }
  /// Gets the max lat vel from param file (0 uses microcontroller param)
  int getLatVelMax(void) const { return myTransVelMax; }
  /// Gets the lat accel from param file (0 uses microcontroller param)
  int getLatAccel(void) const { return myTransAccel; }
  /// Gets the lat decel from param file (0 uses microcontroller param)
  int getLatDecel(void) const { return myTransDecel; }
  /// Saves it to the subtype.p in Aria::getDirectory/params
  AREXPORT bool save(void);

  /// The X (forward-back) location of the GPS (antenna) on the robot
  int getGPSX() const { return myGPSX; }
  /// The Y (left-right) location of the GPS (antenna) on the robot
  int getGPSY() const { return myGPSY; }
  /// The Baud rate to use when connecting to the GPS
  int getGPSBaud() const { return myGPSBaud; }
  /// The serial port the GPS is on
  const char *getGPSPort() const { return myGPSPort; }
  const char *getGPSType() const { return myGPSType; }

  // The Baud rate to use when connecting to the Sonar
  //int getSonarBaud() const { return mySonarBaud; }
  /// The serial port the Sonar is on
  //const char *getSonarPort() const { return mySonarPort; }
  //const char *getSonarType() const { return mySonarType; }

  /// What kind of compass the robot has
  const char *getCompassType() const { return myCompassType; }
  /// Gets what port the compass is on
  const char *getCompassPort() const { return myCompassPort; }

  /// For internal use only, gets a pointer to the dist conv factor value
  double *internalGetDistConvFactorPointer(void) { return &myDistConvFactor; }
  
  /// Internal function to set if we use the default behavior
  /// (shouldn't be used outside of core developers)
  static void internalSetUseDefaultBehavior(bool useDefaultBehavior,
					    const char *owerOutputDisplayHint);

  /// Internal function to get if we use the default behavior
  /// (shouldn't be used outside of core developers)
  static bool internalGetUseDefaultBehavior(void);

  /// Adds things to the config for the commercial software
  void internalAddToConfigCommercial(ArConfig *config);

  /// Internal call that adds to this config the same way it's always
  /// been done (this is only exposed for some internal testing)
  void internalAddToConfigDefault(void);

  /// return a const reference to the video device parameters
  const std::vector<ArVideoParams>& getVideoParams() const { return myVideoParams; }
  
  /// return a const reference to the PTU/PTZ parameters
  const std::vector<ArPTZParams>& getPTZParams() const { return myPTZParams; }

protected:
  static bool ourUseDefaultBehavior;
  static std::string ourPowerOutputChoices;

  // Adds a laser to the config
  AREXPORT void addLaserToConfig(int laserNumber, ArConfig *config, 
				 bool useDefaultBehavior, 
				 const char *section);

  // Adds a battery to the config 
  AREXPORT void addBatteryToConfig(int batteryNumber, ArConfig *config, 
				   bool useDefaultBehavior);

  // Adds an LCD to the config 
  AREXPORT void addLCDToConfig(int lcdNumber, ArConfig *config, 
			       bool useDefaultBehavior);

  // Adds the sonar to the config (it's added automatically for
  // non-commercial)
  AREXPORT void addSonarToConfigCommercial(ArConfig *config, bool isMTXSonar);

  // Processes the 
  AREXPORT void processSonarCommercial(ArConfig *config);

  // Adds a sonarBoard to the config 
  AREXPORT void addSonarBoardToConfig(int sonarBoardNumber, 
				      ArConfig *config,
				      bool useDefaultBehavior);

  AREXPORT void addPTZToConfig(int i, ArConfig *config);
  AREXPORT void addVideoToConfig(int i, ArConfig *config);
  
  // Processes the config for commercial
  AREXPORT bool commercialProcessFile(void);
    
  char myClass[1024];
  char mySubClass[1024];
  double myRobotRadius;
  double myRobotDiagonal;
  double myRobotWidth;
  double myRobotLength;
  double myRobotLengthFront;
  double myRobotLengthRear;
  bool myHolonomic;
  int myAbsoluteMaxRVelocity;
  int myAbsoluteMaxVelocity;
  bool myHaveMoveCommand;
  bool myRequestIOPackets;
  bool myRequestEncoderPackets;
  int mySwitchToBaudRate;
  double myAngleConvFactor;
  double myDistConvFactor;
  double myVelConvFactor;
  double myRangeConvFactor;
  double myDiffConvFactor;
  double myVel2Divisor;
  double myGyroScaler;
  bool myTableSensingIR;
  bool myNewTableSensingIR;
  bool myFrontBumpers;
  int myNumFrontBumpers;
  bool myRearBumpers;
  int myNumRearBumpers;

  class LaserData
  {
  public:
    LaserData()
      {
	myLaserType[0] = '\0';
	myLaserPortType[0] = '\0';
	myLaserPort[0] = '\0';
	myLaserAutoConnect = false;
	myLaserFlipped = false;
	myLaserPowerControlled = true;
	myLaserMaxRange = 0;
	myLaserCumulativeBufferSize = 0;
	myLaserX = 0;
	myLaserY = 0;
	myLaserTh = 0.0;
	myLaserZ = 0;
	myLaserIgnore[0] = '\0';
	myLaserStartDegrees[0] = '\0';
	myLaserEndDegrees[0] = '\0';
	myLaserDegreesChoice[0] = '\0';
	myLaserIncrement[0] = '\0';
	myLaserIncrementChoice[0] = '\0';
	myLaserUnitsChoice[0] = '\0';
	myLaserReflectorBitsChoice[0] = '\0';
	myLaserStartingBaudChoice[0] = '\0';
	myLaserAutoBaudChoice[0] = '\0';
	mySection[0] = '\0';
	myLaserPowerOutput[0] = '\0';
      }
    virtual ~LaserData() {}
  
    char myLaserType[256];
    char myLaserPortType[256];
    char myLaserPort[256];
    bool myLaserAutoConnect;
    bool myLaserFlipped;
    bool myLaserPowerControlled;
    unsigned int myLaserMaxRange;
    unsigned int myLaserCumulativeBufferSize;
    int myLaserX;
    int myLaserY;
    double myLaserTh;
    int myLaserZ;
    char myLaserIgnore[256];
    char myLaserStartDegrees[256];
    char myLaserEndDegrees[256];
    char myLaserDegreesChoice[256];
    char myLaserIncrement[256];
    char myLaserIncrementChoice[256];
    char myLaserUnitsChoice[256];
    char myLaserReflectorBitsChoice[256];
    char myLaserStartingBaudChoice[256];
    char myLaserAutoBaudChoice[256];
    char mySection[256];
    char myLaserPowerOutput[256];
  };
  std::map<int, LaserData *> myLasers;

  const LaserData *getLaserData(int laserNumber) const
    {
      std::map<int, LaserData *>::const_iterator it;
      if ((it = myLasers.find(laserNumber)) != myLasers.end())
	return (*it).second;
      else
	return NULL;
    }

  LaserData *getLaserData(int laserNumber) 
    {
      std::map<int, LaserData *>::const_iterator it;
      if ((it = myLasers.find(laserNumber)) != myLasers.end())
	return (*it).second;
      else
	return NULL;
    }

  class BatteryMTXBoardData
  {
  public:
    BatteryMTXBoardData()
      {
	myBatteryMTXBoardType[0] = '\0';
	myBatteryMTXBoardPortType[0] = '\0';
	//sprintf((char *)myBatteryMTXBoardPortType, "serial");
	myBatteryMTXBoardPort[0] = '\0';
	myBatteryMTXBoardBaud = 0;
	myBatteryMTXBoardAutoConn = false;
      }
    virtual ~BatteryMTXBoardData() {}
  
    char myBatteryMTXBoardType[256];
    char myBatteryMTXBoardPortType[256];
    char myBatteryMTXBoardPort[256];
    int myBatteryMTXBoardBaud;
    bool myBatteryMTXBoardAutoConn;
  };
  std::map<int, BatteryMTXBoardData *> myBatteryMTXBoards;

  const BatteryMTXBoardData *getBatteryMTXBoardData(int batteryBoardNum) const
    {
      std::map<int, BatteryMTXBoardData *>::const_iterator it;
      if ((it = myBatteryMTXBoards.find(batteryBoardNum)) != myBatteryMTXBoards.end())
	return (*it).second;
      else
	return NULL;
    }

  BatteryMTXBoardData *getBatteryMTXBoardData(int batteryBoardNum) 
    {
      std::map<int, BatteryMTXBoardData *>::const_iterator it;
      if ((it = myBatteryMTXBoards.find(batteryBoardNum)) != myBatteryMTXBoards.end())
	return (*it).second;
      else
	return NULL;
    }


  class LCDMTXBoardData
  {
  public:
    LCDMTXBoardData()
      {
	myLCDMTXBoardType[0] = '\0';
	myLCDMTXBoardPortType[0] = '\0';
	//sprintf((char *)myLCDMTXBoardPortType, "serial");
	myLCDMTXBoardPort[0] = '\0';
	myLCDMTXBoardBaud = 0;
	myLCDMTXBoardAutoConn = false;
	myLCDMTXBoardConnFailOption = false;
	myLCDMTXBoardPowerOutput[0] = '\0';
      }
    virtual ~LCDMTXBoardData() {}
  
    char myLCDMTXBoardType[256];
    char myLCDMTXBoardPortType[256];
    char myLCDMTXBoardPort[256];
    int myLCDMTXBoardBaud;
    bool myLCDMTXBoardAutoConn;
    bool myLCDMTXBoardConnFailOption;
    char myLCDMTXBoardPowerOutput[256];
  };
  std::map<int, LCDMTXBoardData *> myLCDMTXBoards;

  const LCDMTXBoardData *getLCDMTXBoardData(int lcdBoardNum) const
    {
      std::map<int, LCDMTXBoardData *>::const_iterator it;
      if ((it = myLCDMTXBoards.find(lcdBoardNum)) != myLCDMTXBoards.end())
	return (*it).second;
      else
	return NULL;
    }

  LCDMTXBoardData *getLCDMTXBoardData(int lcdBoardNum) 
    {
      std::map<int, LCDMTXBoardData *>::const_iterator it;
      if ((it = myLCDMTXBoards.find(lcdBoardNum)) != myLCDMTXBoards.end())
	return (*it).second;
      else
	return NULL;
    }


  class SonarMTXBoardData
  {
  public:
    SonarMTXBoardData()
      {
			mySonarMTXBoardType[0] = '\0';
			mySonarMTXBoardPortType[0] = '\0';
			mySonarMTXBoardPort[0] = '\0';
			mySonarMTXBoardBaud = 0;
			mySonarMTXBoardAutoConn = false;
			myNumSonarTransducers = 0;
			mySonarDelay = 2;
			mySonarGain = 10;
			/*
			mySonarNoiseDelta = 1250;
			*/
			mySonarDetectionThreshold = 25;
			mySonarMaxRange = 255 * 17;
			mySonarUseForAutonomousDriving = false;
			mySonarMTXBoardPowerOutput[0] = '\0';
      }
    virtual ~SonarMTXBoardData() {}
  
    char mySonarMTXBoardType[256];
    char mySonarMTXBoardPortType[256];
    char mySonarMTXBoardPort[256];
    int mySonarMTXBoardBaud;
    bool mySonarMTXBoardAutoConn;
    int myNumSonarTransducers;
    int mySonarBaud;
    int mySonarDelay;
    int mySonarGain;
		/*
    int mySonarNoiseDelta;
		*/
    int mySonarDetectionThreshold;
    int mySonarMaxRange;
	bool mySonarUseForAutonomousDriving;
    char mySonarMTXBoardPowerOutput[256];
  };
  std::map<int, SonarMTXBoardData *> mySonarMTXBoards;

  const SonarMTXBoardData *getSonarMTXBoardData(int sonarBoardNum) const
    {
		std::map<int, SonarMTXBoardData *>::const_iterator it;
		if ((it = mySonarMTXBoards.find(sonarBoardNum)) != mySonarMTXBoards.end())
			return (*it).second;
		else
			return NULL;
    }

  SonarMTXBoardData *getSonarMTXBoardData(int sonarBoardNum) 
    {
		std::map<int, SonarMTXBoardData *>::const_iterator it;
		if ((it = mySonarMTXBoards.find(sonarBoardNum)) != mySonarMTXBoards.end())
			return (*it).second;
		else
			return NULL;
    }

  bool mySettableVelMaxes;
  int myTransVelMax;
  int myRotVelMax;
  bool mySettableAccsDecs;
  int myTransAccel;
  int myTransDecel;
  int myRotAccel;
  int myRotDecel;

  bool myHasLatVel;
  int myLatVelMax;
  int myLatAccel;
  int myLatDecel;
  int myAbsoluteMaxLatVelocity;


  // Sonar
  int mySonarBoardCount;
  int myNumSonarUnits;
  int myNumSonar;
  std::map<int, std::map<int, int> > mySonarMap;
  enum SonarInfo 
  { 
    SONAR_X, 
    SONAR_Y, 
    SONAR_TH,
    SONAR_BOARD,
    SONAR_BOARDUNITPOSITION,
    SONAR_GAIN,
		/*
    SONAR_NOISE_DELTA,
		*/
    SONAR_DETECTION_THRESHOLD,
    SONAR_MAX_RANGE,
	SONAR_USE_FOR_AUTONOMOUS_DRIVING
  };
  AREXPORT void internalSetSonar(int num, int x, int y, int th);
  AREXPORT bool parseSonarUnit(ArArgumentBuilder *builder);
  AREXPORT bool parseMTXSonarUnit(ArArgumentBuilder *builder);
	AREXPORT const std::list<ArArgumentBuilder *> *getSonarUnits(void);
	//AREXPORT const std::list<ArArgumentBuilder *> *getMTXSonarUnits(void);
  std::list<ArArgumentBuilder *> myGetSonarUnitList;
  ArRetFunctorC<const std::list<ArArgumentBuilder *> *, ArRobotParams> mySonarUnitGetFunctor;
  ArRetFunctor1C<bool, ArRobotParams, ArArgumentBuilder *> mySonarUnitSetFunctor;


  // Battery
	int myBatteryMTXBoardCount;

  // LCD
	int myLCDMTXBoardCount;

  // Sonar
	int mySonarMTXBoardCount;

  // IRs
  int myNumIR;
  std::map<int, std::map<int, int> > myIRMap;
  enum IRInfo 
  { 
    IR_X, 
    IR_Y,
    IR_TYPE,
    IR_CYCLES
  };
  AREXPORT void internalSetIR(int num, int type, int cycles, int x, int y);
  AREXPORT bool parseIRUnit(ArArgumentBuilder *builder);
  AREXPORT const std::list<ArArgumentBuilder *> *getIRUnits(void);
  std::list<ArArgumentBuilder *> myGetIRUnitList;
  ArRetFunctorC<const std::list<ArArgumentBuilder *> *, ArRobotParams> myIRUnitGetFunctor;
  ArRetFunctor1C<bool, ArRobotParams, ArArgumentBuilder *> myIRUnitSetFunctor;

  // GPS
  bool myGPSPossessed;
  int myGPSX;
  int myGPSY;
  char myGPSPort[256];
  char myGPSType[256];
  int myGPSBaud;

  // Sonar
  //char mySonarPort[256];
  //char mySonarType[256];
  //int mySonarBaud;

  // Compass
  char myCompassType[256];
  char myCompassPort[256];


  // PTZ/PTU parameters
  std::vector<ArPTZParams> myPTZParams;

  // Video device parameters
  std::vector<ArVideoParams> myVideoParams;  

  ArConfig *myCommercialConfig;
  bool myCommercialAddedConnectables;
  bool myCommercialProcessedSonar;
  int myCommercialNumSonar;
  int myCommercialMaxNumberOfLasers;
  int myCommercialMaxNumberOfBatteries;
  int myCommercialMaxNumberOfLCDs;
  int myCommercialMaxNumberOfSonarBoards;
  /// This lets us just have a straight mapping from the child
  /// argument number to the sonar map above
  std::map<int, int> myCommercialSonarFieldMap;

  ArRetFunctorC<bool, ArRobotParams> myCommercialProcessFileCB;
};

#endif // ARROBOTPARAMS_H