Running a controller

This tutorial explains how to run a controller for some of the interfaces available with mc_rtc. This is meant as a starting point. Please refer to each interface documentation for details regarding the available options.

Pre-requisites

There is two options to visualize the controller and interact with it:

  1. Using the RViZ panel available in mc_rtc_ros. mc_rtc must have been built with ROS support.
  2. Use a stand-alone visualizer such as mc_rtc-magnum

Runing the display interface

Using RViZ

We assume roscore is already running or that ROS_MASTER_URI points to an active master.

Run the following command to start RViZ along with mc_rtc dedicated panel and the robot model you need:

$ roslaunch mc_rtc_ticker display.launch

If your simulation has more than two robots, you should add a new RobotModel to the scene. The description of the robot is published in the parameter /control/env_N where N is the robot index.

Using mc_rtc-magnum

After installing the package, simply run the following command:

$ mc-rtc-magnum

Running the controller

To run the controller, use the following command:

$ mc_rtc_ticker

Note that you can restart the controller without restarting the display interface.

The ticker has many more functionalities, see the mc_rtc_ticker and the Replay plugin tutorial.

Pre-requisites

To run this interface you need to have installed mc_openrtm on your system. Furthermore, you will need Choreonoid and a related simulation file for your robot. An example is provided for JVRC-1.

Running the controller

Open the simulation file with Choreonoid. For example, using the JVRC example provided with mc_openrtm:

# Go to the directory where the simulation file has been installed
$ cd /usr/local/share/hrpsys/samples/JVRC1
# Restart omniNames services
$ ./clear-omninames.sh
# Open the simulation file
$ choreonoid sim_mc.cnoid

Then click the button to start the simulation in Choreonoid. This will also start your controller. Note that you can directly start the simulation from the command line:

$ choreonoid sim_mc.cnoid --start-simulation

Getting feedback and interacting with the controller

If mc_rtc is built with ROS support and the correct options are activated, you can visualize the controller's output using RViZ and interact with it through the dedicated RViZ panel. Follow the mc_rtc_ticker tutorial to find out how to launch RViZ.

Otherwise, you can still build mc_rtc_ros without ROS if you have the Qt library. After installing, simply run the following command:

$ mc_rtc_gui

Note: this won't enable 3D visualization beyond what is available in Choreonoid

Pre-requisites

To run this interface you need to have installed mc_vrep and V-REP on your system.

Running the controller

First start V-REP and load a scene with the robot you wish to control. Make sure that mc_rtc configuration matches the robot being controlled.

To start the simulation and run the controller, simply execute the following command:

$ mc_vrep

To stop the simulation, input stop in mc_vrep command shell.

Getting feedback and interacting with the controller

If mc_rtc is built with ROS support and the correct options are activated, you can visualize the controller's output using RViZ and interact with it through the dedicated RViZ panel. Follow the mc_rtc_ticker tutorial to find out how to launch RViZ.

Otherwise, you can still build mc_rtc_ros without ROS if you have the Qt library. After installing, simply run the following command:

$ mc_rtc_gui

Note: this won't enable 3D visualization beyond what is available in V-REP