echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "export ROS_DOMAIN_ID=1" >> ~/.bashrcgo to:
cd ~
sudo apt install python3-pip
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
sudo pip3 install -e .
pip3 install mujoco
pip3 install pygame
cd ~
git clone https://github.com/unitreerobotics/unitree_mujoco.git
cd unitree_mujoco
cd ./simulate_python
python3 ./unitree_mujoco.py
change config.py
nano ~/unitree_mujoco/simulate_python/config.py
# set in this file: USE_JOYSTICK = 0cd ~/unitree_mujoco/example/python
python3 ./stand_go2.pygo to: unitree_ros2
cd ~
git clone https://github.com/unitreerobotics/unitree_ros2
sudo apt install ros-humble-rmw-cyclonedds-cpp
sudo apt install ros-humble-rosidl-generator-dds-idl
sudo apt install libyaml-cpp-dev
cd ~/unitree_ros2
colcon buildsudo gedit ~/unitree_ros2/setup_local.sh#!/bin/bash
echo "Setup unitree ros2 simulation environment"
source /opt/ros/humble/setup.bash
#source $HOME/unitree_ros2/cyclonedds_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces>
<NetworkInterface name="lo" priority="default" multicast="default" />
</Interfaces></General></Domain></CycloneDDS>'cd ~/unitree_mujoco/simulate_python
source ~/unitree_ros2/setup_local.sh # use "lo" as the network interface
python3 ./unitree_mujoco.py
source ~/unitree_ros2/setup_local.sh
ros2 topic list
cd ~/unitree_ros2
source install/setup.bash
./install/unitree_ros2_example/bin/read_low_state_hg
change config.py
nano ~/unitree_mujoco/simulate_python/config.py
# set in this file: ROBOT = "g1"
# and : ROBOT_SCENE = "../unitree_robots/" + ROBOT + "/scene_29dof.xml"cd ~/unitree_ros2
source ~/unitree_ros2/setup_local.sh
source install/setup.bash
./install/unitree_ros2_example/bin/g1_ankle_swing_example