4 * Movement test: move on a line.
6 * Copyright: (c) 2007 CTU Dragons
7 * CTU FEE - Department of Control Engineering
12 #include <movehelper.h>
17 #include <actuators.h>
18 #include <boost/statechart/asynchronous_state_machine.hpp>
19 #include <boost/statechart/transition.hpp>
20 #include "../timedFSM.h"
26 struct FSMMain : boost::statechart::asynchronous_state_machine< FSMMain, on, Scheduler > {
27 FSMMain(my_context ctx) : my_base(ctx) {
28 printf("%s\n", __FUNCTION__);
32 struct on : TimedState< on, FSMMain > {
34 on(my_context ctx) : base_state(ctx) {
36 runTimer(onTime, 10000, new evTimer());
38 typedef sc::transition< evTimer, off > reactions;
42 struct off : TimedState< off, FSMMain > {
44 off(my_context ctx) : base_state(ctx) {
46 runTimer(offTime, 10000, new evTimer());
48 typedef sc::transition< evTimer, on > reactions;
51 int main(int argc, char *argv[])
54 robot.MAIN = robot.sched.create_processor<FSMMain>();
56 if (rv) error(1, errno, "robot_init() returned %d\n", rv);
59 if (rv) error(1, errno, "robot_start() returned %d\n", rv);