如何使Ardrone自治软件包在Jetson Nano上工作?

时间:2019-08-05 12:29:46

标签: ros ubuntu-18.04 armv8 nvidia-jetson-nano

我正在研究Jetson Nano板,我需要将其与鹦鹉Ar Drone 2.0相连,因此,我想使用ardrone_autonomy软件包,但是由于Jetson具有Ubuntu 18,仅支持ROS Melodic,没有此软件包。

这是我尝试过的:

  1. 我从此存储库构建了软件包: https://github.com/dsapandora/ardrone_autonomy

但是我得到了这个错误:

/tmp/ccIoQjBo.s: Assembler messages:
/tmp/ccIoQjBo.s:128: Error: unknown mnemonic `bswap' -- `bswap x3'
generic.makefile:231: recipe for target '../../Soft/Build/targets_versions/vlib_PROD_MODE_Linux_4.9.140-tegra_GNU_Linux_usrbingcc_5.4.0/video_mem32.o' failed
make[8]: *** [../../Soft/Build/targets_versions/vlib_PROD_MODE_Linux_4.9.140-tegra_GNU_Linux_usrbingcc_5.4.0/video_mem32.o] Error 1
vlib.makefile:104: recipe for target 'all' failed
make[7]: *** [all] Error 2
Makefile:167: recipe for target 'build_vlib' failed
make[6]: *** [build_vlib] Error 2
Makefile:170: recipe for target 'all' failed
make[5]: *** [all] Error 2
Makefile:84: recipe for target 'build_libs' failed
make[4]: *** [build_libs] Error 2
Makefile:20: recipe for target 'all' failed
make[3]: *** [all] Error 2
ardrone_autonomy/CMakeFiles/ardronelib.dir/build.make:110: recipe for target '/catkin_ws/devel/src/ardronelib-stamp/ardronelib-build' failed
make[2]: *** [/catkin_ws/devel/src/ardronelib-stamp/ardronelib-build] Error 2
CMakeFiles/Makefile2:578: recipe for target 'ardrone_autonomy/CMakeFiles/ardronelib.dir/all' failed
make[1]: *** [ardrone_autonomy/CMakeFiles/ardronelib.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

在使用以下所有解决方案解决了该问题之后: https://github.com/AutonomyLab/ardrone_autonomy/issues/71

我可以毫无问题地编译该程序包,但是当我尝试运行该节点时,它说ardrone_driver已死,没有任何其他信息。

2。然后我尝试在ROS Kinetic下的docker中构建软件包,但是在获得与上述相同的bswap错误之后,在应用上述解决方案后我得到了:

/tmp/ccFs5LFZ.s: Assembler messages:
/tmp/ccFs5LFZ.s:130: Error: unexpected characters following instruction at operand 2 -- `mov x4,x4,ror#8'
generic.makefile:231: recipe for target '../../Soft/Build/targets_versions/vlib_PROD_MODE_Linux_4.9.140-   tegra_GNU_Linux_usrbingcc_5.4.0/video_mem32.o' failed
make[8]: *** [../../Soft/Build/targets_versions   /vlib_PROD_MODE_Linux_4.9.140-tegra_GNU_Linux_usrbingcc_5.4.0   /video_mem32.o] Error 1
vlib.makefile:110: recipe for target 'all' failed
make[7]: *** [all] Error 2
Makefile:167: recipe for target 'build_vlib' failed
make[6]: *** [build_vlib] Error 2
Makefile:170: recipe for target 'all' failed
make[5]: *** [all] Error 2
Makefile:84: recipe for target 'build_libs' failed
make[4]: *** [build_libs] Error 2
Makefile:24: recipe for target 'all' failed
make[3]: *** [all] Error 2
ardrone_autonomy/CMakeFiles/ardronelib.dir/build.make:110: recipe for target '/ardrone_ws/devel/src/ardronelib-stamp/ardronelib-build' failed
make[2]: *** [/ardrone_ws/devel/src/ardronelib-stamp/ardronelib-build]     Error 2
CMakeFiles/Makefile2:578: recipe for target 'ardrone_autonomy/CMakeFiles/ardronelib.dir/all' failed
make[1]: *** [ardrone_autonomy/CMakeFiles/ardronelib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  2%] Built target    _ardrone_autonomy_generate_messages_check_deps_matrix33
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2" failed

这就是我遇到的问题,因为据我所知,这完全是处理器体系结构的问题(Jetson使用armv8),而以上所有解决方案都是针对armv7的,但是我不知道如何解决这个问题。请让我知道是否有人找到了解决此问题的方法。任何帮助将不胜感激!

2 个答案:

答案 0 :(得分:0)

我终于解决了这个问题,如果还有其他人在同样的问题上挣扎,这是完整的步骤:

  1. 我使用以下命令下载了docker映像: sudo docker pull ros:kinetic-robot-xenial 然后按照以下步骤运行图像:http://wiki.ros.org/docker/Tutorials/Docker

  2. 我从上面的链接中在工作区中克隆了ardrone_autonomy软件包:

mkdir -p catkin_ws/src cd catkin_ws/src git clone https://github.com/dsapandora/ardrone_autonomy.git apt-get update cd ../ rosdep install --from-paths src --ignore-src -r -y catkin_make

  1. 出现bswap错误后,请编辑以下文件:devel/src/ardronelib/ARDroneLib/VP_SDK/VP_Os/linux/intrin.h并替换:

static INLINE uint32_t _byteswap_ulong(uint32_t value) { __asm("bswap %0":      "=r" (value):      "0" (value));

return value; }

与此:

static INLINE uint32_t _byteswap_ulong(uint32_t value) { int32_t tmp;

__asm __volatile( "eor %1, %2, %2, ror #16\n" "bic %1, %1, #0x00ff0000\n" "mov %0, %2, ror #8\n" "eor %0, %0, %1, lsr #8" : "=r" (value), "=r" (tmp) : "r" (value) );

return value; }

并评论以下行:_BitScanReverse(&index, code);

  1. 执行此操作后,如果尝试给它一个catkin_make,则应该显示最后一个可以“简单地”解决的错误(在您了解那里发生了什么之后:)),只需替换此行即可(从与上面相同的文件):

"mov %0, %2, ror #8\n"

具有:

"mov %0, %2\n"

,现在应该可以正常工作了。

PS:别忘了为您的工作空间提供资源。

答案 1 :(得分:0)

AR Drone 2.0 仍然兼容。

只需将固件从 2.4.1 降级到 2.4.1(我用这个)

https://www.espaciodrone.com/todos-los-firmware-del-ar-drone-1-y-2/

为您的 AR.Drone 通电
将您的计算机连接到 AR.Drone 的网络
打开 telnet 会话到 192.168.1.1
输入以下内容: echo "1.1.1" > /firmware/version.txt
按回车
输入以下内容: echo "2.4.1" > /update/version.txt
将 FTP 客户端连接到:192.168.1.1 端口:5551(我使用 nautilius ctrl + l 然后 ftp://192.168.1.1:5551
将下载的plf文件上传到FTP服务器(AR.Drone)
断开您的计算机与 AR.Drone
的连接 从 AR.Drone 上断开电池
重新连接电池
升级完成后等待大约 5 分钟,让您的无人机保持开启

并使用这个 git clone https://github.com/dsapandora/ardrone..

它就像一个魅力...