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.