Mission monitor sequencer
From Rsewiki
Introduction
This plug-in implements a a language that is a mixture of a rule-based and a sequential based language. The idea is that a number of situations need permanent - or semi permanent - monitoring to get a good situation awareness for the root, but a large number of the robot tasks are better described by a sequential language.
This implementation attempts to cover this gab.
Language
An example function could look like this:
<?xml version="1.0" ?> <plan name="planB" full="true"> <init> gateFound = false <plan name="straight" if="not gateFound and odoPose.tripB < 100.0"> odoPose.tripB = odoPose.tripB + 15.1; if (odoPose.tripB > 80.0) break "planB" </plan> </init> print("started") enable("straight") # active - or until disabled. odoPose.tripB = 100.1 wait(1) : false; odoPose.tripB = 0.4 wait(99) : gateFound print("wait expired!!! - block print") <commands to="smr.send"> # through gate, turn right and re-find line near wall 'followline "bm" @v0.3: ($drivendist >0.37)' 'turn 90' + ' slut' </commands> <post> print("finsihed gate-on-the-loose") </post> </plan>
<plan name="planMain" full="default"> <init> powHi = 13.9 powLo = powHi - 3.5 <plan name="powerMon" if="power.low()"> print("Stopping - out of power") break pit </plan> energy = 66; </init> enable("powerMon") <commands to="print"> # through gate, turn right and re-find line near wall 'followline "bm" @v0.3: ($drivendist >0.37)' 'turn 90' + ' slut' </commands> wait(20) : false planB() <post> print("finished OK") </post> </plan>
A number of these plans can be started (enabled) simultaniously, an can in principle be total independant. I.e.one can control the robot arm whele another controls the navigation.