ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Message Definition Object in Object

asked 2015-07-18 14:24:39 -0500

unknown_entity2 gravatar image

Would a custom message definition with a child Object of the message definition type define an infinite loop?

Example Message Definition for CogFoo: Fim x Fim y

Example Message Definition for Fim: float32 a float32 b Fim z

edit retag flag offensive close merge delete


May I suggest to change the title of the question to something that includes the word recursive? Perhaps something like "Are recursive message definitions allowed/supported?".

gvdhoorn gravatar image gvdhoorn  ( 2015-08-04 02:28:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-04 01:22:45 -0500

mgruhler gravatar image

In Short: In theory yes, but is caught due to reaching the maximum recursion depth.

Long answer here:

Actually, I would have expected to break with another message. However, the build process actually starts and breaks with the following error message:

/opt/ros/hydro/share/genmsg/cmake/pkg-genmsg.cmake.em:50: error: <type 'exceptions.RuntimeError'>: maximum recursion depth exceeded while calling a Python object
Traceback (most recent call last):
  File "/usr/bin/empy", line 3288, in <module>
    if __name__ == '__main__': main()
  File "/usr/bin/empy", line 3286, in main
  File "/usr/bin/empy", line 3269, in invoke
    interpreter.wrap(interpreter.file, (file, name))
  File "/usr/bin/empy", line 2273, in wrap
  File "/usr/bin/empy", line 2264, in wrap
    apply(callable, args)
  File "/usr/bin/empy", line 2337, in file, done, locals)
  File "/usr/bin/empy", line 2379, in safe
    self.parse(scanner, locals)
  File "/usr/bin/empy", line 2399, in parse, locals)
  File "/usr/bin/empy", line 1410, in run
    interpreter.execute(self.code, locals)
  File "/usr/bin/empy", line 2576, in execute
    exec statements in self.globals
  File "<string>", line 37, in <module>
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 48, in find_msg_dependencies
    genmsg.msg_loader.load_depends(msg_context, spec, search_paths)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 344, in load_depends
    return load_msg_depends(msg_context, spec, msg_search_path)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 321, in load_msg_depends
    load_msg_depends(msg_context, depspec, search_path)
 ... the two lines above now appear multiple times
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 310, in load_msg_depends
    depspec = msg_context.get_registered(resolved_type)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 434, in get_registered
    if self.is_registered(full_msg_type):
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 423, in is_registered
    package, base_type = package_resource_name(full_msg_type)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genmsg/", line 104, in package_resource_name
    val = tuple(name.split(PRN_SEPARATOR))
 RuntimeError: maximum recursion depth exceeded while calling a Python object
 CMake Error at /opt/ros/hydro/share/catkin/cmake/safe_execute_process.cmake:11 (message):

  "/usr/bin/empy" "--raw-errors" "-F"
  "-o" "/home/mig/git/sandbox_ws/build/py_test/cmake/py_test-genmsg.cmake"
  "/opt/ros/hydro/share/genmsg/cmake/pkg-genmsg.cmake.em") returned error
  code 1

This actually comes from empy, invoked from some CMake part (don't know where).

edit flag offensive delete link more

Question Tools



Asked: 2015-07-18 14:24:14 -0500

Seen: 866 times

Last updated: Aug 04 '15