Skip to content

Software ‐ Installation & Development

JonasFrey96 edited this page Jul 6, 2025 · 4 revisions

Installation Instructions

Maintaining consistent installation Wiki instructions across all PCs has proven to be a challenge.

Instead of a step-wise installation instruction, we provide installation scripts that define the required dependencies, located in the box_configuration folder.

General Installation Script

Location: box_configuration/general/general_install.sh

This script installs general helper tools that are useful across all machines:

  • Installs: vim, tmux
  • Configures vim with a color scheme
  • Adds IP addresses to /etc/hosts

PC specific scripts

Location: box_configuration/jetson/jetson_configure.sh

This script contains more detailed information on which packages were required for the specific PC.


Setup Summary

We lay out the general workflow here to get started with the installation.

1. Clone the Repository

Clone the repository into the ~/git folder:

cd ~/git
git clone --recurse-submodules [email protected]:leggedrobotics/grand_tour_box.git

Tip: If you are not doing development, you can speed up cloning with:

--shallow-submodules --depth 1 --branch main

2. Set Up Workspaces

We recommend creating two workspaces. This separation helps to avoid long build times by isolating heavy packages (like gtsam and opencv) from the main workspace.

Workspace 1 – Heavy Dependencies (e.g., GTSAM, OpenCV)

mkdir -p ~/opencv_gtsam_ws/src
cd ~/opencv_gtsam_ws

catkin init
catkin config --extend /opt/ros/noetic
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
# Ideally, this workspace is only built once.

Workspace 2 – Main (Lightweight) Workspace

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws

catkin init
catkin config --extend ~/workspaces/opencv_gtsam_ws/devel
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
# Keep this workspace lightweight for fast rebuilds when switching branches or commits.

Simlink only the required packages into the box_ws. There are some ros2 and ros1 packages with conflicting names therefore we cannot simply ln -s ~/git/grand_tour_box ~/box_ws/src and rather instead select individual packages.


3. Reference for Dependencies

The most accurate and up-to-date list of required packages can be found in the Docker container configurations or box_configuration:

  • box_utils/box_auto/docker/box_kleinkram.Dockerfile
  • box_utils/box_auto/docker/dependencies
  • box_configuration

Review these files to identify necessary dependencies. Each package should include comments explaining its purpose.


4. Notes on dependencies

There are multiple systemwide apt install packages to get right but while we tried to include most packages as submodules within the grand_tour_box some are pulled in via the default rosdep dependency management. Refer more to the individual installation script.


5. Verify Installation (after installing our Custom CLI Tool: Boxi - see below.)

To verify that everything is set up correctly, run:

boxi build --<host> --clean

<host> can be one of: jetson, opc, nuc, pi

If this command runs successfully, your setup is good to go. It corresponds to the manual workflow:

cd ~/catkin_ws
catkin clean
catkin build launch_<host>

For more details about the Boxi CLI, see Boxi – Custom CLI Tool.


Simplified Usage – Aliases & CLI

Aliases

To streamline common tasks, we provide alias files for each computer:

  • Example Aliases:

    • l-recording – launches the recording tmux session
    • tk – terminates all tmux sessions

Aliases are defined in:

box_configuration/<respective_pc>/alias.sh

Boxi – Custom CLI Tool

We've created a lightweight CLI tool called boxi to simplify common workflows.

Installation:

cd ~/git/grand_tour_box/box_utils/boxi
pip3 install -e ./

Usage:

boxi <command>

⚠️ Note: The CLI is functional but currently lacks features like tab completion. A future improvement should involve migrating it to a more robust CLI framework.


Development Instructions

Pre-commit Installation

To keep code clean and consistent, we use pre-commit hooks. These automatically check code (e.g., formatting, whitespace) before each commit.

  1. Install pre-commit:
pip install pre-commit
  1. Install the hooks:
cd ~/git/grand_tour_box
pre-commit install

This activates the hooks for this repository.

Run Hooks Manually (Optional)

To check all files manually:

pre-commit run --all-files

TODO

⚠️ Old Instructions here:

see old instructions

Install dependencies

ROS
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-noetic-desktop-full python3-catkin-tools
USB HDR Cam
sudo apt install libv4l-dev v4l-utils
# Find camera with:
# v4l2-ctl --list-devices
Hesai Lidar
sudo apt install libpcap-dev
Livox Lidar
cd ~/catkin_ws/src/grand_tour_box/box_drivers/Livox-SDK2
mkdir build
cd build
cmake .. && make -j
sudo make install
IMU over USB
sudo apt install python3-pip
pip3 install pyserial
FKIE Multimaster

sudo apt install python3-rosdep sudo rosdep init rosdep update rosdep install -i --as-root pip:false --reinstall --from-paths ~/catkin_ws/src/grand_tour_box/box_drivers/multimaster_fkie

GPS
source ~/catkin_ws/devel/setup.bash
cd ~/catkin_ws/src
./grand_tour_box/box_drivers/ethz_piksi_ros/piksi_multi_cpp/install/prepare-jenkins-slave.sh
git clone [email protected]:catkin/catkin_simple.git
git clone [email protected]:ethz-asl/libsbp_catkin.git
git clone [email protected]:ethz-asl/libserialport_catkin.git
Totalstaion
cd ~/catkin_ws/src
git clone [email protected]:ethz-asl/cuckoo_time_translator.git
Alphasense
# Install alphasense drivers
# Add the Sevensense PGP key to make this machine trust Sevensense's packages.
curl -Ls http://deb.7sr.ch/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/deb-7sr-ch-keyring.gpg

# Add the Sevensense APT repository to the list of known sources.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deb-7sr-ch-keyring.gpg] http://deb.7sr.ch/alphasense/stable $(lsb_release -cs) main" \
          | sudo tee /etc/apt/sources.list.d/sevensense.list

# Install the Alphasense driver.
sudo apt update
sudo apt install alphasense-driver-core alphasense-viewer alphasense-firmware ros-noetic-alphasense-driver-ros ros-noetic-alphasense-driver

# Set the maximum socket buffer size
sudo sysctl -w net.core.rmem_max=11145728
ADIS16475 IMU

Install the firmware on the microcontroller. (probably already done)

Install Rosserial driver:

sudo apt install ros-noetic-rosserial
sudo apt install ros-noetic-rosserial-arduino

sudo copy box_drivers/adis16475_ros/udev/70-adis16475.rules /etc/udev/rules.d/
sudo service udev reload  
sudo service udev restart
mkdir -p ~/opencv_ws/src
source /opt/ros/noetic/setup.bash
cd ~/opencv_ws
catkin init
catkin config --extend /opt/ros/noetic
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
mkdir -p ~/catkin_ws/src
source /opt/ros/noetic/setup.bash
cd ~/catkin_ws
catkin init
catkin config --extend /rsl/home/opencv_ws/devel
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo

Cloning the Repository and Building the Workspace

mkdir -p ~/git
cd ~/git
# Make sure to initialize the submodule
git clone --recurse-submodules [email protected]:leggedrobotics/grand_tour_box.git
cd ~/git/grand_tour_box
ln -s ~/git/grand_tour_box ~/catkin_ws/src
cd ~/catkin_ws
catkin build box_launch

For FKIE Mulitmaster

cd ~/catkin_ws/src/grand_tour_box/box_drivers
rosdep install -i --as-root pip:false --reinstall --from-paths multimaster_fkie
catkin build fkie_multimaster

Submodules for visualization

The rviz visualization tool uses the rviz_rqt_wrapper from ANYbotics. Follow the newest release instructions on the bitbucket.

catkin build anymal_rsl_user_interface

Update submodules from remote if needed

git submodule update --remote usb_cam

Bashrc

boxi autocomplete append


# Copy of __expand_tilde_by_ref from bash-completion
__python_argcomplete_expand_tilde_by_ref () {
    if [ "${!1:0:1}" = "~" ]; then
        if [ "${!1}" != "${!1//\/}" ]; then
            eval $1="${!1/%\/*}"/'${!1#*/}';
        else
            eval $1="${!1}";
        fi;
    fi
}
# complete -o default -o bashdefault -D -F _python_argcomplete_global
eval "$(register-python-argcomplete boxi)"
source ~/catkin_ws/src/grand_tour_box/box_configuration/alias.sh

⚠️ Old Instructions here:

Clone this wiki locally