NODE rosplan_pipeline_manager.py
This is maybe the most important node of the RoboCLuedo ROSPlan package: it allows other nodes to plan and to dispatch the solved plan with a simple interface. Moreover, it adds a large set of informations and details about how the planning process proceeds, and in particular when something wrong occurs, it makes this failure explainable.
The ROSPlan workflow is always the same: load the problem, try to solve it, parse the solved plan, and finally dispatch the solved plan. Each step must be “triggered” each time it is required. And each step, when finished its job, returns something via topic. In other words, it is a pipeline, and this node collects all these triggers in only one place.
- Authors:
Francesco Ganci (S4143910)
- Version
v1.0.0
- rosplan_pipeline_manager.LANDMARK_COLLECT = 1
landmark corresponding to “COLLECT”
- rosplan_pipeline_manager.LANDMARK_REPLAN = 0
landmark corresponding to “REPLAN”
- rosplan_pipeline_manager.LANDMARK_SOLVE = 2
landmark corresponding to “SOLVE”
- rosplan_pipeline_manager.NODE_NAME = 'rosplan_pipeline_manager'
nothing to say, node name
- rosplan_pipeline_manager.SRV_TIMEOUT = 60
a timeout of 1min used for the client connection
- rosplan_pipeline_manager.action_feedback_msg = None
the pending feedback from the actions
- rosplan_pipeline_manager.action_feedback_received = False
any pending feedback?
- rosplan_pipeline_manager.cbk_action_feedback(feedback)[source]
receive a feedback from the ROSPlan action
The feedback manager can provide an explaination of whatever problem it could arise during the dispatch phase. It is used mostly for detecting a hardware failure,
- Parameters
plan (robocluedo_rosplan_msgs/ActionFeedback) – the feedback from the last executed action
Attention
the feedback manager does not send a “succes” feedbacl, meaning that a feedback is sent only when something goes wrong.
- rosplan_pipeline_manager.cbk_parsing_interface(plan)[source]
this callback receives the output from the parsing interface, if any
this topic is used for understanding if the planning interface succeeded in parsing the plan.
- Parameters
plan (rosplan_dispatch_msgs/CompletePlan) – the parsed plan
Note
if something goes wrong, the node publishes nothing!
- rosplan_pipeline_manager.cbk_pipeline(req)[source]
implementation of the service pipeline manager
This very long function allows to use the ROSPlan framework as a pipeline, in a simple way.
- Parameters
req (RosplanPipelineManagerServiceRequest) – the pipeline request
- Returns
(RosplanPipelineManagerServiceResponse) the response to the caller.
- rosplan_pipeline_manager.cbk_planning_interface(plan)[source]
this callback receives the output from the planner, if any
When the plannning interface ended its work, it publishes on this topic the preprocessed problem instance. The pipeline manager uses this topic for understanding the outcome of the problem solution phase.
- Parameters
plan (std_msgs/String) – the solution of the problem
Note
if something goes wrong, the node publishes nothing!
- rosplan_pipeline_manager.cbk_problem_instance(problem)[source]
this callback received the problem instance from the problem interface
When the problem interface ended its work, it publishes on this topic the preprocessed problem instance. The pipeline manager uses this topic for understanding the outcome of this loading phase.
- Parameters
problem (std_msgs/String) – the problem instance loaded into the knowledge base.
Note
if something goes wrong, the node publishes nothing!
- rosplan_pipeline_manager.cl_dispatch = None
(ros client handle) plan dispatcher
- rosplan_pipeline_manager.cl_parse = None
(ros client handle) plan parser trigger
- rosplan_pipeline_manager.cl_plan = None
(ros client handle) planning interface trigger
- rosplan_pipeline_manager.cl_problem = None
(ros client handle) problem instance trigger
- rosplan_pipeline_manager.cl_update_goal = None
(ros client handle) set a particular goal into the rosplan knowledge base
- rosplan_pipeline_manager.inspect_planner_output(fpath)[source]
the function reurns true when the problem has been found unsolvable. Otherwise, it returns false.
This function is used when there’s something wrong with the planning interface, and enables to distinguish the scenario in which the planner is not solvable from the simple syntax error.
- Parameters
fpath (String) – the path of the output from the planner.
Attention
this function is good only for popf planner, because when the problem is declared unsolvable, it writes a particular thing on the output, the one that is searched by this function in order to understand if the problem is unsolvable or simply badly formulated. Using other planners makes this function to be updated.
- rosplan_pipeline_manager.open_cl(cl_name, cl_type)[source]
handful utility to open a client
- Parameters
cl_name (string) – name of the client
cl_type – type of message used by the service
- rosplan_pipeline_manager.parsing_interface_array = []
the parsed plan
- rosplan_pipeline_manager.parsing_interface_received = False
if the parsed plan han been sent or not
- rosplan_pipeline_manager.planner_interface_received = False
it becomes false a bit before triggering the planner, and true when the planning interface succeeded.
- rosplan_pipeline_manager.planner_interface_solution_path = ''
the value of the parameter “output_problem_path”
- rosplan_pipeline_manager.planner_interface_text = ''
text received from the planning interface
- rosplan_pipeline_manager.problem_instance_received = False
this flag is set true when the subscriber received a problem instance. this means that the problem generation worked as expected.
- rosplan_pipeline_manager.problem_instance_text = ''
the last problem instance received
- rosplan_pipeline_manager.service_dispatch = '/rosplan_plan_dispatcher/dispatch_plan'
name of the service plan dispatch
- rosplan_pipeline_manager.service_parse = '/rosplan_parsing_interface/parse_plan'
name of the trigger of the plan parser
- rosplan_pipeline_manager.service_pipeline = '/robocluedo/pipeline_manager'
service for the pipeline command manager
- rosplan_pipeline_manager.service_plan = '/rosplan_planner_interface/planning_server'
name of the trigger of planning interface
- rosplan_pipeline_manager.service_problem = '/rosplan_problem_interface/problem_generation_server'
name of the trigger of problem interface
- rosplan_pipeline_manager.service_update_goal = '/update_goal'
used to apply a landmark to the knowledge base
- rosplan_pipeline_manager.shut_msg()[source]
called at the shutdown of the node, just a message
- rosplan_pipeline_manager.srv_pipeline = None
(ros service handle) service handle for the pipeline service
- rosplan_pipeline_manager.sub_action_feedback = None
(ros subscriber handle) the feedback subscription
- rosplan_pipeline_manager.sub_parser_interface = None
(ros subscription handle)
- rosplan_pipeline_manager.sub_planner_interface = None
(ros subscription handle)
- rosplan_pipeline_manager.sub_problem_instance = None
(ros subscriber handle)
- rosplan_pipeline_manager.topic_action_feedback = '/robocluedo/action_feedback'
the topic for receiving the feedback
- rosplan_pipeline_manager.topic_parser_interface = '/rosplan_parsing_interface/complete_plan'
used for checking the outcome of the parsing interface
- rosplan_pipeline_manager.topic_planner_interface = '/rosplan_planner_interface/planner_output'
used for checking if the plan succeeded
- rosplan_pipeline_manager.topic_problem_instance = '/rosplan_problem_interface/problem_instance'
topic used to understand if the problem generation succeeded