解决方法在最后。
系统:ubuntu18.04
make px4_sitl_default gazebo时的报错:
Traceback (most recent call last):
File "tools/px_generate_uorb_topic_files.py", line 530, in <module>
generate_idx, f, args.temporarydir, args.package, args.templatedir, INCL_DEFAULT)
File "tools/px_generate_uorb_topic_files.py", line 177, in generate_output_from_file
return generate_by_template(output_file, template_file, em_globals)
File "tools/px_generate_uorb_topic_files.py", line 346, in generate_by_template
em.RAW_OPT: True, em.BUFFERED_OPT: True})
AttributeError: module 'em' has no attribute 'RAW_OPT'
ninja: build stopped: subcommand failed.
Makefile:198: recipe for target 'px4_sitl_default' failed
make: *** [px4_sitl_default] Error 1
查了下可能是SWAP内存小导致的?因为当时缓存太大物理内存剩余极少,编译内存不足。
缓存释放之后可以明显看到编译时内存增加极快,但是增加的SWAP内存一直没有被使用,可能没有被正确启用,不过物理内存好像也没有满。
经过stress工具的压力测试证明SWAP内存有效,但在内存足够的情况下编译仍然失败,排除内存不足的原因。
应该是前面的依赖?
sudo apt install ninja-build exiftool ninja-build protobuf-compiler libeigen3-dev genromfs xmlstarlet libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python-pip python3-pip
sudo apt install python-pip
pip2 install jinja2 pyserial cerberus pyulog==0.7.0 numpy toml pyquaternion empy pyyaml
pip3 install packaging numpy empy toml pyyaml jinja2 pyargparse
又安装完了一遍依然报错...
最后在别的地方找的的解决办法(感谢):
pip3 uninstall empy
pip3 install empy==3.3.4
编译成功了,gazebo打开。