Getting started with MiRos¶
Prerequisites¶
- Firefox browser.
- eduroam + University VPN.
- MiRoCloud credentials.
- On Blackboard, read the Risk Assessment form and complete the pre-lab quiz.
Rules for working with the MiRo robot¶
Handle MiRo with care!
- Use common sense when handling the robot: it is not especially fragile, but neither is it intended to be treated roughly.
- Lift the robot only by the body shell, supporting its weight from underneath—do not pick up the robot by the head, this may damage the robot.
- Do not drop the robot from any height—it is not designed to absorb the shock of falling.
- Do not force any of the robot’s joints to move when they are under power or the robot may be damaged. If the joints are unpowered (for example, when the robot is powered off) you can gently move the joints as required.
- Do not otherwise apply force to or pull on any of the robot’s appendages (head, nose, ears, tail, eyelids, etc.) at any time.
- Do not forcibly drive the robot when it is on the ground. If you need to move the robot, pick it up and place it where you want it.
- You may use your MiRo on your table for tasks that don't require moving forwards and backwards.
Always monitor MiRo while it's in motion to ensure it doesn't fall off the table.
Getting Started with MiRo¶
Once you've completed the pre-lab quiz and shown a teaching team member that you've achieved full marks, you'll receive a MiRo that should be ready to use.
Nevertheless, it's helpful to familiarise yourself with the following instructions.
Switching on¶
Turn on your MiRo at the switch underneath (see picture below).
The booting sequence is as follows:
- Both red and blue lights on the left side of the body shell flicker together for two seconds.
- The red light stops flashing and remains lit and the blue light flashes slowly, indicating that the on-board computer is booting.
- When booting is complete, the blue light will stop flashing and remain lit.
- Your robot will then start Bluetooth services and connect to the Diamond wireless network, DIA-LAB.
- Finally, once everything is booted up the robot should speak aloud its IP address.
A note on MiRo's IP address
All MiRos in the Diamond have an IP address in the following range:
where XX
goes from 01 to 40.
The IP address is printed on a sticker underneath each MiRo.
The last two digits are also duplicated on a yellow sticker on the back of MiRo's head.
Check that the IP address is correct
Sometimes MiRo fails to connect to Wi-Fi and you'll hear a different IP: 127.0.0.1
(localhost) or nothing at all.
In this case MiRo needs to be rebooted (see below).
Rebooting¶
- Toggle the switch to OFF.
- Wait for all the LEDs to go out.
- Turn the switch back ON again.
Connecting MiRoCODE to MiRo¶
As mentioned in the introduction, the transition from the simulator to the physical MiRos is really simple.
Make note of the IP address of your robot and type it in the corresponding field in the robot control panel:
No passphrase required
There is no need to set the passphrase, so the corresponding field should be left empty.
To do a quick check of your connection, simply click on the Stop
button in the robot control panel.
If everything is working correctly, this should replace the camera views from the simulator with the video feed from your MiRo's cameras.
Programming MiRo¶
Codes from previous session¶
Start by trying out some of the codes you've developed in the previous session.
Remember the rule about not driving MiRo on the table!
- Clapper control — arena only
- Watch the edge — arena only (use a different threshold to detect walls instead)
- Emergency lights — desk-friendly
- Friendly MiRo — desk-friendly
Below are some further ideas you can attempt to implement on your MiRo.
5. Torch (desk-friendly)¶
MiRo has four light sensors: two at the front and two at the back (left and right).
You can access them using the block, which returns a list of four values between 0 (dark) and 1 (bright), representing the overall brightness level detected by each sensor.
Assign a distinct action to each of the sensors any action is allowed except translational motion or making loud noises. You should always keep track which sensor has the highest brightness. Whenever this changes from one sensor to another, the corresponding action should trigger for the sensor with the highest brightness.
Tip
Use the torch on your phone for quick testing!
6. Piano (desk-friendly)¶
Using the 14 touch sensors on the back and 14 touch sensors on the head, see if you can turn MiRo into an impromptu piano!
You can use the block to assign a musical note to each of the sensors and play the sound when that sensor is triggered.
To avoid excessive noise, please limit the volume to 50.
Tip
Consider using functions to encode the mapping between touch sensors and musical notes.
7. ∞ (arena only)¶
Program MiRo to drive in a figure-eight pattern!
Tip
Use the and blocks.
Fine-tune x
and y
as function of time to make the two halves join seamlessly.
Wrapping up¶
Once you've finished, save your codes, turn off your MiRo, and return it to a member of the teaching team.