File size: 3,252 Bytes
2d6bfa0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.. _mir_task_planning_pkg:

Task planning
=============

`mir_task_planning <https://github.com/b-it-bots/mas_industrial_robotics/tree/kinetic/mir_planning/mir_task_planning>`_
generates task plan using classical planner.

This module provides

- ros independent wrapping for planners (currently ``mercury``
  and ``lama``) in ``/common/planner_wrapper/``.

    Based on the ``planner`` requested, this module executes a shell command as
    mentioned in config file (see :ref:`task_planning_config`). This generates a
    bunch of files in ``/tmp/plan/`` directory. The wrapper parses the most optimal
    plan file and returns as a list of string. Remaining files are deleted for a
    fresh start for next request.

- ros wrapper on top of the previously mentioned module is available in
  ``/ros`` folder. The ros wrapper is implemented as an ``ActionServer``.

    Upon request from an ``ActionClient`` containing ``domain_file``, ``problem_file``,
    ``planner`` and ``mode``, the server tries to plan with those provided configuration
    and returns a ``CompletePlan``.

    - ``domain_file`` - file path of domain file (it should be a ``.pddl`` file)
    - ``problem_file`` - file path of problem file (it should be a ``.pddl`` file)
    - ``planner`` - name of planner to use (``lama`` or ``mercury``)
    - ``mode`` - ``PlanGoal.NORMAL`` or ``PlanGoal.FAST`` (fast mode implies that first
      plan found will be returned. No further optimisation will be performed by the
      planner.

      .. note::

        This should only be use when a small number of goals are
        provided as it will produce a very bad and non optimal plan.


Requirements
------------
- `mercury_planner <https://github.com/b-it-bots/mercury_planner>`_
- `lama_planner <https://github.com/b-it-bots/lama_planner>`_

  .. note::

     ``g++-multilib`` is needed to install these packages.

Usage
-----

- Without ROS

  .. code-block:: bash

     python planner_wrapper.py

- With ROS

  .. code-block:: bash

     roscore
     roslaunch mir_task_planning task_planner.launch
     roslaunch mir_task_planning task_planner_client_test.launch


.. _task_planning_config:

Configuration
-------------

.. literalinclude:: ../../../mir_planning/mir_task_planning/ros/config/planner_commands.yaml
   :language: yaml
   :emphasize-lines: 5, 9

Additional files
----------------

- ``ros/launch/upload_problem.launch`` and ``ros/test/upload_problem`` can be used
  for testing whole planning pipeline without Refbox. This launch file will act
  as *refbox*, *refbox client* and *refbox parser*. It reads a ``.pddl`` problem file
  and uploads instances and facts to *knowledge base*. To test the whole
  planning pipeline without refbox, following things need to be executed

  .. code-block:: bash

     roscore
     roslaunch mir_planning_core task_planning_components.launch
     rosrun mir_task_executor task_executor_mockup
     roslaunch mir_task_planning upload_problem.launch
     roslaunch mir_planning_core task_planning_sm.launch

- ``common/pddl`` contains robocup's domain file and a bunch of problem files for
  testing.

  .. note::

     This folder is needed by default if
     ``common/planner_wrapper/planner_wrapper.py`` is running standalone.