Lab 6: Real Robot Path Following
Lab 5: Real Robot ROS bag Record
Lab 4: Real Robot Cmd Velocity
Lab 2: Waypoints, Wall Localization, Wall Following
Lab 1: Tutorial of Environment Setup of Unitree GO2
Please change the bag_file
in the script: extract_data_real_robot.py
cd /usr/app/comp0244_ws/
source /opt/ros/humble/setup.sh
source unitree_ros2/setup.sh
python3 extract_data_real_robot.py
cd /usr/app/comp0244_ws/cmp0244-go2
colcon build
source install/setup.bash
cd /usr/app/comp0244_ws/cmp0244-go2
source install/setup.bash
ros2 launch go2_config gazebo_mid360.launch.py rviz:=false
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 launch waypoint_follower path_following.launch.py
Publish different level of trajectory
ros2 run waypoint_follower publish_ellipse_shape # easy
ros2 run waypoint_follower publish_eight_shape # middle
ros2 run waypoint_follower publish_cosince_shape # hard
Once the robot finishes its path, you can see output in the terminal:
[path_follower-3] [INFO] [1742573862.979052993] [path_follower]: ----- All waypoints reached. Stopping. ----
[path_follower-3] [INFO] [1742573862.979052993] [path_follower]: Sum of error: 13.896, Cost time: 27.573s
Terminal 1:
source /usr/app/comp0244_ws/unitree_ros2/setup.sh
ros2 run waypoint_follower path_follower /utlidar/robot_odom
Terminal 2:
source /usr/app/comp0244_ws/unitree_ros2/setup.sh
ros2 run waypoint_follower publish_ellipse_shape
Terminal 3:
source /usr/app/comp0244_ws/unitree_ros2/setup.sh
ros2 run unitree_go2_example forward_cmd_sport_mode_ctrl
NOTE: If you want to try your own state estimation algorithm, please change /utlidar/robot_odom
with your own odometry topic.
NOTE: If you want to try your own path following algorithm, please change path_follower.py
with your own functions.
Date: 27/02/2025
Goal: Record Sportmode state includes position, velcity, foot position, and other motion states of the robot.
Document: https://support.unitree.com/home/en/developer/ROS2_service
Tutorial Link Remember to use humble in commands, not foxy. Here are the summary of these commands (open the docker environment):
cd /usr/app/comp0244_ws/
git clone https://github.com/unitreerobotics/unitree_ros2
apt install net-tools -y
apt install gedit
apt update && apt install ros-humble-rmw-cyclonedds-cpp && apt install ros-humble-rosidl-generator-dds-idl -y
cd unitree_ros2/cyclonedds_ws/src/
git clone https://github.com/ros2/rmw_cyclonedds -b humble && git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd ../
colcon build --packages-select cyclonedds
source /opt/ros/humble/setup.bash
colcon build
Use the cable to connect the robot and your computer, and then configure the network follow the tutorial here
Check connection
ping 192.168.123.99
And modify the /usr/app/comp0244_ws/unitree_ros2/setup.sh
with the below command.
Note: eno2
is the network card of your computer and should change:
#!/bin/bash
echo "Setup unitree ros2 environment"
source /opt/ros/humble/setup.bash
source /usr/app/comp0244_ws/unitree_ros2/cyclonedds_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces>
<NetworkInterface name="eno2" priority="default" multicast="default" />
</Interfaces></General></Domain></CycloneDDS>'
Setup unitree ros2 environment
source /usr/app/comp0244_ws/unitree_ros2/setup.sh
source /usr/app/comp0244_ws/unitree_ros2/setup.sh
ros2 topic echo /sportmodestate
mkdir /usr/app/comp0244_ws/data_comp0244
cd /usr/app/comp0244_ws/data_comp0244
ros2 bag record /lowstate /sportmodestate
Please move the robot. If enough data are record, please enter Enter ctrl+C
to exit. The rosbag will be stored in the folder.
ros2 interface show unitree_go/msg/LowState
ros2 interface show unitree_go/msg/SportModeState
Date: 06/02/2025
Goal: Move the real robot via command velocities: we will see how to use the real robot in the lab._
- Read carefully the instructions shared in moodle named: OPS-G07-SOP-Go2
- Make sure you understand how to insert a battery and how to turn the robot on/off.
- Make sure you understand how to use the two external controllers to move the robot, to stop it, and put it down.
- Make sure you need at least 3 people operating the robot: one controlling via the terminal, the other having the two controllers, and one on the crane.
- Do not put at any case fingers/jewleries/hair close to robot motors.
- Long and loose hair must be contained, Rings and jewellery must not be worn. Budges or any other items risking being trapped in the motors must not be worn.
- Teams will be operating one by one.
To operate the robot we will use two computers:
Install the battery, double-click the batter switch, and wait for about 30s to make sure the robot to be started
source ~/opt/ros/foxy/setup.bash
source ~/Documents/ros2_ws/install/setup.bash
export ROBOT_IP="172.20.10.6"
export CONN_TYPE="webrtc"
ping 172.20.10.6
ros2 launch go2_robot_sdk test.launch.py
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /opt/ros/humble/setup.bash
export ROBOT_IP="172.20.10.6"
export CONN_TYPE="webrtc"
ping 172.20.10.6
NOTE: not exceed 0.4m/s for linear velocity.
ros2 topic pub /cmd_vel -r 10 geometry_msgs/msg/Twist '{
linear: {x: 0.2, y: 0.0, z: 0.0},
angular: {x: 0.0, y: 0.0, z: 0.0}
}'
Do not forget to DISCONNECT the wifi once you finish the task
Install the battery, double-click the batter switch, and wait for about 30s to make sure the robot to be started
conda deactivate
source ~/Documents/ros2_ws/install/setup.bash
export ROBOT_IP="172.20.10.3"
export CONN_TYPE="webrtc"
ping 172.20.10.3
ros2 launch go2_robot_sdk test.launch.py
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /opt/ros/humble/setup.bash
export ROBOT_IP="172.20.10.3"
export CONN_TYPE="webrtc"
ping 172.20.10.3
NOTE: not exceed 0.4m/s for linear velocity.
ros2 topic pub /cmd_vel -r 10 geometry_msgs/msg/Twist '{
linear: {x: 0.2, y: 0.0, z: 0.0},
angular: {x: 0.0, y: 0.0, z: 0.0}
}'
Do not forget to DISCONNECT the wifi once you finish the task
- Write a script that makes the robot move in a circle in the lab.
- Write a script that makes the robot move two time in a circle in the lab and then stop.
Date: 30/01/2025
Goal: Move the Robot via waypoints and wall localization to follow the walls of a convex obstacle: we will check how to use the lidar-based fit lines of an obstacle to follow the wall/obstacle._
Open the first terminal to pull recursively all repos, re-compile, and load the gazebo environment:
cd /home/$USER/comp0244_ws/comp0244-go2
git pull --recurse-submodules
cd /home/$USER/comp0244_ws/comp0244-go2/src/FAST_LIO
git checkout -f && git checkout comp0244 && git pull
cd /home/$USER/comp0244_ws/comp0244-go2/src/waypoint_follower
git checkout -f && git checkout master && git pull
cd /home/$USER/comp0244_ws/comp0244-go2/src/local_map_creator
git checkout -f && git checkout master && git pull
cd /home/$USER/comp0244_ws/comp0244-go2/src/edge_follower
git checkout -f && git checkout master && git pull
cd /home/$USER/comp0244_ws/comp0244-go2
xhost +
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /opt/ros/humble/setup.bash
sudo apt-get install ros-humble-rviz2 ros-humble-turtle-tf2-py ros-humble-tf2-ros ros-humble-tf2-tools
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
xhost +
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
cd /usr/app/comp0244_ws/comp0244-go2/scripts
ros2 launch robot_launch.launch.py
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 topic pub /waypoint geometry_msgs/Pose2D "{x: -1.0, y: 0.0, theta: 0.0}" -r 1
Ctrl+C
ros2 run edge_follower edge_follower
- Make the robot work more smoothly based on the lines to follow the cylinder.
- Move the robot to {x: 0.0, y: 1.0, theta: 3.14} and make it see and turn into the corners and keep following the wall cw.
Date: 23/01/2025
Goal: Move the Robot via Waypoints, Wall Localization, and Wall Following: we will first understand how to move the robot to a waypoint (x,y,θ). We will check how to use the lidar data to fit lines to the point cloud of a wall.
Open the first terminal to pull recursively all repos, re-compile, and load the gazebo environment:
cd /home/$USER/comp0244_ws/comp0244-go2/
git pull --recurse-submodules
cd /home/$USER/comp0244_ws/comp0244-go2/src/waypoint_follower
git checkout master
git pull
cd /home/$USER/comp0244_ws/comp0244-go2/src/local_map_creator
git checkout master
git pull
sudo rm -rf build log install
xhost +
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /opt/ros/humble/setup.bash
cd /usr/app/comp0244_ws
cd comp0244-go2/src/livox_ros_driver2 && ./build.sh humble
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
xhost +
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 launch go2_config gazebo_mid360.launch.py
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 launch fast_lio mapping.launch.py config_file:=unitree_go2_mid360.yaml
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 run waypoint_follower waypoint_follower
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 topic pub /waypoint geometry_msgs/Pose2D "{x: 4.0, y: -2.0, theta: 0.0}" -r 1
- Move the robot to (x,y) = (0.0,1.2)
- Publish waypoints that move the robot around the obstacle you are facing, and end up in the same pose.
- Make the final orientation angle goal work in the code, and make it go to (0.0, 1.2, 1.6)
xhost +
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 launch go2_config gazebo_mid360.launch.py
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 launch fast_lio mapping.launch.py config_file:=unitree_go2_mid360.yaml
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 run waypoint_follower waypoint_follower
sudo docker exec -it comp0244_unitree /bin/bash
source /usr/app/comp0244_ws/comp0244-go2/install/setup.bash
ros2 topic pub /waypoint geometry_msgs/Pose2D "{x: 0.0, y: 1.2, theta: 1.6}" -r 1
sudo docker exec -it comp0244_unitree /bin/bash
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 run local_map_creator local_map_creator
To visualize the local map, open the rviz2 window opened by step 1 and do the following:
- Switch the Global Options to
Fixed Frame: livox
- Add the
Marker
topic/local_map_points
- Add the
Marker
topic/local_map_lines
- Understand what each parameter is doing and tune them accordingly to get lines align with the point clouds when straight walls and corners appear.
- Overview
- Installation on Ubuntu 20+
- Installation on Windows 11+
- Installation on AppleSilicon
- Attaching to a Running Docker Container in VS Code
This repository provides an environment that can be run using Docker. The environment is designed to run specific software or tasks, and the following instructions will guide you through installing dependencies, setting up the Docker container, and running the necessary files.
ssh-keygen -t rsa -b 4096 -C "[email protected]"
For Mac you need also to do:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Then, add the SSH key to your GitHub account (New SSH key):
cat ~/.ssh/id_rsa.pub
mkdir /home/$USER/comp0244_ws
cd /home/$USER/comp0244_ws
git clone --recursive [email protected]:COMP0244-S25/comp0244-go2.git
Step 2: In the same terminal, download the Docker (https://docs.docker.com/engine/install):
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 3: In the same terminal, download the docker images (click here to understand docker):
sudo docker pull jjiao/comp0244:unitree-go-ros2-humble
sudo docker tag jjiao/comp0244:unitree-go-ros2-humble comp0244:unitree-go-ros2-humble
sudo apt-get install x11-xserver-utils
xhost +
Note that everytime you restart your computer you will probably need to run the xhost + command above.
sudo docker run -it -e DISPLAY -e QT_X11_NO_MITSHM=1 -e XAUTHORITY=/tmp/.docker.xauth \
-v /home/$USER/comp0244_ws:/usr/app/comp0244_ws \
--network host \
--name comp0244_unitree comp0244:unitree-go-ros2-humble /bin/bash
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /opt/ros/humble/setup.bash
cd /usr/app/comp0244_ws
cd comp0244-go2/src/livox_ros_driver2 && ./build.sh humble
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
Step 8: Run the package with running the FAST-LIO SLAM:
ros2 launch go2_config gazebo_mid360.launch.py rviz:=true
You can obtain ground truth poses (base_link with respect to the world):
ros2 topic echo /odom/ground_truth
NOTE: if you change configuration the files such as *.xacro/, *.rviz, ... , please build the package once again:
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
Run the FAST-LIO SLAM (in the docker)
sudo docker exec -it comp0244_unitree /bin/bash
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 launch fast_lio mapping.launch.py config_file:=unitree_go2_mid360.yaml
ros2 topic echo /Odometry
sudo docker exec -it comp0244_unitree /bin/bash
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
Using your keyboard to move your robot.
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Use your keyboard to move the robot:
u i (move forward) o
j (counterclockwise turn) k (stop) l (clockwise turn)
m , (move backward) .
Instead of Steps 13 and 14, we can move the robot (e.g., stop, move forward, move backward, clock-wise turn, couterwise turn) via commanding the velocity:
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: -1.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 1.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: -0.3
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 1
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.3
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 0.5
mkdir /home/$USER/comp0244_ws
cd /home/$USER/comp0244_ws
git clone --recursive [email protected]:COMP0244-S25/comp0244-go2.git
Step 2: In the same terminal, download the Docker (https://docs.docker.com/engine/install):
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 3: In the same terminal, download the docker images (click here to understand docker):
sudo docker pull jjiao/comp0244:unitree-go-ros2-humble
sudo docker tag jjiao/comp0244:unitree-go-ros2-humble comp0244:unitree-go-ros2-humble
echo '# WSLg Configuration
export DISPLAY=:0
export WAYLAND_DISPLAY=wayland-0
export XDG_RUNTIME_DIR=/run/user/1000
export PULSE_SERVER=/run/user/1000/pulse/native' >> ~/.bashrc
source ~/.bashrc
Verify display setup:
# Install x11-apps for testing
apt-get update && apt-get install -y x11-apps
# Test the display (should open a window with moving eyes)
xeyes
# If the test is successful, you can proceed with the tutorial
# Press Ctrl+C to close xeyes
sudo docker run -it \
-e DISPLAY=$DISPLAY \
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e PULSE_SERVER=$PULSE_SERVER \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /mnt/wslg:/mnt/wslg \
-v /usr/lib/wsl:/usr/lib/wsl \
-v /home/$USER/comp0244_ws:/usr/app/comp0244_ws \
--network host \
--name comp0244_unitree comp0244:unitree-go-ros2-humble /bin/bash
sudo docker container start comp0244_unitree
sudo docker exec -it comp0244_unitree /bin/bash
source /opt/ros/humble/setup.bash
cd /usr/app/comp0244_ws
cd comp0244-go2/src/livox_ros_driver2 && ./build.sh humble
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
Step 8: Run the package with running the FAST-LIO SLAM:
ros2 launch go2_config gazebo_mid360.launch.py rviz:=true
You can obtain ground truth poses (base_link with respect to the world):
ros2 topic echo /odom/ground_truth
NOTE: if you change configuration the files such as *.xacro/, *.rviz, ... , please build the package once again:
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
Run the FAST-LIO SLAM (in the docker)
sudo docker exec -it comp0244_unitree /bin/bash
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 launch fast_lio mapping.launch.py config_file:=unitree_go2_mid360.yaml
ros2 topic echo /Odometry
sudo docker exec -it comp0244_unitree /bin/bash
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
Using your keyboard to move your robot.
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Use your keyboard to move the robot:
u i (move forward) o
j (counterclockwise turn) k (stop) l (clockwise turn)
m , (move backward) .
Instead of Steps 13 and 14, we can move the robot (e.g., stop, move forward, move backward, clock-wise turn, couterwise turn) via commanding the velocity:
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: -1.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 1.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: -0.3
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 1
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.3
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 0.5
This repository provides an environment that can be run within an virtual environemnt of ARM architecture. The environment is designed to run specific software or tasks, and the following instructions will guide you through installing dependencies, setting up the Docker container, and running the necessary files.
- Visit the UTM Virtual Machine Website.
- Download the free version of the UTM application (not the App Store version to avoid charges).
- Open the downloaded
UTM.dmg
file and follow the installation steps. - Download the 64-bit ARM Ubuntu 22.04 image
- Open UTM and click + → Virtualize → Linux.
- Allocate:
- Memory: 2+ GB.
- CPU Cores: 2+.
- Add:
- Primary Disk: 30+ GB.
- CD/DVD Drive: Attach the downloaded Ubuntu ISO.
- Set the CD/DVD Drive as the first boot device under System.
- Save and click Play to boot the VM into the Ubuntu installer.
- Follow the installer prompts:
- Use the entire disk for installation.
- Set a username, password, and hostname.
- Enable install of OpenSSH
- Stop the VM.
- Go to Drives → Remove the CD/DVD Drive.
- Save and reboot.
- Update your VM:
sudo apt update && sudo apt upgrade -y
- Install the graphic interface:
sudo apt install -y xubuntu-desktop
- When prompted - selected lightdm
- Reboot your environemnt:
sudo reboot
1.Set SSH key compatible with yout Github account - replace "youremail"
ssh-keygen -t rsa -b 4096 -C “youremail”@youremail.com
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
-
Copy to GitHub ssh keys:
- In your Github acount go to settings and SSH and GPG Keys.
- Add a new SSH key and name it "UbunutuVMkey"
- Coppy the output of the last command.
- sSave entry
-
Varify correct setup:
ssh -T [email protected]
You should see a "Hey, [your Github username]"
1: Setup Locale Make sure your system locale is set to UTF-8:
sudo apt update && sudo apt install -y locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
2: Add the ROS 2 Repository
sudo apt update && sudo apt install -y software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install -y curl
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -
Add the ROS 2 repository to your sources list:
sudo sh -c 'echo "deb [arch=arm64] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
3: Install ROS 2 Humble Update your package index and install ROS 2:
sudo apt update
sudo apt install -y ros-humble-desktop
For a smaller installation (if you're limited on storage or just need core features):
sudo apt install -y ros-humble-ros-base
4: Environment Setup Source the ROS 2 setup file automatically on terminal startup:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc
5: Install Additional Tools (Optional)
Install colcon
for building ROS 2 packages:
sudo apt install -y python3-colcon-common-extensions
Install ROS 2 CLI tools:
sudo apt install -y python3-argcomplete
Open a terminal and run:
mkdir /home/$USER/comp0244_ws
cd /home/$USER/comp0244_ws
git clone --recursive [email protected]:COMP0244-S25/comp0244-go2.git
- Open a terminal (Terminator) in the virtual machine, or press
Ctrl+Alt+T
. - Run the following command to start Gazebo:
gazebo
- If it launches successfully you are ready to go!
- Navigate to the specified directory for the course environment:
cd comp0244/tutorial_env_go2
- Source the setup file:
source install/setup.bash
Step 8: Run the package with running the FAST-LIO SLAM:
ros2 launch go2_config gazebo_mid360.launch.py rviz:=true
You can obtain ground truth poses (base_link with respect to the world) in a new terminal:
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 topic echo /odom/ground_truth
NOTE: if you change configuration the files such as *.xacro/, *.rviz, ... , please build the package once again:
cd /usr/app/comp0244_ws/comp0244-go2
colcon build
source install/setup.bash
Run the FAST-LIO SLAM (in the docker)
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 launch fast_lio mapping.launch.py config_file:=unitree_go2_mid360.yaml
ros2 topic echo /Odometry
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
Using your keyboard to move your robot.
cd /usr/app/comp0244_ws/comp0244-go2
source install/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Use your keyboard to move the robot:
u i (move forward) o
j (counterclockwise turn) k (stop) l (clockwise turn)
m , (move backward) .
Instead of Steps 13 and 14, we can move the robot (e.g., stop, move forward, move backward, clock-wise turn, couterwise turn) via commanding the velocity:
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: -1.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 1.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: -0.3
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 1
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.3
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 0.5
ros2 topic pub /cmd_vel geometry_msgs/Twist '
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
' -r 0.5
This would allow access to file explorer.
Before you start, ensure the following are set up:
- Docker Installed: Docker must be installed and running on your machine.
- Visual Studio Code Installed: Make sure you have VS Code installed.
- Docker Extension:
- Open the Extensions view in VS Code (
Ctrl+Shift+X
orCmd+Shift+X
on macOS). - Search for "Docker" and install the extension by Microsoft.
- Open the Extensions view in VS Code (
- Click on the Docker icon in the Activity Bar on the left-hand side of VS Code. If this does not exist you can install the Docker Extension from the VScode extensions.
- Under the Containers section, find the container you want to attach to.
- Running containers will have a green status indicator.
- Right-click on the container name and choose one of the following options:
- Attach Shell: Opens a terminal session attached to the container.
- Attach Visual Studio Code: Opens the container's filesystem as a remote workspace in VS Code.
- If you selected Attach Visual Studio Code, the container will open as a remote workspace. You can now:
- Browse and edit files within the container.
- Use the integrated terminal to run commands in the container.
If the container is stopped, you can restart it:
- Right-click on the container in the Docker view and select Start.
You can also use the Command Palette:
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS). - Type and select
Docker: Attach Shell
orRemote-Containers: Attach to Running Container
.
Copyright (c) 2016-2025 Dimitrios Kanoulas All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.