/spike

ROS control and simulation system for the four-legged Unitree A1 robot using the Champ Framework.

Primary LanguageJava

ENAMOUR Informatics Project

The ENAMOUR project of the Technische Hochschule Ingolstadt focuses on controlling a robot with voice commands while it simulates the typical behaviour and emotions of a robot dog. For this purpose this repository contains the source code for controlling a A1 UNITREE robot. It receives data from other teams of this project and moves the robot accordingly.

Quick Links

Quick Start

Building the project

In order to build the project catkin is required. Executing source make.sh builds all modules under the "src/" dir and updates your environment with required variables. The script for setting up your environment can be found under "scripts/setup_environment.sh". Prefferabily, execute all commands while being sudo, since ROS uses system calls. Use sudo -s to switch into sudo mode, then execute source make.sh again.

Formating the code

Executing ./scripts/format_code.sh formats the source code inside the enamour source dir with 'back' and returns errors using 'flake8'. This is necessary to have a successful build. After commiting your code, visit the action page and see if your build was sucessful.

Try it out

To test the project:

  • Build the project with source make.sh
  • Execute roslaunch champ_config bringup.launch rviz:=true
  • In another terminal (CTRL + SHIFT + T) execute roslaunch champ_teleop teleop.launch.

Technologies used and How-To-Dos

Git

Git is a distributed version control system to enable collaboration between our team members.

Setting up your git config

Git needs to know who the author of a commit is. Therefore you need to execute ./scripts/setup_git.sh "THI-LOGIN" with your own thi login name.

Most important commands

  • To create a new branch: git checkout -b BRANCH-NAME
    • New software functionalities should be in a branch startin with feature/BRANCH-NAME
  • To switch to a branch: git checkout BRANCH-NAME
  • To see the status of your local changes: git status
  • To add all changed files to your commit (in the root dir of the project): git add .
  • To create a local commit with your added files: git commit -m "YOUR COMMIT MESSAGE"
  • To push your local commits: git push
  • To squash multiple commits into one use this guide
    • ONLY DO THIS IF YOU WORK ALONE ON YOUR OWN FEATURE BRANCH!
    • Use this method before creating a pull request in order to reduce unnecessary commit messages
    • You need to use git push --force since you change the git history
    • If you dont know how to use the editor (vim), then take a look here
    • You can change the default editor for git commands, e. g. a quick guide for setting vscode as your editor
  • To create a pull request use the web gui

UNITREE A1

This is the robot currently used. Everything code related is in their offical github account-

ROS

The Robot Operating System is used as a basis to send data between system nodes. Offical documenation can be found here.

Champ

This framework is utilized ontop of ROS in order to reduce boiler plate and help us creating a basic architecture. Offical repository can be found here.

Simulation

For simulation mainly Gazebo and RVIZ are used.

head-server

The head-server runs on the Raspberry Pi independently of the rest of the project

Building

Navigate to src/enamour/head-server/ and run make.

Installing the service

Navigate to src/enamour/head-server/ and run sudo make install. This moves the binary executable to /opt/head-server/ and the SystemD Service file to /etc/systemd/system/.

Starting the service

The service will start automatically. If it doesn't it can be started manually with sudo systemctl start head-server.service.