RobotLabLTH / skiros2

A skill-based platform for ROS v.2
Other
163 stars 20 forks source link

"return self.fail(-1, "Location not reached")" in primitive doesn't work #17

Closed matthiashh closed 4 years ago

matthiashh commented 5 years ago

Returning

return self.fail(-1, "Location not reached")

in a primitive leads to

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 64, in _run
    self._tick()
  File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 77, in _tick
    self.publish_progress(uid, visitor)
  File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 100, in publish_progress
    self._progress_cb(task_id=uid, id=id, **desc)
  File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 400, in _on_progress_update
    self._monitor.publish(msg)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 886, in publish
    raise ROSSerializationException(str(e))
ROSSerializationException: field progress_code must be an integer type

which is not very descriptive.

frovida commented 4 years ago

Added assertion, hope the output is a bit more clear.