Skip to content

Commit

Permalink
added installation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyLai1234 committed Aug 27, 2024
1 parent dd341d2 commit 0521c11
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 40 deletions.
51 changes: 15 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,25 @@ Supported versions

__Please note that the setup of PC and the mini pupper is separated__

* To use Gazebo simulator, "1.1 PC Setup" is required.
* To control Mini Pupper, "1.2 Mini Pupper Setup" is required.
* To control Mini Pupper, "1.1 Mini Pupper Setup" is required.
* To use Gazebo simulator, "1.2 PC Setup" is required.
* To control Mini Pupper using visualize tools, "1.1 PC Setup" and "1.2 Mini Pupper Setup" is required.
* To use Gazebo simulator or control Mini Pupper using joystick, "1.4 Joystick Setup" is required.

### 1.1 PC Setup
### 1.1 Mini Pupper Setup

PC Setup corresponds to PC (your desktop or laptop PC) for controlling Mini Pupper remotely or execute simulator.
__Do not apply these PC Setup commands to your Raspberry Pi on Mini Pupper.__

Ubuntu 22.04 + ROS 2 Humble is required.
Mini Pupper Setup corresponds to the Raspberry Pi on your Mini Pupper.
Ubuntu 22.04 is required.

```sh
cd ~
sudo apt update
git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git
~/ros2_setup_scripts_ubuntu/ros2-humble-ros-base-main.sh
source /opt/ros/humble/setup.bash
```
Before installation, you need to install the BSP(board support package) repo for your [Mini Pupper 2](https://github.com/mangdangroboticsclub/mini_pupper_2_bsp) or [Mini Pupper](https://github.com/mangdangroboticsclub/mini_pupper_bsp.git).

After ROS 2 installation, download the Mini Pupper ROS package in the workspace.
After installing the driver software, install ROS 2 Humble is required.

```sh
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
cd ~
git clone https://github.com/mangdangroboticsclub/mini_pupper_ros.git -b ros2-dev mini_pupper_ros
vcs import < mini_pupper_ros/.minipupper.repos --recursive
```

Build and install all ROS packages.

```sh
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
sudo apt install ros-humble-teleop-twist-keyboard
sudo apt install ros-humble-teleop-twist-joy
pip3 install simple_pid
colcon build --symlink-install
cd mini_pupper_ros
./pupper_install.sh
```

Reference(Just for reference, don't need to do it again.):
Expand All @@ -68,20 +49,18 @@ Reference(Just for reference, don't need to do it again.):
[unofficial ROS 2 installation script](https://github.com/Tiryoh/ros2_setup_scripts_ubuntu)


### 1.2 Mini Pupper Setup

Mini Pupper Setup corresponds to the Raspberry Pi on your Mini Pupper.
Ubuntu 22.04 is required.
### 1.2 PC Setup

Before installation, you need to install the BSP(board support package) repo for your [Mini Pupper 2](https://github.com/mangdangroboticsclub/mini_pupper_2_bsp) or [Mini Pupper](https://github.com/mangdangroboticsclub/mini_pupper_bsp.git).
PC Setup corresponds to PC (your desktop or laptop PC) for controlling Mini Pupper remotely or execute simulator.
__Do not apply these PC Setup commands to your Raspberry Pi on Mini Pupper.__

After installing the driver software, install ROS 2 Humble is required.
Ubuntu 22.04 + ROS 2 Humble is required.

```sh
cd ~
git clone https://github.com/mangdangroboticsclub/mini_pupper_ros.git -b ros2-dev mini_pupper_ros
cd mini_pupper_ros
./install.sh
./pc_install.sh
```

Reference(Just for reference, don't need to do it again.):
Expand Down
35 changes: 35 additions & 0 deletions pc_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
######################################################################################
# ROS2
#
# This stack will consist of ROS2 install
#
# To install
# ./pc_install.sh
######################################################################################

# Update package lists
cd ~
sudo apt update

# Install ROS 2 Humble setup scripts
if ! [ -d "ros2_setup_scripts_ubuntu" ]; then
git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git
fi
~/ros2_setup_scripts_ubuntu/ros2-humble-ros-base-main.sh
source /opt/ros/humble/setup.bash

# Create ROS 2 workspace and clone Mini Pupper ROS repository
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
if ! [ -d "mini_pupper_ros" ]; then
git clone https://github.com/mangdangroboticsclub/mini_pupper_ros.git -b ros2-dev mini_pupper_ros
fi
vcs import < mini_pupper_ros/.minipupper.repos --recursive

# Install dependencies and build the ROS 2 packages
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
sudo apt install ros-humble-teleop-twist-keyboard ros-humble-teleop-twist-joy
pip3 install simple_pid
colcon build --symlink-install
12 changes: 8 additions & 4 deletions install.sh → pupper_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This stack will consist of ROS2 install
#
# To install
# ./install.sh
# ./pupper_install.sh
######################################################################################

set -e
Expand Down Expand Up @@ -39,14 +39,18 @@ sudo apt-get update
sudo apt -y install python3-pip python3-venv python3-virtualenv

#Auto install ROS2 Humble
git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git
if ! [ -d "ros2_setup_scripts_ubuntu" ]; then
git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git
fi
~/ros2_setup_scripts_ubuntu/ros2-humble-ros-base-main.sh
source /opt/ros/humble/setup.bash

#clone mini pupper 2 ros2 repo
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/mangdangroboticsclub/mini_pupper_ros.git -b ros2-dev mini_pupper_ros
if ! [ -d "mini_pupper_ros" ]; then
git clone https://github.com/mangdangroboticsclub/mini_pupper_ros.git -b ros2-dev mini_pupper_ros
fi
vcs import < mini_pupper_ros/.minipupper.repos --recursive
# compiling gazebo and cartographer on Raspberry Pi is not recommended
touch champ/champ/champ_gazebo/AMENT_IGNORE
Expand Down Expand Up @@ -75,4 +79,4 @@ sudo systemctl daemon-reload
sudo systemctl enable robot

echo "setup.sh finished at $(date)"
sudo reboot
sudo reboot

0 comments on commit 0521c11

Please sign in to comment.