Sequencer

From Rsewiki
Revision as of 11:48, 29 September 2008 by Lvm (talk | contribs) (New page: ''Status'' The sequencer is in broad terms equal the the sequencer in smrdemo, but is less real time oriented ''How to operate'' Load the module 'auseq-1.XX.so.0' by e.g.: The module re...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Status

The sequencer is in broad terms equal the the sequencer in smrdemo, but is less real time oriented

How to operate

Load the module 'auseq-1.XX.so.0' by e.g.: The module requires the variable handling module to be loaded too, so load both.

>> module load='/usr/local/smr/bin/auseq-1.77.so.0'
>> module load=var

The variable handling module is static - and can thus be loaded using a short name - see '>> module help' for a list of static modules.

Look at:

>> seq help

to get sequencer options, then try to add a sequencer line by e.g.:

>> seq add="a=sin(0.5)"
USeqLoop::run: 0 Parsing 'a=sin(0.5)' 
USeqLoop::run: ** 1 warning: sequencer out of mission lines (try "seq help")

The sequenser reply is that the line is parsed and it now is out of sequence lines

All variables and functions available to the sequencer can be displayed with the command:

>> var all
false=0;                      Constant false is the same as 0
true=1;                       Constant true is the same as 1
pi=3.14159;                   Constant pi is the same as 3.14159...
replayTime=0;                 Current time index to replay file(s)
a=0.479426;                   new
core='struct';                Variables related to the server core.
poseHist='struct';            Holds the most recent robot position and the
seq='struct';                 Plan sequencer settings and status
roaddrive='struct';           Road line driver settings and functions
drivepos='struct';            Drive to position settings and functions
limitToPi(d);
sin(d); 
cos(d);
...

And among the list is the new variable 'a' introduced by the sequencer line.

Some modules introduce drive commands, the 'drivepos' module allow to drive to a position, in local or absolute coordinates To try it, first load the module

>> module load="/usr/local/smr/bin/audrivepos-1.77.so.0"

To see the settings and functions in this plugin, try:

>> var drivepos
version=1.77;                 Resource version
updateTime=0;                 Last time the road drive command was calles
loopCnt=0;                    Number of times called by sequencer
odoX=0;                       (ro) target position used in obstacle avoidance
                             (set by call)
odoY=0;
odoH=0;
odoV=1;                       target velocity at end of obstacle avoidance
failCnt=0;                    Path fails since last success
finalDistance=0.7;            Distance from target position where no new path
                             is calculated
odo(ddd);                     Drive towards this odometry position (x[m],
                             y[m], h[rad])
odo(dddd);                    Drive towards this odometry position (x[m],
                             y[m], h[rad]), the last (optional) parameter is
                             a repeat count for calls in rapid succession.
rel(ddd);                     Drive towards this position relative to the
                             robot (x[m], y[m], h[rad])
rel(dddd);                    Drive towards this position relative to the
                             robot (x[m], y[m], h[rad]), the last (optional)
                             parameter is a repeat count for calls in rapid
                             succession. First call (repeat==0) determines
                             origin for relative position
odoVel(dddd);                 Drive towards this odometry position and desired
                             end velocity (x, y, h, vel)

To add a line that will drive to a position 1 meter forward and 0.5 meter to the right maintaining the current heading, try:

>> seq add="drivepos.odo(1, -0.5, 0) : false"

The first part is a function call the the 'odo(ddd)' function in the 'drivepos' module with the 3 needed 'double' parameters. Then a ':' to say that it is a drive command that should be continued until it returnes 'true' or the explicit stop condition after the ':' evaluates to true.

Then a failure remark is most likely returned, this is because the drive module depends on other modules to complete the command

@todo more info needed