Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation based on docx #220

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
13 changes: 11 additions & 2 deletions .build/imageSizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function walkDir(root) {
},
body: {
operation: "download",
objects: objectsToRequest,
objects: objectsToRequest.slice(0,999),
ref: {
name: "refs/heads/master",
},
Expand All @@ -137,7 +137,16 @@ function walkDir(root) {
console.log(
`info: requesting lfs info for ${objectsToRequest.length} images...`
);
const lfsRes = await request(lfsReq);

var lfsRes;
try {
lfsRes = await request(lfsReq);}
catch {console.log("errored")};
console.log(lfsRes);
for(let i = 0; i< objectsToRequest.length() / 7; i++ ){

}
console.log(lfsRes);
const objectsLength = lfsRes.objects.length;
for (let i = 0; i < objectsLength; i++) {
const object = lfsRes.objects[i];
Expand Down
26 changes: 13 additions & 13 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ const imageSizes = JSON.parse(
);

const galleryZipSizes = {};
const zipsPath = path.resolve(__dirname, "..", ".non-vuepress-public", "galleryzips");
for (const zip of fs.readdirSync(zipsPath)) {
const zipPath = path.join(zipsPath, zip);
// const zipsPath = path.resolve(__dirname, "..", ".non-vuepress-public", "galleryzips");
// for (const zip of fs.readdirSync(zipsPath)) {
// const zipPath = path.join(zipsPath, zip);

let size = fs.statSync(zipPath).size;
if (size <= 2147483647) { // If the file is bigger than a buffer it isn't a lfs pointer
const data = fs.readFileSync(zipPath, { encoding: "utf8" });
if (data.startsWith("version https://git-lfs.github.com/spec/v1")) {
const lines = data.split("\n");
size = parseInt(lines[2].split(" ")[1]);
}
}
// let size = fs.statSync(zipPath).size;
// if (size <= 2147483647) { // If the file is bigger than a buffer it isn't a lfs pointer
// const data = fs.readFileSync(zipPath, { encoding: "utf8" });
// if (data.startsWith("version https://git-lfs.github.com/spec/v1")) {
// const lines = data.split("\n");
// size = parseInt(lines[2].split(" ")[1]);
// }
// }

galleryZipSizes[zip.substring(0, zip.length - 4)] = size;
}
// galleryZipSizes[zip.substring(0, zip.length - 4)] = size;
// }

function makeGallerySidebar() {
const galleries = fm(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/BrainBox red pannel photo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/Landscape RC24 image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
3 changes: 3 additions & 0 deletions .vuepress/public/images/RC logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/RC24 Laptop background 1600x900.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/RoboCon 2024 game image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/RoboCon 2024 title image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/Robocon recruitment poster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/angled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/brainboxmotors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/powerconnector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/redpanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/roboconHeader.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .vuepress/public/images/run-button.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ No previous experience is required, and we provide support throughout the year t
</p>


<p><b>The RoboCon 2023 finals were held on the 12th and 13th of April 2023, Robocon 2024 Kickoff is live on the 28th of October!</b></p>
<p><b>Robocon 2024 Kickoff has Finished on the 28th of October, 2024 Comptetition Expected on the 13th of April 2024</b></p>


<br>
Expand Down
11 changes: 6 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ position: 1
Welcome to the docs for **Robocon 2024**!

We suggest you first grasp the idea of the [rules](/rulebook.pdf).

:::tip

If you are viewing this page on your BrainBox then please check the website for the latest revision.

:::

![Game logo](/images/roboconHeader.png)
![Game logo](/images/roboconHeader.jpg)
Once you've done that, you'll need to turn your robot on.

To begin, get familiar with the kit provided. It includes : <!--StartFragment-->
Expand All @@ -29,17 +28,19 @@ To begin, get familiar with the kit provided. It includes : <!--StartFragment-->
| 2 | Motor |
| 2 | Wheels |
| 1 | Caster Wheel |
| 1 | Chassis Kit |
| 1 | Chassis |
| 2 | Servo Motor |
| 1 | Start Button |
| 1 | Power Switch |

::: caution- Handling batteries incorrectly can be dangerous. Make sure you follow these [safety guidelines](/docs/charging.html) at all times. :::
:::warning
Handling batteries incorrectly can be dangerous. Make sure you follow these [safety guidelines](/docs/charging.html) at all times.
:::

:::tip
You can also access these docs from your robot. Go to <http://robot.go/docs> when you're connected to your robot.
:::

It might also be a good idea to sign up for the [forum](/forum/). You can do this using the registration code provided in your kit. This is a great place to ask questions on anything related to the competition, the kit, or robot programming.
It might also be a good idea to sign up for the [forum](/forum/). This is a great place to ask questions on anything related to the competition, the kit, or robot programming.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the forum still up & can you sign up? Did we provide codes in their kit? If so, we should say that. If not, we should remove this entirely


<!--END_PI_REMOVE-->
30 changes: 0 additions & 30 deletions docs/gpio.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,3 @@ However, the built-in pull-up resistor alleviates this need. It essentially wire

![An example weak pull up](/images/capture.png)

## Setting multiple pins

When you set multiple pins, you'll need to set them in order. This is due to how the brainbox internally sets pins

For example...<br/>
This won't work:
```python
# Wrong
import robot

R = robot.Robot()

R.gpio[1].mode = robot.INPUT
R.gpio[3].mode = robot.INPUT_PULLUP
R.gpio[2].mode = robot.OUTPUT

# Pin 3 is set before pin 2, which won't work
```
But this will:
```python
# Right
import robot

R = robot.Robot()

R.gpio[1].mode = robot.INPUT
R.gpio[2].mode = robot.OUTPUT
R.gpio[3].mode = robot.INPUT_PULLUP
# As all the GPIO pins are set in order, this is fine
```
2 changes: 2 additions & 0 deletions docs/hello-gpio.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ R.gpio[POT_PIN].mode = robot.INPUT_ANALOG
while True:
print(R.gpio[POT_PIN].analog)
```

## Using distance sensors with retroreflective tape
24 changes: 12 additions & 12 deletions docs/hello-motors.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ R = robot.Robot()
Motor power is automatically scaled for the 3-6V motors included in the kit, if you are sourcing your own motors then see https://hr-robocon.org/docs/motors.html for how to allow faster speeds.
:::

Now that everything is set up, it's time to set the motors. All the motors are stored in a list inside the Robot variable - to access the first motor, you can use `R.motors[1]`, the second motor is found with `R.motors[2]`.<br\>
Now that everything is set up, it's time to set the motors. All the motors are stored in a list inside the Robot variable - to access the first motor, you can use `R.motors[0]`, the second motor is found with `R.motors[1]`.

Changing the speed of the motor is easy - just set the motor to a number from -100 to 100. Immediately setting the power to 100 can have unwanted side effects, so we'll start by setting them to half power:
```python
import time
import robot
R = robot.Robot()

R.motors[0] = 50
R.motors[1] = 50
R.motors[2] = 50
```
Running this program will make your robot move forwards. Unfortunately, it will never tell it to stop moving forwards, so hopefully you put it on the floor and it hasn't driven off the table.<br>
To fix this we can set the power of the motors to 0 after a couple seconds:
Expand All @@ -40,40 +40,40 @@ import time
import robot
R = robot.Robot()

R.motors[0] = 50
R.motors[1] = 50
R.motors[2] = 50

time.sleep(2)

R.motors[1] = 0
R.motors[2] = 0
R.motors[0] = 0
R.moto1s[1] = 0
```
To turn the robot, you just need to set one motor going forwards and the second motor going backwards. The following program makes the robot do a little dance - try it out!
```python
speed = 50

R.motors[0] = speed
R.motors[1] = speed
R.motors[2] = speed

time.sleep(2)

R.motors[1] = speed
R.motors[2] = -speed
R.motors[0] = speed
R.motors[1] = -speed

time.sleep(2)

R.motors[0] = -speed
R.motors[1] = -speed
R.motors[2] = -speed

time.sleep(2)

R.motors[1] = -speed
R.motors[2] = speed
R.motors[0] = -speed
R.motors[1] = speed

time.sleep(2)

R.motors[0] = 0
R.motors[1] = 0
R.motors[2] = 0
```
A final note, even if you set both motors to the same power, your robot probably won't drive in a perfectly straight line. This is due to defects in the motors, and unless you get specialised motors, no two motors will have the same offset. How your robot deals with this is up to you!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole file, actually, seems to have some weird spelling errors


Expand Down
2 changes: 1 addition & 1 deletion docs/init-robot.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ import robot
R = robot.Robot()
```

When you initialise the robot with `robot.Robot()`, your code will be paused until the hardware start button or Shepherd run button is pressed. When the Robot is waiting for either of these buttons to be pressed, the blue status LED will flash on and off.
When you initialise the robot with `robot.Robot()`, your code will be paused until the hardware start button or Shepherd run button is pressed. When the Robot is waiting for either of these buttons to be pressed, the blue user LED will flash on and off.
10 changes: 10 additions & 0 deletions docs/minibot-assembly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Minibot Assembly
category: Hardware
position: 6
---
# Minibot Assembly

You can download instructions on how to make your minibot [here](/minibot.pdf).

<Embed :aspect-ratio="1/1.4142"><iframe width="100" height="141" src="https://hr-robocon.org/HowToAssembleYourMiniBot.pdf"></iframe></Embed>
10 changes: 5 additions & 5 deletions docs/motors.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ If you want to spin your motors in reverse, just stick a negative sign in front
You can control motors using the `motors` property of the `Robot` object. To set the power of the first motor to 60% use:

```python
R.motors[1] = 60
R.motors[0] = 60
```

To control the second motor instead, replace `motors[1]` with `motors[2]`.

To stop both motors:

```python
R.motors[0] = 0
R.motors[1] = 0
R.motors[2] = 0
```

Here's a more complete example:
Expand All @@ -40,14 +40,14 @@ import robot
R = robot.Robot()

# set motor 1 to 60% power
R.motors[1] = 60
R.motors[0] = 60

# set motor 2 to 60% power in the backwards direction
R.motors[2] = -60
R.motors[1] = -60

# turn both motors off
R.motors[0] = 0
R.motors[1] = 0
R.motors[2] = 0
```

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/patching-the-robot.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An important part of looking after your robot is making sure its software is up
6. Select the patch file in the left-hand panel. The patch will show on the code view as Base64 encoded data (random-looking text). 
7. Click the "Run" button (green arrow on the right-hand panel). 

![](/images/run-button.png)
![](/images/run-button.jpg)
8. After a few moments, your BrainBox should reboot, and the LED will either turn off or remain on. You will lose connection with it while it does this. Do not turn off your BrainBox - the LED may stay off for up to a minute.
9. The BrainBox LED will eventually start flashing again to show it has rebooted successfully. 
10. If your PC has not automatically connected, connect to it using the WiFi. Once reconnected, refresh your browser and open a project from the left-hand side of the editor. Check that the patch version is correct in the right-hand panel.  
Expand Down
18 changes: 9 additions & 9 deletions docs/servos.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Servos are plugged into the **PWM** ports on the BrainBox. **PWM 1** represents
You can control servos using the `servos` property of the `Robot` object. To set the first servo to the 50% position use:

```python
R.servos[1] = 50
R.servos[0] = 50
```

To control the fourth servo instead, replace `servos[1]` with `servos[4]`.
To control the fourth servo instead, replace `servos[0]` with `servos[3]`.

Here's a more complete example:

Expand All @@ -29,14 +29,14 @@ import robot
R = robot.Robot()

# set servo 1 to the 50% position
R.servos[1] = 50
R.servos[0] = 50

# set servo 3 to the -100% position
R.servos[3] = -100
R.servos[2] = -100

# set servos 1 & 3 to the default positions
R.servos[1] = 0
R.servos[3] = 0
R.servos[0] = 0
R.servos[2] = 0
```

## Blockly
Expand All @@ -52,9 +52,9 @@ E.g. to set PWM1 to `100%` and PWM3 to `50%` use
import robot

servo_values = {
1: 100,
2: 50,
3: -100
0: 100,
1: 50,
2: -100
}

R = robot.Robot(servo_defaults=servo_values)
Expand Down
Loading