ubuntu18.04 配置环境时遇到的问题

(持续更新....)

1      缺少libusb

1.1 安装libusb

下载地址:https://www.intra2net.com/en/developer/libftdi/download.php(因为libuusb libftdi libconfuse是交叉编译的,所以一次全部安装)

安装libusb,全程用sudo权限

1)进入下载目录,依次执行,

$ sudo ./configure

$ sudo make 

$ sudo  make install

步骤分解如下:

$ sudo ./configure 
[sudo] password for simileciwh: 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/x86_64-linux-gnu-ld
checking if the linker (/usr/bin/x86_64-linux-gnu-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/x86_64-linux-gnu-ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/x86_64-linux-gnu-ld -m elf_x86_64
checking if the linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for windres... no
checking for inline... inline
checking operating system... Linux
checking for library containing clock_gettime2... no
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: udev support requested but libudev header not installed

提示error:configure: error: udev support requested but libudev header not installed

解决办法,安装libudev库,

$ sudo apt-get install libudev-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libudev-dev
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 19.1 kB of archives.
After this operation, 196 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libudev-dev amd64 237-3ubuntu10.3 [19.1 kB]
Fetched 19.1 kB in 2s (12.5 kB/s)      
Selecting previously unselected package libudev-dev:amd64.
(Reading database ... 368981 files and directories currently installed.)
Preparing to unpack .../libudev-dev_237-3ubuntu10.3_amd64.deb ...
Unpacking libudev-dev:amd64 (237-3ubuntu10.3) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up libudev-dev:amd64 (237-3ubuntu10.3) ...

再次执行sudo ./configure如下:

sudo ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/x86_64-linux-gnu-ld
checking if the linker (/usr/bin/x86_64-linux-gnu-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/x86_64-linux-gnu-ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/x86_64-linux-gnu-ld -m elf_x86_64
checking if the linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for windres... no
checking for inline... inline
checking operating system... Linux
checking for library containing clock_gettime2... no
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for udev_new in -ludev... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/timerfd.h usability... yes
checking sys/timerfd.h presence... yes
checking for sys/timerfd.h... yes
checking whether TFD_NONBLOCK is declared... yes
checking whether TFD_CLOEXEC is declared... yes
checking whether to use timerfd for timing... yes
checking for pipe2... yes
checking for struct timespec... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sigaction... yes
checking whether CC supports -std=gnu99... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libusb-1.0.pc
config.status: creating Makefile
config.status: creating libusb/Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating doc/doxygen.cfg
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

正常配置好后,执行sudo make进行编译:

sudo make 
make  all-recursive
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'
Making all in libusb
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/libusb'
  CC       libusb_1_0_la-core.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-hotplug.lo
  CC       libusb_1_0_la-io.lo
  CC       libusb_1_0_la-strerror.lo
  CC       libusb_1_0_la-sync.lo
  CC       os/libusb_1_0_la-poll_posix.lo
  CC       os/libusb_1_0_la-threads_posix.lo
  CC       os/libusb_1_0_la-linux_usbfs.lo
  CC       os/libusb_1_0_la-linux_udev.lo
  CCLD     libusb-1.0.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/libusb'
Making all in doc
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/doc'
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'

编译完成,通过sudo make install安装库:

sudo make install
Making install in libusb
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/libusb'
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/libusb'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libusb-1.0.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libusb-1.0.so.0.1.0 /usr/local/lib/libusb-1.0.so.0.1.0
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.1.0 libusb-1.0.so.0 || { rm -f libusb-1.0.so.0 && ln -s libusb-1.0.so.0.1.0 libusb-1.0.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.1.0 libusb-1.0.so || { rm -f libusb-1.0.so && ln -s libusb-1.0.so.0.1.0 libusb-1.0.so; }; })
libtool: install: /usr/bin/install -c .libs/libusb-1.0.lai /usr/local/lib/libusb-1.0.la
libtool: install: /usr/bin/install -c .libs/libusb-1.0.a /usr/local/lib/libusb-1.0.a
libtool: install: chmod 644 /usr/local/lib/libusb-1.0.a
libtool: install: ranlib /usr/local/lib/libusb-1.0.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/include/libusb-1.0'
 /usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0'
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/libusb'
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/libusb'
Making install in doc
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/doc'
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/doc'
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22/doc'
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'
make[2]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/libusb-1.0.22'

阅读安装内容可知,libusb被安装到了/usr/local/lib位置,成功安装

是否安装完成可以通过如下指令查看:

dpkg -l | grep  libudev
ii  libgudev-1.0-0:amd64                       1:232-2                             amd64        GObject-based wrapper library for libudev
ii  libudev-dev:amd64                          237-3ubuntu10.3                     amd64        libudev development files
ii  libudev1:amd64                             237-3ubuntu10.3                     amd64        libudev shared library
dpkg -l | grep  libusb
ii  libgusb2:amd64                             0.2.11-1                            amd64        GLib wrapper around libusb1
ii  libusb-1.0-0:amd64                         2:1.0.21-2                          amd64        userspace USB programming library
ii  libusb-1.0-0-dev:amd64                     2:1.0.21-2                          amd64        userspace USB programming library development files
ii  libusb-1.0-doc                             2:1.0.21-2                          all          documentation for userspace USB programming
ii  libusbmuxd4:amd64                          1.1.0~git20171206.c724e70f-0.1      amd64        USB multiplexor daemon for iPhone and iPod Touch devices - library

2    安装libconfuse

通过1中的链接下载好后,进入解压目录,步骤和1相同

3    安装libftdi

通过1中的链接下载好后,进入解压目录,

$ mkdir build 
$ cd build 
$ cmake -DCMAKE_INSTALL_PREFIX="/usr" ../
$ sudo make
$ sudo make install

分步如下:

code snippet widget

$ sudo make install
[  8%] Built target ftdi1-static
[ 16%] Built target ftdi1
[ 21%] Built target ftdipp1-static
[ 27%] Built target ftdipp1
[ 32%] Built target ftdi_eeprom
[ 37%] Built target bitbang2
[ 43%] Built target simple
[ 48%] Built target serial_test
[ 54%] Built target bitbang_cbus
[ 59%] Built target bitbang
[ 64%] Built target find_all_pp
[ 70%] Built target baud_test
[ 75%] Built target stream_test
[ 81%] Built target eeprom
[ 86%] Built target find_all
[ 91%] Built target bitbang_ft2232
[100%] Built target test_libftdi1
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Up-to-date: /usr/lib/pkgconfig/libftdi1.pc
-- Up-to-date: /usr/lib/pkgconfig/libftdipp1.pc
-- Up-to-date: /usr/bin/libftdi1-config
-- Up-to-date: /usr/lib/cmake/libftdi1/LibFTDI1Config.cmake
-- Up-to-date: /usr/lib/cmake/libftdi1/LibFTDI1ConfigVersion.cmake
-- Up-to-date: /usr/lib/cmake/libftdi1/UseLibFTDI1.cmake
-- Up-to-date: /usr/lib/libftdi1.so.2.4.0
-- Up-to-date: /usr/lib/libftdi1.so.2
-- Up-to-date: /usr/lib/libftdi1.so
-- Up-to-date: /usr/lib/libftdi1.a
-- Up-to-date: /usr/include/libftdi1/ftdi.h
-- Up-to-date: /usr/lib/libftdipp1.so.2.4.0
-- Up-to-date: /usr/lib/libftdipp1.so.3
-- Up-to-date: /usr/lib/libftdipp1.so
-- Up-to-date: /usr/lib/libftdipp1.a
-- Up-to-date: /usr/include/libftdi1/ftdi.hpp
-- Up-to-date: /usr/bin/ftdi_eeprom
-- Up-to-date: /usr/share/doc/libftdi1/example.conf

4    安装kobuki_gazebo的包

遇到如下问题,

Built target diagnostic_msgs_generate_messages_cpp
Scanning dependencies of target kobuki_qtestsuite
/bin/sh: 1: pyrcc5: not found
KOBUKIpkg/kobuki_desktop-gazebo9/kobuki_qtestsuite/CMakeFiles/kobuki_qtestsuite.dir/build.make:57: recipe for target 'KOBUKIpkg/kobuki_desktop-gazebo9/kobuki_qtestsuite/CMakeFiles/kobuki_qtestsuite' failed
make[2]: *** [KOBUKIpkg/kobuki_desktop-gazebo9/kobuki_qtestsuite/CMakeFiles/kobuki_qtestsuite] Error 127
CMakeFiles/Makefile2:48723: recipe for target 'KOBUKIpkg/kobuki_desktop-gazebo9/kobuki_qtestsuite/CMakeFiles/kobuki_qtestsuite.dir/all' failed
make[1]: *** [KOBUKIpkg/kobuki_desktop-gazebo9/kobuki_qtestsuite/CMakeFiles/kobuki_qtestsuite.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Built target diagnostic_msgs_generate_messages_nodejs
[ 11%] Built target ecl_exceptions
[ 11%] Built target ecl_demo_errors
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

这是因为kobuki_gazebo在0.5.7版本之前有bug导致的,检查你的版本是否低于它,如果低于他,那么下载新版本重新构建,如果不是,尝试安装pyqt5-dev-tools

sudo apt install pyqt5-dev-tools

安装完成后在构建,成功构建完成。

2    配置turtlebot2

2.1在构建turtlebot包时,安装joy依赖关系,报错spnav.h: No such file or directory

[  8%] Built target map_msgs_generate_messages_cpp
/home/simileciwh/catkin_ws/src/turtlebot2/joystick_drivers-master/spacenav_node/src/spacenav_node.cpp:38:10: fatal error: spnav.h: No such file or directory
 #include "spnav.h"
          ^~~~~~~~~
compilation terminated.
[  8%] Built target map_msgs_generate_messages_eus
turtlebot2/joystick_drivers-master/spacenav_node/CMakeFiles/spacenav_node.dir/build.make:62: recipe for target 'turtlebot2/joystick_drivers-master/spacenav_node/CMakeFiles/spacenav_node.dir/src/spacenav_node.cpp.o' failed
make[2]: *** [turtlebot2/joystick_drivers-master/spacenav_node/CMakeFiles/spacenav_node.dir/src/spacenav_node.cpp.o] Error 1
CMakeFiles/Makefile2:30266: recipe for target 'turtlebot2/joystick_drivers-master/spacenav_node/CMakeFiles/spacenav_node.dir/all' failed
make[1]: *** [turtlebot2/joystick_drivers-master/spacenav_node/CMakeFiles/spacenav_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  8%] Built target map_msgs_generate_messages_py
[  8%] Linking CXX executable /home/simileciwh/catkin_ws/devel/lib/turtlebot_teleop/turtlebot_teleop_joy
[  8%] Built target turtlebot_teleop_joy
[  8%] Linking CXX executable /home/simileciwh/catkin_ws/devel/lib/joy/joy_node
[  8%] Built target joy_node
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

因为系统中缺少相关的库,解决办法:

sudo apt-get install libspnav-dev

继续构建,到71%,又报错,fatal error: bluetooth/bluetooth.h: No such file or directory

[ 71%] Built target add_two_ints_client
In file included from /home/simileciwh/catkin_ws/src/turtlebot2/joystick_drivers-master/wiimote/src/wiimote_controller.cpp:45:0:
/home/simileciwh/catkin_ws/src/turtlebot2/joystick_drivers-master/wiimote/include/wiimote/wiimote_controller.h:49:10: fatal error: bluetooth/bluetooth.h: No such file or directory
 #include <bluetooth/bluetooth.h>  // libbluetooth.so
          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/build.make:62: recipe for target 'turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/src/wiimote_controller.cpp.o' failed
make[2]: *** [turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/src/wiimote_controller.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

解决办法,

sudo apt-get install libbluetooth-dev

到89%,有报错,fatal error: cwiid.h: No such file or directory

In file included from /home/simileciwh/catkin_ws/src/turtlebot2/joystick_drivers-master/wiimote/src/wiimote_controller.cpp:45:0:
/home/simileciwh/catkin_ws/src/turtlebot2/joystick_drivers-master/wiimote/include/wiimote/wiimote_controller.h:52:10: fatal error: cwiid.h: No such file or directory
 #include <cwiid.h>  // libcwiid.so
          ^~~~~~~~~
compilation terminated.
turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/build.make:62: recipe for target 'turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/src/wiimote_controller.cpp.o' failed
make[2]: *** [turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/src/wiimote_controller.cpp.o] Error 1
CMakeFiles/Makefile2:44715: recipe for target 'turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/all' failed
make[1]: *** [turtlebot2/joystick_drivers-master/wiimote/CMakeFiles/wiimote_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 89%] Built target costmap_2d_cloud
[ 89%] Built target gazebo_ros_kobuki
[ 89%] Built target layers
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

在github上找到相关信息,link:https://github.com/abstrakraft/cwiid/tree/master(branch:master),下载下来执行以下命令编译安装

$ aclocal
$ autoconf
$ ./configure
$ make
$ sudo make install

当执行./configure时,出现如下错误configure: error: flex not found
 

$ ./configure 
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gawk... no
checking for mawk... mawk
checking for flex... no
checking for lex... no
configure: error: flex not found

解决办法:安装flex

$ sudo apt-get install flex

继续执行,提示error: bison not found

$ sudo apt-get install bison byacc

继续执行./configure 成功

$ ./configure 
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gawk... no
checking for mawk... mawk
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking for python... python
checking for pthread_create in -lpthread... yes
checking for hci_devid in -lbluetooth... yes
checking for dlopen in -ldl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdint.h... (cached) yes
checking bluetooth/bluetooth.h usability... yes
checking bluetooth/bluetooth.h presence... yes
checking for bluetooth/bluetooth.h... yes
checking for bluetooth/l2cap.h... yes
checking for bluetooth/hci.h... yes
checking linux/input.h usability... yes
checking linux/input.h presence... yes
checking for linux/input.h... yes
checking for linux/uinput.h... yes
checking for library containing strerror... none required
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GTK... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating defs.mak
config.status: creating common/include/lib.mak
config.status: creating doc/Makefile
config.status: creating man/Makefile
config.status: creating libcwiid/Makefile
config.status: creating libcwiid/cwiid.pc
config.status: creating wmdemo/Makefile
config.status: creating wmgui/Makefile
config.status: creating wminput/Makefile
config.status: creating wminput/plugins/Makefile
config.status: creating wminput/plugins/ir_ptr/Makefile
config.status: creating wminput/plugins/acc/Makefile
config.status: creating wminput/plugins/nunchuk_acc/Makefile
config.status: creating wminput/plugins/led/Makefile
config.status: creating wminput/plugins/nunchuk_stick2btn/Makefile
config.status: creating lswm/Makefile
config.status: creating python/Makefile
config.status: creating common/include/config.h

继续执行,make

make
make  -C libcwiid
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/libcwiid'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/libcwiid'
make  -C wmgui
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wmgui'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wmgui'
make  -C wminput
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput'
make  -C plugins
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins'
make  -C ir_ptr
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/ir_ptr'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/ir_ptr'
make  -C acc
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/acc'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/acc'
make  -C nunchuk_acc
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_acc'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_acc'
make  -C led
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/led'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/led'
make  -C nunchuk_stick2btn
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_stick2btn'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_stick2btn'
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins'
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput'
make  -C lswm
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/lswm'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/lswm'
make  -C python
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/python'
python setup.py build_ext -g -I../libcwiid -L../libcwiid
running build_ext
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/python'
make  -C wmdemo
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wmdemo'
gcc -L../libcwiid -o wmdemo wmdemo.o -lcwiid
/usr/bin/x86_64-linux-gnu-ld: wmdemo.o: undefined reference to symbol 'str2ba'
//usr/lib/x86_64-linux-gnu/libbluetooth.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
/home/simileciwh/Downloads/libstuff/cwiid-master/common/include/app.mak:13: recipe for target 'wmdemo' failed
make[1]: *** [wmdemo] Error 1
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wmdemo'
Makefile:33: recipe for target 'wmdemo' failed
make: *** [wmdemo] Error 2

虽然有错误提示,但是我们可以忽略

继续

$ sudo make install
install -d /usr/local/etc/cwiid
install -d /usr/local/lib/cwiid/plugins
make install -C libcwiid
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/libcwiid'
install -D cwiid.h /usr/local/include/cwiid.h
install -D libcwiid.a /usr/local/lib/libcwiid.a
install -D libcwiid.so.1.0 /usr/local/lib/libcwiid.so.1.0
ln -sf libcwiid.so.1.0 /usr/local/lib/libcwiid.so.1
ln -sf libcwiid.so.1 /usr/local/lib/libcwiid.so
ldconfig
install -D -m 644 cwiid.pc /usr/local/lib/pkgconfig/cwiid.pc
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/libcwiid'
make install -C wmgui
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wmgui'
install -D wmgui /usr/local/bin/wmgui
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wmgui'
make install -C wminput
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput'
make install -C plugins
make[2]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins'
make install -C ir_ptr
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/ir_ptr'
install -D ir_ptr.so /usr/local/lib/cwiid/plugins/ir_ptr.so
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/ir_ptr'
make install -C acc
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/acc'
install -D acc.so /usr/local/lib/cwiid/plugins/acc.so
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/acc'
make install -C nunchuk_acc
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_acc'
install -D nunchuk_acc.so /usr/local/lib/cwiid/plugins/nunchuk_acc.so
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_acc'
make install -C led
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/led'
install -D led.so /usr/local/lib/cwiid/plugins/led.so
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/led'
make install -C nunchuk_stick2btn
make[3]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_stick2btn'
install -D nunchuk_stick2btn.so /usr/local/lib/cwiid/plugins/nunchuk_stick2btn.so
make[3]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins/nunchuk_stick2btn'
make[2]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput/plugins'
install -d /usr/local/etc/cwiid/wminput
install configs/* /usr/local/etc/cwiid/wminput
ln -sf acc_led /usr/local/etc/cwiid/wminput/default
install -D wminput /usr/local/bin/wminput
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/wminput'
make install -C lswm
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/lswm'
install -D lswm /usr/local/bin/lswm
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/lswm'
make install -C python
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/python'
python setup.py install --install-lib=/usr/local/lib/python2.7/site-packages 
running install
running build
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/cwiid.so -> /usr/local/lib/python2.7/site-packages
running install_egg_info
Writing /usr/local/lib/python2.7/site-packages/cwiid-0.6.00.egg-info
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/python'
make install -C man
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/man'
for f in `ls man?/*.?`; do \
	install -D -m 644 $f /usr/local/share/man/$f ; \
done
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/man'
make install -C doc
make[1]: Entering directory '/home/simileciwh/Downloads/libstuff/cwiid-master/doc'
install -d /usr/local/share/doc/cwiid
install -m 644 Xmodmap wminput.list /usr/local/share/doc/cwiid
make[1]: Leaving directory '/home/simileciwh/Downloads/libstuff/cwiid-master/doc'

通过如下指令查看是否安装完成,加到库中

$ whereis cwiid.h
cwiid: /usr/local/etc/cwiid /usr/local/lib/cwiid

问题解决,回到之前构建的工作,重新构建......构建完成。

3    配置moveit_core出现问题(turtlebot_arm的依赖库)

提示:No package 'fcl' found

在github找到解决办法,link:https://github.com/flexible-collision-library/fcl/tree/master

由文档可知,需要:

Dependencies:
============

 - Eigen (available at http://eigen.tuxfamily.org/)
 - libccd (available at http://libccd.danfis.cz/(这个打不开))link:https://github.com/danfis/libccd
 - octomap (optional dependency, available at http://octomap.github.com)

依次安装,安装时方法如下

3.1    安装Eigen命令,进入解压目录

  cd build_dir
  cmake source_dir
  make install

3.2    安装libccd命令,要进入sh模式,自己了解一下

$ sh
  $ cd src/
  $ make
  $ make install

3.3    安装octomap命令,

    cd build
    cmake ..
    make
    make install

3.4    安装fcl命令,

mkdir build
cd build
cmake ..
make

在cmake时提示 --   No package 'ccd' found    --   No package 'libccd' found

解决办法,将libccd设置成share libary,可以解决这两个问题。

#To build libccd as a shared library, set the `BUILD_SHARED_LIBS` option:
```sh
  $ mkdir build && cd build
  $ cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON ..
  $ make && sudo make install
```
sh
$ mkdir build 
$ cd build
$ cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_SUPPORTS_VISIBILITY
-- Performing Test COMPILER_SUPPORTS_VISIBILITY - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/simileciwh/Downloads/libccd-master/build
$ make
Scanning dependencies of target ccd
[  3%] Building C object src/CMakeFiles/ccd.dir/ccd.c.o
[  7%] Building C object src/CMakeFiles/ccd.dir/mpr.c.o
[ 11%] Building C object src/CMakeFiles/ccd.dir/polytope.c.o
[ 14%] Building C object src/CMakeFiles/ccd.dir/support.c.o
[ 18%] Building C object src/CMakeFiles/ccd.dir/vec3.c.o
[ 22%] Linking C shared library libccd.so
[ 22%] Built target ccd
Scanning dependencies of target cu
[ 25%] Building C object src/testsuites/cu/CMakeFiles/cu.dir/cu.c.o
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c: In function ‘cu_run_fork’:
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:67:17: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define MSG_END write(fd, "6\n", 2)
                 ^~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:149:9: note: in expansion of macro ‘MSG_END’
         MSG_END;
         ^~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c: In function ‘run_test_suite’:
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:207:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
         write(fd, buffer, len);
         ^~~~~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:63:25: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define MSG_TEST_FAILED write(fd, "2\n", 2)
                         ^~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:213:13: note: in expansion of macro ‘MSG_TEST_FAILED’
             MSG_TEST_FAILED;
             ^~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:64:26: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define MSG_TEST_SUCCEED write(fd, "3\n", 2)
                          ^~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:216:13: note: in expansion of macro ‘MSG_TEST_SUCCEED’
             MSG_TEST_SUCCEED;
             ^~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:65:31: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define MSG_TEST_SUITE_FAILED write(fd, "4\n", 2)
                               ^~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:223:9: note: in expansion of macro ‘MSG_TEST_SUITE_FAILED’
         MSG_TEST_SUITE_FAILED;
         ^~~~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:66:32: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define MSG_TEST_SUITE_SUCCEED write(fd, "5\n", 2)
                                ^~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:225:9: note: in expansion of macro ‘MSG_TEST_SUITE_SUCCEED’
         MSG_TEST_SUITE_SUCCEED;
         ^~~~~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c: In function ‘receive_messages’:
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:257:21: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
                     write(1, bufout, bufout_len);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:259:21: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
                     write(2, bufout, bufout_len);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c: In function ‘cu_success_assertation’:
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:62:27: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define MSG_CHECK_SUCCEED write(fd, "1\n", 2)
                           ^~~~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:293:5: note: in expansion of macro ‘MSG_CHECK_SUCCEED’
     MSG_CHECK_SUCCEED;
     ^~~~~~~~~~~~~~~~~
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c: In function ‘cu_fail_assertation’:
/home/simileciwh/Downloads/libccd-master/src/testsuites/cu/cu.c:304:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, buf, len);
     ^~~~~~~~~~~~~~~~~~~
[ 29%] Linking C static library libcu.a
[ 29%] Built target cu
Scanning dependencies of target bench
[ 33%] Building C object src/testsuites/CMakeFiles/bench.dir/bench.c.o
/home/simileciwh/Downloads/libccd-master/src/testsuites/bench.c:1:0: warning: "CU_ENABLE_TIMER" redefined
 #define CU_ENABLE_TIMER
 
<command-line>:0:0: note: this is the location of the previous definition
[ 37%] Building C object src/testsuites/CMakeFiles/bench.dir/support.c.o
[ 40%] Linking C executable bench
[ 40%] Built target bench
Scanning dependencies of target main
[ 44%] Building C object src/testsuites/CMakeFiles/main.dir/main.c.o
[ 48%] Building C object src/testsuites/CMakeFiles/main.dir/common.c.o
[ 51%] Building C object src/testsuites/CMakeFiles/main.dir/support.c.o
[ 55%] Building C object src/testsuites/CMakeFiles/main.dir/vec3.c.o
[ 59%] Building C object src/testsuites/CMakeFiles/main.dir/polytope.c.o
[ 62%] Building C object src/testsuites/CMakeFiles/main.dir/boxbox.c.o
[ 66%] Building C object src/testsuites/CMakeFiles/main.dir/spheresphere.c.o
[ 70%] Building C object src/testsuites/CMakeFiles/main.dir/cylcyl.c.o
[ 74%] Building C object src/testsuites/CMakeFiles/main.dir/boxcyl.c.o
[ 77%] Building C object src/testsuites/CMakeFiles/main.dir/mpr_boxbox.c.o
[ 81%] Building C object src/testsuites/CMakeFiles/main.dir/mpr_cylcyl.c.o
[ 85%] Building C object src/testsuites/CMakeFiles/main.dir/mpr_boxcyl.c.o
[ 88%] Linking C executable main
[ 88%] Built target main
Scanning dependencies of target bench2
[ 92%] Building C object src/testsuites/CMakeFiles/bench2.dir/bench2.c.o
/home/simileciwh/Downloads/libccd-master/src/testsuites/bench2.c:1:0: warning: "CU_ENABLE_TIMER" redefined
 #define CU_ENABLE_TIMER
 
<command-line>:0:0: note: this is the location of the previous definition
[ 96%] Building C object src/testsuites/CMakeFiles/bench2.dir/support.c.o
[100%] Linking C executable bench2
[100%] Built target bench2
$ sudo make install
[sudo] password for simileciwh: 
[ 22%] Built target ccd
[ 29%] Built target cu
[ 40%] Built target bench
[ 88%] Built target main
[100%] Built target bench2
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/ccd/ccd-config.cmake
-- Installing: /usr/local/lib/ccd/ccd-config-version.cmake
-- Installing: /usr/local/lib/pkgconfig/ccd.pc
-- Installing: /usr/local/share/doc/ccd/BSD-LICENSE
-- Installing: /usr/local/lib/libccd.so.2.0
-- Installing: /usr/local/lib/libccd.so.2
-- Installing: /usr/local/lib/libccd.so
-- Installing: /usr/local/include/ccd/ccd.h
-- Installing: /usr/local/include/ccd/compiler.h
-- Installing: /usr/local/include/ccd/ccd_export.h
-- Installing: /usr/local/include/ccd/quat.h
-- Installing: /usr/local/include/ccd/vec3.h
-- Installing: /usr/local/include/ccd/config.h
-- Installing: /usr/local/lib/ccd/ccd-targets.cmake
-- Installing: /usr/local/lib/ccd/ccd-targets-release.cmake
$ exit

在make时,提示No rule to make target 'octomap-NOTFOUND,在此之前还提示变量未初始化的warnning,如下所示,

In file included from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array.h:49:0,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array-inl.h:41,
                 from /home/simileciwh/Downloads/fcl-master/src/broadphase/broadphase_dynamic_AABB_tree_array.cpp:38:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h: In member function ‘void fcl::detail::implementation_array::HierarchyTree<BV>::init_2(fcl::detail::implementation_array::HierarchyTree<BV>::NodeType*, int) [with BV = fcl::AABB<double>]’:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h:79:32: warning: ‘comp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return nodes[a].code < split;
                                ^~~~~
In file included from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h:294:0,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array.h:49,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array-inl.h:41,
                 from /home/simileciwh/Downloads/fcl-master/src/broadphase/broadphase_dynamic_AABB_tree_array.cpp:38:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h:212:16: note: ‘comp’ was declared here
   SortByMorton comp;
                ^~~~
In file included from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array.h:49:0,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array-inl.h:41,
                 from /home/simileciwh/Downloads/fcl-master/src/broadphase/broadphase_dynamic_AABB_tree_array.cpp:38:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h: In member function ‘void fcl::detail::implementation_array::HierarchyTree<BV>::init_3(fcl::detail::implementation_array::HierarchyTree<BV>::NodeType*, int) [with BV = fcl::AABB<double>]’:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h:79:32: warning: ‘comp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return nodes[a].code < split;
                                ^~~~~
In file included from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h:294:0,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array.h:49,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array-inl.h:41,
                 from /home/simileciwh/Downloads/fcl-master/src/broadphase/broadphase_dynamic_AABB_tree_array.cpp:38:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h:259:16: note: ‘comp’ was declared here
   SortByMorton comp;
                ^~~~
In file included from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array.h:49:0,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array-inl.h:41,
                 from /home/simileciwh/Downloads/fcl-master/src/broadphase/broadphase_dynamic_AABB_tree_array.cpp:38:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h: In member function ‘void fcl::detail::implementation_array::HierarchyTree<BV>::init_1(fcl::detail::implementation_array::HierarchyTree<BV>::NodeType*, int) [with BV = fcl::AABB<double>]’:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h:79:32: warning: ‘comp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return nodes[a].code < split;
                                ^~~~~
In file included from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array.h:294:0,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array.h:49,
                 from /home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/broadphase_dynamic_AABB_tree_array-inl.h:41,
                 from /home/simileciwh/Downloads/fcl-master/src/broadphase/broadphase_dynamic_AABB_tree_array.cpp:38:
/home/simileciwh/Downloads/fcl-master/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h:165:16: note: ‘comp’ was declared here
   SortByMorton comp;
                ^~~~
make[2]: *** No rule to make target 'octomap-NOTFOUND', needed by 'lib/libfcl.so.0.6.0'.  Stop.
CMakeFiles/Makefile2:117: recipe for target 'src/CMakeFiles/fcl.dir/all' failed
make[1]: *** [src/CMakeFiles/fcl.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

查看hierarchy_tree_array.h文件后,做出如下改动,在line83

//uint32 split;//原来是这样没有初始化的    
uint32 split = 0;

接下来只剩下No rule to make target 'octomap-NOTFOUND这个问题,解决办法在这

link:https://github.com/flexible-collision-library/fcl/issues/210

将顶层的CMakeLists.txt第178行做出如下修改,追加上版本号

  #find_package(octomap QUIET)
  find_package(octomap1.9.0 QUIET)

问题都解决以后,重新在fcl/build下使用make进行编译..........成功

使用 sudo make install

编译成功。 

4    继续构建pkg,提示Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)

安装这个库,

sudo apt-get install libglew-dev

5    继续构建,提示Could not find a package configuration file provided by "ompl" 

因为没有安装这个库,通过这个link:http://ompl.kavrakilab.org/

5.1    安装ompl时,提示

No package 'libspot' found(下载网址):http://spot.lrde.epita.fr

./configure
make #时间很长
sudo make install #会出现警告,可以忽略

Could NOT find PY_pyplusplus(下载网址):http://pypy.org

通过ln -s 创建软连接到usr/local/bin

#进入解压目录下的bin
ln -s pypy /usr/local/bin

5.2    make install 时提示,如下错误

/usr/local/include/spot/misc/bitset.hh:57:5: error: constexpr constructor does not have empty body
     }
     ^

解决方法,打开bitset.hh文件,找到删掉前面的57行,删掉函数体前面的constexpr。

继续执行sudo make install 

成功。

6    继续构建moviet_core的包,提示fatal error: fcl/broadphase/broadphase.h: No such file or directory

sudo apt-get install libfcl-dev

7    最终将所以依赖关系都安装完成了,但是构建到86%时出现bug,因为melodic版本的moviet_core还在测试中,所以暂停安装等待正式公布。至此turtlebot2所有的包除了turtlebot2_arm包,因为缺少moviet_core所以无法成功构建。

(持续更新......)

猜你喜欢

转载自blog.csdn.net/SimileciWH/article/details/81475206