Skip to content

NaoTH Development Setup

Setting up the Development Computer for local development

This section describes which software must be installed on a computer to run the our software. The version numbers of indicate the versions that this guide was tested with it does not mean that newer or older versions will not work.

  • Microsoft Windows 11 64 bit Version 25H2
  • Microsoft Visual Studio Community 2022 Version 17.14.31. Installing the workload Desktop development with C++ (including the packages MSVC-Buildtools for x64/x86 (latest version), Windows 11 SDK 10.0.26100.7705, and C++ ATL for C++ (latest MSVC)) is sufficient.
  • CMake 3.x
  • Install Java JDK 21 from https://learn.microsoft.com/de-de/java/openjdk/download#openjdk-21
  • Get cygwin
  • Install cygwin, for example to C:\cygwin
    • Required: Select the package make for installation
    • Required: Install the mintty: Terminal emulator with native Windows look and feel shell package.
    • Optional: To add mintty to the windows context menu you have to install the cygwin chere package and execute chere -i -t mintty -s bash in a cygwin console with admin privileges. You are now able to right click and open a mintty bash console in any folder.
# java: currently supported openjdk version is 21 (LTS).
# Other versions migth work but are not guaranteed to.
sudo apt install default-jdk openjfx netbeans

# c++ compile
sudo apt install build-essential cmake -y
# c++ cross-compilation (for robots)
sudo apt install clang-18 llvm-18 lld-18 -y
# c++ essential libs
sudo apt install zlib1g-dev uuid-dev -y
# libreadline-dev is needed for our LUA experiments
sudo apt install libreadline-dev -y
# code versioning control
sudo apt install git
# needed for compiling glib
sudo apt install gettext -y
# for archives in the toolchain repo
sudo apt install unzip -y
# for creating an ubuntu image for the nao
sudo apt install pigz debootstrap -y

Cloning the Repositories

Choice of git client

SmartGit is a git-client used by our team. It can be used for free for non-profit and academic projects. You can use command line git or other git tools if you don't want to use Smartgit. Just make sure you can follow our git rules with your tool. [TODO: LINK]

Download SmartGit:
- https://www.syntevo.com/smartgit/
Register an academic license: (e.g., use your university email address)
- https://www.syntevo.com/register-non-commercial/#academic

Clone the main repo from:

  • Main repo: https://scm.cms.hu-berlin.de/berlinunited/naoth-2020
  • Toolchain: https://scm.cms.hu-berlin.de/berlinunited/tools/windowstoolchain or https://scm.cms.hu-berlin.de/berlinunited/tools/linuxtoolchain (linux/macos)
  • Xabsl Editor: https://github.com/BerlinUnited/xabsleditor

Setup Toolchain

Inside <NaoTH-Projekt/NaoTHToolchain> run setup.bat as admin.

This script will generate projectconfig.user.lua which must be copied <NaoTH-Projekt/Naoth-2020>/NaoTHSoccer/Make. This is later used for configuring the compile step if needed.

Speed up compilation

You can speed up the compilation of the toolchain by setting the MAKEFLAGS environment variable:

export MAKEFLAGS="-j $(nproc)"
This is also useful for the project compilation, since it utilizes all available CPUs. Therefore, the above line have to be added to the ~/.profile and/or ~./.bashrc file.

After cloning, execute CMAKE_BUILD_PARALLEL_LEVEL=12 ./setup.sh -j 12 to compile and install the required libraries.

Note: If you want to use the default path configuration in ~/.profile and/or ~/.bashrc you have to restart your computer because this file is only read by the login shell and/or your session/window manager during start up.

! Now copy the (newly generated) file projectconfig.user.lua to /path/to/NaoTHSoccer/Make/.

Compile

Go to the <NaoTH-Projekt/Naoth-2020>/NaoTHSoccer/Make directory and execute generate-vs2022.bat to create Visual Studio 2019 project files <NaoTH-Projekt/Naoth-2020>/NaoTHSoccer/build/vs2022

Open the NaoTHSoccer.sln file with Visual Studio and you have all the projects loaded that are needed for compilation. You can now build each project by right clicking on it and then clicking on build.

There are two ways to compile the naoth source code for the NAO. First you can use cygwin and target the softbank provided image for the NAO or use clang and target the self build Ubuntu image.

Cygwin + Softbank Image

You need to have cygwin installed as described above in the prerequisites section.

In order to build the naoth binary go to <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make, open the mintty bash console in this folder via the context menu and run ./compileGame.sh -j 4

Clang + Ubuntu Image

You need to have cygwin and LLVM installed as described above in the prerequisites section.

To tell premake to use the ubuntu toolchain you need to change two lines <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make/projectconfig.user.lua

  • NAO_CTC=/toolchain_nao_ubuntu
  • _OPTIONS["crosscompiler"] = "clang"

In order to build the naoth binary go to <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make, open the mintty bash console in this folder via the context menu and run ./compileGame.sh -j 4

TODO: mention lolaadaptor and naosmal compilation

There are two ways to compile the naoth source code for the NAO. First you can target the softbank provided image for the NAO or use clang and target the self build Ubuntu image.

Softbank Image

In order to build the naoth binary go to <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make and run ./compileGame.sh -j 4

Clang

To tell premake to use the ubuntu toolchain you need to change two lines in <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make/projectconfig.user.lua

(If <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make/projectconfig.user.lua does not exist, you did not do section setup toolchain correctly).

NAO_CTC="<NaoTH-Projekt/NaoTHToolchain>/toolchain_nao_ubuntu/"
if PLATFORM == "Nao" then
    _OPTIONS["crosscompiler"] = "clang"
end

In order to build the naoth binary go to <NaoTH-Projekt>/Naoth-2020/NaoTHSoccer/Make and run ./compileGame.sh -j 4

TODO: mention lolaadaptor and naosmal compilation

Additional tools for development

We use different tools with our project:

  • For controlling, modify and analyze the nao robot
  • load the Netbeans project RobotControl and run the application
  • File->Import Project <ProjectDir>/RobotControl
  • manual:
  • compile: ./gradlew clean build
  • run: ./gradlew run or ./dist/robotcontrol or java -jar dist/lib/RobotControl.jar

We have a dedicated editor for editing and compiling the robots behavior written in xabsl.

  • clone: git clone https://github.com/BerlinUnited/xabsleditor.git
  • load the Netbeans project from xabsleditor and run the application
  • manual (after the project was loaded once with netbeans):
  • change dir cd xabsleditor
  • compile: ./gradlew.bat clean build
  • run: ./gradlew.bat run or ./dist/xabsleditor.bat or java -jar dist/lib/xabsleditor-1.2.jar

See NaoSCP Documentation