ROSPlan教程

tutorial_01.launch

<?xml version="1.0"?>
<launch>

    <!-- arguments -->
    <arg name="domain_path"    default="$(find rosplan_demos)/common/domain_turtlebot.pddl" />
    <arg name="problem_path"    default="$(find rosplan_demos)/common/problem_turtlebot.pddl" />

    <!-- knowledge base -->
    <node name="rosplan_knowledge_base" pkg="rosplan_knowledge_base" type="knowledgeBase" respawn="false" output="screen">
        <param name="domain_path" value="$(arg domain_path)" />
        <param name="problem_path" value="$(arg problem_path)" />
        <!-- conditional planning flags -->
        <param name="use_unknowns" value="false" />
    </node>

    <!-- problem generation -->
    <include file="$(find rosplan_planning_system)/launch/includes/problem_interface.launch">
        <arg name="knowledge_base"   value="rosplan_knowledge_base" />
        <arg name="domain_path"      value="$(arg domain_path)" />
        <arg name="problem_path"     value="$(find rosplan_demos)/common/problem.pddl" />
        <arg name="problem_topic"    value="problem_instance" />
    </include>
</launch>

tutorial_02.launch

<?xml version="1.0"?>
<launch>

    <!-- arguments -->
    <arg name="domain_path"    default="$(find rosplan_demos)/common/domain_turtlebot.pddl" />
    <arg name="problem_path"    default="$(find rosplan_demos)/common/problem_turtlebot.pddl" />

    <!-- knowledge base -->
    <node name="rosplan_knowledge_base" pkg="rosplan_knowledge_base" type="knowledgeBase" respawn="false" output="screen">
        <param name="domain_path" value="$(arg domain_path)" />
        <param name="problem_path" value="$(arg problem_path)" />
        <!-- conditional planning flags -->
        <param name="use_unknowns" value="false" />
    </node>

    <!-- problem generation -->
    <include file="$(find rosplan_planning_system)/launch/includes/problem_interface.launch">
        <arg name="knowledge_base"   value="rosplan_knowledge_base" />
        <arg name="domain_path"      value="$(arg domain_path)" />
        <arg name="problem_path"     value="$(find rosplan_demos)/common/problem.pddl" />
        <arg name="problem_topic"    value="problem_instance" />
    </include>
    <!-- planner interface -->
    <include file="$(find rosplan_planning_system)/launch/includes/planner_interface.launch">
        <arg name="use_problem_topic"    value="true" />
        <arg name="problem_topic"        value="/rosplan_problem_interface/problem_instance" />
        <arg name="planner_topic"        value="planner_output" />
        <arg name="domain_path"          value="$(arg domain_path)" />
        <arg name="problem_path"         value="$(find rosplan_demos)/common/problem.pddl" />
        <arg name="data_path"            value="$(find rosplan_demos)/common/" />
        <arg name="planner_command"      value="timeout 10 $(find rosplan_planning_system)/common/bin/popf DOMAIN PROBLEM" />
    </include>
</launch>

tutorial_03.launch

<?xml version="1.0"?>
<launch>

    <!-- arguments -->
    <arg name="domain_path"    default="$(find rosplan_demos)/common/domain_turtlebot.pddl" />
    <arg name="problem_path"    default="$(find rosplan_demos)/common/problem_turtlebot.pddl" />

    <!-- knowledge base -->
    <node name="rosplan_knowledge_base" pkg="rosplan_knowledge_base" type="knowledgeBase" respawn="false" output="screen">
        <param name="domain_path" value="$(arg domain_path)" />
        <param name="problem_path" value="$(arg problem_path)" />
        <!-- conditional planning flags -->
        <param name="use_unknowns" value="false" />
    </node>
    
    <!-- plan parsing -->
    <node name="rosplan_parsing_interface" pkg="rosplan_planning_system" type="pddl_simple_plan_parser" respawn="false" output="screen">
        <param name="knowledge_base" value="rosplan_knowledge_base" />
        <param name="planner_topic"  value="/rosplan_planner_interface/planner_output" />
        <param name="plan_topic"     value="complete_plan" />
    </node>

    <!-- plan dispatching -->
    <node name="rosplan_plan_dispatcher" pkg="rosplan_planning_system" type="pddl_simple_plan_dispatcher" respawn="false" output="screen">
        <param name="knowledge_base"        value="rosplan_knowledge_base" />
        <param name="plan_topic"            value="/rosplan_parsing_interface/complete_plan" />
        <param name="action_dispatch_topic" value="action_dispatch" />
        <param name="action_feedback_topic" value="action_feedback" />
    </node>

</launch>

plan_tutorial_03.pddl

  0.000: (undock kenny wp1)             [10.000]
 10.001: (localise kenny)               [60.000]
 70.002: (goto_waypoint kenny wp0 wp0)  [60.000]
130.003: (goto_waypoint kenny wp0 wp1)  [60.000]
190.004: (goto_waypoint kenny wp1 wp2)  [60.000]
250.005: (goto_waypoint kenny wp2 wp3)  [60.000]
310.006: (goto_waypoint kenny wp3 wp4)  [60.000]

tutorial_04.launch

<?xml version="1.0"?>
<launch>

    <!-- ROSPlan -->
    <include file="$(find rosplan_planning_system)/launch/interfaced_planning_system.launch" >
        <arg name="domain_path"        value="$(find rosplan_demos)/common/domain_turtlebot.pddl" />
        <arg name="problem_path"    value="$(find rosplan_demos)/common/problem_turtlebot.pddl" />
    </include>

    <!-- sim actions -->
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="undock" />
    </include>
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="dock" />
    </include>
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="localise" />
    </include>
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="goto_waypoint" />
    </include>
</launch>

tutorial_04.bash

echo "Generating a Problem"
rosservice call /rosplan_problem_interface/problem_generation_server

echo "Planning"
rosservice call /rosplan_planner_interface/planning_server

echo "Executing the Plan"
rosservice call /rosplan_parsing_interface/parse_plan
rosservice call /rosplan_plan_dispatcher/dispatch_plan

tutorial_05.launch

<?xml version="1.0"?>
<launch>

    <!-- ROSPlan -->
    <include file="$(find rosplan_planning_system)/launch/interfaced_planning_system.launch" >
        <arg name="domain_path"        value="$(find rosplan_demos)/common/domain_turtlebot.pddl" />
        <arg name="problem_path"    value="$(find rosplan_demos)/common/problem_turtlebot.pddl" />
    </include>

       <!-- sim actions -->
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="undock" />
        <arg name="action_duration" value="5" />
    </include>
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="dock" />
        <arg name="action_duration" value="15" />
    </include>
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="localise" />
        <arg name="action_duration" value="60" />
    </include>
    <include file="$(find rosplan_planning_system)/launch/includes/simulated_action.launch" >
        <arg name="pddl_action_name" value="goto_waypoint" />
        <arg name="action_duration" value="45" />
    </include>
</launch>

 

posted @ 2021-03-15 16:00  白雪儿  Views(299)  Comments(0Edit  收藏  举报