Skip to content

Commit 04fdac7

Browse files
authored
Merge pull request #529 from srobo/update-simulator
Update docs for the simulator
2 parents adbe6a6 + e452019 commit 04fdac7

File tree

2 files changed

+29
-42
lines changed

2 files changed

+29
-42
lines changed

_data/sidebar_tree.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ tree:
102102
- url: /simulator/
103103
title: Simulator
104104
tree:
105-
- url: /simulator/simulator_programming
106-
title: Simulator Programming
107105
- url: /simulator/setting_up_simulator
108106
title: Setting up the simulator
109107
- url: /simulator/using_the_simulator
110108
title: Using the simulator
109+
- url: /simulator/simulator_programming
110+
title: Simulator Programming
111111
- url: /troubleshooting/
112112
title: Troubleshooting
113113
tree:

simulator/simulator_programming.md

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -73,53 +73,58 @@ Your robot has one servo board attached, the jaws of the robot are controlled by
7373
|-------|-----------|
7474
| 0 | Left Jaw |
7575
| 1 | Right Jaw |
76+
| 2 | Lifter |
7677

77-
Setting each servo to -1 fully opens the respective jaw.
78+
Setting each servo to -1 fully opens the respective jaw, setting them to 1 fully opens them.
79+
80+
Setting the lifter to -1 fully lowers the lifter, setting it to 1 fully raises it.
7881

7982
The servo board has the part code `srXYZ2`, but since only a single servo board is attached it can be referenced as `R.servo_board`.
8083

81-
### Ruggeduino
84+
### Arduino
8285

83-
Your robot has a microswitch and six distance sensors, attached to the digital and analogue pins respectively. These are all attached to a single ruggeduino.
86+
Your robot has a microswitch and six distance sensors, attached to the digital and analog pins respectively. These are all attached to a single arduino.
8487

85-
Because these sensors are pre-attached to the ruggeduino, you do not need to set its `pin_mode`.
88+
Make sure you have set the correct [pin_mode]({{ site.baseurl }}/programming/arduino/sr_firmware#setting-pin-modes), depending on what device you're using.
8689

8790
#### Microswitches
8891

92+
The rear of the robot has a wide microswitch.
93+
8994
The microswitch is attached to digital pin 2:
9095

91-
| Pin | Location |
92-
|-----|----------|
93-
| 2 | Back |
96+
| Pin | Location | Required Mode |
97+
|-----|----------|---------------|
98+
| 2 | Back | `INPUT` |
9499

95100
This is shown as a red coloured block on the robot. Using the `digital_read` method, you'll receive a `bool` telling you whether the switch is currently actuated.
96101

97102
#### Distance Sensors
98103

99-
Analogous to ultrasound sensors, distance sensors allow you to retrieve the distance between your robot and an object. These are attached to analogue pins A0-A5:
104+
Analogous to ultrasound sensors, distance sensors allow you to retrieve the distance between your robot and an object. These are attached to analog pins A0-A5:
100105

101-
| Pin | Location |
102-
|-----|----------|
103-
| A0 | Front Left |
104-
| A1 | Front Right |
105-
| A2 | Left |
106-
| A3 | Right |
107-
| A4 | Front |
108-
| A5 | Back |
106+
| Pin | Location | Required Mode |
107+
|-----|-------------|---------------|
108+
| A0 | Front Left | `INPUT` |
109+
| A1 | Front Right | `INPUT` |
110+
| A2 | Left | `INPUT` |
111+
| A3 | Right | `INPUT` |
112+
| A4 | Front | `INPUT` |
113+
| A5 | Back | `INPUT` |
109114

110-
These are shown as blue boards with silver transceivers on the robot. The `analogue_read` method will return the distance in metres. They can see in a narrow cone up to a maximum of about 2m away.
115+
These are shown as blue boards with silver transceivers on the robot. The `analog_read` method will return the distance in metres. They can see in a narrow cone up to a maximum of about 2m away.
111116
Since these sensors rely on echoes being reflected back from objects, if the angle of incidence between the sensor's pulse and the contacted surface exceeds 22.5 degrees then the sensor will be unable to detect the object.
112117

113118
#### LEDs
114119

115120
The LEDs are attached to digital pins 3-4:
116121

117-
| Pin | Location |
118-
|-----|----------|
119-
| 3 | Red (Left) |
120-
| 4 | Green (right) |
122+
| Pin | Location | Required Mode |
123+
|-----|---------------|---------------|
124+
| 3 | Red (lower) | `OUTPUT` |
125+
| 4 | Green (upper) | `OUTPUT` |
121126

122-
Using the `digital_write` method, you can set these to True (On) or False (Off).
127+
Using the `digital_write` method, you can set these to `True` (On) or `False` (Off).
123128

124129
### Vision
125130

@@ -131,24 +136,6 @@ The information returned by the simulated vision API is similar to the physical
131136
robot's [vision API](/docs/programming/vision/), however there are a number
132137
of differences as are noted in the vision docs.
133138

134-
### Pressure sensing
135-
136-
Your simulated robot has two deployable 'fingers' that are able to lift the front of the robot up. These fingers have pressure sensors on their tips, with these you can determine the weight of an object your robot is carrying.
137-
138-
The servos to move the fingers are attached to servo pins 2 and 3 in the servo board:
139-
140-
| Servo | Location |
141-
|-------|--------------------|
142-
| 2 | Left finger servo |
143-
| 3 | Right finger servo |
144-
145-
Once the fingers are deployed, your robot will have reduced manoeuvrability, but you will be able to sense the total pressure on the front of the robot. The pressure measuring devices on the end of the fingers are available as analogue inputs on A6 and A7. They are meant to emulate sensors that output a value proportional to pressure, the higher the pressure the higher the voltage reading.
146-
147-
| Pin | Location |
148-
|-----|------------------------------|
149-
| A6 | Left finger pressure sensor |
150-
| A7 | Right finger pressure sensor |
151-
152139
## Simulated Time
153140

154141
In the simulated environment, time advances only at the pace that the simulator

0 commit comments

Comments
 (0)