Compile HATP planner under Ubuntu 16 | Ubuntu 16 编译 HATP

Recently, my project needs the HATP planner. Compiling under Ubuntu 16 encountered the following problems. Here I wrote down some solutions.

Error: Could not find Antlr

This problem is caused by not installing Antlr2.7.7, so we need compile and install Antlr.

First, download the source package from https://www.antlr2.org/download/antlr-2.7.7.tar.gz

You may meet the following problem during compiling, caused by CharScanner.cpp

The solution is to modify the CharScanner.hpp file manually, add the following code at the beginning.

The above modification refers to the following two posts

  1. https://stackoverflow.com/questions/4577453/fcgio-cpp50-error-eof-was-not-declared-in-this-scope
  2. https://stackoverflow.com/questions/7248509/strcasecmp-was-not-declared-in-this-scope

After the compilation and installation, when I tried to execute the antlr command, I got this error: Could not find or load main class antlr.Tool

Then I found that there is no antlr.jar file in the /usr/local/lib directory, just copy this file (in the source code directory) to /usr/local/lib.

Important: When compiling HATP later, please use the following command to declare the executable path of Antlr. Otherwise, you may get this error: Unable to find Antlr executable!

Error: No rule to make target /usr/lib/libantlr.a

Execute the following command.

Error: toaster_msgs/GetInfoDB.h: No such file or directory

This is because toaster is not installed, please visit the following link

https://github.com/laas/toaster/wiki/Installation

Toaster.git can be cloned into the same workspace as HATP and compile together.

Error: No rule to make target ‘/lib/libtoaster.so’

Execute the following command.


最近项目需要HATP规划器,在Ubuntu 16下编译遇到了下面的问题,这里记录一下解决方案。

错误:Could not find Antlr

这个问题是没有安装Antlr2.7.7导致的,我们先编译安装Antlr

首先,下载源码包https://www.antlr2.org/download/antlr-2.7.7.tar.gz

在编译过程中遇到下面的问题,CharScanner.cpp编译失败

解决方案就是手动修改 CharScanner.hpp 文件,在开头加上下面的代码

上面的修改参考了下面两篇文章

  1. https://stackoverflow.com/questions/4577453/fcgio-cpp50-error-eof-was-not-declared-in-this-scope
  2. https://stackoverflow.com/questions/7248509/strcasecmp-was-not-declared-in-this-scope

编译安装结束后,尝试执行 antlr 命令,却提示Error: Could not find or load main class antlr.Tool

然后发现在 /usr/local/lib 目录里没有 antlr.jar 文件,将源码目录中的同名文件拷贝到该目录即可。

非常重要:后面编译HATP的时候,请使用下面的命令执行Antlr的可执行文件路径。否则会出现Unable to find Antlr executable!的问题

错误:No rule to make target /usr/lib/libantlr.a

执行下面的命令

错误:toaster_msgs/GetInfoDB.h: No such file or directory

这是因为没有安装toaster导致的,参考下面的链接https://github.com/laas/toaster/wiki/Installation

其中toaster.git可以克隆到和HATP相同的workspace,一起编译即可。

错误:No rule to make target ‘/lib/libtoaster.so’

执行下面的命令

发表评论

电子邮件地址不会被公开。 必填项已用*标注