next up previous contents index
Next: Examples Up: Splats Previous: A second implementation of

Running the stopping controller

In order to execute the stopping-controller splat you must:
1.
Start scheme and connect to the wheelchair (see Chapter 1).
2.
Load the file containing the controller definition.
3.
Run the splat.

Our splat can be run by calling

(run-top-level (stopping-controller my-robot 1 0.5 2))

where my-robot is the wheelchair-client instance created when connecting to the wheelchair (see Section 1.8).

It is possible to run the splat in a different thread to the one running scheme. In this case you will type

(set! my-splat (stopping-controller my-robot 1 0.5 2))
(start-task my-splat #f)

The result of calling (stopping-controller my-robot 1 0.5 2) is a splat object, which is stored in the variable my-splat. One can execute this splat by calling start-task, where the second argument of this call is the thread creating the task (in our case #f indicates that the father is the Rscheme thread).

One can finish the execution of the stopping controller by calling

(finish my-splat 'method-succeeded)

It is also possible to explicitly wait until a splat has been executed by calling

(wait-for-task my--splat #f)
where the second argument (#f) denotes the thread calling this function.


next up previous contents index
Next: Examples Up: Splats Previous: A second implementation of
Emilio Remolina
2000-10-04