You may like to wirelessly interface with MIRO using the included ROS interface.
Run ROS core on workstation
In a shell, start the ROS core, as follows.
Run USB-ROS bridge on MIRO
MIRO must be running the USB-ROS bridge in order to expose a ROS interface to the network. In normal operation, you will start the bridge using MIROapp, or use MIROapp to set it to autostart when MIRO boots. However, to make sure everything is working properly as you get started you might want to start the bridge manually first, as shown here, so you can check everything is configured correctly.
Log in to MIRO in a new terminal window, and run the single command below.
MIRO tools [miro_bridge]
Copyright (C) 2017 Consequential Robotics
network: ROS (/miro/rob01)
sync_interval: (do not change)
frame: (do not change)
[000.000] enter threadproc
[000.001] interf opening (FLAGS=0x8)...
[000.002] start thread
[000.012] open() /dev/P2 OK
[000.021] initializing ROS...
[000.054] attempting to contact ROS master...
[000.059] upstream connection validated
[000.194] loading sound from: /home/root/sound
[000.309] finished: total RAM used is 1171 kiB
[000.310] advertising main topics...
[005.324] hooking SIGINT
[005.330] received: PLATFORM_READY
[005.331] sending P2_W_SYNC [n_hi=0]... [MIRO_USB_OK]
[005.334] read model_pars persist file... NOT FOUND!
[005.335] sending SET_MODEL_PARS... [MIRO_USB_OK]
[005.336] sending SET_RTC (16:25:08)... [MIRO_USB_OK]
[005.356] received (in msg_id=57445): ACK_SET_MODEL_PARS
[005.357] received (in msg_id=57445): ACK_SET_RTC
For clarity, all WARNINGs have been stripped from the trace, above—a handful of warnings whilst the bridge starts up and settles are to be expected, and can safely be ignored.
If your output looks like that above, the bridge is now running in that window and you should leave it open for now whilst you check you can send commands to the robot. If not, check the section Troubleshooting, below. Once everything is working correctly, you probably want to use MIROapp to enable autostart of the bridge.
Test ROS connectivity
If the bridge has started correctly, you will be able to see the interface exposed by MIRO by running
rostopic on your workstation, as shown below.
$ rostopic list
This shows that the default name for the robot on the network is
rob01 (you can change this by adding the parameter
robot=<your_robot_name> to the command line of the bridge in
If this test has not worked, you should first make sure of the following.
- On board your MIRO, the environment variables
ROS_MASTER_IP are set correctly (ROS_IP to the IP of your MIRO, and ROS_MASTER_IP to the IP of your workstation) before the bridge starts—see
run_bridge_ros.sh and check the instructions in
~/.profile on board your MIRO.
- On your workstation,
ROS_IP has been set to the workstation's own IP address, as detailed in Install ROS.
Note that if you have chosen a network configuration other than that described here you should take your own steps to ensure that both your robot and your ROS master are configured so that they can find each other.
Exchanging data with your MIRO from your workstation
requires a low-latency network connection—if you are in a busy radio environment, or the wireless network is weak, you will probably have trouble establishing communications.
We provide an example interpreted Python Command-line Client on-board MIRO for you to use as a starting point. It also works to test that the preparations, above, have been performed correctly.
MIRO is going to move! Support it with its wheels off the ground, or ensure that it can move around safely.
$ cd ~/mdk/bin/shared
$ ./miro_ros_client.py robot=rob01
2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609]
The client's main thread produces tick, tock, periodically. Meanwhile, each time a message arrives from the bridge with updated
platform_sensors data, a message is sent back down, and the robot is driven in a forward-turn-forward-turn pattern, indefinitely.
You can try any one of the client Examples, they will all run against the configuration above. The Python GUI Client, in particular, gives you access to most of the robot interface.