Drivebase.rule
Introduction
The drivebase rule implements a number of rules to allow a HAKO like implementation of mobotware to execute missions. The mission itself should be formed as a rule describing the mission waypoints, and may be supplemented by additional rules defining special behaviour - like speed or tool action - in e.g. geographic areas.
This description reflects the drivebase version 2.777 (6 nov 2009)
Drivebase
The drivebase is placed in the distribution at:
.../bin/conf_hako2/drivebase.rule
or it can be seen (in the 2.777 version) here
Description
The basic principle is that the mission describes the next waypoint as a target pose - in one of the allowed coordinate systems. The allowed coordinate systems are odometry, UTM (zone 33), map coordinates (that relates to the UTM coordinates with an origin in UTM coordinates).
The drivebase then converts (if needed) to odometry coordinates and requests a manoeuvre to get the robot to the requested pose. This may involve obstacle avoidance - if allowed.
The process can be paused by setting a pause flag, and a waypoint can be skipped by setting another flag.
If the waypoint is far away (typically more than 10-15m) then a carrot point is inserted about 10m from current position, but on the line described by the desired waypoint pose.
Rules
The (sub) rules implementing this behavior is as follows:
driveInit
Defines the global variable with default values:
global.drive.mapDest[2] = 0.0 # destination in map coordinates global.drive.utmDest[2] = 0.0 # destination in UTM coordinates global.drive.odoDest[2] = 0.0 # destination in ODO coordinates global.drive.lastMapDest[2] = 0.0 # last destination in map coordinates global.drive.lastUtmDest[2] = 0.0 # last destination in UTM coordinates global.drive.lastOdoDest[2] = 0.0 # last destination in ODO coordinates global.drive.refCoord = -1 # 0=odo, 1=UTM, 2=map global.drive.newDest = 0 global.drive.pause = false global.drive.waitHere = true # waits in a state with low RPM global.drive.gettingClose = false global.drive.skipDestination = false global.drive.compasHeading = false # heading in compas degrees if true (else math) global.drive.radians = true # heading in radians if true, else in degrees (math heading only) global.drive.continueDist = 1 # continues when closer than this from next node global.drive.holdLine = true # try hold line from last waypoint, else go direct global.drive.engineRPM= 1900; global.mission.name= 'none' global.mission.leg= 0 odoPose.tripTimeB= 0 odoPose.tripB= 0 global.drive.distToTgt = 0 global.drive.fromPose[2] = 0.0 # last used source pose
(more to come)