]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: init localization variable.
authorTran Duy Khanh <trandk1@fel.cvut.cz>
Sun, 27 Apr 2008 14:44:17 +0000 (16:44 +0200)
committerTran Duy Khanh <trandk1@fel.cvut.cz>
Sun, 27 Apr 2008 14:44:17 +0000 (16:44 +0200)
src/robofsm/eb2008/Makefile.omk
src/robofsm/eb2008/robot_eb2008.c
src/robofsm/eb2008/robot_eb2008.h

index 364948519f51ea2bf999b4193dd52c27307945ef..161c9fd252f4c9890c9da14232cc82a34018d760 100644 (file)
@@ -2,7 +2,7 @@
 
 #SUBDIRS = test
 
-#default_CONFIG = CONFIG_OPEN_LOOP=n
+default_CONFIG = CONFIG_OPEN_LOOP=n
 LOCAL_CONFIG_H = robot_config.h
 
 #bin_PROGRAMS += robomain
index cf4f4e1494a0893dd6ffcddbcc792a038f0d7e42..493520149e3d7e1e2b3e21971584bbe2792d62f8 100644 (file)
@@ -75,7 +75,7 @@ void robot_loc_init()
        robot.mcl.maxnoisecycle = 10;
 
        /* amount of particles */
-       robot.mcl.count = 2000;
+       robot.mcl.count = 1000;
        robot.mcl.parts = (struct mcl_particle *)
                        malloc(sizeof(struct mcl_particle)*robot.mcl.count);
 
@@ -160,8 +160,9 @@ int robot_init()
        robot.orte.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
        robot.orte.drives.bagr = BAGR_DRIVE_OFF;
        
-       /* localizaton initialization */
-       robot_loc_init();
+       /* init localization if needed */
+       if (robot.use_loc == 1)
+               robot_loc_init();
 
        /* init ORTE domain, create publishers, subscribers, .. */
        robot_init_orte();
index 8e0e2ba03a1d45f7f681426941ebc96714ce2513..934830b0d5807b5d8d5ba655aa1c9eb2ff4ece07 100644 (file)
@@ -116,6 +116,7 @@ struct robot_eb2008 {
        /* mcl */
        struct mcl_model mcl;
        struct mcl_angles meas_angles;;
+       unsigned char use_loc;
 
 }; /* robot_eb2008 */
 
@@ -130,6 +131,7 @@ int robot_start();
 int robot_exit();
 int robot_wait();
 int robot_destroy();
+void robot_loc_init();
 
 FSM_STATE_DECL(main_init);
 FSM_STATE_DECL(move_init);