Skip to content

Commit a254c02

Browse files
Merge pull request #175 from sourcebots/physical-robot
Add a basic physical robot page
2 parents 0b8e34e + d8e28f7 commit a254c02

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

content/api/servos.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Servos
3+
---
4+
5+
{{% notice note %}}
6+
Servos only apply to the [physical robot](/robots/physical/).
7+
{{% /notice %}}
8+
9+
You can control attached servo motors from the [Arduino](../arduino/). By default, servos will be unpowered when your robot starts, and can freely rotate when turned by hand. Upon setting a value, they will hold the corresponding position. They will become unpowered again when you turn off your robot, unplug your USB stick, or set their position to the special value `None`.
10+
11+
## Querying servos
12+
13+
The servo assembly can interface with up to sixteen servos connected to it.
14+
15+
```python
16+
servo_zero = r.arduino.servos[0]
17+
```
18+
19+
{{% notice tip %}}
20+
Servo can be connected to any port, you don't have to start at 0!
21+
{{% /notice %}}
22+
23+
## Controlling servos
24+
25+
Servos can be controlled using the `position` parameter. This should be set to a value between -1 and 1.
26+
27+
```python
28+
servo_zero.position = 0.65
29+
print(servo_zero.position)
30+
>>> 0.65
31+
```
32+
33+
{{% notice tip %}}
34+
When `position` is set to `None`, the servo loses power and can freely rotate. This is the same state they're in at start-up.
35+
{{% /notice %}}

content/robots/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ In this year's competition we have 2 Robots, which are each controlled by their
88
- [Crane Robot](crane) which is controlled by `crane.py`.
99
- [Forklift Robot](forklift) which is controlled by `forklift.py`.
1010

11-
See [the API section](../api/) for more details on how to run your code.
11+
There is also a [Physical Robot](physical).
12+
13+
See [the API section](../api/) for more details on how to run your code.

content/robots/physical.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Physical robot
3+
---
4+
5+
The physical robot is closely modelled after the [forklift](../forklift) robot, however is different in a few important ways. The physical robot has two [radial motors](/api/motor-board), allowing it to move itself around the arena.
6+
7+
## Motor layout
8+
9+
The layout of the motors attached to the motor boards for the forklift robot are as follows:
10+
11+
- Motor Board 0:
12+
- Motor 0 - Left wheel motor
13+
- Motor 1 - Right wheel motor
14+
15+
## Servos
16+
17+
The front grabber is actuated by a single [servo](/api/servos), attached to the [Arduino](/api/arduino/#servos). It is plugged in to port 0.
18+
19+
The servo will only let you move the grabber in a safe range. `-1` will open the grabber, and `1` will close the grabber.
20+
21+
## Ultrasound
22+
23+
The forklift has an [ultrasound sensor](/api/ultrasound) attached to the front of the robot. This sensor uses pin 4 as the trigger pin and 5 as the echo.

0 commit comments

Comments
 (0)