Check-in [cecb467b84]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Correction of wide spread typo.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:cecb467b84824560292b0fb29cd3e49243a2332d724c33ae964f24e710d4531b
User & Date: gwlester 2018-02-09 22:39:37
Context
2018-02-10
21:26
Added copyright statement and dedication text to each of the Tcl Module files (.tm) being built. Moved package provides to the top of the file. Leaf check-in: 1b79317527 user: gwlester tags: trunk
21:04
Starting a new branch that will introduce instabilities. Changes in this checkin intro place holders for the configuration of the accelerometer and magnetometer. The general configuration gui will likely change and even the low level bno055 may have some incompatible changes (the examples will be updated accordingly). check-in: e9e2cb5abf user: gwlester tags: development
2018-02-09
22:39
Correction of wide spread typo. check-in: cecb467b84 user: gwlester tags: trunk
22:38
General configration section of dIMU class and Multisenor example working. check-in: cbe12efdf4 user: gwlester tags: trunk
Changes

Changes to examples/Gyro_Example.tcl.

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
        gyr,hiR,intEnab \
    piio usleep 10

    ##
    ## Specified scale range, power mode and bandwidth.
    ##
    bno055 writeRegisterBlock $handle \
        gyr,range       [bno055 getValue2 GRY_RANGE [string toupper $range]] \
        gyr,bandwidth   [bno055 getValue GRY_BANDWIDTH_32HZ] \
        gyr,pwrMode     [bno055 getValue GRY_POWER_MODE_NORMAL]
    piio usleep 10

    ##
    ## Switch to IMU mode so autocalibration happens.
    ##
    bno055 writeRegister $handle operMode [bno055 getValue OPER_MODE_IMU]
    piio usleep 20







|
|
|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
        gyr,hiR,intEnab \
    piio usleep 10

    ##
    ## Specified scale range, power mode and bandwidth.
    ##
    bno055 writeRegisterBlock $handle \
        gyr,range       [bno055 getValue2 GYR_RANGE [string toupper $range]] \
        gyr,bandwidth   [bno055 getValue GYR_BANDWIDTH_32HZ] \
        gyr,pwrMode     [bno055 getValue GYR_POWER_MODE_NORMAL]
    piio usleep 10

    ##
    ## Switch to IMU mode so autocalibration happens.
    ##
    bno055 writeRegister $handle operMode [bno055 getValue OPER_MODE_IMU]
    piio usleep 20

Changes to src/bno055/bno055.tcl.

202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
...
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

    SymDef ORI_MODE WINDOWS 0
    SymDef ORI_MODE ANDROID 1
    SymDef TEMP_UNIT C 0
    SymDef TEMP_UNIT F 1
    SymDef EUL_UNIT DEG 0
    SymDef EUL_UNIT RAD 1
    SymDef GRY_UNIT DPS 0
    SymDef GRY_UNIT RPS 1
    SymDef ACC_UNIT MPS2 0
    SymDef ACC_UNIT MG 1
    SymDef OPER_MODE CONFIGMODE 0b0000
    SymDef OPER_MODE ACCONLY 0b0001
    SymDef OPER_MODE MAGONLY 0b0010
    SymDef OPER_MODE GYROONLY 0b0011
    SymDef OPER_MODE ACCMAG 0b0100
................................................................................
    SymDef MAG_OPER_MODE REGULAR 0b01
    SymDef MAG_OPER_MODE ENHANCED 0b10
    SymDef MAG_OPER_MODE HIGH 0b11
    SymDef MAG_POWER_MODE NORMAL 0b00
    SymDef MAG_POWER_MODE SLEEP 0b01
    SymDef MAG_POWER_MODE SUSPEND 0b10
    SymDef MAG_POWER_MODE FORCE 0b11
    SymDef GRY_RANGE 2000DPS 0b000
    SymDef GRY_RANGE 1000DPS 0b001
    SymDef GRY_RANGE 500DPS 0b010
    SymDef GRY_RANGE 250DPS 0b011
    SymDef GRY_RANGE 125DPS 0b100
    SymDef GRY_BANDWIDTH 523HZ 0b000
    SymDef GRY_BANDWIDTH 230HZ 0b001
    SymDef GRY_BANDWIDTH 116HZ 0b010
    SymDef GRY_BANDWIDTH 47HZ 0b011
    SymDef GRY_BANDWIDTH 23HZ 0b100
    SymDef GRY_BANDWIDTH 12HZ 0b101
    SymDef GRY_BANDWIDTH 64HZ 0b110
    SymDef GRY_BANDWIDTH 32HZ 0b111
    SymDef GRY_POWER_MODE NORMAL 0b000
    SymDef GRY_POWER_MODE FAST_UP 0b001
    SymDef GRY_POWER_MODE DEEP_SUSPEND 0b010
    SymDef GRY_POWER_MODE SUSPEND 0b011
    SymDef GRY_POWER_MODE ADVANCED_POWERSAVE 0b100
    SymDef ACC_SLEEP_MODE EVENT 0
    SymDef ACC_SLEEP_MODE EQUIDISTANT 1
    set value 0
    foreach item {0.5MS 0.5MS 0.5MS 0.5MS 0.5MS 0.5MS 1MS 2MS 4MS 6MS 10MS 25MS 50MS 100MS 500MS 1000MS} {
        SymDef ACC_SLEEP_DURR $item $value
        incr value
    }
    set value 0
    foreach item {"Not Allowed" 4MS 5MS 8MS 10MS 15MS 20MS 40MS} {
        SymDef GRY_AUTOSLP_DURR $item $value
        incr value
    }
    set value 0
    foreach item {4MS 5MS 8MS 10MS 15MS 18MS 20MS} {
        SymDef GRY_SLEEP_DURR $item $value
        incr value
    }
    unset value
    SymDef GYR_AWAKE_DURR 8SAMPLES 0
    SymDef GYR_AWAKE_DURR 16SAMPLES 1
    SymDef GYR_AWAKE_DURR 32SAMPLES 2
    SymDef GYR_AWAKE_DURR 64SAMPLES 3







|
|







 







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|









|




|







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
...
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

    SymDef ORI_MODE WINDOWS 0
    SymDef ORI_MODE ANDROID 1
    SymDef TEMP_UNIT C 0
    SymDef TEMP_UNIT F 1
    SymDef EUL_UNIT DEG 0
    SymDef EUL_UNIT RAD 1
    SymDef GYR_UNIT DPS 0
    SymDef GYR_UNIT RPS 1
    SymDef ACC_UNIT MPS2 0
    SymDef ACC_UNIT MG 1
    SymDef OPER_MODE CONFIGMODE 0b0000
    SymDef OPER_MODE ACCONLY 0b0001
    SymDef OPER_MODE MAGONLY 0b0010
    SymDef OPER_MODE GYROONLY 0b0011
    SymDef OPER_MODE ACCMAG 0b0100
................................................................................
    SymDef MAG_OPER_MODE REGULAR 0b01
    SymDef MAG_OPER_MODE ENHANCED 0b10
    SymDef MAG_OPER_MODE HIGH 0b11
    SymDef MAG_POWER_MODE NORMAL 0b00
    SymDef MAG_POWER_MODE SLEEP 0b01
    SymDef MAG_POWER_MODE SUSPEND 0b10
    SymDef MAG_POWER_MODE FORCE 0b11
    SymDef GYR_RANGE 2000DPS 0b000
    SymDef GYR_RANGE 1000DPS 0b001
    SymDef GYR_RANGE 500DPS 0b010
    SymDef GYR_RANGE 250DPS 0b011
    SymDef GYR_RANGE 125DPS 0b100
    SymDef GYR_BANDWIDTH 523HZ 0b000
    SymDef GYR_BANDWIDTH 230HZ 0b001
    SymDef GYR_BANDWIDTH 116HZ 0b010
    SymDef GYR_BANDWIDTH 47HZ 0b011
    SymDef GYR_BANDWIDTH 23HZ 0b100
    SymDef GYR_BANDWIDTH 12HZ 0b101
    SymDef GYR_BANDWIDTH 64HZ 0b110
    SymDef GYR_BANDWIDTH 32HZ 0b111
    SymDef GYR_POWER_MODE NORMAL 0b000
    SymDef GYR_POWER_MODE FAST_UP 0b001
    SymDef GYR_POWER_MODE DEEP_SUSPEND 0b010
    SymDef GYR_POWER_MODE SUSPEND 0b011
    SymDef GYR_POWER_MODE ADVANCED_POWERSAVE 0b100
    SymDef ACC_SLEEP_MODE EVENT 0
    SymDef ACC_SLEEP_MODE EQUIDISTANT 1
    set value 0
    foreach item {0.5MS 0.5MS 0.5MS 0.5MS 0.5MS 0.5MS 1MS 2MS 4MS 6MS 10MS 25MS 50MS 100MS 500MS 1000MS} {
        SymDef ACC_SLEEP_DURR $item $value
        incr value
    }
    set value 0
    foreach item {"Not Allowed" 4MS 5MS 8MS 10MS 15MS 20MS 40MS} {
        SymDef GYR_AUTOSLP_DURR $item $value
        incr value
    }
    set value 0
    foreach item {4MS 5MS 8MS 10MS 15MS 18MS 20MS} {
        SymDef GYR_SLEEP_DURR $item $value
        incr value
    }
    unset value
    SymDef GYR_AWAKE_DURR 8SAMPLES 0
    SymDef GYR_AWAKE_DURR 16SAMPLES 1
    SymDef GYR_AWAKE_DURR 32SAMPLES 2
    SymDef GYR_AWAKE_DURR 64SAMPLES 3

Changes to src/dimu/dimu.tcl.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
...
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
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
		variable OptionDef
		variable ReadOnly

		set OptionDef {
            -bus        	{-default 1}
			-power          {-register powerMode -allowed {normal low suspend} -type PWR_MODE}
			-operation		{-register operMode -immediate yes -allowed {configmode acconly magonly gyroonly accmag accgyro maggyro amg imu compass m4g ndof_fmc_off ndof} -type OPER_MODE}
            -gyrorange		{-register gyr,range -allowed {2000dps 1000dps 500dps 250dps 125dps} -type GRY_RANGE}
            -gyrobandwidth	{-register gyr,bandwidth -allowed {523hz 230hz 116hz 64hz 47hz 32hz 23hz 12hz} -type GRY_BANDWIDTH}
            -gyropowermode	{-register gyr,pwrMode -allowed {normal fast_up deep_suspend suspend advanced_powersave} -type GRY_POWER_MODE}
			-gyrounits		{-register gyr,units -allowed {dps rps} -type GRY_UNIT}
			-gyroautosleep	{-register gyr,autoSlpDur -allowed {4MS 5MS 8MS 10MS 15MS 20MS 40MS} -type GRY_AUTOSLP_DURR}
			-gyrosleep		{-register gyr,sleepDur -allowed {4MS 5MS 8MS 10MS 15MS 18MS 20MS} -type GRY_SLEEP_DURR}
			-gyroawake		{-register gyr,am,durr -allowed {8samples 16samples 32samples 64samples} -type GYR_AWAKE_DURR}
			-gyroslope		{-register gyr,am,slope}
			-gyroxoffset	{-register gyr,x,offset}
			-gyroyoffset	{-register gyr,y,offset}
			-gyrozoffset	{-register gyr,z,offset}
			-clocksource	{-register clockSource -type CLOCK_SOURCE}
			-temperaturesource	{-register tempSource -type TEMP_SRC}
................................................................................
		set operMode [bno055 getShortSymbol OPER_MODE [dict get $currentConfiguration operMode]]
		if {$operMode in {CONFIGMODE ACCONLY MAGONLY COMPASS M4G}} {
			throw [list DIMU SENDIS $operMode] "Gyroscope reading are not availble when dIMU is in '$operMode' mode."
		}
		
		set results {}
		set readings [bno055 readMultipleRegisters [dict get $instanceInfo handle] {gyr,data,x gyr,data,y gyr,data,z}]
		set range [bno055 getSymbol GRY_RANGE [dict get $currentConfiguration gyr,range]]
		switch -exact -- $range {
			GRY_RANGE_125DPS {
				set divisor 256.0
			}
			GRY_RANGE_250DPS {
				set divisor 128.0
			}
			GRY_RANGE_500DPS {
				set divisor 64.0
			}
			GRY_RANGE_1000DPS {
				set divisor 32.0
			}
			GRY_RANGE_2000DPS {
				set divisor 16.0
			}
		}
		set units [bno055 getSymbol GRY_UNIT [dict get $currentConfiguration gyr,units]]
		if {$units eq "GRY_UNIT_DPS" } {
			dict set results units dps
		} else {
			dict set results units rps
			set divisor [expr {$divsor * 900 / 16}]
		}
		dict set results x [expr {[dict get $readings gyr,data,x] / $divisor}]
		dict set results y [expr {[dict get $readings gyr,data,y] / $divisor}]
................................................................................

	method readTemperature {} {
        variable instanceInfo
        variable currentConfiguration

		set results {}
		set readings [bno055 readRegister [dict get $instanceInfo handle] temp,data]
		set units [bno055 getSymbol GRY_UNIT [dict get $currentConfiguration temp,units]]
		if {$units in {C c}} {
			dict set results units C
			set divisor 1.0
		} else {
			dict set results units V
			set divisor 2.0
		}







|
|
|
|
|
|







 







|

|


|


|


|


|



|
|







 







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
...
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
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
		variable OptionDef
		variable ReadOnly

		set OptionDef {
            -bus        	{-default 1}
			-power          {-register powerMode -allowed {normal low suspend} -type PWR_MODE}
			-operation		{-register operMode -immediate yes -allowed {configmode acconly magonly gyroonly accmag accgyro maggyro amg imu compass m4g ndof_fmc_off ndof} -type OPER_MODE}
            -gyrorange		{-register gyr,range -allowed {2000dps 1000dps 500dps 250dps 125dps} -type GYR_RANGE}
            -gyrobandwidth	{-register gyr,bandwidth -allowed {523hz 230hz 116hz 64hz 47hz 32hz 23hz 12hz} -type GYR_BANDWIDTH}
            -gyropowermode	{-register gyr,pwrMode -allowed {normal fast_up deep_suspend suspend advanced_powersave} -type GYR_POWER_MODE}
			-gyrounits		{-register gyr,units -allowed {dps rps} -type GYR_UNIT}
			-gyroautosleep	{-register gyr,autoSlpDur -allowed {4MS 5MS 8MS 10MS 15MS 20MS 40MS} -type GYR_AUTOSLP_DURR}
			-gyrosleep		{-register gyr,sleepDur -allowed {4MS 5MS 8MS 10MS 15MS 18MS 20MS} -type GYR_SLEEP_DURR}
			-gyroawake		{-register gyr,am,durr -allowed {8samples 16samples 32samples 64samples} -type GYR_AWAKE_DURR}
			-gyroslope		{-register gyr,am,slope}
			-gyroxoffset	{-register gyr,x,offset}
			-gyroyoffset	{-register gyr,y,offset}
			-gyrozoffset	{-register gyr,z,offset}
			-clocksource	{-register clockSource -type CLOCK_SOURCE}
			-temperaturesource	{-register tempSource -type TEMP_SRC}
................................................................................
		set operMode [bno055 getShortSymbol OPER_MODE [dict get $currentConfiguration operMode]]
		if {$operMode in {CONFIGMODE ACCONLY MAGONLY COMPASS M4G}} {
			throw [list DIMU SENDIS $operMode] "Gyroscope reading are not availble when dIMU is in '$operMode' mode."
		}
		
		set results {}
		set readings [bno055 readMultipleRegisters [dict get $instanceInfo handle] {gyr,data,x gyr,data,y gyr,data,z}]
		set range [bno055 getSymbol GYR_RANGE [dict get $currentConfiguration gyr,range]]
		switch -exact -- $range {
			GYR_RANGE_125DPS {
				set divisor 256.0
			}
			GYR_RANGE_250DPS {
				set divisor 128.0
			}
			GYR_RANGE_500DPS {
				set divisor 64.0
			}
			GYR_RANGE_1000DPS {
				set divisor 32.0
			}
			GYR_RANGE_2000DPS {
				set divisor 16.0
			}
		}
		set units [bno055 getSymbol GYR_UNIT [dict get $currentConfiguration gyr,units]]
		if {$units eq "GYR_UNIT_DPS" } {
			dict set results units dps
		} else {
			dict set results units rps
			set divisor [expr {$divsor * 900 / 16}]
		}
		dict set results x [expr {[dict get $readings gyr,data,x] / $divisor}]
		dict set results y [expr {[dict get $readings gyr,data,y] / $divisor}]
................................................................................

	method readTemperature {} {
        variable instanceInfo
        variable currentConfiguration

		set results {}
		set readings [bno055 readRegister [dict get $instanceInfo handle] temp,data]
		set units [bno055 getSymbol GYR_UNIT [dict get $currentConfiguration temp,units]]
		if {$units in {C c}} {
			dict set results units C
			set divisor 1.0
		} else {
			dict set results units V
			set divisor 2.0
		}