我最近开始使用ROS来使用rosserial模块中的arduino发布事件。每当我在工作区调用catkin_make时,我都会通过rosserial中的许多软件包,但在尝试创建TopicInfo.msg,Log.msg和rosserial_arduino时会出错。下面是抛出的错误以及引用unicode散列问题的问题。我已经尝试过复制和采购到正确的区域,但似乎没有任何帮助。有人有建议吗?此外,我正在使用ROS Hypdro运行Arch linux。
Generating Lisp code from rosserial_msgs/TopicInfo.msg
Traceback (most recent call last):
File "/opt/ros/hydro/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in <module>
import genmsg.template_tools
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/template_tools.py", line 74
raise RuntimeError, "Template file %s not found in template dir %s" % (template_file_name, template_dir)
^
SyntaxError: invalid syntax
rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_cpp.dir/build.make:59: recipe for target '/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/include/rosserial_msgs/TopicInfo.h' failed
make[2]: *** [/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/include/rosserial_msgs/TopicInfo.h] Error 1
CMakeFiles/Makefile2:337: recipe for target 'rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_cpp.dir/all' failed
make[1]: *** [rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_cpp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 20%] Traceback (most recent call last):
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/genlisp_main.py", line 71, in genmain
retcode = generate_msg(options.package, args[1:], options.outdir, search_path)
Generating Lisp code from rosserial_msgs/Log.msg
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/generate.py", line 720, in generate_msg
generate_msg_from_spec(msg_context, spec, search_path, out_dir, pkg)
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/generate.py", line 770, in generate_msg_from_spec
write_md5sum(s, msg_context, spec)
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/generate.py", line 591, in write_md5sum
md5sum = genmsg.compute_md5(msg_context, parent or spec)
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/gentools.py", line 119, in compute_md5
return _compute_hash(msg_context, spec, hashlib.md5())
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/gentools.py", line 103, in _compute_hash
hash.update(compute_md5_text(msg_context, spec))
TypeError: Unicode-objects must be encoded before hashing
ERROR: Unicode-objects must be encoded before hashing
rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_lisp.dir/build.make:58: recipe for target '/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/share/common-lisp/ros/rosserial_msgs/msg/TopicInfo.lisp' failed
make[2]: *** [/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/share/common-lisp/ros/rosserial_msgs/msg/TopicInfo.lisp] Error 3
make[2]: *** Waiting for unfinished jobs....
[ 25%] Traceback (most recent call last):
File "/opt/ros/hydro/lib/python2.7/site-packages/genpy/generator.py", line 965, in generate_messages
outfile = self.generate(msg_context, full_type, f, outdir, search_path) #actual generation
File "/opt/ros/hydro/lib/python2.7/site-packages/genpy/generator.py", line 946, in generate
for l in self.generator_fn(msg_context, spec, search_path):
File "/opt/ros/hydro/lib/python2.7/site-packages/genpy/generator.py", line 885, in srv_generator
for l in msg_generator(msg_context, mspec, search_path):
File "/opt/ros/hydro/lib/python2.7/site-packages/genpy/generator.py", line 736, in msg_generator
md5sum = genmsg.compute_md5(msg_context, spec)
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/gentools.py", line 119, in compute_md5
return _compute_hash(msg_context, spec, hashlib.md5())
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/gentools.py", line 103, in _compute_hash
hash.update(compute_md5_text(msg_context, spec))
TypeError: Unicode-objects must be encoded before hashing
ERROR: Unable to generate services for package 'rosserial_msgs': while processing '/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/src/rosserial/rosserial_msgs/srv/RequestParam.srv': Unicode-objects must be encoded before hashing
Generating Python srv __init__.py for rosserial_arduino
rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_py.dir/build.make:78: recipe for target '/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/lib/python3.4/site-packages/rosserial_msgs/srv/_RequestParam.py' failed
make[2]: *** [/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/lib/python3.4/site-packages/rosserial_msgs/srv/_RequestParam.py] Error 1
CMakeFiles/Makefile2:399: recipe for target 'rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_py.dir/all' failed
make[1]: *** [rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_py.dir/all] Error 2
Traceback (most recent call last):
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/genlisp_main.py", line 71, in genmain
retcode = generate_msg(options.package, args[1:], options.outdir, search_path)
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/generate.py", line 720, in generate_msg
generate_msg_from_spec(msg_context, spec, search_path, out_dir, pkg)
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/generate.py", line 770, in generate_msg_from_spec
write_md5sum(s, msg_context, spec)
File "/opt/ros/hydro/lib/python2.7/site-packages/genlisp/generate.py", line 591, in write_md5sum
md5sum = genmsg.compute_md5(msg_context, parent or spec)
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/gentools.py", line 119, in compute_md5
return _compute_hash(msg_context, spec, hashlib.md5())
File "/opt/ros/hydro/lib/python2.7/site-packages/genmsg/gentools.py", line 103, in _compute_hash
hash.update(compute_md5_text(msg_context, spec))
TypeError: Unicode-objects must be encoded before hashing
ERROR: Unicode-objects must be encoded before hashing
rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_lisp.dir/build.make:64: recipe for target '/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/share/common-lisp/ros/rosserial_msgs/msg/Log.lisp' failed
make[2]: *** [/home/jared/Documents/AdvancedRoboticsArm/catkin_ws/devel/share/common-lisp/ros/rosserial_msgs/msg/Log.lisp] Error 3
CMakeFiles/Makefile2:368: recipe for target 'rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_lisp.dir/all' failed
make[1]: *** [rosserial/rosserial_msgs/CMakeFiles/rosserial_msgs_generate_messages_lisp.dir/all] Error 2
[ 33%] Built target rosserial_arduino_generate_messages_py
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make" failed
任何输入都会有所帮助。谢谢!
答案 0 :(得分:1)
您的语法错误raise RuntimeError, ...
中的逗号的异常表明Python解释器实际上是Python 3,尽管您的lib路径包含Python 2.7库。
仔细检查您的路径并确保您正在运行Python 2.7