Getting started with MiRos¶
Prerequisites¶
- You have to be connected to
eduroam
and use Firefox web browser. - Depending on the setup, some users might require connection to the University VPN.
- Read the Risk Assessment and complete the pre-lab quiz on Blackboard.
Rules for working with the MiRo robot¶
- 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.
Turning the robot on and off¶
Turn on your MiRo at the switch underneath (see picture below)
- 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 say its IP address.
Bug
MiRo has to be rebooted if it doesn't say its IP address in about a minute or so, or says it incorrectly.
Info
When rebooting the MiRo using the ON/OFF switch, after turning MiRo off wait for all the LEDs to go out before starting it back again.
Connecting MiRoCODE to MiRo¶
As mentioned in the introduction, the transition to working with the physical MiRos is really simple. 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.
Tip
The last two digits are also duplicated on a yellow sticker on the back of MiRo's head.
Make note of the IP address of your robot and type it in the corresponding field in the robot control panel:
Success
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.
MiRoCODE programs on MiRo¶
Below are some ideas that you can attempt to implement on the physical MiRo. You can use your MiRos on your desks, for the exercises that don't involve translations (moving MiRo forward or backward), namely first and second one.
Exercise 1. Torch (desk-friendly)¶
MiRo has four light sensors, two at the front and two at the back (left and right).
They can be accessed using the All light sensors
block, which returns a list of four floats from 0 (dim) to 1 (bright), measuring the overall brightness level for 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.
Exercise 2. 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 Play Tone
block to assign a musical note to each of the sensors and play the sound when that sensor is triggered.
Tip
Try using functions when encoding the mapping between the touch sensors and musical notes, otherwise the code might get too lengthy to navigate comfortably.
Exercise 3. Huddle (arena only)¶
Your MiRo is placed in the arena together with MiRos of other student groups as well as independent, free-roaming MiRos. In this exercise, MiRos are happy when they are near other MiRos and sad when they are left alone. In the happy state, your MiRo should:
- Every so often, make happy, low frequency coos
- Glow green
- Actuate cosmetic joints (eyelids, tail, ears), and, optionally, the head
- Do not move
In the sad state, your MiRo should:
- Every so often, make unhappy, high frequency coos
- Glow red
- Do not actuate cosmetic joints
- Actively try to find other MiRos
You can use the sonar and head position on MiRo to check the surroundings and locate other MiRos. You can also try using vision blocks, but that is more challenging.
Wrapping up¶
Once you're done, save your codes, switch your MiRo off and hand it back to someone from the teaching team.