From 66fae83fca3c11a74d39beface525b9b44c51a1f Mon Sep 17 00:00:00 2001 From: Khang Pham Date: Wed, 10 Jun 2026 15:47:14 +0900 Subject: [PATCH 1/5] build: install ur_rtde from source as default --- dockerfiles/Dockerfile | 17 +++++++++++++---- dockerfiles/docker-compose.yml | 8 ++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index e2b114d..5ceb112 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -31,10 +31,19 @@ RUN apt-get update && apt-get install -y \ # Install dependencies for robots_interface RUN apt-get update \ - && apt-get install -y software-properties-common \ - && add-apt-repository ppa:sdurobotics/ur-rtde \ - && apt-get update \ - && apt-get install librtde librtde-dev + && apt-get install -y software-properties-common + +# If ppa:sdurobotics/ur-rtde is not available, consider building from source +# RUN add-apt-repository ppa:sdurobotics/ur-rtde \ +# && apt-get update \ +# && apt-get install -y librtde librtde-dev +WORKDIR /opt +RUN git clone https://gitlab.com/sdurobotics/ur_rtde.git && \ + cd ur_rtde && \ + mkdir -p build && cd build && \ + cmake -DPYTHON_BINDINGS:BOOL=OFF .. && \ + make && \ + sudo make install WORKDIR /opt RUN git clone https://github.com/jrl-umi3218/ur_modern_driver && \ diff --git a/dockerfiles/docker-compose.yml b/dockerfiles/docker-compose.yml index a220f9f..073cca1 100644 --- a/dockerfiles/docker-compose.yml +++ b/dockerfiles/docker-compose.yml @@ -2,15 +2,15 @@ version: '3.3' services: mc_rtc_tutorials: - image: ghcr.io/isri-aist/mc_rtc_tutorials:latest + # image: ghcr.io/isri-aist/mc_rtc_tutorials:latest user: root container_name: mc_rtc_tutorials environment: DISPLAY: $DISPLAY # Uncomment if you can to build local image - # build: - # context: .. - # dockerfile: ./dockerfiles/Dockerfile + build: + context: .. + dockerfile: ./dockerfiles/Dockerfile volumes: - /tmp/.X11-unix:/tmp/.X11-unix # Use the command 'echo $XAUTHORITY' to find exact path From 991d1e8981b2a5b30906d349d7a5076eb965d9b3 Mon Sep 17 00:00:00 2001 From: Khang Pham Date: Wed, 10 Jun 2026 16:00:43 +0900 Subject: [PATCH 2/5] chore(mc_kinova): update submodule pointer --- controllers/dual_arm_controller/src/DualArmController.cpp | 4 ++-- robots/mc_kinova | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/dual_arm_controller/src/DualArmController.cpp b/controllers/dual_arm_controller/src/DualArmController.cpp index d73c46f..46421c1 100644 --- a/controllers/dual_arm_controller/src/DualArmController.cpp +++ b/controllers/dual_arm_controller/src/DualArmController.cpp @@ -3,13 +3,13 @@ #include DualArmController::DualArmController(mc_rbdyn::RobotModulePtr rm, double dt, const mc_rtc::Configuration & config) -: mc_control::MCController({rm, mc_rbdyn::RobotLoader::get_robot_module("KinovaDefault")}, dt) +: mc_control::MCController({rm, mc_rbdyn::RobotLoader::get_robot_module("Kinova")}, dt) { solver().addConstraintSet(contactConstraint); solver().addConstraintSet(kinematicsConstraint); solver().addConstraintSet(selfCollisionConstraint); - addCollisions("ur5e", "kinova_default", {{"*", "*", iDist, sDist, 0}}); + addCollisions("ur5e", "kinova", {{"*", "*", iDist, sDist, 0}}); postureTask->stiffness(1); postureTask->weight(1); diff --git a/robots/mc_kinova b/robots/mc_kinova index 7cf7424..7eda814 160000 --- a/robots/mc_kinova +++ b/robots/mc_kinova @@ -1 +1 @@ -Subproject commit 7cf74240bcb9eb04eab5fe221f5fcaa009fe294e +Subproject commit 7eda81445e782c5c0fccfbadd73cf234db949a5c From 375a48a4bef563eb678796a8d10379858811e5dc Mon Sep 17 00:00:00 2001 From: Khang Pham Date: Wed, 10 Jun 2026 17:15:07 +0900 Subject: [PATCH 3/5] feat: use oh-my-zsh as default shell --- dockerfiles/.zshrc | 116 +++++++++++++++++++++++++++++++++ dockerfiles/Dockerfile | 43 +++++------- dockerfiles/docker-compose.yml | 10 +-- dockerfiles/entrypoint.sh | 67 ++++++++++++------- 4 files changed, 181 insertions(+), 55 deletions(-) create mode 100644 dockerfiles/.zshrc mode change 100644 => 100755 dockerfiles/entrypoint.sh diff --git a/dockerfiles/.zshrc b/dockerfiles/.zshrc new file mode 100644 index 0000000..e74f1a0 --- /dev/null +++ b/dockerfiles/.zshrc @@ -0,0 +1,116 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH + +# Path to your Oh My Zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time Oh My Zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + nvm + pip + pre-commit + ssh + zsh-interactive-cd + zsh-autosuggestions +) + +# for zsh-completions +fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src +autoload -U compinit && compinit + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 5ceb112..bb1ad03 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -6,23 +6,23 @@ LABEL org.opencontainers.image.description="mc_rtc_tutorial image" LABEL org.opencontainers.image.licenses=BSD # Configure environment -ENV DISPLAY host.docker.internal:0.0 -ENV LD_LIBRARY_PATH "/usr/local/lib" +ENV LD_LIBRARY_PATH="/usr/local/lib" -# Set default bash shell SHELL ["/bin/bash", "-c"] -RUN apt-get update && apt install -y curl ca-certificates gpg wget +RUN apt-get update && apt install -y curl ca-certificates gpg wget zsh fzf -RUN curl -1sLf 'https://dl.cloudsmith.io/public/mc-rtc/head/setup.deb.sh' | bash +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended && \ + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \ + git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions +COPY ./dockerfiles/.zshrc /root/.zshrc -RUN apt install -y libmc-rtc-dev mc-rtc-utils - -RUN apt install -y ros-${ROS_DISTRO}-mc-rtc-plugin ros-${ROS_DISTRO}-mc-rtc-tools - -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null -RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null -RUN apt-get update && apt-get install -y \ +RUN curl -1sLf 'https://dl.cloudsmith.io/public/mc-rtc/head/setup.deb.sh' | bash && \ + apt install -y libmc-rtc-dev mc-rtc-utils && \ + apt install -y ros-${ROS_DISTRO}-mc-rtc-plugin ros-${ROS_DISTRO}-mc-rtc-tools && \ + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ + apt-get update && apt-get install -y \ kitware-archive-keyring \ cmake \ ros-humble-gazebo-ros-pkgs \ @@ -30,30 +30,23 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* # Install dependencies for robots_interface -RUN apt-get update \ - && apt-get install -y software-properties-common - -# If ppa:sdurobotics/ur-rtde is not available, consider building from source -# RUN add-apt-repository ppa:sdurobotics/ur-rtde \ -# && apt-get update \ -# && apt-get install -y librtde librtde-dev WORKDIR /opt -RUN git clone https://gitlab.com/sdurobotics/ur_rtde.git && \ +RUN apt-get update && apt-get install -y software-properties-common \ + && rm -rf /var/lib/apt/lists/* && \ + git clone https://gitlab.com/sdurobotics/ur_rtde.git && \ cd ur_rtde && \ mkdir -p build && cd build && \ cmake -DPYTHON_BINDINGS:BOOL=OFF .. && \ - make && \ - sudo make install + make && make install WORKDIR /opt RUN git clone https://github.com/jrl-umi3218/ur_modern_driver && \ cd ur_modern_driver && \ mkdir build && cd build && \ - cmake .. && \ - make install + cmake .. && make install COPY ./dockerfiles/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh WORKDIR /root ENTRYPOINT ["/entrypoint.sh"] -CMD ["/bin/bash"] +CMD ["/bin/zsh"] diff --git a/dockerfiles/docker-compose.yml b/dockerfiles/docker-compose.yml index 073cca1..f4de54b 100644 --- a/dockerfiles/docker-compose.yml +++ b/dockerfiles/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.3' - services: mc_rtc_tutorials: # image: ghcr.io/isri-aist/mc_rtc_tutorials:latest @@ -12,6 +10,7 @@ services: context: .. dockerfile: ./dockerfiles/Dockerfile volumes: + - ./entrypoint.sh:/entrypoint.sh:ro - /tmp/.X11-unix:/tmp/.X11-unix # Use the command 'echo $XAUTHORITY' to find exact path - /run/user/1000/gdm/Xauthority:/root/.Xauthority @@ -22,6 +21,7 @@ services: - "./colcon_defaults.yaml:/root/colcon_ws/colcon_defaults.yaml" - "../robots/:/root/mc_robots/" - "../robots_interface/:/root/mc_interface/" - privileged: True - stdin_open: True - command: bash + privileged: true + stdin_open: true + tty: true + command: zsh diff --git a/dockerfiles/entrypoint.sh b/dockerfiles/entrypoint.sh old mode 100644 new mode 100755 index 95585f5..462c595 --- a/dockerfiles/entrypoint.sh +++ b/dockerfiles/entrypoint.sh @@ -3,35 +3,52 @@ set -e source /opt/ros/humble/setup.bash +echo "--- Building colcon workspace ---" cd /root/colcon_ws colcon build +if [[ -f "/root/colcon_ws/install/setup.bash" ]]; then + source "/root/colcon_ws/install/setup.bash" +fi +echo "--- Colcon workspace build complete ---" + +build_project() { + local name="$1" + local src="$2" + if [[ ! -d "$src" ]]; then + echo "--- Skipping $name (directory not found) ---" + return 0 + fi + echo "--- Compiling $name ---" + mkdir -p "$src/build" + cd "$src/build" + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo + make -j$(nproc) + make install + echo "--- $name compilation complete ---" +} + +build_project "mc_robots" /root/mc_robots +build_project "controllers" /root/mc_rtc_ws +build_project "mc_mujoco" /root/mc_mujoco +build_project "mc_interface" /root/mc_interface + +# Source ROS in shell configs +if ! grep -q "^ros/humble/setup.bash" ~/.bashrc 2>/dev/null; then + echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc + echo "source /root/colcon_ws/install/setup.bash" >> ~/.bashrc +fi +if ! grep -q "^ros/humble/setup.zsh" ~/.zshrc 2>/dev/null; then + echo "source /opt/ros/humble/setup.zsh" >> ~/.zshrc + echo "source /root/colcon_ws/install/setup.zsh" >> ~/.zshrc +fi -if [ -f "/root/colcon_ws/install/setup.bash" ]; then - source "/root/colcon_ws/install/setup.bash" +if ! grep -q "^RobotModulePaths" /usr/etc/mc_rtc.yaml; then + echo 'RobotModulePaths: [/usr/lib/mc_robots]' >> /usr/etc/mc_rtc.yaml +fi +if ! grep -q "^ControllerModulePaths" /usr/etc/mc_rtc.yaml; then + echo 'ControllerModulePaths: [/usr/lib/mc_controller]' >> /usr/etc/mc_rtc.yaml fi -echo "--- Compiling mc_robots ---" -mkdir -p /root/mc_robots/build -cd /root/mc_robots/build -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -make install -echo "--- Compilation Complete ---" - -echo "--- Compiling controllers ---" -mkdir -p /root/mc_rtc_ws/build -cd /root/mc_rtc_ws/build -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -make install -echo "--- Compilation Complete ---" - -echo "--- Compiling mc_interface ---" -mkdir -p /root/mc_interface/build -cd /root/mc_interface/build -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -make install -echo "--- Compilation Complete ---" - -echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc -echo "source /root/colcon_ws/install/setup.bash" >> ~/.bashrc +echo "--- COMPILATION COMPLETED ---" exec "$@" From 8dbdcf59c81286a8b166f69d8e8ae7d92c673e5e Mon Sep 17 00:00:00 2001 From: Khang Pham Date: Wed, 10 Jun 2026 17:54:19 +0900 Subject: [PATCH 4/5] feat(mujoco): add mujoco description for kinova and ur5e --- .gitmodules | 6 ++++++ .../src/DualArmController.cpp | 4 ++-- dockerfiles/Dockerfile | 17 ++++++++++++----- dockerfiles/docker-compose.yml | 1 + dockerfiles/entrypoint.sh | 2 +- mujoco_description/CMakeLists.txt | 6 ++++++ mujoco_description/kinova_mj_description | 1 + mujoco_description/ur5e_mj_desription | 1 + 8 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 mujoco_description/CMakeLists.txt create mode 160000 mujoco_description/kinova_mj_description create mode 160000 mujoco_description/ur5e_mj_desription diff --git a/.gitmodules b/.gitmodules index 24a053c..2ef22d0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,3 +24,9 @@ [submodule "robots_interface/mc_rtde"] path = robots_interface/mc_rtde url = https://github.com/isri-aist/mc_rtde +[submodule "mujoco_description/kinova_mj_description"] + path = mujoco_description/kinova_mj_description + url = https://github.com/mathieu-celerier/kinova_mj_description.git +[submodule "mujoco_description/ur5e_mj_desription"] + path = mujoco_description/ur5e_mj_desription + url = https://github.com/isri-aist/ur5e_mj_description.git diff --git a/controllers/dual_arm_controller/src/DualArmController.cpp b/controllers/dual_arm_controller/src/DualArmController.cpp index 46421c1..b14c916 100644 --- a/controllers/dual_arm_controller/src/DualArmController.cpp +++ b/controllers/dual_arm_controller/src/DualArmController.cpp @@ -9,6 +9,8 @@ DualArmController::DualArmController(mc_rbdyn::RobotModulePtr rm, double dt, con solver().addConstraintSet(kinematicsConstraint); solver().addConstraintSet(selfCollisionConstraint); + robots().robot("kinova").posW(sva::PTransformd(sva::RotZ(0.0), Eigen::Vector3d(0.7, 0.5, 0))); + addCollisions("ur5e", "kinova", {{"*", "*", iDist, sDist, 0}}); postureTask->stiffness(1); @@ -83,8 +85,6 @@ void DualArmController::reset(const mc_control::ControllerResetData & reset_data kinovaKinematics_ = std::make_unique(robots(), 1, solver().dt()); solver().addConstraintSet(kinovaKinematics_); - - robots().robot(1).posW(sva::PTransformd(sva::RotZ(0.0), Eigen::Vector3d(0.7, 0.5, 0))); } CONTROLLER_CONSTRUCTOR("DualArmController", DualArmController) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index bb1ad03..af1d368 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -22,13 +22,20 @@ RUN curl -1sLf 'https://dl.cloudsmith.io/public/mc-rtc/head/setup.deb.sh' | bash apt install -y ros-${ROS_DISTRO}-mc-rtc-plugin ros-${ROS_DISTRO}-mc-rtc-tools && \ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ - apt-get update && apt-get install -y \ - kitware-archive-keyring \ - cmake \ - ros-humble-gazebo-ros-pkgs \ - ros-humble-hardware-interface \ + apt-get update && apt-get install -y kitware-archive-keyring cmake ros-humble-gazebo-ros-pkgs ros-humble-hardware-interface \ && rm -rf /var/lib/apt/lists/* +# Install dependencies for mc_mujoco +WORKDIR /opt +RUN apt-get update && apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libglew-dev && \ + source /opt/ros/${ROS_DISTRO}/setup.bash && \ + git clone --recursive https://github.com/rohanpsingh/mc_mujoco.git && \ + cd mc_mujoco && \ + mkdir build && cd build && \ + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ + make && \ + make install + # Install dependencies for robots_interface WORKDIR /opt RUN apt-get update && apt-get install -y software-properties-common \ diff --git a/dockerfiles/docker-compose.yml b/dockerfiles/docker-compose.yml index f4de54b..3c8b67f 100644 --- a/dockerfiles/docker-compose.yml +++ b/dockerfiles/docker-compose.yml @@ -21,6 +21,7 @@ services: - "./colcon_defaults.yaml:/root/colcon_ws/colcon_defaults.yaml" - "../robots/:/root/mc_robots/" - "../robots_interface/:/root/mc_interface/" + - "../mujoco_description/:/root/mc_mujoco_description/" privileged: true stdin_open: true tty: true diff --git a/dockerfiles/entrypoint.sh b/dockerfiles/entrypoint.sh index 462c595..ce8a21f 100755 --- a/dockerfiles/entrypoint.sh +++ b/dockerfiles/entrypoint.sh @@ -29,7 +29,7 @@ build_project() { build_project "mc_robots" /root/mc_robots build_project "controllers" /root/mc_rtc_ws -build_project "mc_mujoco" /root/mc_mujoco +build_project "mc_mujoco" /root/mc_mujoco_description build_project "mc_interface" /root/mc_interface # Source ROS in shell configs diff --git a/mujoco_description/CMakeLists.txt b/mujoco_description/CMakeLists.txt new file mode 100644 index 0000000..f466e69 --- /dev/null +++ b/mujoco_description/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.22) + +project(mc_rtc_tutorial_mujoco_description) + +add_subdirectory(kinova_mj_description) +add_subdirectory(ur5e_mj_desription) diff --git a/mujoco_description/kinova_mj_description b/mujoco_description/kinova_mj_description new file mode 160000 index 0000000..2877d30 --- /dev/null +++ b/mujoco_description/kinova_mj_description @@ -0,0 +1 @@ +Subproject commit 2877d305f7c5e1994c8033047da62a6a149ede63 diff --git a/mujoco_description/ur5e_mj_desription b/mujoco_description/ur5e_mj_desription new file mode 160000 index 0000000..04a4400 --- /dev/null +++ b/mujoco_description/ur5e_mj_desription @@ -0,0 +1 @@ +Subproject commit 04a4400de567c8ac49e20a13319ab5a84d34bf7f From a8b77713969a80c0601381ca84c6eef7eb8be4e7 Mon Sep 17 00:00:00 2001 From: Khang Pham Date: Wed, 10 Jun 2026 17:57:08 +0900 Subject: [PATCH 5/5] chore: update readme --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aea08cb..8471da8 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ This repository contains various tutorials for [mc_rtc](https://jrl.cnrs.fr/mc_r - **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. +Mujoco description for UR5e and Kinova robots are also provided to run controller with [mc_mujoco](https://github.com/rohanpsingh/mc_mujoco), a MuJoCo interface for mc_rtc. + ## Installation Clone this repository to your local machine: ```bash @@ -41,7 +43,8 @@ It is not recommended to run the tutorials without Docker since it is mixed betw make && make install ``` -## Running preinstalled controller +## mc_rtc controller + In one terminal, run RVIZ2 for visualization: ```bash ros2 launch mc_rtc_ticker display.launch @@ -70,7 +73,7 @@ PYTHONPATH=/controllers/mobile_arm_controller/python m ``` 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 +### 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](https://jrl.cnrs.fr/mc_rtc/tutorials.html). @@ -92,3 +95,20 @@ cmake .. make sudo make install ``` + +## mc_mujoco + +With the provided mc_mujoco descriptions, you can run `dual_arm_controller` with mc_mujoco +```sh +mc_mujoco -sf ~/config/dual_arm_controller.yaml +``` + +You can add other controllers for UR5e and Kinova and simulate them with mc_mujoco using the same command. + +```sh +mc_mujoco -sf +``` + +## Note + +For both `mc_rtc_ticker` and `mc_mujoco`, you can run them with flag `-h` or `--help` to see all available options.