Skip to content

NaoDevils/CodeRelease

Repository files navigation

Nao Devils Code Release 2024

This is the Nao Devils Code Release 2024, originally based on B-Human Code Release 2015.

Installation

Windows 10/11, Linux (e.g., Ubuntu 22.04) and macOS (experimental) are supported natively.

Build dependencies:

  • Microsoft Visual C++ >= 14.37 (Visual Studio 2022 17.7)
  • Clang >= 14
  • CMake >= 3.20
  • Conan >= 1.58 < 2.0

Windows 10/11

Notes

  • Visual Studio is the recommended IDE on Windows. Other CMake compatible IDEs such as JetBrains CLion and VS Code (and possibly more) are also supported. Nevertheless, at least the Microsoft Visual C++ compiler included in Visual Studio build tools is required in this case to build on Windows.
  • We recommend at least 40 GiB of free disk space.

Installation

You can choose between

  • a basic installation that includes the robot framework and everything you need to develop and run the simulation and
  • a full installation that also allows to cross-compile the framework for NAO and requires the installation and configuration of Windows Subsystem for Linux (WSL).
Basic installation
  • Install Python and make sure to check "Add Python to PATH" during setup.

  • Install Conan package manager using pip install "conan==1.*" (version 2 is not supported yet!) on the command line.

  • Install Microsoft Visual Studio:

  • Start VisualStudio and choose "Clone a repository".

  • After that, check the console output at the bottom of the window (may be minimized) and wait until message "CMake generation finished" appears.

  • Build simulator. (Menu Build => Build All)

  • In the upper toolbar, select SimRobot.exe as startup item and run the application.

  • See Testing section on how to load a scene and run the simulation.

Full installation
  • Complete the basic installation steps above.

  • Install Windows Subsystem for Linux (WSL 1) running Ubuntu 22.04:

    • First, enable the required Windows feature if you haven't done that already. Therefore, open a command prompt as administrator and run:

      wsl --install --no-distribution
      

      (If you just get an overview about the available options, then the feature is probably already enabled.)

      You have to reboot your system afterwards to finish the installation.

    • Afterwards, you can either download the Ubuntu system and install the dependencies manually (not recommended) or import our pre-generated WSL archive (recommended):

    • System archive (recommended)
      • Download the system archive.
      • Open a (non-admin) command prompt and import the downloaded .tgz file (adjust path to your needs):
      cd %HOMEPATH%
      wsl --import Ubuntu-22.04 ubuntu-2204 Downloads\WSL-Ubuntu-22.04-NaoDevils.tgz --version 1
      
      • Done!
    • Manual installation (not recommended)
      • Open a (non-admin) command prompt and execute:
        wsl --set-default-version 1
        wsl --install -d Ubuntu-22.04
        
      • Notes:
        • WSL1 and WSL2 both work, however WSL1 is highly recommended due to frequent Windows file system acccess.
        • You can check the currently used WSL version using wsl --list --verbose.
        • You can also convert an existing distribution from WSL 2 to WSL 1 afterwards using wsl --set-version Ubuntu-22.04 1.
      • Open Ubuntu bash if not opened automatically (type bash in command line).
      • Update system and install packages:
      sudo apt update
      sudo apt dist-upgrade
      
      sudo apt install --no-install-recommends clang clang-14 ccache cmake make git ninja-build python3-pip pkg-config clang-format dos2unix
      pip3 install "conan==1.*"
      
  • In Visual Studio, select Dorsh.exe as startup item and run the application.

  • Select the checkbox of any robot and click "deploy" in the lower toolbar.

  • Check the console output and make sure everything compiles correctly.

  • If you are not connected to a robot yet, the command will fail at the end with an error message "<RobotName> is not reachable".

Ubuntu 22.04

Notes

  • You can use any CMake compatible IDE you want. JetBrains CLion is recommended, but others will probably also work.

Installation

  • Install required packages:

    sudo apt install --no-install-recommends clang clang-14 ccache cmake make git ninja-build python3-pip pkg-config clang-format dos2unix libgl-dev libglu1-mesa-dev libopengl-dev libegl-dev libasound-dev
    pip3 install "conan==1.*"
    
    # make conan available in path (login again should also work)
    source ~/.profile
    
  • Afterwards, you can open CMakeLists.txt in the repository's root directory using your preferred IDE. Modern IDEs like CLion are able to import configure and build options from CMakePresets.json.

  • If you would like to compile using the command line, change to the repository's root directory and execute:

    export CC=clang CXX=clang++ # use Clang compiler if not system default
    cmake --preset "simulator-develop"
    cmake --build --preset "simulator-develop"
    
  • The initial configuration may take some time depending on the number of Conan packages that are not available precompiled for your platform and have to be compiled from source.

  • After compilation, you can start the SimRobot binary in Build/simulator-develop.

  • See Testing section on how to load a scene and run the simulation.

  • To cross-compile for Nao, execute:

    cmake --preset "nao-develop"
    cmake --build --preset "nao-develop"
    

Mac

Mac support (Intel and Apple M1/M2) is in an experimental state and has been tested using VSCode and CLion, other IDEs may or may not work. Cross compilation for Nao is currently not supported!

  • First, install Homebrew.
  • Then, installed some basic requirements for development:
brew install cmake conan@1.60 ninja
  • You are now ready to build SimRobot as described for Linux using CMake.

Testing

  • Run SimRobot and click Open.
  • Change to the framework directory and open Config/Scenes/TwoPlayers.ros2.
  • In Scene Graph window, double click on RoboCup and on Console and arrange both windows as you like.
  • Focus the console window and enter gc playing.
  • Two robots should start playing against each other now.

Flash a robot

Create a Nao Devils system image using the generate_naodevils.sh script. You can either

  • generate a ready-to-run version of our robot software (pass this framework directory using the -f parameter) or
  • generate a base version that only contains the Ubuntu base image and has to be deployed using Dorsh later (omit the -f parameter).

Deploy a robot

If you want to deploy/update a robot without re-flashing it everytime, you have to configure it first:

  1. Connect the robot to a DHCP enabled network via Ethernet.
  2. The robot should say its IP address automatically.
  3. Call Install/addRobot.sh <IP address> <Name> <Robot ID> <Team ID> from a Linux (e.g., WSL) command prompt and replace the placeholders accordingly. This will change the robot's IP address to 10.0.<Team ID>.<Robot ID> and 10.1.<Team ID>.<Robot ID> for LAN and WLAN, respectively.
  4. Open Dorsh, move the robot to any player number, select it, and click deploy. (Note: If the robot does not contain our robot software yet and was flashed using the base image, select "Device: LAN" in the upper right corner manually for the first time.)

Steps 1-3 are only required for unknown robots that are not listed in Config/robots.cfg.