Skip to content

knmlprz/unitree_ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Links

Dependencies

  • ROS2 humble

setup ros2

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "export ROS_DOMAIN_ID=1" >> ~/.bashrc

sudo apt install ros-humble-rmw-cyclonedds-cpp
sudo apt install ros-humble-rosidl-generator-dds-idl
sudo apt install libyaml-cpp-dev

prepare simulation

#unitree_sdk2_python installation
cd ~
sudo apt install python3-pip
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
pip3 install -e .
pip3 install mujoco
pip3 install pygame

#Change the lines depending on your network interface in file:
#~/unitree_ws/setup_local.sh --> ...<NetworkInterface name="wlp4s0"...

#run simulation
python3 ~/unitree_ws/scripts/simulate_python/unitree_mujoco.py

#test in next terminal
python3 ~/unitree_ws/scripts/simulate_python/test/test_unitree_sdk2.py 

test simulation with ros2

colcon build
#
#
#
#run simulation
source ~/unitree_ws/setup_local.sh
python3 ~/unitree_ws/scripts/simulate_python/unitree_mujoco.py
#
#
#
#and in next terminals run:
#
#
#visualize data
source ~/unitree_ws/setup_local.sh
rqt

#test pure dds hello_world with ros2
source ~/unitree_ws/setup_local.sh
python3 ~/unitree_ws/scripts/simulate_python/test/hello_world.py 

#test moving all motors (but be careful! test only for simulation (when robot is on the ground))
source ~/unitree_ws/setup_local.sh
ros2 run unitree_bringup g1_test.py

#test read data
source ~/unitree_ws/setup_local.sh
ros2 run unitree_ros2_example read_low_state_hg

#test move 
source ~/unitree_ws/setup_local.sh
ros2 run unitree_ros2_example g1_ankle_swing_example 

source ~/unitree_ws/setup_local.sh
ros2 run unitree_ros2_example g1_low_level_example 

source ~/unitree_ws/setup_local.sh
ros2 run unitree_ros2_example g1_dual_arm_example   ~/unitree_ws/src/unitree_ros2_example/src/g1/lowlevel/behavior_lib/   motion2 #or "motion" but be careful! default version is too fast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published