Skip to content

Instantly share code, notes, and snippets.

@Micrified
Created September 14, 2019 22:26
Show Gist options
  • Save Micrified/21878bd78a72bd39a44ae4b80c901980 to your computer and use it in GitHub Desktop.
Save Micrified/21878bd78a72bd39a44ae4b80c901980 to your computer and use it in GitHub Desktop.
ErleRobot Compilation Steps

ErleRobot Firmware Compilation

If I succeed in compiling this, the steps will be listed below. For your information, I'm running: MacOS El Capitan 10.11.6.

Brew Installations

The repository asks you run:

brew tap PX4/homebrew-px4
brew tap osrf/simulation
brew update
brew install git bash-completion genromfs kconfig-frontends gcc-arm-none-eabi
brew install astyle cmake

This worked out alright, I think all were able to be installed. The only one that won't work out for you is cmake. The version Brew fetches is just too new. I'll address getting the proper old version next. Running

sudo easy_install pip
sudo pip install pyserial empy

Completed successfully as well.

Raspberry Pi Toolchain

The link given in the repository for the toolchain is dead. So I obtained the toolchain from the following Github repository: https://github.com/raspberrypi/tools

├── Firmware
└── gcc-linaro-arm-linux-gnueabihf-raspbian
  • The README asks I run export RPI_TOOLCHAIN_DIR=/usr/local/linaro/arm-linux-gnueabihf-raspbian. However, I downloaded the toolchain on my desktop, so I changed it to export RPI_TOOLCHAIN_DIR=/Users/Owatch/Desktop/gcc-linaro-arm-linux-gnueabihf-raspbian.

CMake 3.4.3

Here I detail how I obtained and built the appropriate version of CMake

  • Visit https://github.com/Kitware/CMake/tree/v3.4.3, and bootstrap it by (1) chmod +x bootstrap, and then running ./bootstrap.
  • Once the bootstrapping finishes. You will find calling make doesn't successfully compile the stupid thing. I get the following error:
/Users/Owatch/Desktop/CMake-3.4.3-dl/Utilities/cmcurl/lib/vtls/darwinssl.c:1999:6: error: 'SecTrustEvaluateAsync' undeclared (first use in this function); did you mean 'SecTrustEvaluate'?
   if(SecTrustEvaluateAsync != NULL) {
      ^~~~~~~~~~~~~~~~~~~~~
      SecTrustEvaluate
  • Apple has since deprecated some of these API calls. But I just replaced SecTrustEvaluateAsync with the suggeted SecTrustEvaluate and it works! make should then finish executing
  • I didn't want to run make install because I already have a newer version of CMake in my system libraries. So I went to the bin directory of the project I cloned, and then updated my path by prefixing the bin directory to it.
  • (I ran export PATH=/Users/Owatch/Desktop/CMake-3.4.3-dl/bin:$PATH)
  • If you run cmake --version, you should get cmake version 3.4.3. Make sure to do this in whatever terminal you intend to build the project with.

Compile for Erle-Brain2

  • When executing make posix_erlebrain2_default, you encounter the following error:
CMake Error at /Users/Owatch/Desktop/CMake-3.4.3-dl/Modules/ExternalProject.cmake:1890 (message):
  No download info given for 'sitl_gazebo' and its source directory:

   /Users/Owatch/Desktop/Firmware/Tools/sitl_gazebo

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * URL
   * GIT_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
   * SVN_REVISION
   * DOWNLOAD_COMMAND

Somewhere in the output it explains what the source of this error is. I had to CMD-F my terminal for it, but in general:

  1. fatal: Le clonage de 'https://github.com/erlerobot/sitl_gazebo_private.git' dans le chemin de sous-module '/Users/Owatch/Desktop/Firmware/Tools/sitl_gazebo' a échoué
  2. Impossible de cloner 'Tools/sitl_gazebo' pour la seconde fois, abandon

A translation isn't really needed, since it's clear that sitl_gazebo_private.git doesn't exist. Well it is known that the repository https://github.com/erlerobot/Firmware is believed to be called https://github.com/erlerobot/Firmware_private, so it makes sense how this error occurred. The following steps detail a workaround.

I think it's pretty obvious why this doesn't work. The _private suffix doesn't apply anymore. I'll edit all mentions of the repository to remove this.

  • Checking that the required repository https://github.com/erlerobot/sitl_gazebo exists turns out to be the case (check the link yourself). So editing should fix the problem.
  • Grep'ing for sitl_gazebo_private mentions it in .git/config and .gitmodules.
  • In .git/config I edit the following:
[submodule "Tools/sitl_gazebo"]
        active = true
        url = https://github.com/erlerobot/sitl_gazebo_private.git

to

[submodule "Tools/sitl_gazebo"]
        active = true
        url = https://github.com/erlerobot/sitl_gazebo.git
  • And in .gitmodules I edit the following:
[submodule "Tools/sitl_gazebo"]
        path = Tools/sitl_gazebo
        url = https://github.com/erlerobot/sitl_gazebo_private.git

to

[submodule "Tools/sitl_gazebo"]
        path = Tools/sitl_gazebo
        url = https://github.com/erlerobot/sitl_gazebo.git
  • However, Git will realize you are messing with the repositories and comes back with the following once you attempt to recompile:
error: Le serveur n'autorise pas de requête pour l'objet 854774573eb4b70eaff57c3263f73c9380efb50a non annoncé
Fetched in submodule path 'Tools/sitl_gazebo', but it did not contain 854774573eb4b70eaff57c3263f73c9380efb50a. Direct fetching of that commit failed.

First line is in French, but it says: "The server didn't authorize the request for object ... unannounced"

  • I attempt to repair the submodule with by selecting u on the following prompt. The problem here is that after this there seems to be a problem with DriverFramework:
Different commits:
* src/lib/DriverFramework b5c3968...c7d2fe2:
  Warn: src/lib/DriverFramework doesn't contain commit b5c39680e08a4e8ada3313be42b16d574c106229


 *******************************************************************************
 *   IF YOU DID NOT CHANGE THIS FILE (OR YOU DON'T KNOW WHAT A SUBMODULE IS):  *
 *   Hit 'u' and <ENTER> to update ALL submodules and resolve this.            *
 *   (performs git submodule sync --recursive                                  *
 *    and git submodule update --init --recursive )                            *
 *******************************************************************************


   Only for EXPERTS:
   src/lib/DriverFramework submodule is not in the recommended version.
   Hit 'y' and <ENTER> to continue the build with this version. Hit <ENTER> to resolve manually.
   Use git add src/lib/DriverFramework && git commit -m 'Updated src/lib/DriverFramework' to choose this version (careful!)

Okay to get around this I entered and executed the git add command at the bottom. I now get prompted again with:

Different commits:
* Tools/sitl_gazebo 8547745...1d8661f:
  Warn: Tools/sitl_gazebo doesn't contain commit 854774573eb4b70eaff57c3263f73c9380efb50a


 *******************************************************************************
 *   IF YOU DID NOT CHANGE THIS FILE (OR YOU DON'T KNOW WHAT A SUBMODULE IS):  *
 *   Hit 'u' and <ENTER> to update ALL submodules and resolve this.            *
 *   (performs git submodule sync --recursive                                  *
 *    and git submodule update --init --recursive )                            *
 *******************************************************************************


   Only for EXPERTS:
   Tools/sitl_gazebo submodule is not in the recommended version.
   Hit 'y' and <ENTER> to continue the build with this version. Hit <ENTER> to resolve manually.
   Use git add Tools/sitl_gazebo && git commit -m 'Updated Tools/sitl_gazebo' to choose this version (careful!)

Because I want to use the new version of sitl_gazebo, I'm going to say y and hit ENTER.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment