From a60e557862a9b2448e94880cd019b447d1f35f64 Mon Sep 17 00:00:00 2001 From: Tran Duy Khanh Date: Sat, 3 May 2008 09:22:31 +0200 Subject: [PATCH] Almost final competition version. --- build/ppc/config.target | 4 ++-- src/robofsm/eb2008/fsmmain.cc | 6 +++++- src/robofsm/eb2008/robot_eb2008.c | 5 ++--- src/robofsm/eb2008/robot_orte.c | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build/ppc/config.target b/build/ppc/config.target index 1c2ddda9..495e69bf 100644 --- a/build/ppc/config.target +++ b/build/ppc/config.target @@ -8,10 +8,10 @@ AR := $(CROSS_COMPILE)$(AR) #CONFIG_OC_ETH_ORTE_IDL=y -CFLAGS = -fno-strict-aliasing +CFLAGS = -fno-strict-aliasing -DCOMPETITION CXXFLAGS = -fno-strict-aliasing INCLUDES = -I/usr/powerpc-603e-linux-gnu/gcc/4.1.1/lib/include/c++/4.1.1 -I /usr/powerpc-603e-linux-gnu/gcc/4.1.1/lib/include/c++/4.1.1/powerpc-603e-linux-gnu IDL_COMPILER = orte-idl -CONFIG_UOLED_TTY="/dev/ttyPSC2" \ No newline at end of file +CONFIG_UOLED_TTY="/dev/ttyPSC2" diff --git a/src/robofsm/eb2008/fsmmain.cc b/src/robofsm/eb2008/fsmmain.cc index a05fdcdc..30339de0 100644 --- a/src/robofsm/eb2008/fsmmain.cc +++ b/src/robofsm/eb2008/fsmmain.cc @@ -26,7 +26,8 @@ #include /* define this macro */ -#define COMPETITION +/* define in CFLAGS */ +// #define COMPETITION #ifdef COMPETITION #define WAIT_FOR_START @@ -311,6 +312,9 @@ FSM_STATE(wait_for_start) #else case EV_ENTRY: #endif + robot.orte.laser_cmd.speed = LASER_DRIVE_ON; + ORTEPublicationSend(robot.orte.publication_laser_cmd); + /* start to do something */ FSM_TRANSITION(decide_where_now); break; diff --git a/src/robofsm/eb2008/robot_eb2008.c b/src/robofsm/eb2008/robot_eb2008.c index d5234018..f2f90a0c 100644 --- a/src/robofsm/eb2008/robot_eb2008.c +++ b/src/robofsm/eb2008/robot_eb2008.c @@ -161,9 +161,6 @@ int robot_init() robot.laser.aeval_sigma = DEG2RAD(4); robot.mcl = mcl_laser_init(&robot.laser, 1000); - robot.orte.laser_cmd.speed = LASER_DRIVE_ON; - ORTEPublicationSend(robot.orte.publication_laser_cmd); - robot.fsm[FSM_ID_MOTION].state = &fsm_state_motion_init; robot.fsm[FSM_ID_LOC].state = &fsm_state_loc_init; @@ -250,6 +247,8 @@ int robot_exit() robot.orte.laser_cmd.speed = LASER_DRIVE_OFF; ORTEPublicationSend(robot.orte.publication_laser_cmd); + ORTEPublicationSend(robot.orte.publication_laser_cmd); + open_back_door(); open_bottom_door(); off_bagr(); diff --git a/src/robofsm/eb2008/robot_orte.c b/src/robofsm/eb2008/robot_orte.c index 39abb49d..a76755d5 100644 --- a/src/robofsm/eb2008/robot_orte.c +++ b/src/robofsm/eb2008/robot_orte.c @@ -393,6 +393,7 @@ void robot_init_orte() eb2008_publisher_servos_create(&robot.orte, send_dummy_cb, &robot.orte); eb2008_publisher_drives_create(&robot.orte, send_dummy_cb, &robot.orte); + eb2008_publisher_laser_cmd_create(&robot.orte, NULL, NULL); /* create generic subscribers */ generic_subscriber_motion_irc_create(&robot.gorte, rcv_motion_irc_cb, &robot.gorte); -- 2.39.2