Errors << ros_define_data:make /home/chuanmei/ros_basic/logs/ros_define_data/build.make.000.log
Traceback (most recent call last):
File "/opt/ros/noetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 49, in <module>
genmsg.template_tools.generate_from_command_line_options(
File "/opt/ros/noetic/lib/python3/dist-packages/genmsg/template_tools.py", line 213, in generate_from_command_line_options
generate_from_file(argv[1], options.package, options.outdir, options.emdir, options.includepath, msg_template_dict, srv_template_dict)
File "/opt/ros/noetic/lib/python3/dist-packages/genmsg/template_tools.py", line 154, in generate_from_file
_generate_msg_from_file(input_file, output_dir, template_dir, search_path, package_name, msg_template_dict)
File "/opt/ros/noetic/lib/python3/dist-packages/genmsg/template_tools.py", line 93, in _generate_msg_from_file
_generate_from_spec(input_file,
File "/opt/ros/noetic/lib/python3/dist-packages/genmsg/template_tools.py", line 77, in _generate_from_spec
interpreter = em.Interpreter(output=ofile, globals=g, options={em.RAW_OPT:True,em.BUFFERED_OPT:True})
^^^^^^^^^^
AttributeError: module 'em' has no attribute 'RAW_OPT'
make[2]: *** [CMakeFiles/ros_define_data_generate_messages_cpp.dir/build.make:64:/home/chuanmei/ros_basic/devel/.private/ros_define_data/include/ros_define_data/grasp.h] 错误 1
make[2]: *** 正在删除文件“/home/chuanmei/ros_basic/devel/.private/ros_define_data/include/ros_define_data/grasp.h”
make[1]: *** [CMakeFiles/Makefile2:1185:CMakeFiles/ros_define_data_generate_messages_cpp.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
make: *** [Makefile:141:all] 错误 2
解决办法
empy版本不匹配,empy版本为4.1,但是4.0版本以上都会出现这个错误
卸载
pip uninstall empy
指定版本按装
pip install empy==3.3.4
成功编译