Skip to content

isri-aist/mc_rtc_tutorials

Repository files navigation

mc_rtc_tutorials

Introduction

This repository contains various tutorials for mc_rtc, an interface for simulation and robot control systems. Each tutorial is organized in its own folder, with code examples and explanations to help users understand different aspects of mc_rtc. Currently, two tutorials are available:

  • dual_arm_controller: This tutorial demonstrates how to implement a dual-arm controller using C++ and Python. It showcases the control of two robotic arms working together to perform tasks.
  • mobile_arm_controller: This tutorial focuses on controlling a mobile manipulator robot using C++ and Python. It illustrates how to manage both the mobility and manipulation capabilities of the robot.

Installation

Clone this repository to your local machine:

git clone --recursive https://github.com/isri-aist/mc_rtc_tutorials.git

With docker (recommended)

To easily set up the environment for running the tutorials, you can use Docker. Follow these steps:

  1. Install Docker Desktop (or Docker Engine) and Docker Compose on your system if you haven't already.
  2. Navigate to the dockerfiles directory of cloned repository and build, run the Docker container using Docker Compose:
    cd mc_rtc_tutorials/dockerfiles
    docker compose up -d
  3. Access the running container:
    docker exec -it mc_rtc_tutorials bash

Without docker

It is not recommended to run the tutorials without Docker since it is mixed between independent CMake projects and ROS2 packages. However, if you want to run the tutorials without Docker, make sure to follow these steps:

  1. Install mc_rtc on your system.
  2. Build robots_description ROS2 packages in a colcon workspace (assuming you have ROS2 Humble installed, and sourced):
    cd robots_description/
    colcon build
    Remember to source the workspace after building:
    source install/setup.bash
  3. Navigate to the tutorial directories and build them using CMake for C++ examples or run the Python scripts directly.
    mkdir build && cd build
    cmake ..
    make && make install
    

Running preinstalled controller

In one terminal, run RVIZ2 for visualization:

ros2 launch mc_rtc_ticker display.launch

In a separate terminal, use mc_rtc_ticker to run the tutorials.

dual_arm_controller

C++

mc_rtc_ticker -f ~/config/dual_arm_controller.yaml

Python

PYTHONPATH=<path_to_mc_rtc_tutorials>/controllers/dual_arm_controller/python mc_rtc_ticker -f ~/config/dual_arm_controller_python.yaml

If you are using docker: PYTHONPATH=${HOME}/mc_rtc_ws/dual_arm_controller/python mc_rtc_ticker -f ~/config/dual_arm_controller_python.yaml

mobile_arm_controller

C++

mc_rtc_ticker -f ~/config/mobile_arm_controller.yaml

Python

PYTHONPATH=<path_to_mc_rtc_tutorials>/controllers/mobile_arm_controller/python mc_rtc_ticker -f ~/config/mobile_arm_controller_python.yaml

If you are using docker: PYTHONPATH=${HOME}/mc_rtc_ws/mobile_arm_controller/python mc_rtc_ticker -f ~/config/mobile_arm_controller_python.yaml

Adding controller

You can add controllers of your own and build it easily.

Put your new controller inside controllers directory. If you have never work with mc_rtc before, you can find several tutorials to get started here.

cd controllers

List your new controller in ~/controllers/CMakeLists.txt.

You can exit the container and recompose it.

docker compose up -d
docker exec -it mc_rtc_tutorials bash

If you are not using Docker or do not want to exit your container. Navigate to the build directory and rebuild the project.

cd build/
cmake ..
make
sudo make install

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors