Overview

The C++ command-line client is a demonstrator client that gives you a quick introduction for how to write a client to control your MIRO over the ROS interface in a compiled language. It allows you to drive the robot through several different motor paths. It will also act as a great starting point if you plan your own development in C++.

The robot may move, and you should prepare for this—in particular, make sure it is not able to fall!

Usage

You can run the client on your workstation to send pre-prepared control programs to the robot and confirm that MIRO's ROS interface is operating correctly.

$ cd ~/mdk/bin/deb64 $ miro_ros_client robot=rob01 drive=lean show=s ________________________________________________________________ MIRO tools [miro_ros_client] Copyright (C) 2017 Consequential Robotics ________________________________________________________________ open log... initializing ROS... subscribing to "/miro/rob01/platform/sensors"... subscribing to "/miro/rob01/platform/state"... subscribing to "/miro/rob01/core/state"... subscribing to "/miro/rob01/platform/caml"... subscribing to "/miro/rob01/platform/camr"... publishing on "/miro/rob01/platform/control"... publishing on "/miro/rob01/core/config"... publishing on "/miro/rob01/core/control"... entering loop... robot time = 513.136s (client time = 0.237s) dr, dtheta: 0.000mm/sec 0.000Rad/sec joints: -0.087Rad 0.802Rad -0.491Rad -0.211Rad sensors: sonar=300mm lean right... ...

If all is well, MIRO will swing his head from side to side, and you will see sensor data coming back to your workstation console. The client accepts various additional arguments—try entering just ./miro_ros_client (with no arguments) to see them. All MIRO tools will display the help page if no arguments are supplied.

Rebuild

The C++ command-line client will be a suitable starting point if you plan to connect to MIRO's ROS interface from a C++ program. Basic upstream and downstream operations are illustrated. You can find the source code at ~/mdk/src/miro_ros_client.

To rebuild the client, enter the source folder and run make:

$ cd ~/mdk/src $ make ... compiling object: /tmp/miro/mdk/deb64/miro_ros_client/miro_ros_client.o linking executable: ../../bin/deb64/miro_ros_client ...

Moving on

For a fuller understanding of the interface offered by MIRO, next try the Python GUI Client.