OBSOLETE VERSION most functions are methods used from their objects now

Waypoint move

-- create or fetch objects
tracker = RobotTracker()
mvtplan = MovementPlanning(tracker)
mybot = RobotMove("HBot")
odo = Odometer("HBot")

-- connect events: basic moves and odometer events
connect(mvtplan,"basic move",mybot)
connect(odo, "robot translated", tracker)
connect(odo, "robot rotated", tracker)
connect(odo, "robot position changed", tracker)

-- goto is a primitive that executes a waypoint move to (x=10, y=10) in a MovementPlanning
goto(mvtplan, 10, 10)

Free move (with a gamepad)

tracker = RobotTracker()
odo = Odometer("HBot")
freemove = FreeMove("HBot")

connect(odo, "robot translated", tracker)
connect(odo, "robot rotated", tracker)
connect(odo, "robot position changed", tracker)

-- create pad, connect it to free move
pad = PadController("/dev/input/js0")
connect(pad,"free move",freemove)

-- primitive to enter in a read loop on the gamepad events
padloop(pad)             

Map generation (with a keyboard)

-- usual objects
tracker = RobotTracker()
mybot = RobotMove("HBot")
odo = Odometer("HBot")
sc = SensorControl("playerlaser")
freemove = FreeMove("HBot")

-- usual connections
connect(odo, "robot translated", tracker)
connect(odo, "robot rotated", tracker)
connect(odo, "robot position changed", tracker)

-- create a global map, with cells of 30mm size
globalMap = GridMap(30)

-- create a map generator, connect sensor control to it
mapgen = MapGenerator(globalMap, tracker)
connect(sc,"sensor report", mapgen)

-- create a web repository for publishing maps, connect map updates to it
testweb = WebHRI("./www")
connect(globalMap,"map update",testweb)

-- create a keyboard controller, connect it to free moves AND sensor control
kbd = KeyboardController()
connect(kbd, "free move", freemove)
connect(kbd, "sensor request", sc)

-- launch keyboard read loop
kbdloop(kbd)

Discovery

-- usual objects
tracker = RobotTracker()
mybot = RobotMove("HBot")
odo = Odometer("HBot")
sc = SensorControl("playerlaser")
mvtplan = MovementPlanning(tracker)
mybot = RobotMove("HBot")

-- usual connections
connect(mvtplan,"basic move",mybot)
connect(odo, "robot translated", tracker)
connect(odo, "robot rotated", tracker)
connect(odo, "robot position changed", tracker)

-- create a global map, with cells of 30mm size
globalMap = GridMap(30)

-- create a map generator, connect sensor control to it
mapgen = MapGenerator(globalMap, tracker)
connect(sc,"sensor report", mapgen)

-- create a web repository for publishing maps, connect map updates to it
testweb = WebHRI("./www")
connect(globalMap,"map update",testweb)

-- create Discovery algorithm, connect it
disc = Discovery(globalMap, tracker)
connect(disc,"waypoint move",mvtplan)
connect(disc,"sensor request",sc)

-- launch discovery algorithm in a limit of 3 meters around the robot
launchDiscovery(disc,3000)
 
software_configuration_example.txt · Last modified: 2009/03/24 18:06 by hadrien
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS La rache Driven by DokuWiki