Skip to content

Commit aba63a2

Browse files
committed
Annotate which APIs are not available in the simulator
1 parent c207d89 commit aba63a2

File tree

7 files changed

+57
-0
lines changed

7 files changed

+57
-0
lines changed

programming/arduino/custom_firmware.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ On this page we talk specifically about Arduinos.
1212
However this page is applicable to opening any device that shows up as a serial port.
1313
</div>
1414

15+
<div class="info">
16+
This documentation refers to a feature which is only available on the physical robot kits.
17+
</div>
18+
1519

1620
## Ignoring a device
1721

programming/arduino/extended_sr_firmware.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ title: Arduino extended firmware
55

66
# Arduino with extended SR firmware
77

8+
<div class="info">
9+
This documentation refers to a feature which is only available on the physical robot kits.
10+
</div>
11+
812
You may wish to extend the SR firmware with additional functionality.
913
This will allow you to continue using the commands already provided by the SR firmware (e.g. `digital_read()`),
1014
which means any existing robot code you have won't need modifying very much.

programming/cheat_sheet.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ robot.motor_board.motors[1].power = -1
124124

125125
### Special motor values
126126

127+
<div class="info">
128+
This documentation refers to a feature which is only available on the physical robot kits.
129+
</div>
130+
127131
Setting a motor to `BRAKE` is equivalent to power level `0`.
128132

129133
~~~~~ python
@@ -153,6 +157,10 @@ You can also set the position to `0`, which is the approximate centre.
153157

154158
### Taking a photo
155159

160+
<div class="info">
161+
This documentation refers to a feature which is only available on the physical robot kits.
162+
</div>
163+
156164
It can sometimes be useful to save a photo of what markers the robot can see:
157165

158166
~~~~~ python
@@ -161,6 +169,10 @@ robot.camera.save("my-photo.jpg") # Save my-photo.jpg to the USB drive
161169

162170
### Capturing an openCV array
163171

172+
<div class="info">
173+
This documentation refers to a feature which is only available on the physical robot kits.
174+
</div>
175+
164176
Take a photo using the webcam, and return the image data as an OpenCV array:
165177

166178
~~~~~ python
@@ -183,6 +195,7 @@ for marker in markers:
183195
marker.id # The ID of the marker
184196
marker.size # Physical size of the marker in mm.
185197

198+
# Position of the marker on the image (physical kits only)
186199
marker.pixel_centre # The co-ordinates of the centre of the marker
187200
marker.pixel_corners # A list of corners of the marker
188201

programming/leds.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ title: Brain Board LED API
88
Brain Board LED API
99
===================
1010

11+
<div class="info">
12+
This documentation refers to a feature which is only available on the physical robot kits.
13+
</div>
14+
1115
The KCH board provides diagnostic information about the state of your robot through a collection of preconfigured and user-controllable LEDs.
1216
It is part of the [Brain Board](/docs/kit/brain_board) assembly and will be found attached to the top of the Raspberry Pi.
1317

programming/motors.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ print(robot.motor_boards["srABC1"].motors[0].power)
124124
Special Values
125125
--------------
126126

127+
<div class="info">
128+
This documentation refers to a feature which is only available on the physical robot kits.
129+
</div>
130+
127131
In addition to the numeric values, there are two special constants that can be used:
128132
- `BRAKE`
129133
- `COAST`
@@ -151,6 +155,10 @@ robot.motor_boards["srABC1"].motors[0].power = COAST
151155
Motor currents
152156
--------------
153157

158+
<div class="info">
159+
This documentation refers to a feature which is only available on the physical robot kits.
160+
</div>
161+
154162
The Motor Board can also measure the current being drawn by each of the ports on the board.
155163
This value is measured in amps.
156164

programming/servos.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ print(robot.servo_board.servos[1].position)
5858
Disabling servo outputs
5959
-----------------------
6060

61+
<div class="info">
62+
This documentation refers to a feature which is only available on the physical robot kits.
63+
</div>
64+
6165
Setting a position to `None` will disable an output.
6266
This is the state all the servo outputs are in when the board turns on, where no servo pulses are being sent to the outputs.
6367

@@ -70,6 +74,10 @@ robot.servo_board.servos[5].position = None
7074
Extended servo range
7175
--------------------
7276

77+
<div class="info">
78+
This documentation refers to a feature which is only available on the physical robot kits.
79+
</div>
80+
7381
For an RC servo the angle of rotation is determined by the width of an electrical pulse on the control wire.
7482
A typical servo expects to see a pulse every 20ms, with a pulse width between 1ms and 2ms.
7583
Our API will take the position provided (between -1 and 1) and map it to the correct pulse width.

programming/vision/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ Try pausing movement while taking an image.
4949

5050
save
5151
: Take a photo using the webcam, draw a box around the detected markers and save it to the provided location.
52+
<div class="info">
53+
This function is only available on the physical robot kits.
54+
</div>
5255

5356
~~~~~ python
5457
from sr.robot3 import *
@@ -60,6 +63,9 @@ robot.camera.save(robot.usbkey / "initial-view.jpg")
6063

6164
capture
6265
: Take a photo using the webcam, and return the image data as an OpenCV array.
66+
<div class="info">
67+
This function is only available on the physical robot kits.
68+
</div>
6369

6470
~~~~~ python
6571
import cv2
@@ -108,9 +114,15 @@ size
108114

109115
pixel_centre
110116
: A [`PixelCoordinates`](#pixel-coordinates) object describing the position of the centre of the marker in the image.
117+
<div class="info">
118+
This attribute is only available on the physical robot kits.
119+
</div>
111120

112121
pixel_corners
113122
: A list of 4 [`PixelCoordinates`](#pixel-coordinates) objects, each representing the position of a corner of the marker in the image.
123+
<div class="info">
124+
This attribute is only available on the physical robot kits.
125+
</div>
114126

115127
position
116128
: A `Position` object describing the position of the marker.
@@ -151,6 +163,10 @@ orientation
151163

152164
### Pixel Coordinates
153165

166+
<div class="info">
167+
This documentation refers to a feature which is only available on the physical robot kits.
168+
</div>
169+
154170
A named tuple of `x` and `y` coordinates for the point, in pixels relative to the top left of the image.
155171

156172
~~~~~ python

0 commit comments

Comments
 (0)