@@ -34,11 +34,9 @@ R = Robot()
34
34
35
35
Within your ` Robot ` (` R ` in this case), you then have access to the following attributes:
36
36
37
- * [ compass] ( /docs/programming/sr/compass/ )
38
37
* [ motors] ( /docs/programming/sr/motors/ )
39
38
* [ power] ( /docs/programming/sr/power/ )
40
39
* [ servos] ( /docs/programming/sr/servos/ )
41
- * [ radio] ( /docs/programming/sr/radio/ )
42
40
* [ ruggeduinos] ( /docs/programming/sr/ruggeduinos/ )
43
41
* [ vision] ( /docs/programming/sr/vision/ )
44
42
@@ -47,15 +45,15 @@ Note that `motors`, `ruggeduinos`, and `servos` are Python lists, and so should
47
45
Here are some examples:
48
46
49
47
~~~~~ python
50
- R.motors[0 ].m0 .power = 50 # WILL work, if motor 0 exists
51
- R.motors[1 ].m0 .power = - 20 # WILL work, if motor 1 exists
52
- R.motors.m0 .power = 42 # WON'T WORK
48
+ R.motor_board. motors[0 ].power = 50 # WILL work, if motor 0 exists
49
+ R.motor_board. motors[1 ].power = - 20 # WILL work, if motor 1 exists
50
+ R.motor_board.motors .power = 42 # WON'T WORK
53
51
54
52
# the above is similar to the situation for 'ruggeduinos' and 'servos'
55
53
~~~~~
56
54
57
55
A number of examples in the documentation will assume you've instantiated the required ` Robot ` class and have called it ` R ` .
58
- From here in, if you see a ` R.something ` , the requirement of the ` sr.robot ` import line and the instantiation of ` Robot ` as ` R ` is implicit.
56
+ From here in, if you see a ` R.something ` , the requirement of the ` sr.robot3 ` import line and the instantiation of ` Robot ` as ` R ` is implicit.
59
57
60
58
[ Other Robot Attributes] ( #OtherRobotAttributes ) {#OtherRobotAttributes}
61
59
----------------------
77
75
An example of how the `usbkey` attribute might be used:
78
76
79
77
~~~~~ python
80
- from sr.robot import *
78
+ from sr.robot3 import *
81
79
import os
82
80
83
81
R = Robot()
@@ -104,23 +102,14 @@ However if you want to:
104
102
Then Robot initialisation can be broken up as follows (this example is equivalent to the previous code excerpt):
105
103
106
104
~~~~~ python
107
- R = Robot.setup()
108
-
109
- # Setup phase.
110
- # Here you can configure hardware enumeration
111
-
112
- R.init()
105
+ R = Robot(auto_start = True )
113
106
114
107
# Initialisation phase.
115
108
# Here you can perform hardware/software initialisation before start
116
109
117
110
R.wait_start()
118
111
~~~~~
119
112
120
- During the setup phase, the Robot hardware is inaccessible.
121
- For example, ` R.motors ` is unavailable since enumerations occurs in the ` init ` function.
122
- In this phase you can configure how the Robot finds and configures hardware.
123
-
124
- After the ` init ` call, all hardware is accessible.
113
+ During the initialisation phase, all hardware is accessible.
125
114
If you have any hardware which must be initialised before the start button is pressed,
126
115
the initialisation phase is the time to do so.
0 commit comments