For collaborative development of the MiRo-E demo code
There's just a few things you'll need to do before using this repo for MiRo development:
- Request access to the repo in the Slack and accept the invite
- Clone the repo to a suitable location on your local machine
- Run the MDK installer (at
mdk/bin/deb64/install_mdk.sh
) from the download location to set this version of the MDK as the one your MiRo simulator will run -- if you've previously installed the MDK you may have to remove the current symlink at~/mdk
first - That's it! If you're already familiar with Git, feel free to create a branch for your project and dig in; if you've not used Git before then there's a couple of guides linked below, but just ask if you need any help.
The desktop computers in B.09 have a copy of this repo at ~/Documents/MiRo
; the first thing you should do is create and checkout a new branch for your project by changing to the repo directory and running git checkout -b <your_project_name>
. We're going to store project work in a single cloned repo location on the disk (as this makes running the MDK a lot easier) but in separate branches, so it's probably worth familiarising yourself with how branching works in Git if you've not used Git before. In particular, it's important that you remember to checkout your branch each time you want to do some work, and then commit and push your changes once you're finished.
Please don't push changes to the master
branch or make changes to the code on the physical robots; these should be left in a known-good state.
We use ROS to interface with both physical and virtual MiRos and Gazebo as a simulation environment, so these are the two additional software packages you'll need to test your code on your personal machine. There are two ways to get going:
A native install will allow the Gazebo simulator to run quicker and is likely to be simpler and have fewer issues overall, but because of the software dependencies it will require you to install Ubuntu 16 or an Ubuntu 16 fork such as Linux Mint 'Sylvia' as your OS.
Once you've done that, it's recommended you follow the official MiRo-E documentation for installing ROS Kinetic and Gazebo 7.
If you don't want to install Ubuntu 16 on your machine, it should be possible to run a virtualised instance of the MiRo simulator through Docker (as long as you're still running some Linux variant). Install Docker CE and then:
- Run
docker pull tacd/miro_sim
to get the MiRo simulator Docker image - Run
docker run -it --net host -v $XAUTHORITY:/root/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix tacd/miro_sim
to launch the Docker image
If all goes well, Gazebo should open with a virtual MiRo already loaded.
To connect to the ROS core on your MiRo robot you will need to ensure three environment variables are set correctly:
ROS_IP
must be set to your machine's IP address (of the interface used to communicate with MiRo)ROS_MASTER_URI
must be set tohttp://<MiRo's IP>:11311
MIRO_ROBOT_NAME
must be set to your MiRo's ROS name - this can easily be viewed in the MiRo app
The following commands all require a running roscore
instance for use with a virtual MiRo
Launch the MiRo simulator:
~/mdk/sim/launch_sim.sh
Run the client GUI:
~/mdk/bin/shared/client_gui.py
Run the MiRo demo code: Run the following commands in separate terminal windows:
~/mdk/share/python/miro2/core/client_demo.py - caml
(Note the space before and after the dash)~/mdk/share/python/miro2/core/client_demo.py - camr
~/mdk/share/python/miro2/core/client_demo.py
If you can view ROS data but not send commands, this usually indicates that ROS_IP
is not set correctly.