wiki:WikiStart/OngoingWork/RockRoby/CoordinationModels
state_machine(Mission) do
  pipeline_following = self.pipeline_following
  search_for_buoy = self.search_for_buoy
  survey_buoy = self.survey_buoy
  find_wall = self.find_wall

  pipeline_following.
    on_exception(ChildFailedError, blablabla).
    transition(survey_buoy)

  start(pipeline_following)
  transition(pipeline_following, :success => search_for_buoy)
  transition(search_for_buoy, :success => survey_buoy, :failed => pipeline_following)
end

script(Mission) do
  run pipeline_following
  start search_for_buoy
end

class MyTask < Roby::Task
  on_exception(ChildFailedError) do |error|
  end
end

class MyTask < Roby::Task
  on_exception(ChildFailedError, :role => 'pose_estimator', :event => :diverged) do |error|
    emit :pose_estimator_failed
  end
end

action(:main_mission) do
  pipeline_following = self.pipeline_following
  search_for_buoy = self.search_for_buoy
  survey_buoy = self.survey_buoy
  find_wall = self.find_wall

  main_task = Mission.new
  main_task.state_machine do
    start_state(pipeline_following, :success => search_for_buoy)
    state(search_for_buoy, :success => survey_buoy, :failed => find_wall)
  end
end
Last modified 7 years ago Last modified on 12/04/12 10:58:09