Skip to content

Commit 0eee1b6

Browse files
Updated special config files
1 parent 41a9724 commit 0eee1b6

File tree

4 files changed

+100
-66
lines changed

4 files changed

+100
-66
lines changed

trikControl/model-config-usb.xml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Note that device, even if listed here, may fail by itself, then it also will not
4141
<angularServomotor />
4242
</S5>
4343
<S6>
44-
<angularServomotor />
44+
<manipulatorServomotor />
4545
</S6>
4646

4747
<!-- Analog sensor ports. -->
@@ -52,17 +52,18 @@ Note that device, even if listed here, may fail by itself, then it also will not
5252
<sharpGP2Sensor />
5353
</A2>
5454
<A3>
55-
<sharpGP2Sensor />
55+
<touchSensor />
5656
</A3>
5757
<A4>
58-
<analogSensor />
58+
<touchSensor />
5959
</A4>
6060
<A5>
61-
<analogSensor />
61+
<lightSensor />
6262
</A5>
6363
<A6>
64-
<analogSensor />
64+
<lightSensor />
6565
</A6>
66+
6667
<!-- Analog sensor ports (I2C NXT temp sensors). -->
6768
<T1>
6869
<analogSensor />
@@ -595,10 +596,10 @@ Note that device, even if listed here, may fail by itself, then it also will not
595596
</U7_0x20>
596597
<!-- Digital sensor ports. -->
597598
<D1>
598-
<rangeSensor />
599+
<sonarSensor />
599600
</D1>
600601
<D2>
601-
<rangeSensor />
602+
<sonarSensor />
602603
</D2>
603604
<!--
604605
<D3>
@@ -607,22 +608,18 @@ Note that device, even if listed here, may fail by itself, then it also will not
607608
-->
608609

609610
<!-- Encoder ports. -->
610-
611-
<B1>
611+
<E1>
612612
<encoder95 />
613-
</B1>
614-
615-
<B2>
613+
</E1>
614+
<E2>
616615
<encoder95 />
617-
</B2>
618-
619-
<B3>
616+
</E2>
617+
<E3>
620618
<encoder95 />
621-
</B3>
622-
623-
<B4>
619+
</E3>
620+
<E4>
624621
<encoder95 />
625-
</B4>
622+
</E4>
626623

627624
<!-- Power motor ports. -->
628625
<M1>
@@ -688,7 +685,7 @@ Note that device, even if listed here, may fail by itself, then it also will not
688685
</video1>
689686

690687
<video2>
691-
<colorSensor3x3 />
688+
<lineSensor />
692689
</video2>
693690

694691
<!-- Sound sensor ports. -->
@@ -708,7 +705,9 @@ Note that device, even if listed here, may fail by itself, then it also will not
708705
<mailbox />
709706

710707
<!-- Example of custom FIFO sensor -->
711-
<!-- <soundSensor>
708+
<!--
709+
<soundSensor>
712710
<fifo />
713-
</soundSensor>-->
711+
</soundSensor>
712+
-->
714713
</config>

trikControl/model-config-v6.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Note that device, even if listed here, may fail by itself, then it also will not
2626

2727
<!-- Servomotor or PWM capture ports. -->
2828
<E1>
29-
<angularServomotor />
29+
<manipulatorServomotor />
3030
</E1>
3131
<E2>
32-
<angularServomotor invert="false" />
32+
<angularServomotor />
3333
</E2>
3434
<E3>
35-
<angularServomotor min="600000" max="2200000" zero="1400000" stop="0" invert="false" />
35+
<angularServomotor />
3636
</E3>
3737
<C1>
3838
<angularServomotor />
@@ -52,16 +52,16 @@ Note that device, even if listed here, may fail by itself, then it also will not
5252
<sharpGP2Sensor />
5353
</A2>
5454
<A3>
55-
<sharpGP2Sensor />
55+
<touchSensor />
5656
</A3>
5757
<A4>
58-
<analogSensor />
58+
<touchSensor />
5959
</A4>
6060
<A5>
61-
<analogSensor />
61+
<lightSensor />
6262
</A5>
6363
<A6>
64-
<analogSensor />
64+
<lightSensor />
6565
</A6>
6666

6767
<!-- Digital sensor ports. -->
@@ -85,7 +85,7 @@ Note that device, even if listed here, may fail by itself, then it also will not
8585
<encoder95 />
8686
</B2>
8787
<B3>
88-
<encoder126 />
88+
<encoder95 />
8989
</B3>
9090
<B4>
9191
<encoder95 />
@@ -96,7 +96,7 @@ Note that device, even if listed here, may fail by itself, then it also will not
9696
<powerMotor />
9797
</M1>
9898
<M2>
99-
<powerMotor invert="true" />
99+
<powerMotor />
100100
</M2>
101101
<M3>
102102
<powerMotor />
@@ -111,7 +111,7 @@ Note that device, even if listed here, may fail by itself, then it also will not
111111
</video0>
112112

113113
<video1>
114-
<colorSensor3x3 />
114+
<lineSensor />
115115
</video1>
116116

117117
<!-- On-board sensors. -->
@@ -125,7 +125,9 @@ Note that device, even if listed here, may fail by itself, then it also will not
125125
<mailbox />
126126

127127
<!-- Example of custom FIFO sensor -->
128-
<!-- <soundSensor>
128+
<!--
129+
<soundSensor>
129130
<fifo />
130-
</soundSensor>-->
131+
</soundSensor>
132+
-->
131133
</config>

trikControl/system-config-usb.xml

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ equal to its class name.
5656

5757
echo 1 > /sys/devices/virtual/input/input1/enable_device
5858

59-
<!-- It is very important to initialize MSP430 USB devices with this parameters -->
59+
<!-- It is very important to initialize MSP430 USB devices with these parameters -->
6060
stty 921600 -F /dev/ttyACM0 -echo -onlcr
6161
stty 921600 -F /dev/ttyACM1 -echo -onlcr
6262

@@ -73,18 +73,18 @@ equal to its class name.
7373
<rangeSensor commonModule="hcsr04" minValue="0" maxValue="100" />
7474
<digitalSensor />
7575
<fifo />
76-
<accelerometer deviceFile="/dev/input/event1" optional="true" />
76+
<accelerometer deviceFile="/dev/input/by-path/platform-i2c_davinci.2-event" optional="true" />
7777
<gyroscope deviceFile="/dev/input/by-path/platform-spi_davinci.1-event" optional="true" />
78-
<lineSensor script="/etc/init.d/line-sensor-ov7670.sh" inputFile="/run/line-sensor.in.fifo" outputFile="/run/line-sensor.out.fifo" toleranceFactor="1.0" />
79-
<objectSensor script="/etc/init.d/object-sensor-ov7670.sh" inputFile="/run/object-sensor.in.fifo" outputFile="/run/object-sensor.out.fifo" toleranceFactor="1.0" />
80-
<colorSensor script="/etc/init.d/mxn-sensor-ov7670.sh" inputFile="/run/mxn-sensor.in.fifo" outputFile="/run/mxn-sensor.out.fifo" m="3" n="3" />
78+
<lineSensor script="/etc/init.d/line-sensor-ov7670" inputFile="/run/line-sensor.in.fifo" outputFile="/run/line-sensor.out.fifo" toleranceFactor="1.0" />
79+
<objectSensor script="/etc/init.d/object-sensor-ov7670" inputFile="/run/object-sensor.in.fifo" outputFile="/run/object-sensor.out.fifo" toleranceFactor="1.0" />
80+
<colorSensor script="/etc/init.d/mxn-sensor-ov7670" inputFile="/run/mxn-sensor.in.fifo" outputFile="/run/mxn-sensor.out.fifo" m="3" n="3" />
8181
<soundSensor script="/etc/init.d/sound-sensor-1.sh" inputFile="/run/sound-sensor.in.fifo" outputFile="/run/sound-sensor.out.fifo" />
8282

8383
<!-- Device files for LED on a brick. -->
8484
<led green="/sys/class/leds/led_green/brightness" red="/sys/class/leds/led_red/brightness" />
8585

8686
<!--Device file for keys on a brick -->
87-
<keys deviceFile="/dev/input/by-path/platform-gpio-keys-event" />
87+
<keys deviceFile="/dev/input/by-path/platform-gpio-keys-event" />
8888

8989
<!-- Settings for gamepad TCP server to communicate with Android "TRIK Gamepad" application -->
9090
<gamepad port="4444" optional="true" />
@@ -141,10 +141,10 @@ equal to its class name.
141141
frequencyFile="/sys/class/pwm/ecap_cap.0/freq"
142142
dutyFile="/sys/class/pwm/ecap_cap.0/duty_percentage"
143143
/>
144-
<powerMotor port="M1" i2cCommandNumber="0x0014" />
144+
<powerMotor port="M1" i2cCommandNumber="0x0014" invert="true" />
145145
<powerMotor port="M2" i2cCommandNumber="0x0015" />
146-
<powerMotor port="M3" i2cCommandNumber="0x0017" />
147-
<powerMotor port="M4" i2cCommandNumber="0x0016" />
146+
<powerMotor port="M3" i2cCommandNumber="0x0016" />
147+
<powerMotor port="M4" i2cCommandNumber="0x0017" />
148148
<powerMotor port="SS1" i2cCommandNumber="0x003F" />
149149
<powerMotor port="SS2" i2cCommandNumber="0x0040" />
150150
<powerMotor port="SS3" i2cCommandNumber="0x0041" />
@@ -345,8 +345,8 @@ equal to its class name.
345345
<encoder port="B3" i2cCommandNumber="0x0032" />
346346
<encoder port="B4" i2cCommandNumber="0x0033" />
347347
<encoder port="E1" i2cCommandNumber="0x0030" />
348-
<encoder port="E2" i2cCommandNumber="0x0031" />
349-
<encoder port="E3" i2cCommandNumber="0x0032" />
348+
<encoder port="E2" i2cCommandNumber="0x0031" invert="true" />
349+
<encoder port="E3" i2cCommandNumber="0x0032" invert="true" />
350350
<encoder port="E4" i2cCommandNumber="0x0033" />
351351
<rangeSensor port="D1" eventFile="/dev/input/by-path/platform-trik_jd1-event" module="jd1_hcsr04" />
352352
<rangeSensor port="D2" eventFile="/dev/input/by-path/platform-trik_jd2-event" module="jd2_hcsr04" />
@@ -356,20 +356,37 @@ equal to its class name.
356356
<objectSensor port="video1" />
357357
<objectSensor port="video2" />
358358
<colorSensor port="video1" />
359+
<colorSensor port="video2" />
360+
<fifo port="soundSensor" file="/home/root/trik/soundSensor.fifo" />
359361
<soundSensor port="default" />
360362
</devicePorts>
361363

362364
<deviceTypes>
363-
<angularServomotor class="servoMotor" min="600000" max="2200000" zero="1400000" stop="0" type="angular" />
364-
<!-- <irSensor class="analogSensor" rawValue1="0" rawValue2="1023" normalizedValue1="0" normalizedValue2="100" /> -->
365-
<continuousRotationServomotor class="servoMotor" min="700000" max="2300000" zero="1500000" stop="0" type="continuousRotation" controlMin="-100" controlMax="100" />
366-
<sharpGP2Sensor class="analogSensor" rawValue1="0" rawValue2="1023" normalizedValue1="0" normalizedValue2="100" type="SharpGP2" values="(25;322)(35;235)(15;511)" />
367-
<sonarSensor class="rangeSensor" rawValue1="750" rawValue2="400" normalizedValue1="10" normalizedValue2="20" minValue="0" maxValue="400" />
368-
<lightSensor class="digitalSensor" min="30000" max="350000" />
365+
<angularServomotor class="servoMotor" min="700000" max="2150000" zero="1425000" stop="0"
366+
controlMin="-90" controlMax="90" />
367+
368+
<continuousRotationServomotor class="servoMotor" min="700000" max="2300000" zero="1500000" stop="0"
369+
controlMin="-100" controlMax="100" />
370+
371+
<manipulatorServomotor class="servoMotor" min="530000" max="2300000" zero="1415000" stop="0"
372+
controlMin="0" controlMax="100" />
373+
374+
<sharpGP2Sensor class="analogSensor" type="SharpGP2" values="(25;322)(35;235)(15;511)" />
375+
376+
<touchSensor class="analogSensor" rawValue1="100" rawValue2="1023" normalizedValue1="1" normalizedValue2="0"
377+
minValue="0" maxValue="1" />
378+
379+
<sonarSensor class="rangeSensor" minValue="0" maxValue="400" />
380+
381+
<lightSensor class="analogSensor" rawValue1="30" rawValue2="1023" normalizedValue1="0" normalizedValue2="100"
382+
minValue="0" maxValue="100" />
383+
369384
<volumeSensor class="digitalSensor" min="0" max="100" />
370-
<!-- <encoder95 class="encoder" ticksInDegree="43.389445" /> -->
385+
371386
<encoder95 class="encoder" ticksInDegree="1.569444" />
387+
372388
<encoder126 class="encoder" ticksInDegree="32.964168" />
389+
373390
<colorSensor3x3 class="colorSensor" m="3" n="3" />
374391
</deviceTypes>
375392

trikControl/system-config-v6.xml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ equal to its class name.
6666
<powerMotor invert="false" />
6767
<analogSensor rawValue1="0" rawValue2="1023" normalizedValue1="0" normalizedValue2="100" type="Analog" minValue="0" maxValue="100" />
6868
<encoder invert="false" />
69-
<rangeSensor commonModule="hcsr04" minValue="0" maxValue="100"/>
69+
<rangeSensor commonModule="hcsr04" minValue="0" maxValue="100" />
7070
<digitalSensor />
7171
<fifo />
72-
<accelerometer deviceFile="/dev/input/event1" optional="true" />
72+
<accelerometer deviceFile="/dev/input/by-path/platform-i2c_davinci.2-event" optional="true" />
7373
<gyroscope deviceFile="/dev/input/by-path/platform-spi_davinci.1-event" optional="true" />
74-
<lineSensor script="/etc/init.d/line-sensor-ov7670.sh" inputFile="/run/line-sensor.in.fifo" outputFile="/run/line-sensor.out.fifo" toleranceFactor="1.0" />
75-
<objectSensor script="/etc/init.d/object-sensor-ov7670.sh" inputFile="/run/object-sensor.in.fifo" outputFile="/run/object-sensor.out.fifo" toleranceFactor="1.0" />
76-
<colorSensor script="/etc/init.d/mxn-sensor-ov7670.sh" inputFile="/run/mxn-sensor.in.fifo" outputFile="/run/mxn-sensor.out.fifo" m="3" n="3" />
74+
<lineSensor script="/etc/init.d/line-sensor-ov7670" inputFile="/run/line-sensor.in.fifo" outputFile="/run/line-sensor.out.fifo" toleranceFactor="1.0" />
75+
<objectSensor script="/etc/init.d/object-sensor-ov7670" inputFile="/run/object-sensor.in.fifo" outputFile="/run/object-sensor.out.fifo" toleranceFactor="1.0" />
76+
<colorSensor script="/etc/init.d/mxn-sensor-ov7670" inputFile="/run/mxn-sensor.in.fifo" outputFile="/run/mxn-sensor.out.fifo" m="3" n="3" />
7777

7878
<!-- Device files for LED on a brick. -->
7979
<led green="/sys/class/leds/led_green/brightness" red="/sys/class/leds/led_red/brightness" />
@@ -93,6 +93,8 @@ equal to its class name.
9393
port="E1"
9494
deviceFile="/sys/class/pwm/ehrpwm.1:1/duty_ns"
9595
periodFile="/sys/class/pwm/ehrpwm.1:1/period_ns"
96+
controlMin="0"
97+
controlMax="100"
9698
/>
9799
<servoMotor
98100
port="E2"
@@ -118,8 +120,6 @@ equal to its class name.
118120
port="C3"
119121
deviceFile="/sys/class/pwm/ecap.2/duty_ns"
120122
periodFile="/sys/class/pwm/ecap.2/period_ns"
121-
controlMin="0"
122-
controlMax="100"
123123
/>
124124
<pwmCapture
125125
port="C1"
@@ -136,7 +136,7 @@ equal to its class name.
136136
frequencyFile="/sys/class/pwm/ecap_cap.2/freq"
137137
dutyFile="/sys/class/pwm/ecap_cap.2/duty_percentage"
138138
/>
139-
<powerMotor port="M1" i2cCommandNumber="0x14" />
139+
<powerMotor port="M1" i2cCommandNumber="0x14 invert="true" />
140140
<powerMotor port="M2" i2cCommandNumber="0x15" />
141141
<powerMotor port="M3" i2cCommandNumber="0x17" />
142142
<powerMotor port="M4" i2cCommandNumber="0x16" />
@@ -163,15 +163,31 @@ equal to its class name.
163163
</devicePorts>
164164
165165
<deviceTypes>
166-
<angularServomotor class="servoMotor" min="700000" max="2300000" zero="1500000" stop="0" />
167-
<continuousRotationServomotor class="servoMotor" min="700000" max="2300000" zero="1500000" stop="0" controlMin="-100" controlMax="100" />
168-
<sharpGP2Sensor class="analogSensor" rawValue1="0" rawValue2="1023" normalizedValue1="0" normalizedValue2="100"
169-
type="SharpGP2" values="(25;322)(35;235)(15;511)" />
166+
<angularServomotor class="servoMotor" min="700000" max="2150000" zero="1425000" stop="0"
167+
controlMin="-90" controlMax="90" />
168+
169+
<continuousRotationServomotor class="servoMotor" min="700000" max="2300000" zero="1500000" stop="0"
170+
controlMin="-100" controlMax="100" />
171+
172+
<manipulatorServomotor class="servoMotor" min="530000" max="2300000" zero="1415000" stop="0"
173+
controlMin="0" controlMax="100" />
174+
175+
<sharpGP2Sensor class="analogSensor" type="SharpGP2" values="(25;322)(35;235)(15;511)" />
176+
177+
<touchSensor class="analogSensor" rawValue1="100" rawValue2="1023" normalizedValue1="1" normalizedValue2="0"
178+
minValue="0" maxValue="1" />
179+
170180
<sonarSensor class="rangeSensor" minValue="0" maxValue="400" />
171-
<lightSensor class="digitalSensor" min="30000" max="350000" />
181+
182+
<lightSensor class="analogSensor" rawValue1="30" rawValue2="1023" normalizedValue1="0" normalizedValue2="100"
183+
minValue="0" maxValue="100" />
184+
172185
<volumeSensor class="digitalSensor" min="0" max="100" />
173-
<encoder95 class="encoder" ticksInDegree="43.389445" />
186+
187+
<encoder95 class="encoder" ticksInDegree="1.569444" />
188+
174189
<encoder126 class="encoder" ticksInDegree="32.964168" />
190+
175191
<colorSensor3x3 class="colorSensor" m="3" n="3" />
176192
</deviceTypes>
177193

0 commit comments

Comments
 (0)