Skip to content

rt-net/mujina_ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

mujina_ros

Requirements

Build and Install

# Clone the mujina_ros repository
mkdir -p ~/mujina_ws/src
cd ~/mujina_ws/src
git clone https://github.com/rt-net/mujina_ros.git

# Install dependencies
rosdep install -r -y -i --from-paths .
python3 -m pip install --break-system-packages mujoco torch torchvision torchaudio onnxruntime

# Build and Install
cd ~/mujina_ws/
colcon build --symlink-install
source ~/mujina_ws/install/setup.bash

# Device setup
sudo usermod -aG dialout $USER
# logout and login to reload user group
sudo cp ~/mujina_ws/src/mujina_ros/mujina/config/90-mujina.rules /etc/udev/rules.d/ # Please edit the file to match your device.
sudo udevadm control --reload

Reinforcement Learning

For reinforcement learning with Isaac Lab, please refer to this blog post.

The Isaac Lab project for Mujina is available here.

Setting the Initial Position

Before first use, set the motor origin:

  1. Move each joint to its origin position.
  2. Set the joint origin by running the following commands:
cd ~/mujina_ws/src/mujina_ros
./mujina_control/scripts/can_setup_net.sh
python3 mujina_control/scripts/motor_set_zero_position.py --ids 1

Usage

To test the installation, run:

cd ~/mujina_ws/src/mujina_ros
python3 -m mujina_control.mujina_utils.mujina_utils

To test the motors, run:

cd ~/mujina_ws/src/mujina_ros
./mujina_control/scripts/can_setup_net.sh
python3 mujina_control/scripts/motor_test_read_only.py --ids 1

To test the real robot, run the following commands:

# On the Mujina PC
## Terminal 1: 
source ~/mujina_ws/install/setup.bash
ros2 run rt_usb_imu_driver rt_usb_imu_driver --ros-args -p "port_name:=/dev/rt_usb_imu"

## Terminal 2: 
source ~/mujina_ws/install/setup.bash
cd ~/mujina_ws/src/mujina_ros
./mujina_control/scripts/can_setup_net.sh
ros2 run mujina_control mujina_main

## Terminal 3: 
source ~/mujina_ws/install/setup.bash
ros2 run joy_linux joy_linux_node

For the recommended gamepad:
Set the control mode slider to the X position and press the MODE button until the LED turns off.

Green button: Sit Down / Stand Up. Red button: Stand Up / Walk.
Left and Right Joysticks: Send commands in Walk mode.

To simulate the robot in Mujoco, run the following command in Terminal 2 instead:

ros2 run mujina_control mujina_main --sim

To create a CAN network interface from a serial port, run the following command in Terminal2 instead:

./mujina_control/scripts/can_setup_serial.sh

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors