]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Restructure repository to get rid or eb200x directories and file suffixes
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 2 Feb 2009 17:16:39 +0000 (18:16 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 2 Feb 2009 19:26:04 +0000 (20:26 +0100)
This commit modifies the repository in the following ways:
* deletes all files under */eb2007 directories
* renames all files like <X>/eb2008/<Y>_eb2008.<Z> to <X>/<Y>.<Z>
* merges robo{orte,ttypes}_xxx libraries to robo{orte,ttypes}
* Updates Makefile.omk files to the above changes
* Removed Robomon tabs for past years

Reasons for this cleanup are the following:
* Filenames was used for things which can be managed better by SCM
  tools (like GIT).
* The actual code often mixed usage of eb2007 and eb2008 files/libraries
  together. This was probably not intentional, but it could lead to
  very bad mistakes.
* The code for older years was never used in reality and it only made
  maintanance of code harder.

113 files changed:
src/cand/Makefile.omk
src/cand/cand.cc [moved from src/cand/eb2008/cand_eb2008.cc with 99% similarity]
src/cand/cand.h [moved from src/cand/eb2008/cand_eb2008.h with 100% similarity]
src/cand/eb2007/Makefile.omk [deleted file]
src/cand/eb2007/cand_eb2007.cc [deleted file]
src/cand/eb2007/cand_eb2007.h [deleted file]
src/cand/eb2008/Makefile [deleted file]
src/cand/eb2008/Makefile.omk [deleted file]
src/canlog/cand.h [moved from src/canlog/cand_eb2008.h with 100% similarity]
src/canlog/canlog.cc
src/hokuyo/Makefile.omk
src/hokuyo/hokuyo.c
src/joyd/Makefile.omk
src/joyd/joyd.cc
src/mcl/mcl.c
src/mcl/mcl_laser.h
src/mcl/test/Makefile.omk
src/mcl/test/testmcl_performance.c
src/robodim/Makefile.omk
src/robodim/eb2007/Makefile [deleted file]
src/robodim/eb2007/Makefile.omk [deleted file]
src/robodim/eb2007/robodim_eb2007.h [deleted file]
src/robodim/eb2008/Makefile [deleted file]
src/robodim/eb2008/Makefile.omk [deleted file]
src/robodim/robodim.c [moved from src/robodim/eb2008/robodim_eb2008.c with 97% similarity]
src/robodim/robodim.h [moved from src/robodim/eb2008/robodim_eb2008.h with 100% similarity]
src/robofsm/Makefile.omk
src/robofsm/eb2007/Makefile [deleted file]
src/robofsm/eb2007/Makefile.omk [deleted file]
src/robofsm/eb2007/fsmdet.c [deleted file]
src/robofsm/eb2007/fsmjoy.c [deleted file]
src/robofsm/eb2007/fsmloc.c [deleted file]
src/robofsm/eb2007/fsmmain.cc [deleted file]
src/robofsm/eb2007/fsmmove.cc [deleted file]
src/robofsm/eb2007/fsmpickup.c [deleted file]
src/robofsm/eb2007/movehelper_eb2007.cc [deleted file]
src/robofsm/eb2007/movehelper_eb2007.h [deleted file]
src/robofsm/eb2007/roboevent_eb2007.py [deleted file]
src/robofsm/eb2007/roboorte.c [deleted file]
src/robofsm/eb2007/robot_eb2007.c [deleted file]
src/robofsm/eb2007/robot_eb2007.h [deleted file]
src/robofsm/eb2007/servos_eb2007.c [deleted file]
src/robofsm/eb2007/servos_eb2007.h [deleted file]
src/robofsm/eb2007/test/Makefile [deleted file]
src/robofsm/eb2007/test/Makefile.omk [deleted file]
src/robofsm/eb2007/test/follower.cc [deleted file]
src/robofsm/eb2007/test/testcollavoid.cc [deleted file]
src/robofsm/eb2007/test/testpickup.cc [deleted file]
src/robofsm/eb2008/test/Makefile [deleted file]
src/robofsm/fsmdisplay.c [moved from src/robofsm/eb2008/fsmdisplay.c with 97% similarity]
src/robofsm/fsmjoy.c [moved from src/robofsm/eb2008/fsmjoy.c with 98% similarity]
src/robofsm/fsmloc.c [moved from src/robofsm/eb2008/fsmloc.c with 98% similarity]
src/robofsm/fsmmain.c [moved from src/robofsm/eb2008/fsmmain.c with 99% similarity]
src/robofsm/fsmmove.cc [moved from src/robofsm/eb2008/fsmmove.cc with 99% similarity]
src/robofsm/main.cc [moved from src/robofsm/eb2008/main.cc with 97% similarity]
src/robofsm/map_handling.c [moved from src/robofsm/eb2008/map_handling.c with 99% similarity]
src/robofsm/map_handling.h [moved from src/robofsm/eb2008/map_handling.h with 87% similarity]
src/robofsm/movehelper.cc [moved from src/robofsm/eb2008/movehelper_eb2008.cc with 94% similarity]
src/robofsm/movehelper.h [moved from src/robofsm/eb2008/movehelper_eb2008.h with 99% similarity]
src/robofsm/roboevent.py [moved from src/robofsm/eb2008/roboevent_eb2008.py with 100% similarity]
src/robofsm/robot.c [moved from src/robofsm/eb2008/robot_eb2008.c with 93% similarity]
src/robofsm/robot.h [moved from src/robofsm/eb2008/robot_eb2008.h with 95% similarity]
src/robofsm/robot_orte.c [moved from src/robofsm/eb2008/robot_orte.c with 82% similarity]
src/robofsm/robot_orte.h [moved from src/robofsm/eb2008/robot_orte.h with 100% similarity]
src/robofsm/servos.c [moved from src/robofsm/eb2008/servos_eb2008.c with 97% similarity]
src/robofsm/servos.h [moved from src/robofsm/eb2008/servos_eb2008.h with 100% similarity]
src/robofsm/test/Makefile [moved from src/cand/eb2007/Makefile with 100% similarity]
src/robofsm/test/Makefile.omk [moved from src/robofsm/eb2008/test/Makefile.omk with 71% similarity]
src/robofsm/test/display.cc [moved from src/robofsm/eb2008/test/display.cc with 95% similarity]
src/robofsm/test/goto.cc [moved from src/robofsm/eb2008/test/goto.cc with 98% similarity]
src/robofsm/test/homologation.cc [moved from src/robofsm/eb2008/test/homologation.cc with 99% similarity]
src/robofsm/test/line.cc [moved from src/robofsm/eb2008/test/line.cc with 97% similarity]
src/robofsm/test/mcl-laser.cc [moved from src/robofsm/eb2008/test/mcl-laser.cc with 97% similarity]
src/robofsm/test/odometry.cc [moved from src/robofsm/eb2008/test/odometry.cc with 97% similarity]
src/robofsm/test/rectangle.cc [moved from src/robofsm/eb2008/test/rectangle.cc with 97% similarity]
src/robofsm/test/sharpcalib.cc [moved from src/robofsm/eb2008/test/sharpcalib.cc with 96% similarity]
src/robofsm/utils/Makefile.omk
src/robofsm/utils/joystick.cc
src/robomon/src/robomon.h
src/robomon/src2/MainWindow.cpp
src/robomon/src2/MainWindow.h
src/robomon/src2/RobomonAtlantis.cpp
src/robomon/src2/RobomonAtlantis.h
src/robomon/src2/RobomonExplorer.cpp
src/robomon/src2/RobomonExplorer.h
src/robomon/src2/RobomonRecycling.h
src/robomon/src2/RobomonTuning.cpp
src/robomon/src2/RobomonTuning.h
src/robomon/src2/SimMcl.cpp
src/robomon/src2/SimMcl.h
src/robomon/src2/robomon_orte.cpp
src/robomon/src2/robomon_orte.h
src/robomon/src2/src2.pro
src/roboorte/Makefile.omk
src/roboorte/eb2007/Makefile [deleted file]
src/roboorte/eb2007/Makefile.omk [deleted file]
src/roboorte/eb2008/Makefile [deleted file]
src/roboorte/eb2008/Makefile.omk [deleted file]
src/roboorte/generic/Makefile [deleted file]
src/roboorte/generic/Makefile.omk [deleted file]
src/types/Makefile.omk
src/types/robottype.c
src/types/robottype.h
src/types/robottype.idl
src/types/robottype_eb2007.c [deleted file]
src/types/robottype_eb2007.h [deleted file]
src/types/robottype_eb2007.idl [deleted file]
src/types/robottype_eb2008.c [deleted file]
src/types/robottype_eb2008.h [deleted file]
src/types/robottype_eb2008.idl [deleted file]
src/ulcdd/oledlib.cc
src/ulcdd/oledlib.h
src/ulcdd/uoled.c

index 0d2aebf2814b7c581dce0c54ab13218d21a97865..b15b85fe69c2d148f7063a4f08428effc14b41ae 100644 (file)
@@ -1,3 +1,7 @@
 # -*- makefile -*-
 
-SUBDIRS = contrib eb2008
+SUBDIRS = contrib
+
+bin_PROGRAMS += cand
+cand_SOURCES = cand.cc
+cand_LIBS = pthread sharp roboorte roboorte_generic robottype robottype orte 
similarity index 99%
rename from src/cand/eb2008/cand_eb2008.cc
rename to src/cand/cand.cc
index 62997c7a6a62bc5ae758a59d41a4a9db28d08070..ea4e57f06867ffa0c964beab9c687dc3895f0b3f 100644 (file)
 #include <can_msg_def.h>
 #include <sharp.h>
 #include <orte.h>
-#include <roboorte_eb2008.h>
+#include <roboorte.h>
 #include <roboorte_generic.h>
 #include <can_msg_masks.h>
-#include "cand_eb2008.h"
+#include "cand.h"
 
 int cand_init()
 {
diff --git a/src/cand/eb2007/Makefile.omk b/src/cand/eb2007/Makefile.omk
deleted file mode 100644 (file)
index 6efcba0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- makefile -*-
-
-bin_PROGRAMS += cand_eb2007
-cand_eb2007_SOURCES = cand_eb2007.cc
-cand_eb2007_LIBS = pthread sharp roboorte_eb2007 robottype robottype_eb2007 orte 
diff --git a/src/cand/eb2007/cand_eb2007.cc b/src/cand/eb2007/cand_eb2007.cc
deleted file mode 100644 (file)
index 489e2c3..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * cand_eb2007.cc                      08/04/07
- *
- * CAN daemon for the Eurobot 2007 competition.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-#include <cstdlib>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <af_can.h>
-#include <canutils.h>
-
-#include <can_ids.h>
-#include <sharp.h>
-#include <orte.h>
-#include <roboorte_eb2007.h>
-
-#include "cand_eb2007.h"
-
-int cand_init()
-{
-       if ((sock = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) {
-               perror("cand: unable to create a socket");
-               return -1;
-       }
-
-       can_addr.can_family = AF_CAN;
-       strcpy(can_ifreq.ifr_name, "can0");
-
-       if (ioctl(sock, SIOCGIFINDEX, &can_ifreq) < 0) {
-               perror("cand: SIOCGIFINDEX");
-               return -2;
-       }
-
-       can_addr.can_ifindex = can_ifreq.ifr_ifindex;
-               
-       if (!can_addr.can_ifindex) {
-               perror("cand: invalid socket interface");
-               return -3;
-       }
-
-       if (bind(sock, (struct sockaddr *)&can_addr, sizeof(can_addr)) < 0) {
-               perror("cand: unable to bind");
-               return -4;
-       }
-
-       return 0;
-}
-
-int set_motor_speed(struct eb2007_orte_data *orte_data)
-{
-       unsigned char data[4];
-
-       data[0] = orte_data->motion_speed.left >> 8;
-       data[1] = orte_data->motion_speed.left & 0xff;
-       data[2] = orte_data->motion_speed.right >> 8;
-       data[3] = orte_data->motion_speed.right & 0xff;
-       can_send(CAN_MOTION_CMD, 4, data);
-
-       /*printf("data: ");
-       for (int i=0; i< 4; i++) {
-               printf("%02x ",data[i]);
-       }
-       printf("\n");*/
-
-       return 0;
-}
-
-int set_serva(struct eb2007_orte_data *orte_data)
-{
-       unsigned char data[6];
-
-       data[5] = orte_data->servos.backDoor;
-       data[1] = orte_data->servos.frontDoor;
-       data[2] = orte_data->servos.transporterFront;
-       data[3] = orte_data->servos.transporterInner;
-       data[4] = orte_data->servos.innerDoor;
-       data[0] = orte_data->servos.release;
-       can_send(CAN_SERVO, 6, data);
-
-       /*for(int i=0; i<6; i++) 
-               printf("data %d = 0x%x\n", i, data[i]);*/
-
-       return 0;
-}
-
-int can_send(canid_t id, unsigned char length, unsigned char *data)
-{
-       struct can_frame frame;
-       int size;
-
-       frame.can_id = id;
-       frame.can_dlc = length;
-
-       for(int i=0; i<length; i++)
-               frame.data[i] = data[i];
-
-       if ((size = write(sock, &frame, sizeof(struct can_frame))) < 0) {
-               perror("cand: can send: write()");
-               return -1;
-       } else if (size < sizeof(struct can_frame)) {
-               perror("cand: can send: incomplete CAN frame\n");
-               return 1;
-       }
-
-       /*
-       printf("write returned %d\n", size);
-       printf("finnished can send\n");
-       */
-
-       return 0;
-}
-
-/**
- * Parse frame ID and react as required
- */
-int cand_parse_frame(struct eb2007_orte_data *orte, struct can_frame frame)
-{
-       int status_cnt = 0;
-       int adc1_cnt = 0;
-       int adc2_cnt = 0;
-       int adc3_cnt = 0;
-       int ir_cnt = 0;
-       unsigned short *las_meas;
-       int las_mi, las_di, las_bcnt;
-       int i;
-
-       switch(frame.can_id) {
-               /* positioning by odometry */
-               case CAN_MOTION_ODOMETRY_SIMPLE:
-                       orte->motion_position.left = 
-                                       ((frame.data[0]<<24)|(frame.data[1]<<16)|
-                                       (frame.data[2]<<8)|(frame.data[3]));
-                       orte->motion_position.right = 
-                                       ((frame.data[4]<<24)|(frame.data[5]<<16)|
-                                        (frame.data[6]<<8)|(frame.data[7]));
-                       ORTEPublicationSend(orte->publicationMotionPos);
-                       break;
-
-               /* motion status */
-               case CAN_MOTION_STATUS:
-                       orte->motion_status.err_left = 
-                                       (frame.data[0]<<8)|(frame.data[1]);
-                       orte->motion_status.err_right = 
-                                       (frame.data[2]<<8)|(frame.data[3]);
-                       if(++status_cnt == 5) {
-                               ORTEPublicationSend(orte->publicationMotionStatus);
-                               status_cnt = 0;
-                       }
-                       /*
-                       if(ms.err_left || ms.err_right) 
-                               printf("MOTOR STATUS: left 0x%x, right 0x%x\n",
-                                               ms.err_left, ms.err_right);
-                       */
-                       break;
-
-               /* long sharps */
-               case CAN_ADC_1:
-                       /* TODO: zkontrolovat, zda hodnoty jsou spravne v mm !! */
-                       orte->sharps_oponent.longSharpDist1 = 
-                               s_ir2mmLong((frame.data[0]<<8)|(frame.data[1]))/1000.0;
-                       orte->sharps_oponent.longSharpDist2 = 
-                               s_ir2mmLong((frame.data[2]<<8)|(frame.data[3]))/1000.0;
-                       orte->sharps_oponent.longSharpDist3 = 
-                               s_ir2mmLong((frame.data[4]<<8)|(frame.data[5]))/1000.0;
-                       orte->front_door.state = (frame.data[6]<<8)|frame.data[7];
-                       
-                       if(++adc1_cnt == 5) {
-                               ORTEPublicationSend(orte->publicationSharp1); 
-                               adc1_cnt = 0;
-                       }
-                       break;
-
-               /* short sharps */
-               case CAN_ADC_2:
-                       orte->sharps_waste.short1 = (frame.data[0]<<8)|(frame.data[1]);
-                       orte->sharps_waste.short2 = (frame.data[2]<<8)|(frame.data[3]);
-                       orte->sharps_waste.short3 = (frame.data[4]<<8)|(frame.data[5]);
-                       orte->sharps_waste.short4 = (frame.data[6]<<8)|(frame.data[7]);
-                       
-                       if(++adc2_cnt == 5) {
-                               ORTEPublicationSend(orte->publicationSharp2); 
-                               adc2_cnt = 0;
-                       }
-                       break;
-
-               /* sharps */
-               case CAN_ADC_3:
-                       orte->adcs.sharpLong1 = (frame.data[0]);
-                       orte->adcs.sharpLong2 = (frame.data[1]);
-                       orte->adcs.sharpLong3 = (frame.data[2]);
-                       orte->adcs.sharpShort1 = (frame.data[3]);
-                       orte->adcs.sharpShort2 = (frame.data[4]);
-                       orte->adcs.sharpShort3 = (frame.data[5]);
-                       orte->adcs.sharpShort4 = (frame.data[6]);
-                       orte->adcs.frontDoor = (frame.data[7]);
-                       
-                       if(++adc3_cnt == 5) {
-                               ORTEPublicationSend(orte->publicationAdcs);
-                               adc3_cnt = 0;
-                       }
-                       break;
-
-               /* IR inner sensors */
-               case CAN_IR:
-                       orte->inner_ir.front = frame.data[1];
-                       orte->inner_ir.back = frame.data[0]; 
-                       ORTEPublicationSend(orte->publicationIR);
-
-                       orte->dig_in.state = frame.data[2];
-                       if(++ir_cnt == 5) {
-                               ORTEPublicationSend(orte->publicationDI);
-                               ir_cnt = 0;
-                       }
-                       break;
-
-               /* laser data */
-               case CAN_LAS1:
-                       printf("CAN: ");
-                       for (i=0; i<frame.can_dlc; i++) {
-                               printf("0x%02x ", frame.data[i]);
-                       }
-                       printf("can_dlc=%d\n", frame.can_dlc);
-                       orte->laser.cnt = frame.data[1];
-                       las_bcnt = orte->laser.cnt;
-                       last_id = frame.data[0];
-                       las_di = 4;
-                       /* rotation period */
-                       orte->laser.period = (frame.data[2]<<8)|(frame.data[3]);
-                       printf("CAN ID=0x%02x: cnt=%d period=%d measures: ", 
-                                       frame.can_id, orte->laser.cnt, orte->laser.period);
-
-                       for (las_mi=0; las_mi<(frame.can_dlc-4)/2; las_mi++) {
-                               switch (las_mi) {
-                                       case 0: las_meas = &orte->laser.measures0; break;
-                                       case 1: las_meas = &orte->laser.measures1; break;
-                                       default: break;
-                               }
-                               *las_meas = 
-                                       (frame.data[las_di++]<<8)|(frame.data[las_di++]);
-                               printf("0x%02x 0x%02x %u ", 
-                                       frame.data[las_di-2], frame.data[las_di-1], *las_meas);
-                       }
-                       printf("\n");
-                       break;
-               case CAN_LAS2:
-               case CAN_LAS3:
-               case CAN_LAS4:
-                       printf("CAN: ");
-                       for (i=0; i<frame.can_dlc; i++) {
-                               printf("0x%02x ", frame.data[i]);
-                       }
-                       printf("can_dlc=%d\n", frame.can_dlc);
-                       printf("CAN ID=0x%02x: cnt=%d period=%d measures: ", 
-                               frame.can_id, orte->laser.cnt, orte->laser.period);
-                       if (frame.data[0] != (last_id+(frame.can_id-CAN_LAS1)))
-                               break;
-                       las_di = 2;
-                       while (las_di < 8 && las_bcnt > 0) {
-                               switch (las_mi) {
-                                       case 2: las_meas = &orte->laser.measures2; break;
-                                       case 3: las_meas = &orte->laser.measures3; break;
-                                       case 4: las_meas = &orte->laser.measures4; break;
-                                       case 5: las_meas = &orte->laser.measures5; break;
-                                       case 6: las_meas = &orte->laser.measures6; break;
-                                       case 7: las_meas = &orte->laser.measures7; break;
-                                       case 8: las_meas = &orte->laser.measures8; break;
-                                       case 9: las_meas = &orte->laser.measures9; break;
-                                       default: break;
-                               }
-                               *las_meas = 
-                                       (frame.data[las_di++]<<8)|(frame.data[las_di++]);
-                               printf("0x%02x 0x%02x %u ", 
-                                       frame.data[las_di-2], frame.data[las_di-1], *las_meas);
-                               las_mi++;
-                               las_bcnt--;
-                       }
-                       printf("\n");
-                       if (las_bcnt == 0) {
-                               printf("ORTEPublicationSend()\n");
-                               ORTEPublicationSend(orte->publicationLaser);
-                       }
-                       break;
-               default:
-//                     printf("received CAN msg with unknown id: %x\n",frame.can_id);
-                       break;
-       }
-}
-
-void rcv_servos_cb (const ORTERecvInfo *info, void *vinstance, 
-                       void *recvCallBackParam) 
-{
-       struct eb2007_orte_data *orte_data = (struct eb2007_orte_data *)recvCallBackParam;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       set_serva(orte_data);   
-                       break;
-               case DEADLINE:
-                       printf("ORTE deadline occurred - servo receive\n");
-                       break;
-       }
-}
-
-void rcv_motion_speed_cb(const ORTERecvInfo *info, void *vinstance, 
-                               void *recvCallBackParam)
-{
-       struct eb2007_orte_data *orte_data = (struct eb2007_orte_data *)recvCallBackParam;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       set_motor_speed(orte_data);
-                       /*printf("motor cmd received\n");*/
-                       break;
-               case DEADLINE:
-                       printf("motor cmd deadline occurred, stopping motors\n");
-                       orte_data->motion_speed.left = 0;
-                       orte_data->motion_speed.right = 0;
-                       set_motor_speed(orte_data);
-                       break;
-       }
-}
-
-int main(int argc, char *argv[])
-{
-       fd_set read_fd_set;
-       struct timeval timeout;
-       int ret;
-       int size;
-       int rv = 0;
-
-       struct eb2007_orte_data orte;
-       struct can_frame frame;
-
-       if (cand_init() < 0) {
-               printf("cand: init failed\n");
-               exit(1);
-       } else {
-               printf("cand: init OK\n");
-       }
-
-       orte.strength = 1;
-
-       /* orte initialization */
-       eb2007_roboorte_init(&orte);
-
-       /* creating publishers */
-       eb2007_publisher_motionstatus_create(&orte, NULL);
-       eb2007_publisher_position_create(&orte, NULL);
-       eb2007_publisher_fd_create(&orte, NULL);
-       eb2007_publisher_ir_create(&orte, NULL);
-       eb2007_publisher_sharpsouper_create(&orte, NULL);
-       eb2007_publisher_sharplahve_create(&orte, NULL);
-       eb2007_publisher_di_create(&orte, NULL);
-       eb2007_publisher_adecka_create(&orte, NULL);
-       eb2007_publisher_laser_create(&orte, NULL);
-
-       /* creating subscribers */
-       eb2007_subscriber_motor_create(&orte, rcv_motion_speed_cb);
-       eb2007_subscriber_serva_create(&orte, rcv_servos_cb);
-
-       /* main loop */
-       for(;;) {
-               FD_ZERO(&read_fd_set);
-               FD_SET(sock, &read_fd_set);
-               timeout.tv_sec = 0;
-               timeout.tv_usec = 10000;
-
-               ret = select(FD_SETSIZE, &read_fd_set, NULL, NULL, &timeout);
-               if (ret < 0) {
-                       perror("cand: select() error");
-                       goto err;
-               }
-
-               /* timeout expired, nothing to be done */
-                if (ret == 0)
-                        continue;
-
-                if (!FD_ISSET(sock, &read_fd_set))
-                        continue;
-
-               /* read data from SocketCAN */
-               size = read(sock, &frame, sizeof(struct can_frame));
-
-               /* parse data */
-               cand_parse_frame(&orte, frame);
-       }
-
-err:
-       close(sock);
-       return 1;
-out:
-       return EXIT_SUCCESS;
-}
diff --git a/src/cand/eb2007/cand_eb2007.h b/src/cand/eb2007/cand_eb2007.h
deleted file mode 100644 (file)
index 5b76a88..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * cand_eb2007.h                       08/04/07
- *
- * CAN daemon for the Eurobot 2007 competition.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#ifndef CAND_EB2007_H
-#define CAND_EB2007_H
-
-int sock;
-struct sockaddr_can can_addr;
-struct can_filter rfilter;
-struct ifreq can_ifreq;
-uint8_t last_id;
-
-/* unused */
-/* short int mL, mR;
-uint16_t las_data[12];
-uint16_t stateIR;
-uint8_t stateDI;
-uint16_t stateSharp1[4];
-uint16_t stateSharp2[4];
-uint8_t serva[8];*/
-
-/* function prototypes */
-/*short int convertShortInt(short int x);*/
-int can_send(canid_t id, unsigned char length, unsigned char *data);
-int set_motor_speed();
-int set_serva();
-
-#endif /* CAND_EB2007_H */
diff --git a/src/cand/eb2008/Makefile b/src/cand/eb2008/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/cand/eb2008/Makefile.omk b/src/cand/eb2008/Makefile.omk
deleted file mode 100644 (file)
index 3aced3d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- makefile -*-
-
-bin_PROGRAMS += cand_eb2008
-cand_eb2008_SOURCES = cand_eb2008.cc
-cand_eb2008_LIBS = pthread sharp roboorte_eb2008 roboorte_generic robottype robottype_eb2008 orte 
similarity index 100%
rename from src/canlog/cand_eb2008.h
rename to src/canlog/cand.h
index 0cd09ec904b3d1a42be7486fb806c9aa6ff6a847..010e1cca85f884ab2d01b60dadd2ea8b81c12b97 100644 (file)
@@ -26,7 +26,7 @@
 #include <can_msg_masks.h>
 #include <can_msg_def.h>
 #include <can_msg_masks.h>
-#include "cand_eb2008.h"
+#include "cand.h"
 #define CAN_SONAR 0x60
 int cand_init()
 {
index 4beed87c77862f8f04b543753cab5f6b0e80f549..273576b4b3c9c763fcd28b54ea2fcf6203c7ac53 100644 (file)
@@ -6,4 +6,4 @@ hokuyo_SOURCES = hokuyo.c
 
 include_HEADERS = hokuyo.h
 
-lib_LOADLIBES = pthread roboorte_generic robottype orte
+lib_LOADLIBES = pthread roboorte robottype orte
index 0995e5c139d152166e6c4a92877a1b9a1b1e15c5..8e91c55750f3bc8b1084b62b39c9c3245cef92cd 100644 (file)
 #include <string.h>
 #include "hokuyo.h"
 #include <robottype.h>
-#include <roboorte_generic.h>
+#include <roboorte_robottype.h>
 
 static FILE *dev;
 u_int16_t *scan;
-struct generic_orte_data gorte;
+struct robottype_orte_data orte;
 
 // SERIAL PORT RELATED FUNCTIONS
 
@@ -237,8 +237,8 @@ int hokuyo_init(char *device)
                return -1;
        }
 
-       generic_roboorte_init(&gorte);
-       generic_publisher_hokuyo_scan_create(&gorte, scan_publisher_callback, NULL);
+       robottype_roboorte_init(&orte);
+       robottype_publisher_hokuyo_scan_create(&orte, scan_publisher_callback, NULL);
 
        return 0;
 
index 47f1fe08fe79240e1aacedc38b6b372622701be5..fe858eeb6c15c9fd69a6af59181ee5000c52a3b5 100644 (file)
@@ -4,4 +4,4 @@ bin_PROGRAMS = joyd
 
 joyd_SOURCES = joyd.cc 
 
-joyd_LIBS = stdc++ pthread roboorte_generic robottype robottype_eb2008 orte
+joyd_LIBS = stdc++ pthread roboorte robottype orte
index 429f790b9bfb31e8b7cc5c6e44f91d47c6595620..aea047a9dee7c1b3f82b88e39a6844bd9598dd82 100644 (file)
 #include <time.h>
 #include <math.h>
 #include <signal.h>
-#include <roboorte_generic.h>
+#include <roboorte_robottype.h>
 
 #define JOY_DEV "/dev/input/js0"
 #define VMAX 16000
 
-struct generic_orte_data gorte;
+struct robottype_orte_data orte;
 int joy_fd;
 
 static void int_handler(int sig)
@@ -30,7 +30,7 @@ static void int_handler(int sig)
        printf("joyd stopping.\n");
 
        /* orte domain destroy */
-       generic_roboorte_destroy(&gorte);
+       robottype_roboorte_destroy(&orte);
 
        /* close file descriptor */
        close(joy_fd);
@@ -48,17 +48,17 @@ int main(int argc, char *argv[])
 
        signal(SIGINT, int_handler);
 
-       gorte.strength = 30;
+       orte.strength = 30;
 
        /* orte initialization */
-       if (generic_roboorte_init(&gorte)) {
+       if (robottype_roboorte_init(&orte)) {
                printf("Unable to initialize ORTE.\n");
                exit(1);
        }
 
        /* creating publishers */
-       generic_publisher_motion_speed_create(&gorte, NULL, &gorte);
-       generic_publisher_joy_data_create(&gorte, NULL, &gorte);
+       robottype_publisher_motion_speed_create(&orte, NULL, &orte);
+       robottype_publisher_joy_data_create(&orte, NULL, &orte);
        
        /* open joystick device */
        if((joy_fd=open(JOY_DEV, O_NONBLOCK))==-1) {
@@ -96,30 +96,30 @@ int main(int argc, char *argv[])
                                        break;
                        }
 
-                       gorte.joy_data.axisX = axis[0];
-                       gorte.joy_data.axisY = axis[1];
-                       gorte.joy_data.axisZ = axis[2];
-                       gorte.joy_data.axisR = axis[3];
-                       gorte.joy_data.axisS1 = axis[4];
-                       gorte.joy_data.axisS2 = axis[5];
-
-                       gorte.joy_data.button1 = button[0];
-                       gorte.joy_data.button2 = button[1];
-                       gorte.joy_data.button3 = button[2];
-                       gorte.joy_data.button4 = button[3];
-                       gorte.joy_data.button5 = button[4];
-                       gorte.joy_data.button6 = button[5];
-                       gorte.joy_data.button7 = button[6];
-                       gorte.joy_data.button8 = button[7];
-                       gorte.joy_data.button9 = button[8];
-                       gorte.joy_data.button10 = button[9];
-                       gorte.joy_data.button11 = button[10];
-                       gorte.joy_data.button12 = button[11];
+                       orte.joy_data.axisX = axis[0];
+                       orte.joy_data.axisY = axis[1];
+                       orte.joy_data.axisZ = axis[2];
+                       orte.joy_data.axisR = axis[3];
+                       orte.joy_data.axisS1 = axis[4];
+                       orte.joy_data.axisS2 = axis[5];
+
+                       orte.joy_data.button1 = button[0];
+                       orte.joy_data.button2 = button[1];
+                       orte.joy_data.button3 = button[2];
+                       orte.joy_data.button4 = button[3];
+                       orte.joy_data.button5 = button[4];
+                       orte.joy_data.button6 = button[5];
+                       orte.joy_data.button7 = button[6];
+                       orte.joy_data.button8 = button[7];
+                       orte.joy_data.button9 = button[8];
+                       orte.joy_data.button10 = button[9];
+                       orte.joy_data.button11 = button[10];
+                       orte.joy_data.button12 = button[11];
                        
 /*                     v = (double)(axis[0]/32768.0);// * 10000;
                        omega = (double)(axis[1]/32768.0);// * 10000;
-                       gorte.motion_speed.right = -(v + r*omega);
-                       gorte.motion_speed.left = v - r*omega;*/
+                       orte.motion_speed.right = -(v + r*omega);
+                       orte.motion_speed.left = v - r*omega;*/
                        v = (double)axis[1]/32768.0;
                        omega = (double)axis[0]/32768.0;
                        lenght = sqrt( pow(v,2) + pow(omega,2));
@@ -131,20 +131,20 @@ int main(int argc, char *argv[])
                                omega = cos(angle);
                        }
                        omega *= 2;
-                       gorte.motion_speed.right = (int)(-((v + r*omega))*VMAX);
-                       gorte.motion_speed.left = (int)(-(v - r*omega)*VMAX);
-                       printf("gorte.motion_speed.left=%d, gorte.motion_speed.right=%d\n",
-                                       gorte.motion_speed.left,gorte.motion_speed.right);
+                       orte.motion_speed.right = (int)(-((v + r*omega))*VMAX);
+                       orte.motion_speed.left = (int)(-(v - r*omega)*VMAX);
+                       printf("orte.motion_speed.left=%d, orte.motion_speed.right=%d\n",
+                                       orte.motion_speed.left,orte.motion_speed.right);
                        printf("v %f, omega %f\n",v, omega);//#endif
                        printf("length %f, angle %f\n",lenght, angle);//#endif
                        printf("axisX %d, axisY %d\n",axis[0], axis[1]);//#endif
 
-                       ORTEPublicationSend(gorte.publication_motion_speed);                    
-                       ORTEPublicationSend(gorte.publication_joy_data);
+                       ORTEPublicationSend(orte.publication_motion_speed);                     
+                       ORTEPublicationSend(orte.publication_joy_data);
                        
                }
-               ORTEPublicationSend(gorte.publication_motion_speed);                    
-               ORTEPublicationSend(gorte.publication_joy_data);
+               ORTEPublicationSend(orte.publication_motion_speed);                     
+               ORTEPublicationSend(orte.publication_joy_data);
                nanosleep(&timer,NULL);
                
 /*             printf( "X: %6d  Y: %6d  ", axis[0], axis[1] ); */
index 22c069d59cd5704c32f9d101b5cc35bdef256256..c4e5e0d82a6751316070e5d2c5e26fb600738119 100644 (file)
@@ -17,7 +17,7 @@
 #include <math.h>
 #include <robomath.h>
 #include <string.h>
-#include <robodim_eb2008.h>
+#include <robodim.h>
 #include "mcl.h"
 
 #ifdef MATLAB_MEX_FILE
index 864414e7e058da6c845dd6f08f44d39e8f4a3f87..e69609366389f0f16124d707f89e566374d85c8e 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <mcl.h>
 #include <mcl_robot.h>
-#include <robodim_eb2008.h>
+#include <robodim.h>
 #include <stdint.h>
 
 #define mcl_to_laser(mcl) (struct mcl_laser*)((mcl)->priv)
index 6f76c392b0f8f17ccdc61e9787a96c1b5f489040..cefeb25a1d0d461d6c0d7bae950c020effded583 100644 (file)
@@ -2,5 +2,5 @@
 
 test_PROGRAMS += testmcl_performance
 testmcl_performance_SOURCES = testmcl_performance.c
-testmcl_performance_LIBS = mcl shist robomath m rt robodim_eb2008
+testmcl_performance_LIBS = mcl shist robomath m rt robodim
 
index c32274b4ced43554a321f41e8d02aaebb5de4198..386108c170a825d3fa0377a01072f7dc4e41afd7 100644 (file)
@@ -16,7 +16,7 @@
 #include <mcl_laser.h>
 #include <math.h>
 #include <robomath.h>
-#include <robodim_eb2007.h>
+#include <robodim.h>
 #include <shist.h>
 
 #define TEST_COUNT 500
index f89a8c8be0c630d4878be1e1f87636027e861000..b6639c2243f1833a957987540a2ce475ae294923 100644 (file)
@@ -1,5 +1,6 @@
 # -*- makefile -*-
 #  Robot's ORTE library
 
-SUBDIRS = eb2007 eb2008
-
+include_HEADERS = robodim.h
+lib_LIBRARIES = robodim
+robodim_SOURCES = robodim.c
diff --git a/src/robodim/eb2007/Makefile b/src/robodim/eb2007/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/robodim/eb2007/Makefile.omk b/src/robodim/eb2007/Makefile.omk
deleted file mode 100644 (file)
index 2d3cc84..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# -*- makefile -*-
-
-include_HEADERS = robodim_eb2007.h
diff --git a/src/robodim/eb2007/robodim_eb2007.h b/src/robodim/eb2007/robodim_eb2007.h
deleted file mode 100644 (file)
index 15427f3..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * robodim_eb2007.h                    07/08/01
- *
- * Dimensions for the robot, playground and other stuffs.
- * Eurobot 2007
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#ifndef ROBODIM_EB2007_H
-#define ROBODIM_EB2007_H
-
-/**
- * ROBOT DIMENSIONS 
- *
- *          +--------------------------+
- *        ^ |   |     |                |---|
- *     ^  | |   -------    ABE         |   |
- *   RR|  | |      :<--------------------->|
- *     v  | |      :                   |   |
- *       W| |      + Center  (L)       |   |
- *        | |  AB  :       AF          |   |
- *        | |<---->:<----------------->|   |
- *        | |   -------                |   |
- *        v |   |     |                |---|
- *          +--------------------------+
- *                 <-->
- *                  WR
- */
-
-#define ROBOT_WIDTH_MM 290     /* W*/
-#define ROBOT_WIDTH_M (ROBOT_WIDTH_MM/1000.0)
-#define ROBOT_ROTATION_RADIUS_MM (254/2) /* R*/
-#define ROBOT_ROTATION_RADIUS_M (ROBOT_ROTATION_RADIUS_MM/1000.0)
-#define LASER_CENTER_OFFSET_MM 50 /*FIXME*/ /* Distance of the laser from rotation axis (Center to L) */
-#define LASER_CENTER_OFFSET_M (LASER_CENTER_OFFSET_MM/1000.0)
-#define ROBOT_WHEEL_RADIUS_MM 40 /* WR */
-#define ROBOT_WHEEL_RADIUS_M (ROBOT_WHEEL_RADIUS_MM/1000.0)
-#define ROBOT_AXIS_TO_BACK_MM 75 /* AB */
-#define ROBOT_AXIS_TO_BACK_M (ROBOT_AXIS_TO_BACK_MM/1000.0)
-#define ROBOT_AXIS_TO_FRONT_MM 183 /* AF */
-#define ROBOT_AXIS_TO_FRONT_M (ROBOT_AXIS_TO_FRONT_MM/1000.0)
-#define ROBOT_AXIS_TO_BELT_MM 280 /* ABE */
-#define ROBOT_AXIS_TO_BELT_M (ROBOT_AXIS_TO_BELT_MM/1000.0)
-
-
-/**
- * PLAYGROUND DIMENSIONS
- * 
- *           D=S2           F            C=R3
- *            +-------------+-------------+
- *        ^   |                           |
- *        |   |                           |
- *        |   |             +H            |
- *        |   |                           |
- *        |   |                           |
- *      H | R1+                           +L=S1
- *        | =K|                           |
- *        |   |                    +r     |
- *        |   |             +G            |
- *        |   |                           |
- *        v   |                           |
- *            +-------------+-------------+
- *           A=S3           E            B=R2
- *             <------------------------->
- *                          W
- *
- * Fixed points (known points) [x,y]
- *     A - [0,0]
- *     B - [width,0]
- *     C - [width,height]
- *     D - [0,height]
- *     E - [width/2,0]
- *     F - [width/2,height]
- *     G - [width/2,height/4]
- *     H - [width/2,height/4*3]
- *     K - [0,height/2]
- *     L - [width,height/2]
- *   Our reflectors
- *     R1, R2, R3
- *   Opponent`s reflectors
- *     S1, S2, S3
- *
- * Unknown point
- *     r - Position of the robot
- *
- * Angles:
- *     theta1 = from robot`s head to the first reflector
- *     theta2 = from robot`s head to the second reflector
- *     theta3 = from robot`s head to the third reflector
- *     alfa = angle R3-r-R2 (S2-r-S3)
- *     beta = angle R1-r-R3 (S3-r-S1)
- *     gama = angle R1-r-R2 (S1-r-S2)
- *
- * Angle`s sense - counterclockwise
- *
- */
-#define PLAYGROUND_WIDTH_MM    3000
-#define PLAYGROUND_WIDTH_M     (PLAYGROUND_WIDTH_MM/1000.0)
-#define PLAYGROUND_HEIGHT_MM   2100
-#define PLAYGROUND_HEIGHT_M    (PLAYGROUND_HEIGHT_MM/1000.0)
-
-#endif /* ROBODIM_EB2007_H */
diff --git a/src/robodim/eb2008/Makefile b/src/robodim/eb2008/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/robodim/eb2008/Makefile.omk b/src/robodim/eb2008/Makefile.omk
deleted file mode 100644 (file)
index c410562..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- makefile -*-
-
-include_HEADERS = robodim_eb2008.h
-lib_LIBRARIES = robodim_eb2008
-robodim_eb2008_SOURCES = robodim_eb2008.c
similarity index 97%
rename from src/robodim/eb2008/robodim_eb2008.c
rename to src/robodim/robodim.c
index da45549b4a88d12780c8b095447cb22ce168cf58..972ad6f3cf7094d77544903d4b1852d00393884f 100644 (file)
@@ -1,4 +1,4 @@
-#include "robodim_eb2008.h"
+#include "robodim.h"
 #include <robomath.h>
 
 /* Beacon positions. For some version of MCL, this must be sorted in
index 23762cc522f88e66296c78529b5db8619e36b126..28b281d5b32745614fac5509079edab0e46632c4 100644 (file)
@@ -1,3 +1,35 @@
 # -*- makefile -*-
 
-SUBDIRS = eb2008 utils
+SUBDIRS = utils test
+
+default_CONFIG = CONFIG_OPEN_LOOP=n CONFIG_LOCK_CHECKING=n
+
+config_include_HEADERS = robot_config.h
+robot_config_DEFINES = CONFIG_OPEN_LOOP CONFIG_LOCK_CHECKING
+
+bin_PROGRAMS += robomain
+robomain_SOURCES = main.cc fsmmain.c
+
+# Library with general support functions for the robot
+lib_LIBRARIES += robot
+robot_SOURCES = robot_orte.c servos.c robot.c fsmmove.cc fsmjoy.c      \
+               movehelper.cc fsmdisplay.c fsmloc.c map_handling.c
+robot_GEN_SOURCES = roboevent.c
+include_GEN_HEADERS += roboevent.h
+
+include_HEADERS += robot.h servos.h movehelper.h robot_orte.h
+
+# Libraries linked to all programs in this Makefile
+lib_LOADLIBES = robot mcl robomath roboorte robottype robottype                \
+               pthread rt m orte pathplan sharp map fsm uoled oledlib  \
+               rbtree motion robodim sercom
+
+# Automatic generation of event definition files
+include-pass_HOOKS = roboevent.c roboevent.h
+
+roboevent.c roboevent.h: $(SOURCES_DIR)/roboevent.py $(SOURCES_DIR)/../fsm/eventgen.py
+       @$(QUIET_CMD_ECHO) "  EVENTGEN roboevent"
+       $(Q)python $(SOURCES_DIR)/../fsm/eventgen.py $<
+
+clean-custom:
+       $(Q)rm -f roboevent.c roboevent.h
diff --git a/src/robofsm/eb2007/Makefile b/src/robofsm/eb2007/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/robofsm/eb2007/Makefile.omk b/src/robofsm/eb2007/Makefile.omk
deleted file mode 100644 (file)
index bf89cb4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- makefile -*-
-
-SUBDIRS = test
-
-default_CONFIG = CONFIG_OPEN_LOOP=n
-LOCAL_CONFIG_H = robot_config.h
-
-bin_PROGRAMS += robomain
-robomain_SOURCES = fsmmain.cc
-
-# Library with general support functions for the robot
-lib_LIBRARIES += robot_eb2007
-robot_eb2007_SOURCES = servos_eb2007.c robot_eb2007.c roboorte.c \
-                      fsmmove.cc fsmpickup.c fsmdet.c fsmjoy.c fsmloc.c \
-               movehelper_eb2007.cc 
-robot_eb2007_GEN_SOURCES = roboevent_eb2007.c
-include_GEN_HEADERS += roboevent_eb2007.h
-
-include_HEADERS += robot_eb2007.h servos_eb2007.h movehelper_eb2007.h
-
-# Libraries linked to all programs in this Makefile
-lib_LOADLIBES = robot_eb2007 mcl laser-nav robomath robottype robottype_eb2007 pthread \
-               rt m orte pathplan sharp map fsm rbtree motion
-
-# Automatic generation of event definition files
-include-pass_HOOKS = roboevent_eb2007.c roboevent_eb2007.h
-
-roboevent_eb2007.c roboevent_eb2007.h: $(SOURCES_DIR)/roboevent_eb2007.py $(SOURCES_DIR)/../../fsm/eventgen.py
-       @$(QUIET_CMD_ECHO) "  EVENTGEN roboevent"
-       $(Q)python $(SOURCES_DIR)/../../fsm/eventgen.py $<
-
-clean-custom:
-       $(Q)rm -f roboevent_eb2007.c roboevent_eb2007.h
diff --git a/src/robofsm/eb2007/fsmdet.c b/src/robofsm/eb2007/fsmdet.c
deleted file mode 100644 (file)
index 4cae1a2..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * detfsm.c                    07/04/20
- *
- * Finite state machine of the detection part.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#define FSM_DETECT
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <fsm.h>
-#include <movehelper_eb2007.h>
-#include <servos_eb2007.h>
-#include <math.h>
-
-#define WASTE_STACK_EMPTYm             0xe0
-#define WASTE_INNER_STACK_BOTTLE1      0x1e
-#define WASTE_INNER_STACK_BOTTLE2      0x0f
-
-#define CLOSE_LIMIT 850
-#define FAR_LIMIT 650
-
-#define VMAX 0.5;
-//#define JOYSTICK_NAV 1
-#define R 0.15
-
-void evaluate_distance(uint16_t value, uint8_t *result) {
-       if((value > CLOSE_LIMIT)) *result = CLOSE;
-       else if((value >= FAR_LIMIT)&&(value < CLOSE_LIMIT)) *result = FAR;
-       else if(value < FAR_LIMIT) *result = NOTHING;
-}
-
-FSM_STATE_DECL(det_start);
-FSM_STATE_DECL(det_scan);
-
-FSM_STATE(det_start) {
-       FSM_TIMER(100);
-//     if(robot.start) {
-       FSM_SIGNAL(MAIN, EV_START, NULL);
-               FSM_TRANSITION(det_scan);
-//     }
-}
-
-FSM_STATE(det_scan) {
-
-//     ROBOT_LOCK();
-       
-       robot.waste_cnt = 0;
-/*     if(robot.sharpsWaste.short1 > VERY_FAR_LIMIT) robot.waste_cnt++;
-       if(robot.sharpsWaste.short2 > VERY_FAR_LIMIT) robot.waste_cnt++;
-       if(robot.sharpsWaste.short3 > VERY_FAR_LIMIT) robot.waste_cnt++;
-       if(robot.sharpsWaste.short4 > VERY_FAR_LIMIT) robot.waste_cnt++;*/
-       
-//     printf("waste_cnt=%d\n",robot.waste_cnt);
-       
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       FSM_TIMER(100);
-                       break;
-               case EV_TIMER:
-                       FSM_TIMER(100);
-                       //printf("EVENT_STATE_ENTERED - pickup ready\n");
-                       if(robot.waste_cnt) {
-                               evaluate_distance(robot.sharpsWaste.short1, &robot.bott_sens.sens1);
-                               evaluate_distance(robot.sharpsWaste.short2, &robot.bott_sens.sens2);
-                               evaluate_distance(robot.sharpsWaste.short3, &robot.bott_sens.sens3);
-                               evaluate_distance(robot.sharpsWaste.short4, &robot.bott_sens.sens4);
-                               
-                               FSM_SIGNAL(MAIN, EV_DETECTED_BOTTLE, NULL);
-                               break;
-                       }
-                       
-               // parsing joy buttons
-
-                       if(robot.joy.button1 == 1) innerTransporterStop();
-                       if(robot.joy.button2 == 1) frontTransporterStop();
-                       if(robot.joy.button3 == 1) frontDoorDown();
-                       if(robot.joy.button4 == 1) frontTransporterBackward();
-                       if(robot.joy.button5 == 1) frontDoorUp();
-                       if(robot.joy.button6 == 1) frontTransporterForward();
-                       if(robot.joy.button7 == 1) innerDoorDown();
-                       if(robot.joy.button8 == 1) innerDoorUp();
-                       if(robot.joy.button9 == 1) backDoorDown();
-                       if(robot.joy.button10 == 1) backDoorUp();
-                       if(robot.joy.button11 == 1) innerTransporterLeft();
-                       if(robot.joy.button12 == 1) innerTransporterRight();
-
-#ifdef JOYSTICK_NAV                                            // if joystick is used for navigating
-                       v = (double)robot.joy.axisY/32768;
-                       omega = (double)robot.joy.axisX/32768;
-                       lenght = sqrt( pow(v,2) + pow(omega,2));
-                       if (lenght >= 1)                // If lenght si more than 1 is used unit circle
-                       {
-                               angle = tan2(robot.joy.axisX/robot.joy.axisY);  // computing new speed and omega
-                               v = sin(angle);
-                               omega = cos(angle);
-                       }
-                       
-                       speedL = (v - R*omega)*VMAX;
-                       speedR = -(v + R*omega)*VMAX;
-                       robot_send_speed(speedL, speedR);       // forcing speed command 
-                       printf("v %f, omega %f\n",v, omega);//#endif
-                       printf("length %f, angle %f\n",lenght, angle);//#endif
-                       printf("axisX %d, axisY %d\n",robot.joy.axisX, robot.joy.axisY);//#endif
-                       printf("sent speed: %f, %f\n",speedL, speedR);//#endif
-#endif
-                       break;
-               default:
-                       DBG_PRINT_EVENT("Unhandled event:");
-       }       
-       
-//     ROBOT_UNLOCK();
-}
-
-/*
-               // definovat nove ev na joy
-       EV_JOY_B0
-       EV_JOY_B1               
-       EV_JOY_B2
-       EV_JOY_B0
-       EV_JOY_B4
-       EV_JOY_B5
-       EV_JOY_B6
-       EV_JOY_B7
-       EV_JOY_B8
-       EV_JOY_B9
-       EV_JOY_B10
-       EV_JOY_B11
-
-
-
-*/
diff --git a/src/robofsm/eb2007/fsmjoy.c b/src/robofsm/eb2007/fsmjoy.c
deleted file mode 100644 (file)
index e14da76..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * fsmjoy.c                    07/10/11
- *
- * Finite state machine of the joystick control.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#define FSM_JOYSTICK
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <fsm.h>
-#include <movehelper_eb2007.h>
-#include <servos_eb2007.h>
-#include <math.h>
-
-#define CLOSE_LIMIT 850
-#define FAR_LIMIT 650
-
-#define VMAX 0.5;
-#define R 0.15
-
-//#define JOYSTICK_NAV
-
-FSM_STATE_DECL(joy_init);
-FSM_STATE_DECL(joy_scan);
-
-FSM_STATE(joy_init) {
-       printf("joystick control initialization\n");
-       FSM_TRANSITION(joy_scan);
-}
-
-FSM_STATE(joy_scan) {
-
-       FSM_TIMER(100);
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       break;
-               case EV_TIMER:
-                       if(robot.joy.button1 == 1) innerTransporterStop();
-                       if(robot.joy.button2 == 1) frontTransporterStop();
-                       if(robot.joy.button3 == 1) frontDoorDown();
-                       if(robot.joy.button4 == 1) frontTransporterBackward();
-                       if(robot.joy.button5 == 1) frontDoorUp();
-                       if(robot.joy.button6 == 1) frontTransporterForward();
-                       if(robot.joy.button7 == 1) innerDoorDown();
-                       if(robot.joy.button8 == 1) innerDoorUp();
-                       if(robot.joy.button9 == 1) backDoorDown();
-                       if(robot.joy.button10 == 1) backDoorUp();
-                       if(robot.joy.button11 == 1) innerTransporterLeft();
-                       if(robot.joy.button12 == 1) innerTransporterRight();
-
-#ifdef JOYSTICK_NAV                                            // if joystick is used for navigating
-                       v = (double)robot.joy.axisY/32768;
-                       omega = (double)robot.joy.axisX/32768;
-                       lenght = sqrt( pow(v,2) + pow(omega,2));
-                       if (lenght >= 1)                // If lenght si more than 1 is used unit circle
-                       {
-                               angle = tan2(robot.joy.axisX/robot.joy.axisY);  // computing new speed and omega
-                               v = sin(angle);
-                               omega = cos(angle);
-                       }
-                       
-                       speedL = (v - R*omega)*VMAX;
-                       speedR = -(v + R*omega)*VMAX;
-                       robot_send_speed(speedL, speedR);       // forcing speed command 
-                       printf("v %f, omega %f\n",v, omega);//#endif
-                       printf("length %f, angle %f\n",lenght, angle);//#endif
-                       printf("axisX %d, axisY %d\n",robot.joy.axisX, robot.joy.axisY);//#endif
-                       printf("sent speed: %f, %f\n",speedL, speedR);//#endif
-#endif
-                       break;
-               default:
-                       DBG_PRINT_EVENT("Unhandled event:");
-       }       
-}
-
-/*
-       // definovat nove ev na joy
-       EV_JOY_B0
-       EV_JOY_B1               
-       EV_JOY_B2
-       EV_JOY_B0
-       EV_JOY_B4
-       EV_JOY_B5
-       EV_JOY_B6
-       EV_JOY_B7
-       EV_JOY_B8
-       EV_JOY_B9
-       EV_JOY_B10
-       EV_JOY_B11
-*/
diff --git a/src/robofsm/eb2007/fsmloc.c b/src/robofsm/eb2007/fsmloc.c
deleted file mode 100644 (file)
index 5838b3e..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- *  @(#)locfsm.c               07/04/19
- *
- * Finite state machine of the localization part.
- *
- * Copyright   : (c) 2007 CTU Dragons
- *               CTU FEE - Department of Control Engineering
- * Contacts    : Tran Duy Khanh <trandk1@fel.cvut.cz>
- * License     : GNU GPL v.2
- */
-
-#define FSM_LOC
-#include <math.h>
-#include <robomath.h>
-#include <laser-nav.h>
-#include <mcl.h>
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <fsm.h>
-
-/* FIXME: not used, need to updated with the new mcl api */
-
-// struct mcl_particle cal_pos;
-// void loc_pln_update();
-// int loc_mcl_update(struct mcl_model *mcl, double dx, double dy, double dangle);
-// void dbg_print_parts();
-
-FSM_STATE_DECL(loc_init);
-// FSM_STATE_DECL(loc_run);
-// FSM_STATE_DECL(loc_mcl_init);
-// FSM_STATE_DECL(loc_update);
-
-/**
- * FSM state: firste state. Initilization.
- */
-FSM_STATE(loc_init)
-{
-       /* set reference points. Used to calculate position of the robot
-        * using laser */
-//     pln_set_points();
-//     FSM_TIMER(1000);
-//     FSM_TRANSITION(loc_mcl_init);
-}
-
-// /**
-//  * FSM state: MCL initialization.
-//  */
-// FSM_STATE(loc_mcl_init)
-// {
-//     struct mcl_model *mcl = (struct mcl_model *)&robot.mcl;
-// 
-//     /* playground size */
-//     mcl->width = PLAYGROUND_WIDTH_MM;
-//     mcl->height = PLAYGROUND_HEIGHT_MM;
-// 
-//     /* the noises */
-//     mcl->gen_dnoise = 0.99;         /* distance noise */
-//     mcl->gen_anoise = DEGREES(10);  /* angle noise */
-//     mcl->mov_dnoise = 1.1;
-//     mcl->mov_anoise = 2.0;
-//     mcl->w_min = 0.25;
-//     mcl->w_max = 2.0;
-//     mcl->eval_sigma = 0.5;
-//     mcl->maxavdist = 50;
-//     mcl->maxnoisecycle = 10;        /* bad cycles before reseting */
-// 
-//     /* amount of particles */
-//     mcl->count = 5000;
-//     mcl->parts = (struct mcl_particle *)
-//                     malloc(sizeof(struct mcl_particle)*mcl->count);
-// 
-//     /* measured data */
-//     mcl->data = 
-// 
-//     /* phases of the MCL */
-//     mcl->init = mcl_init;
-//     mcl->move = mcl_move;
-//     mcl->update = mcl_update;
-//     mcl->normalize = mcl_normalize;
-//     mcl->sort = mcl_partsort;
-//     mcl->resample = mcl_resample;
-// 
-//     /* cycles of enumeration */
-//     mcl->cycle = 0;
-//     mcl->noisecycle = 0;
-// 
-//     /* generate particles with noises */
-//     mcl->init(mcl);
-// //  printf("loc_mcl_init: done\n");
-// 
-//     /* change flag */
-//     mcl->flag = MCL_RUN;
-// 
-//     /* print generated particles */
-//     /*dbg_print_parts();*/
-// 
-//     FSM_TRANSITION(loc_run);
-// }
-// 
-// /**
-//  * FSM state: main state. Every state will return back to this one.
-//  */
-// FSM_STATE(loc_run)
-// {
-// //  DBG_PRINT_EVENT("loc_run event:");
-// 
-// //  FSM_TIMER(1000);
-//     switch (FSM_EVENT) {
-//             case EV_LOC_INIT:
-//                     /*DBG_PRINT_EVENT("mcl_init event:");*/
-//                     FSM_TRANSITION(loc_mcl_init);
-//                     break;
-// //          case EV_TIMEOUT:
-// //                  DBG_PRINT_EVENT("timeout event:");
-// //                  break;
-//             case EV_LOC_LOCATE:
-//             case EV_LASER_RECEIVED:
-//                     SUBFSM_TRANSITION(loc_update);
-//                     break;
-//             default:
-//                     /*DBG_PRINT_EVENT("loc_run:unhandled event:");*/
-//                     ;
-//     }
-// }
-// 
-// /**
-//  * FSM state: update estimated position. Calculate position from measured 
-//  *          times, then continue updating the mcl.
-//  */
-// FSM_STATE(loc_update)
-// {
-//     int dx, dy, dangle;
-//     int rv;
-// 
-// //  DBG_PRINT_EVENT("loc_update:");
-// 
-//     /* FIXME: here should be data from the odometry */
-//     ROBOT_LOCK(act_pos);
-//     dx = 1.0;
-//     dy = 1.0;
-//     dangle = 0.0;
-//     ROBOT_UNLOCK(act_pos);
-// 
-//     /* calculate measured position */
-//     loc_pln_update();
-// 
-//     /* update mcl with measured position */
-// //          rv = loc_mcl_update(&robot.mcl, (double)dx, (double)dy, (double)dangle);
-// 
-// //  /* send update signal if mcl update has finished successful */
-// //  if (!rv)
-// //          FSM_SIGNAL(MOTION, EV_LOC_UPDATED);
-// //  else {
-// //          printf("MCL_RESET: LOST!\n");
-// //          FSM_SIGNAL(MOTION, EV_LOC_LOST);
-// //  }
-// 
-//     SUBFSM_RET();
-// }
-// 
-// /**
-//  * Calculated position from measured times.
-//  */
-// void loc_pln_update()
-// {
-//     struct pln_pos_state _act_pos;
-//     struct pln_pos_state _cal_pos;
-//     unsigned int times[LAS_CNT], cnt;
-//     int i;
-// 
-//     /* measured times from laser beacon */
-//     ROBOT_LOCK(laser_recv);
-//     /* FIXME: just a hack, until the laser will 
-//      * work correctly */
-// //  robot.laser_recv.cnt = 5;
-// //  robot.laser_recv.period = 54619;
-// //  robot.laser_recv.measures0 = 1714;
-// //  robot.laser_recv.measures1 = 12312;
-// //  robot.laser_recv.measures2 = 34549;
-// //  robot.laser_recv.measures3 = 41231;
-// //  robot.laser_recv.measures4 = 49670;
-// 
-//     cnt = robot.laser_recv.cnt + 1;
-//     times[0] = robot.laser_recv.period;
-//     times[1] = robot.laser_recv.measures0;
-//     times[2] = robot.laser_recv.measures1;
-//     times[3] = robot.laser_recv.measures2;
-//     times[4] = robot.laser_recv.measures3;
-//     times[5] = robot.laser_recv.measures4;
-//     times[6] = robot.laser_recv.measures5;
-//     times[7] = robot.laser_recv.measures6;
-//     times[8] = robot.laser_recv.measures7;
-//     times[9] = robot.laser_recv.measures8;
-//     times[10] = robot.laser_recv.measures9;
-//     ROBOT_UNLOCK(laser_recv);
-// 
-//     printf("\n");
-//     printf("cnt=%d period=%d measures: ", 
-//             robot.laser_recv.cnt, robot.laser_recv.period);
-//     printf("times:");
-//     for (i=1; i<cnt; i++)
-//             printf("%d ", times[i]);
-//     printf("\n");
-// 
-//     /* actual position */
-//     ROBOT_LOCK(act_pos);
-//     _act_pos.x = robot.act_pos.x * 1000;
-//     _act_pos.y = robot.act_pos.y * 1000;
-//     _act_pos.head = robot.act_pos.phi;
-//     ROBOT_UNLOCK(act_pos);
-//     /* FIXME: this stays here just until the odometry will be done */
-// //  _act_pos.x = 2000;
-// //  _act_pos.y = 1950;
-// //  _act_pos.head = DEG2RAD(0);
-// //  printf("act: x=%f y=%f h=%f\n", _act_pos.x, _act_pos.y, _act_pos.head);
-// 
-//     /* calculated measured position */
-//     pln_cal_position(times, cnt, _act_pos, &_cal_pos);
-//     printf("calculated posititon: [x=%f,y=%f]\n", _cal_pos.x, _cal_pos.y);
-// 
-//     /* set currently calculated position */
-//     /* FIXME: remove this when the mcl is used */
-//     ROBOT_LOCK(est_pos);
-//     robot.est_pos.x = _cal_pos.x / 1000;
-//     robot.est_pos.y = _cal_pos.y / 1000;
-//     robot.est_pos.phi = _cal_pos.head;
-//     ROBOT_UNLOCK(est_pos);
-// 
-//     cal_pos.x = _cal_pos.x;
-//     cal_pos.y = _cal_pos.y;
-//     cal_pos.angle = _cal_pos.head;
-// }
-// 
-// /**
-//  * Move the particles and the robot by a specified distance. 
-//  *
-//  * @param  mcl              the MCL model
-//  * @param  dx               movement in axis X
-//  * @param  dy               movement in axis Y
-//  * @param  dangle   turning
-//  */
-// int loc_mcl_update(struct mcl_model *mcl, double dx, double dy, double dangle)
-// {
-//     struct mcl_particle est_pos;
-// 
-//     mcl->cycle++;
-// //  printf("loc_mcl_update: cycle = %d\n", mcl->cycle);
-// 
-//     /* move particles */
-//     mcl->move(mcl, dx, dy, dangle);
-// 
-//     /* update particles with calculated position from measured times */
-//     mcl->update(mcl, cal_pos.x, cal_pos.y, cal_pos.angle);
-// 
-//     /* we got lost, reset mcl */
-//     if (mcl->flag == MCL_RESET)
-//             return 1;
-// 
-//     mcl->normalize(mcl);
-//     mcl->sort(mcl);
-//     mcl->resample(mcl);
-//     est_pos = mcl_get_pos(mcl);
-// 
-//     /* estimated position in meter */
-//     ROBOT_LOCK(est_pos);
-//     robot.est_pos.x = est_pos.x / 1000;
-//     robot.est_pos.y = est_pos.y / 1000;
-//     robot.est_pos.phi = est_pos.angle;
-//     ROBOT_UNLOCK(est_pos);
-// 
-// //  printf("estimated position: %f %f %f %f\n", 
-// //          est_pos.x, est_pos.y, est_pos.angle, est_pos.weight);
-// 
-//     return 0;
-// }
-// 
-// /* Debug prints */
-// void dbg_print_parts()
-// {
-//     int i;
-// 
-//     for (i=0; i<robot.mcl.count; i++)
-//             printf("%d) x=%f y=%f a=%f w=%f\n", 
-//                     i,
-//                     ((struct mcl_particle *)(robot.mcl.parts))[i].x,
-//                     ((struct mcl_particle *)(robot.mcl.parts))[i].y,
-//                     ((struct mcl_particle *)(robot.mcl.parts))[i].angle,
-//                     ((struct mcl_particle *)(robot.mcl.parts))[i].weight);
-//     printf("robot: x=%f y=%f angle=%f\n",
-//             ((struct mcl_particle *)(robot.mcl.system))->x,
-//             ((struct mcl_particle *)(robot.mcl.system))->y,
-//             ((struct mcl_particle *)(robot.mcl.system))->angle);
-// 
-// }
diff --git a/src/robofsm/eb2007/fsmmain.cc b/src/robofsm/eb2007/fsmmain.cc
deleted file mode 100644 (file)
index fdeeef0..0000000
+++ /dev/null
@@ -1,1043 +0,0 @@
-/*
- * fsmmain.cc                  07/10/01
- *
- * Robot's main control program (tested in Saint Peterburg).
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-/**
- * TODO: 
- *     test enemy ahead (sharp distance)
- *     test enemy avoidance
- */
-#define FSM_MAIN
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <fsm.h>
-#include <unistd.h>
-#include <servos_eb2007.h>
-#include <math.h>
-#include "trgen.h"
-#include <movehelper_eb2007.h>
-#include <map.h>
-#include <sharp.h>
-#include <robomath.h>
-
-/* TODO: define this macro for the competition */
-#undef COMPETITION
-#ifdef COMPETITION
-#define WAIT_FOR_START
-#define STACK_SIZE_DEFAULT             1
-#define COMPETITION_TIME_DEFAULT       90
-#define WAIT_FOR_DEPOSITION_DEFAULT    60
-#define USE_WALL_TO_ALIGN
-#else
-#undef WAIT_FOR_START
-#define STACK_SIZE_DEFAULT             3
-#define COMPETITION_TIME_DEFAULT       900
-#define WAIT_FOR_DEPOSITION_DEFAULT    60
-#define USE_WALL_TO_ALIGN
-#endif
-
-/* competition time in seconds */
-#define COMPETITION_TIME       COMPETITION_TIME_DEFAULT
-/* competition time in seconds */
-#define WAIT_FOR_DEPOSITION    WAIT_FOR_DEPOSITION_DEFAULT
-/* maximal number of bottles before the deposition */
-#define STACK_SIZE             STACK_SIZE_DEFAULT
-
-/**
- * Time constants.
- */
-/* time before stopping the deposition belt resp. closing the back door */
-#define DEPOSITE_WAIT          1000
-/* the same as above, but we need to wait a little bit longer for the last one*/
-#define LAST_DEPOSITE_WAIT     1500
-/* time before closing the inner door */
-#define WASTE_ROLL_OUT_WAIT    1000
-/* time before another pickup */
-#define NEW_PICK_UP_WAIT       1000
-/* waste detection period */
-#define WASTE_DETECTION_PERIOD 100
-
-#define GOTO_BASKET_MAX_ATTEMPTS       5
-#define ENEMY_AVOIDANCE_MAX_ATTEMPTS   5
-
-struct act_pos_type des_pos;
-int goto_basket_attempt_cnt = 0; 
-int enemy_avoidance_attempt_cnt = 0;
-int no_align = 0;
-
-enum {
-       LEFT = 0,
-       CENTER,
-       RIGHT
-};
-
-/**
- * Convert sharp`s measured values to mm.
- *
- * @ingroup    fsmmain
- */
-void get_short_sharp_mm(int *sharp)
-{
-       ROBOT_LOCK(sharpsWaste);
-       sharp[0] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short1);
-       sharp[1] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short2);
-       sharp[2] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short3);
-       sharp[3] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short4);
-       ROBOT_UNLOCK(sharpsWaste);
-}
-
-/**
- * Get values from long shar.
- *
- * @ingroup    fsmmain
- */
-void get_long_sharp_m(double *sharp)
-{
-       ROBOT_LOCK(sharpsWaste);
-       sharp[0] = robot.sharpsOpponent.longSharpDist1;
-       sharp[1] = robot.sharpsOpponent.longSharpDist2;
-       sharp[2] = robot.sharpsOpponent.longSharpDist3;
-       ROBOT_UNLOCK(sharpsWaste);
-}
-
-/**
- * Check out sharp values to evaluate, if waste is in our reach. 
- * 
- * @ingroup    fsmmain
- * @return     returns true if waste is in our reach.
- */
-int waste_ahead()
-{
-       int sharp[4];
-       int cnt = 0, i;
-
-       get_short_sharp_mm(sharp);
-       printf("sharp: %d %d %d %d\n", sharp[0], sharp[1], sharp[2], sharp[3]);
-       for (i=0; i<4; i++)
-               if (sharp[i] > 0 && sharp[i] < 150)
-                       cnt++;
-
-       return ((cnt >= 1) ? 1 : 0);
-}
-
-/**
- * Check out sharp values to evaluate, if wall is in front of us.
- * 
- * @ingroup    fsmmain
- * @return     returns true if wall is in front of us.
- */
-int wall_ahead()
-{
-       int sharp[4];
-       int cnt = 0, i;
-
-       get_short_sharp_mm(sharp);
-       printf("sharp: %d %d %d %d\n", sharp[0], sharp[1], sharp[2], sharp[3]);
-       for (i=0; i<4; i++)
-               if (sharp[i] > 0 && sharp[i] < 100)
-                       cnt++;
-
-       return ((cnt >= 2) ? 1 : 0);
-}
-
-/**
- * Detection of the enemy ahead.
- *
- * @return     enemy may be ahead us.
- */
-int enemy_ahead()
-{
-       double sharp[3];
-       int cnt = 0, i;
-
-       get_long_sharp_m(sharp);
-       printf("long sharp: %f %f %f\n", sharp[0], sharp[1], sharp[2]);
-       for (i=0; i<3; i++)
-               if (sharp[i] > 0 && sharp[i] < 0.30)
-                       cnt++;
-
-       /* FIXME: dont use enemy avoidance now */
-//     return ((cnt >= 1) ? 1 : 0);
-       return (0);
-}
-
-/**
- * Check out if stack is empty. Use back innerIR sensors to do it.
- *
- * @return     returns true if IR sensors indicate the waste
- */
-int stack_empty()
-{
-       int status;
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.back & 0xe0;
-       ROBOT_UNLOCK(IRsensors);
-       return ((status == 0) ? 1 : 0);
-}
-
-/**
- * Evaluation function to be sure the basket is behind us.
- * 
- * @ingroup    fsmmain
- * @return
- */
-int basket_behind()
-{
-       /* FIXME: return true by now, until the back sharps are connected */
-       return 1;
-}
-
-/**
- * Try to detect type of the waste using sensors in the back release space.
- * 
- * @ingroup    fsmmain
- * @return     returns type of the waste.
- */
-int recognize_waste_phase2()
-{
-       int type = WASTE_UNKNOWN;
-       char bit = 0x01;
-       char status;
-       int i, cnt = 0;
-
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.back & 0x1f;
-       ROBOT_UNLOCK(IRsensors);
-
-       for (i=0; i<8; i++)
-               if (status & (bit << i))
-                       cnt++;
-
-       switch (cnt) {
-               case 0:
-                       type = WASTE_UNKNOWN;
-                       break;
-               case 1: type = WASTE_BOTTLE;
-                       break;
-               default: 
-                       type = WASTE_CAN;
-                       break;
-       }
-
-       return type;
-}
-
-/**
- * Detect on which side of the robot the waste is in front of.
- * 
- * @ingroup    fsmmain
- * @return     Returns enum value LEFT = 0, CENTER = 1, RIGHT = 2
- */
-int short_sharp_direction() {
-       int sharp[4];
-       int window[3];
-       int rv = CENTER;
-       
-       get_short_sharp_mm(sharp);
-       window[0] = sharp[0] + sharp[1];
-       window[1] = sharp[1] + sharp[2];
-       window[2] = sharp[2] + sharp[3];
-       
-//     printf("windows: %d %d %d\n",window[0],window[1],window[2]);
-       
-       if ((window[0] < window[1]) && (window[0] < window[2])) rv = LEFT;
-       if ((window[1] <= window[0]) && (window[1] <= window[2])) rv = CENTER;
-       if ((window[2] < window[0]) && (window[2] < window[1])) rv = RIGHT;
-
-       return rv;
-}
-
-/**
- * Deposite bottle to correct basket according to the actual position and 
- * the color of our team.
- */
-void deposite_bottle()
-{
-       struct act_pos_type act_pos;
-       void (*servo)(void);
-
-       ROBOT_LOCK(act_pos);
-       act_pos = robot.act_pos;
-       ROBOT_UNLOCK(act_pos);
-
-#ifdef WE_ARE_BLUE
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = innerTransporterRight;
-       else
-               servo = backDoorDown;
-#else
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = innerTransporterLeft;
-       else
-               servo = backDoorDown;
-#endif
-       (*servo)();
-}
-
-/**
- * Deposite can to correct basket according to the actual position and 
- * the color of our team.
- */
-void deposite_can()
-{
-       struct act_pos_type act_pos;
-       void (*servo)();
-
-       ROBOT_LOCK(act_pos);
-       act_pos = robot.act_pos;
-       ROBOT_UNLOCK(act_pos);
-
-#ifdef WE_ARE_BLUE
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = backDoorDown;
-       else
-               servo = innerTransporterLeft;
-#else
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = backDoorDown;
-       else
-               servo = innerTransporterRight;
-#endif
-       (*servo)();
-}
-
-/**
- * Competition timer. Stop robot when the timer exceeds.
- *
- */
-void *wait_for_end(void *arg)
-{
-       sleep(COMPETITION_TIME);
-       printf("%d seconds timer exceeded! exiting!\n", COMPETITION_TIME);
-       robot_exit();
-       return NULL;
-}
-
-/**
- * Timer to go to basket.
- *
- */
-void *wait_to_deposition(void *arg)
-{
-       sleep(WAIT_FOR_DEPOSITION);
-       FSM_SIGNAL(MAIN, EV_SHORT_TIME_TO_END, NULL);
-       return NULL;
-}
-
-/**
- * Get position of the point when we know the distance and angle to turn.
- *
- * @param act  actual position
- * @param pos  countered position
- */
-void get_new_pos(struct act_pos_type *act, struct act_pos_type *pos, 
-                       double l, double phi)
-{
-       pos->x = act->x + l*cos(act->phi + phi);
-       pos->y = act->y + l*sin(act->phi + phi);
-//     pos->phi = act->phi + phi;
-       pos->phi = phi;
-}
-
-void robot_goto_point(struct act_pos_type des_pos)
-{
-       struct TrajectoryConstraints tc = trajectoryConstraintsDefault;
-
-       tc.maxv /= 3;
-       robot_trajectory_new(&tc);
-       robot_trajectory_add_final_point_notrans(des_pos.x, des_pos.y, NO_TURN());
-}
-
-void robot_go_backward_to_point(struct act_pos_type des_pos)
-{
-       struct TrajectoryConstraints tc = trajectoryConstraintsDefault;
-
-       tc.maxv /= 1;
-       robot_trajectory_new_backward(&tc);
-       robot_trajectory_add_final_point_notrans(des_pos.x, des_pos.y, NO_TURN());
-}
-
-/**
- * FSM states start here.
- */
-FSM_STATE_DECL(main_init);
-FSM_STATE_DECL(plan_go_start);
-FSM_STATE_DECL(plan_go);
-FSM_STATE_DECL(align_with_the_wall);
-FSM_STATE_DECL(align_with_the_wall2);
-FSM_STATE_DECL(go_backward_to_nearest_conner);
-FSM_STATE_DECL(go_far_from_conner);
-FSM_STATE_DECL(go_for_waste);
-FSM_STATE_DECL(waste_grab);
-FSM_STATE_DECL(go_backward);
-FSM_STATE_DECL(waste_deposite);
-FSM_STATE_DECL(waste_deposite_wait);
-FSM_STATE_DECL(go_to_basket);
-FSM_STATE_DECL(align_with_the_oppos_wall);
-FSM_STATE_DECL(align_with_the_oppos_wall2);
-FSM_STATE_DECL(go_closer_to_basket);
-FSM_STATE_DECL(go_backward_to_basket);
-FSM_STATE_DECL(search_waste);
-FSM_STATE_DECL(turn_robot);
-FSM_STATE_DECL(follow_waste);
-
-/**
- * Set starting position, playground`s safety zone and other obstacles.
- * 
- * @ingroup fsmmain
- */
-FSM_STATE(main_init) 
-{
-       pthread_t thid;
-
-       /* start event ocurred */
-       switch (FSM_EVENT) {
-#ifndef WAIT_FOR_START
-               case EV_ENTRY:
-#endif
-               case EV_START:
-                       /* start competition timer */
-                       pthread_create(&thid, NULL, wait_for_end, NULL);
-                       pthread_create(&thid, NULL, wait_to_deposition, NULL);
-                       /* init map and shared memory if required */
-                       ShmapInit(1);
-                       /* starting position of the robot */
-                       //robot_set_act_pos_trans(ROBOT_AXIS_TO_BACK_M, 
-                       //                      PLAYGROUND_HEIGHT_M - ROBOT_WIDTH_M/2,
-                       //                      DEG2RAD(0));
-                       robot_set_act_pos_trans(ROBOT_WIDTH_M/2,
-                                               PLAYGROUND_HEIGHT_M - ROBOT_AXIS_TO_BACK_M,
-                                               DEG2RAD(-90));
-                       /* safety zone around playground`s wall  */
-//                     ShmapSetRectangleType(0.0, 0.0, 0.1, 2.1, MAP_WALL_CSPACE);
-//                     ShmapSetRectangleType(0.0, 0.0, 3.0, 0.1, MAP_WALL_CSPACE);
-//                     ShmapSetRectangleType(0.0, 2.0, 3.0, 2.1, MAP_WALL_CSPACE);
-//                     ShmapSetRectangleType(2.9, 0.0, 3.0, 2.1, MAP_WALL_CSPACE);
-                       /* 3 cups for batteries */
-//                     ShmapSetRectangleFlag(1.3, PLAYGROUND_HEIGHT_M, 1.7, 
-//                                     PLAYGROUND_HEIGHT_M - 0.8, MAP_FLAG_WALL, 0);
-//                     ShmapSetRectangleFlag(1.3, PLAYGROUND_HEIGHT_M/2 - 0.2, 
-//                                             1.7, PLAYGROUND_HEIGHT_M/2 + 0.2, 
-//                                             MAP_FLAG_WALL, 0);
-                       ShmapSetRectangleFlag(1.3, 0.0, 1.7, 0.8, MAP_FLAG_WALL, 0);
-                       /* waste counter */
-                       ROBOT_LOCK(waste_cnt);
-                       robot.waste_cnt = 0;
-                       printf("waste_cnt = %d\n", robot.waste_cnt);
-                       ROBOT_UNLOCK(waste_cnt);
-                       FSM_TIMER(100);
-                       break;
-               case EV_TIMER:
-                       frontDoorDown();
-                       /* start to do something */
-#ifdef COMPETITION
-                       FSM_TRANSITION(plan_go_start);
-#else
-                       FSM_TRANSITION(plan_go_start);
-//                     FSM_TRANSITION(plan_go);
-//                     FSM_TRANSITION(go_to_basket);
-//                     FSM_TRANSITION(search_waste);
-#endif
-                       break;
-               default: break;
-       }
-}
-
-FSM_STATE(plan_go_start)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       robot_trajectory_new(NULL);
-                       robot_trajectory_add_point_trans(ROBOT_WIDTH_M/2, PLAYGROUND_HEIGHT_M - 1.0);
-                       robot_trajectory_add_point_trans(0.5, PLAYGROUND_HEIGHT_M - 1.0);
-                       robot_trajectory_add_final_point_trans(0.6, PLAYGROUND_HEIGHT_M -1.0, NO_TURN());
-                       frontTransporterBackward();
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(search_waste);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Go and try to detect some waste.
- * 
- * @ingroup fsmmain
- */
-FSM_STATE(plan_go)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       robot_goto_trans(PLAYGROUND_WIDTH_M - 1.0, 1.0, NO_TURN(), NULL);
-                       frontDoorDown();
-                       frontTransporterBackward();
-                       break;
-               case EV_MOTION_DONE:
-                       printf("target achieved!\n");
-                       FSM_TRANSITION(search_waste);
-                       break;
-               case EV_GOAL_NOT_REACHABLE:
-                       DBG("Goal is not reachable: %s\n",fsm_event_str(FSM_EVENT));
-                       FSM_TIMER(1000);
-                       break;
-               case EV_TIMER:
-                       FSM_TRANSITION(search_waste);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Try to align robot with the wall
- */
-FSM_STATE(align_with_the_wall)
-{
-       struct TrajectoryConstraints tc = trajectoryConstraintsDefault;
-       struct act_pos_type act_pos;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       frontDoorUp();
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       tc.maxacc /= 3;
-                       robot_trajectory_new_backward(&tc);
-                       robot_trajectory_add_final_point_trans(0.0, 
-                                               act_pos.y, NO_TURN());
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(align_with_the_wall2);
-                       break;
-
-               default: break;
-       }
-}
-
-FSM_STATE(align_with_the_wall2)
-{
-       struct act_pos_type act_pos;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       act_pos.x = TRANS_X(act_pos.x);
-                       act_pos.y = TRANS_Y(act_pos.y);
-                       robot_trajectory_new(NULL);
-                       robot_trajectory_add_final_point_trans(act_pos.x + 0.2, 
-                                                       act_pos.y, 
-                                                       TURN_CCW(DEG2RAD(90)));
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(go_backward_to_nearest_conner);
-                       break;
-               default: break;
-       }
-}
-
-FSM_STATE(go_backward_to_nearest_conner)
-{
-       struct act_pos_type act_pos;
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       robot_trajectory_new_backward(NULL);
-                       robot_trajectory_add_final_point_trans(0.2, 0.0, 
-                                                               NO_TURN());
-                       break;
-               case EV_MOTION_DONE:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       act_pos.x = TRANS_X(0.2);
-                       act_pos.y = TRANS_Y(0);
-                       act_pos.phi = DEG2RAD(90);
-                       robot_set_act_pos_notrans(act_pos.x, 
-                                               act_pos.y, act_pos.phi);
-                       FSM_TRANSITION(go_far_from_conner);
-                       break;
-               default: break;
-       }
-}
-
-FSM_STATE(go_far_from_conner)
-{
-       struct act_pos_type act_pos;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       act_pos.x = TRANS_X(act_pos.x);
-                       act_pos.y = TRANS_Y(act_pos.y);
-                       robot_trajectory_new(NULL);
-                       robot_trajectory_add_final_point_trans(act_pos.x + 0.0, 
-                                       act_pos.y + 0.2, TURN_CCW(DEG2RAD(90)));
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(go_to_basket);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Try to search some waste. Detect the position of the waste, if its on the 
- * left or on the right side and then turn to that direction to try to detect 
- * the waste.
- */
-FSM_STATE(search_waste) {
-       struct act_pos_type act_pos;
-       static int search_waste_attempts = 0;
-       int dir;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-
-                       /* FIXME: enemy voidance is not used by now */
-                       if (enemy_ahead() && enemy_avoidance_attempt_cnt < 
-                                               ENEMY_AVOIDANCE_MAX_ATTEMPTS) {
-                               printf("enemy is ahead of me\n");
-                               enemy_avoidance_attempt_cnt++;
-                               get_new_pos(&act_pos, &des_pos, -0.1, DEG2RAD(5));
-                               robot_goto_point(des_pos);
-
-                       } else if(waste_ahead()) {
-                               printf("waste is in front of me\n");
-                               dir = short_sharp_direction();
-                               switch(dir) {
-                                       case LEFT:                                              
-                                               get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(10));
-                                               break;
-                                       case RIGHT:
-                                               get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(-10));
-                                               break;
-                                       case CENTER:
-                                       default:
-                                               get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(0));
-                                               break;
-                               }
-                               FSM_TRANSITION(go_for_waste);
-
-                       } else {
-                               search_waste_attempts++;
-                               printf("i can't see any waste, sorry\n");
-                               if (search_waste_attempts >= 4) {
-                                       search_waste_attempts = 0;
-                                       get_new_pos(&act_pos, &des_pos, -0.2, DEG2RAD(10));
-                                       robot_go_backward_to_point(des_pos);
-                               } else {
-                                       get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(0));
-                                       robot_goto_point(des_pos);
-                               }
-                               /* FIXME: this timer???!!!! */
-                               FSM_TIMER(5000);
-                       }
-
-                       /* FIXME: enemy avoidance is not used by now */
-                       if (enemy_avoidance_attempt_cnt >= ENEMY_AVOIDANCE_MAX_ATTEMPTS)
-                               enemy_avoidance_attempt_cnt = 0;
-                       break;
-               case EV_TIMER:
-                       FSM_TRANSITION(search_waste);
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(search_waste);
-                       break;
-               case EV_SHORT_TIME_TO_END:
-                       robot_stop();           
-#ifdef USE_WALL_TO_ALIGN
-                       if (no_align)
-                               FSM_TRANSITION(go_to_basket);
-                       else
-                               FSM_TRANSITION(align_with_the_wall);
-#else
-                               FSM_TRANSITION(go_to_basket);
-#endif
-                       break;
-               default: 
-                       break;
-       }
-}
-
-FSM_STATE(go_for_waste)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       robot_goto_point(des_pos);
-                       break;
-               case EV_MOTION_DONE:
-                       printf("went for waste and finished!!!!!!!!!!!\n");
-                       FSM_TRANSITION(waste_grab);
-                       break;
-               default: break;
-       }
-}
-
-FSM_STATE(waste_grab) {
-       static int waste_grab_attempts_cnt = 0;
-       int waste_cnt;
-       
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       FSM_SIGNAL(PICKUP, EV_PICKUP_START, NULL);
-                       break;
-               case EV_PICKUP_READY:
-                       FSM_SIGNAL(PICKUP, EV_PICKUP_TRY, NULL);
-                       break;
-               case EV_PICKUP_DONE:
-                       ROBOT_LOCK(waste_cnt);
-                       robot.waste_cnt++;
-                       waste_cnt = robot.waste_cnt;
-                       ROBOT_UNLOCK(waste_cnt);
-                       if (waste_cnt == 1 && stack_empty()) {
-                               printf("fsmmain: pickup done. Youuhouuu, I have "
-                                       "a bottle!! In total: %d\n", waste_cnt);
-                       } else {
-                               printf("fsmmain: pickup done. But sensors detect "
-                                       "empty stack!! In total: %d\n", waste_cnt);
-                       }
-                       /* go to deposite waste if the stack is full */
-                       if (waste_cnt >= STACK_SIZE) {
-#ifdef USE_WALL_TO_ALIGN
-                               if (no_align)
-                                       FSM_TRANSITION(go_to_basket);
-                               else
-                                       FSM_TRANSITION(align_with_the_wall);
-#else
-                               FSM_TRANSITION(go_to_basket);
-#endif
-                       /* continue grabbing waste if there`s space in the stack */
-                       } else {
-                               FSM_TIMER(NEW_PICK_UP_WAIT);
-                       }
-                       break;
-               case EV_PICKUP_JAMMED:
-                       printf("fsmmain: waste jammed\n");      
-                       FSM_TRANSITION(go_backward);
-//                     FSM_TRANSITION(search_waste);
-                       break;
-               case EV_PICKUP_FAILED:
-                       printf("fsmmain: pickup failed\n");     
-                       waste_grab_attempts_cnt++;
-                       if (waste_grab_attempts_cnt >= 2) {
-                               waste_grab_attempts_cnt = 0;
-//                             FSM_TRANSITION(go_backward);
-                               FSM_TRANSITION(search_waste);
-                       } else {
-                               FSM_TRANSITION(waste_grab);
-                       }
-                       break;
-               case EV_TIMER:
-                       printf("timeout: continue grabbing waste\n");
-                       FSM_TRANSITION(search_waste);
-                       break;
-               default: 
-                       break;
-       }
-}
-
-/**
- * Go backward and try to avoid baterry collection.
- *
- * @ingroup fsmmain
- */
-FSM_STATE(go_backward)
-{
-       struct act_pos_type act_pos;
-       int dir;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       dir = short_sharp_direction();
-                       switch(dir) {
-                               case LEFT:
-                                       get_new_pos(&act_pos, &des_pos, -0.1, DEG2RAD(5));
-                                       break;
-                               case RIGHT:
-                                       get_new_pos(&act_pos, &des_pos, -0.1, DEG2RAD(-5));
-                                       break;
-                               case CENTER:
-                               default:
-                                       get_new_pos(&act_pos, &des_pos, -0.1, DEG2RAD(5));
-                                       break;
-                       }
-                       robot_go_backward_to_point(des_pos);
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(search_waste);
-                       break;
-               default: break;
-       }
-
-}
-
-/**
- * Go to basket to deposite the waste.
- *
- * @ingroup fsmmain
- */
-FSM_STATE(go_to_basket)
-{
-       static int counter;
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       frontDoorUp();
-                       counter = 3;
-               case EV_TIMER:
-                       robot_goto_trans(PLAYGROUND_WIDTH_M - 0.5, 0.5, 
-                                               TURN_CW(DEG2RAD(180)), NULL);
-                       break;
-               case EV_MOTION_DONE:
-                       printf("target achieved! \n");
-//                     FSM_TRANSITION(go_closer_to_basket);
-//                     FSM_TRANSITION(go_backward_to_basket);
-                       FSM_TRANSITION(align_with_the_oppos_wall);
-                       break;
-               case EV_GOAL_NOT_REACHABLE:
-                       counter--;
-                       DBG("Goal is not reachable: %s\n",fsm_event_str(FSM_EVENT));
-                       if (counter)
-                               FSM_TIMER(1000);
-                       else 
-                               FSM_TRANSITION(align_with_the_oppos_wall);
-//                             FSM_TRANSITION(go_backward_to_basket);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Try to align robot with the wall
- */
-FSM_STATE(align_with_the_oppos_wall)
-{
-       struct TrajectoryConstraints tc = trajectoryConstraintsDefault;
-       struct act_pos_type act_pos;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       tc.maxacc /= 3;
-                       robot_trajectory_new_backward(&tc);
-                       robot_trajectory_add_final_point_trans(PLAYGROUND_WIDTH_M, 
-                                                       act_pos.y, NO_TURN());
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(align_with_the_oppos_wall2);
-                       break;
-
-               default: break;
-       }
-}
-
-FSM_STATE(align_with_the_oppos_wall2)
-{
-       struct act_pos_type act_pos;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       act_pos.x = TRANS_X(act_pos.x);
-                       act_pos.y = TRANS_Y(act_pos.y);
-                       robot_trajectory_new(NULL);
-                       robot_trajectory_add_final_point_trans(act_pos.x - 0.15, 
-                                                       act_pos.y, NO_TURN());
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(go_backward_to_basket);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Try to get closer to the wall. It`s useful to enclose the basket.
- */
-FSM_STATE(go_closer_to_basket)
-{
-       struct act_pos_type act_pos;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-
-                       if (wall_ahead() || 
-                               goto_basket_attempt_cnt >= GOTO_BASKET_MAX_ATTEMPTS) {
-                               printf("wall is ahead\n");
-                               goto_basket_attempt_cnt = 0;
-                               FSM_TRANSITION(go_backward_to_basket);
-                       } else {
-                               goto_basket_attempt_cnt++;
-                               get_new_pos(&act_pos, &des_pos, 0.05, DEG2RAD(0));
-                               FSM_TIMER(100);
-                               robot_goto_point(des_pos);
-                       }
-                       break;
-               case EV_TIMER:
-                       FSM_TRANSITION(go_closer_to_basket);
-                       break;
-               case EV_MOTION_DONE:
-                       FSM_TRANSITION(go_closer_to_basket);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Go backward to the basket.
- */
-FSM_STATE(go_backward_to_basket)
-{
-       struct TrajectoryConstraints tc = trajectoryConstraintsDefault;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       tc.maxacc /= 3;
-                       robot_trajectory_new_backward(&tc);
-                       robot_trajectory_add_final_point_trans(
-                                               PLAYGROUND_WIDTH_M - 0.15,
-                                               0.0, NO_TURN());
-                       break;
-               case EV_LOST_DURING_MOTION:
-               case EV_MOTION_DONE:
-                       /* FIXME: we should check if the position of robot 
-                        * is really closed to the basket */
-                       FSM_TRANSITION(waste_deposite);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Deposite waste.
- * 
- * @ingroup    fsmmain
- */
-FSM_STATE(waste_deposite)
-{
-       int waste_cnt, type;
-
-       ROBOT_LOCK(waste_cnt);
-       waste_cnt = robot.waste_cnt;
-       ROBOT_UNLOCK(waste_cnt);
-
-       if (stack_empty() && waste_cnt != 0) {
-               printf("waste_cnt is %d, but I detect stack empty!!!\n", 
-                       waste_cnt);
-       }
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       printf("deposite waste: %d\n", waste_cnt);
-                       innerDoorDown();
-                       FSM_TIMER(WASTE_ROLL_OUT_WAIT);
-                       break;
-               case EV_TIMER:
-                       innerDoorUp();
-                       type = recognize_waste_phase2();
-                       printf("waste recognition: ");
-                       switch (type) {
-                               case WASTE_CAN:
-                                       printf("it`s a can\n");
-                                       deposite_can();
-                                       break;
-                               case WASTE_BOTTLE:
-                                       printf("it`s a bottle\n");
-                                       deposite_bottle();
-                                       break;
-                               default:
-                                       deposite_bottle();
-                                       printf("unidentified\n");
-                                       break;
-                       }
-                       /* need to recognize type of waste here */
-                       FSM_TRANSITION(waste_deposite_wait);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Wait until deposition terminated then go to find more waste.
- *
- */
-FSM_STATE(waste_deposite_wait)
-{
-       int waste_cnt;
-       switch(FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(waste_cnt);
-                       waste_cnt = robot.waste_cnt;
-                       ROBOT_UNLOCK(waste_cnt);
-                       if (waste_cnt > 1)
-                               FSM_TIMER(DEPOSITE_WAIT);
-                       else
-                               FSM_TIMER(LAST_DEPOSITE_WAIT);
-                       break;
-               case EV_TIMER:
-                       ROBOT_LOCK(waste_cnt);
-                       if (robot.waste_cnt > 0)
-                               robot.waste_cnt--;
-                       waste_cnt = robot.waste_cnt;
-                       ROBOT_UNLOCK(waste_cnt);
-                       innerTransporterStop();
-                       backDoorUp();
-                       if (waste_cnt > 0) {
-                               FSM_TRANSITION(waste_deposite);
-                       } else {
-                               robot_set_act_pos_trans(PLAYGROUND_WIDTH_M - 0.1,
-                                                       0.1, DEG2RAD(90));
-                               FSM_TRANSITION(plan_go);
-                               no_align = 1;
-                       }
-                       break;
-               default: break;
-       }
-}
-
-/* main loop */
-int main()
-{
-       /* robot initialization */
-       robot_init();
-
-       FSM(MAIN)->debug_states = 1;
-
-       robot.fsm[FSM_ID_MAIN].state = &fsm_state_main_init;
-       robot.fsm[FSM_ID_MOTION].state = &fsm_state_move_init;
-//     robot.fsm[FSM_ID_LOC].state = &fsm_state_loc_init;
-//     robot.fsm[FSM_ID_DET].state = &fsm_state_det_start;
-       robot.fsm[FSM_ID_PICKUP].state = &fsm_state_pickup_init;
-
-        /* start threads and wait */
-        robot_start();
-
-       robot_wait();
-
-       /* clean up */
-       robot_destroy();
-
-       return 0;
-}
diff --git a/src/robofsm/eb2007/fsmmove.cc b/src/robofsm/eb2007/fsmmove.cc
deleted file mode 100644 (file)
index 80facdd..0000000
+++ /dev/null
@@ -1,634 +0,0 @@
-/**
- * @file       fsmmove.cc
- * @brief      FSM move
- * @author     Michal Sojka, Jose Maria Martin Laguna
- *
- */
-#define FSM_MOTION
-#include <sys/time.h>
-#include <time.h>
-#include "trgen.h"
-#include "balet.h"
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <pthread.h>
-#include <path_planner.h>
-#include <signal.h>
-#include <movehelper_eb2007.h>
-#include <sharp.h>
-#include <unistd.h>
-#include <map.h>
-#include "robot_config.h"
-#include <robomath.h>
-
-
-/*******************************************************************************
- * Parameters of Obstacle detection
- *******************************************************************************/
-
-#define OBS_PERIOD_WATCH       100000          /**< Time period for watching the sensors in us*/
-#define OBS_PERIOD_BETWEEN_DET 1000000         /**< Minimal time period between two detections in us. */
-#define OBS_AREA               (200/MAP_CELL_SIZE_MM)  /**< Configuration Space of the obstacle in cell units. In this case 200mm = 2 cells. @warning It should be an integer */
-#define OBS_AREA_M (OBS_AREA*MAP_CELL_SIZE_MM)
-#define OBS_FORGET_PERIOD      100000          /**< The period of thread_update_map() */
-
-#define OBS_FORGET_SEC 15                      /**< Time to completely forget detected obstacle. */
-
-#define OBS_OFFSET     0.6
-/*******************************************************************************
- * Controller thread and helper functions for that thread
- *******************************************************************************/
-
-
-//Controller gains
-const struct balet_params k = {
-  p_tangent:  2,               // dx gain
-  p_angle: 2,                  // dphi gain
-  p_perpen: 10                 // dy gain
-};
-#define MAX_POS_ERROR_M 0.5
-#define CLOSE_TO_TARGET_M 0.1
-#define MAX_WAIT_FOR_CLOSE_MS 2000
-
-//#define MOTION_PERIOD_NS (500/*ms*/*1000*1000)
-#define MOTION_PERIOD_NS (50/*ms*/*1000*1000)
-#define SIG_TIMER (SIGRTMIN+0)
-#define SIG_NEWDATA (SIGRTMIN+1)
-
-// Global varibles
-static pthread_t thr_trajctory_follower;
-static pthread_t thr_trajctory_recalc;
-static pthread_t thr_update_map;
-static struct timeval tv_start; /**< Absolute time, when trajectory started. */
-
-/** Stores the actually followed trajectory object */
-static Trajectory *actual_trajectory = NULL;
-
-//static Trajectory *switch_to_trajectory = NULL;
-//static double switch_time;
-
-// function definition
-static int new_goal(void);
-static void stop();
-
-bool actual_trajectory_reverse;
-pthread_mutex_t actual_trajectory_lock = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t switch_to_trajectory_lock = PTHREAD_MUTEX_INITIALIZER;
-
-// static void odometry(double l, r) {
-//     static double last_l, last_r;
-
-//     robot.act_pos.x = (double)ROBOT_AXIS_TO_BACK_MM/1000;
-//     robot.act_pos.y = ((double)PLAYGROUND_HEIGHT_MM - ROBOT_WIDTH_MM/2)/1000;
-//     robot.act_pos.phi = 0;
-
-//     ROBOT_LOCK(act_pos);
-//     ROBOT_UNLOCK(act_pos);
-// }
-
-static void delete_actual_trajectory()
-{
-       Trajectory *old;
-       pthread_mutex_lock(&actual_trajectory_lock);
-       old = actual_trajectory;
-       actual_trajectory = NULL;
-       pthread_mutex_unlock(&actual_trajectory_lock);
-       robot_send_speed(0,0);
-       if (old) delete(actual_trajectory);
-}
-
-/** Sends events from follower thread to FSM. */
-static void notify_fsm(bool done, double error)
-{
-       static bool done_sent;
-
-       if (error > MAX_POS_ERROR_M) {
-           FSM_SIGNAL(MOTION, EV_TRAJECTORY_LOST, NULL);
-       } else {
-               if (done) {
-                       if (error < CLOSE_TO_TARGET_M) {
-                           FSM_SIGNAL(MOTION, EV_TRAJECTORY_DONE_AND_CLOSE, NULL);
-                       } else if (!done_sent) {
-                               done_sent = true;
-                               FSM_SIGNAL(MOTION, EV_TRAJECTORY_DONE, NULL);
-                       }
-               } else {
-                       done_sent = false;
-               }
-       }
-}
-
-/**
- * A thread running the controller.
- *
- * This (high priority) thread executes the motion control
- * algorithm. It calculates repference position based on actual
- * trajectory and current time. Then it calls "balet" controller to
- * close feedback.
- *
- * @param arg
- *
- * @return
- */
-static void *trajectory_follower(void *arg)
-{
-       struct itimerspec ts;
-       sigset_t sigset;
-       struct sigevent sigevent;
-       timer_t timer;
-
-       ts.it_value.tv_sec = 0;
-       ts.it_value.tv_nsec = MOTION_PERIOD_NS;
-       ts.it_interval.tv_sec = 0;
-       ts.it_interval.tv_nsec = MOTION_PERIOD_NS;
-
-       sigemptyset(&sigset);
-       sigaddset(&sigset, SIG_TIMER);
-       sigaddset(&sigset, SIG_NEWDATA);
-
-       pthread_sigmask(SIG_BLOCK, &sigset, (sigset_t*) NULL);
-
-       sigevent.sigev_notify = SIGEV_SIGNAL;
-       sigevent.sigev_signo = SIG_TIMER;
-       sigevent.sigev_value.sival_int = 0;
-
-       if (timer_create(CLOCK_REALTIME, &sigevent, &timer) < 0) {
-               perror("move: timer_create");
-               return NULL;
-       }
-
-       if (timer_settime(timer, 0, &ts, NULL) < 0) {
-               perror("move: timer_settimer");
-               return NULL;
-       }
-
-       while (1) {
-               double speeds[2];
-               int sig;
-               // Wait for start of new period or new data
-               sigwait(&sigset, &sig);
-               //DBG("signal %d ", sig - SIGRTMIN);
-               pthread_mutex_lock(&actual_trajectory_lock);
-               Trajectory *w = actual_trajectory;
-               if (w) {
-                       Pos ref_pos, act_pos, balet_out;
-                       bool done;
-                       double t;
-                       struct timeval tv;
-
-                       // Calculate reference position
-                       gettimeofday(&tv, NULL);
-                       t = (double)(tv.tv_usec - tv_start.tv_usec) / 1000000.0;
-                       t += (tv.tv_sec - tv_start.tv_sec);
-
-
-                       done = w->getRefPos(t, ref_pos);
-
-#ifdef CONFIG_OPEN_LOOP
-                       // We don't use any feedback now. It is
-                       // supposed that the actual position is equal
-                       // to reference position.
-                       robot_set_act_pos_notrans(ref_pos.x, ref_pos.y, ref_pos.phi);
-#endif
-                       ROBOT_LOCK(ref_pos);
-                       ref_pos.x = robot.ref_pos.x;
-                       ref_pos.y = robot.ref_pos.y;
-                       ref_pos.phi = robot.ref_pos.phi;
-                       ROBOT_UNLOCK(ref_pos);
-
-                       DBG("rx=%5.02f ry=%5.02f, rphi=%4.0f v=%-4.02f  omega=%-4.02f\r", ref_pos.x, ref_pos.y, ref_pos.phi/M_PI*180, ref_pos.v, ref_pos.omega);
-                       fflush(stdout);
-                       // Call the controller
-                       double error;
-                       error = balet(ref_pos, ref_pos, k, balet_out);
-                       speeds[0] = balet_out.v - ROBOT_ROTATION_RADIUS_M*balet_out.omega;
-                       speeds[1] = balet_out.v + ROBOT_ROTATION_RADIUS_M*balet_out.omega;
-                       notify_fsm(done, error);
-               } else {
-                       speeds[0] = 0;
-                       speeds[1] = 0;
-               }
-
-
-               // Apply controller output
-               robot_send_speed(speeds[0], speeds[1]);
-               pthread_mutex_unlock(&actual_trajectory_lock);
-       }
-}
-
-static void obstacle_detected_at(double x, double y)
-{
-       int i,j, xcell, ycell;
-       struct ref_pos_type ref_pos;
-       struct map *map = ShmapIsMapInit();
-       double xx, yy;
-       bool obs_already_seen;
-
-       ShmapPoint2Cell(x, y, &xcell, &ycell);
-       if (!ShmapIsCellInMap(xcell, ycell))
-               return;
-       obs_already_seen = (map->cells[ycell][xcell].flags & (MAP_FLAG_DET_OBST)) != 0;
-
-       DBG("New obstacle detected at cell [%f,%f] \n", x,y);
-       bool needs_replan = false;      // This flag indicates if the path should be recalculated
-       bool obstacle_at_goal = false;  // This flag indicates that the goal is an obstacle
-       //DBG("Cell %d, %d\n", xcell, ycell);
-
-       /** Then all the cells arround obstacle cell are set as
-        * #MAP_NEW_OBSTACLE. Cells of current robot position are not
-        * set to avoid path planning deadlock. If there are a path
-        * cell between them, the path will be recalculated. @see
-        * #OBS_CSPACE. */
-
-       ROBOT_LOCK(ref_pos);
-       ref_pos = robot.ref_pos;
-       ROBOT_UNLOCK(ref_pos);
-
-       for (i=(xcell-OBS_AREA); i <= xcell+OBS_AREA; i++) {
-               for (j=(ycell- OBS_AREA); j <=ycell + OBS_AREA; j++) {
-                       if (!ShmapIsCellInMap(i, j)) continue;
-                       ShmapCell2Point(i, j, &xx, &yy);
-                       if (distance(xx, yy, ref_pos.x, ref_pos.y) > 0.2) {
-                               if (i==xcell && j==ycell) 
-                                       map->cells[ycell][xcell].flags |= MAP_FLAG_DET_OBST;
-                               map->cells[j][i].detected_obstacle = MAP_NEW_OBSTACLE;
-                               if (map->cells[j][i].flags & MAP_FLAG_PATH) needs_replan = true;
-                               if (map->cells[j][i].flags & MAP_FLAG_GOAL) obstacle_at_goal = true;
-                       }
-               }
-       }
-
-       // Path recalculation if the goal is not an obstacle and the path should be recalc
-       if (obstacle_at_goal) {
-           FSM_SIGNAL(MOTION, EV_MOVE_STOP, NULL);
-           FSM_SIGNAL(MAIN, EV_GOAL_NOT_REACHABLE, NULL);
-       }
-       else if (needs_replan && !obs_already_seen) {
-               if (new_goal() == 0)
-                       DBG("Path recalc\n");
-               else {
-                       // TODO:
-               }
-       }
-}
-
-/**
- * A thread running the trajectory recalc
- *
- * This (low-medium priority) thread updates the map with sensors information.
- * If it is necesary, it recalculate the path.
- *
- * @param arg
- *
- * @return
- */
-static void * trajctory_recalc(void * arg)
-{
-#define NUM_SHARPS 3
-       double val[NUM_SHARPS], x, y;
-       //Pos p;
-       struct ref_pos_type p;
-       int i;
-       
-       while (1) {
-               /** Updates Map. */
-               //ShmapUpdateTmpObstacles(OBS_UPDATE_MAP_SPEED);
-               ROBOT_LOCK(sharpsOpponent);
-               val[0] = robot.sharpsOpponent.longSharpDist1;
-               val[1] = robot.sharpsOpponent.longSharpDist2;
-               val[2] = robot.sharpsOpponent.longSharpDist3;
-               ROBOT_UNLOCK(sharpsOpponent);
-               
-               const float ang[NUM_SHARPS] = {DEG2RAD(22), DEG2RAD(0), DEG2RAD(-22)};
-               for (i=0; i<NUM_SHARPS; i++) {
-                       if(val[i] < OBS_OFFSET) {
-                               /** Get actual position. */
-                               ROBOT_LOCK(ref_pos);
-                               p = robot.ref_pos;
-                               ROBOT_UNLOCK(ref_pos);
-                               /**
-                               * The obstacle cell its calulated as (val*cos(p.phi)) + p.x) and  ((val*sin(p.phi)) + p.y)
-                               * where p is actual position and val is the value of the sensors in milimiters. Then ShmapPoint2Cell_X() and
-                               * ShmapPoint2Cell_Y() funcions are used to get cell coordonate.
-                               */
-                               val[i] += ROBOT_AXIS_TO_BELT_M;
-                               x = val[i]*cos(p.phi+ang[i]) + p.x;
-                               y = val[i]*sin(p.phi+ang[i]) + p.y;
-                               obstacle_detected_at(x, y);
-       
-                               //waits between detection
-                               usleep(OBS_PERIOD_BETWEEN_DET);
-                       }
-               }
-               
-               /** This process repeats with a period of #OBS_PERIOD_WATCH. */
-               usleep(OBS_PERIOD_WATCH);
-       }
-}
-
-/**
- * A thread updating the map
- */
-static void * thread_update_map(void * arg)
-{
-       int val = (long long)MAP_NEW_OBSTACLE/(OBS_FORGET_SEC*1000000/OBS_FORGET_PERIOD);
-       if (val == 0) val = 1;
-       while (1) {
-               /** Updates Map. */
-               ShmapUpdateTmpObstacles(val);
-               usleep(OBS_FORGET_PERIOD);
-       }
-}
-
-/**
- * Tells trajctory_follower to start moving along trajectory @c t.
- *
- * @param t Trajectory to follow.
- */
-static void go(Trajectory *t)
-{
-       Trajectory *old;
-       pthread_mutex_lock(&actual_trajectory_lock);
-       old = actual_trajectory;
-       gettimeofday(&tv_start, NULL);
-       actual_trajectory = t;
-       pthread_mutex_unlock(&actual_trajectory_lock);
-       if (old)
-               delete(old);
-}
-
-static void stop()
-{
-       delete_actual_trajectory();
-       pthread_kill(thr_trajctory_follower, SIG_NEWDATA);
-}
-
-
-/**
- * @brief      Calculates and simplify a path to goal position avoiding obstacles. In case of error it sends the proper event to MAIN FSM.
- * @return     Zero on succes, non-zero on error.
- * @note Only call this function from this file.
- */
-static int new_goal(void)
-{
-       struct ref_pos_type goal;
-       double startx, starty, angle;
-       PathPoint * path = NULL;
-       PathPoint * tmp_point = NULL;
-       
-       struct TrajectoryConstraints tc;
-       Pos start;
-       //tc.maxv *= 2.5;
-       //tc.maxacc *= 2.5;
-
-       /// Get actual position.
-       ROBOT_LOCK(ref_pos);
-       startx = robot.ref_pos.x;
-       starty = robot.ref_pos.y;
-       start.x = startx;
-       start.y = starty;
-       start.phi = robot.ref_pos.phi;
-       tc = robot.goal_trajectory_constraints;
-       ROBOT_UNLOCK(ref_pos);
-       /// Get goal position.
-       ROBOT_LOCK(goal);
-       goal = robot.goal;
-       ROBOT_UNLOCK(goal);
-
-       //DBG("Going from (%.2f, %.2f) to (%.2f, %.2f)\n", startx, starty, goalx, goaly);
-       /// Calculates the path between actual position to goal position. If the goal is not reachable returns -1.
-       switch (path_planner(startx, starty, goal.x, goal.y, &path, &angle)) {
-               case 1:
-                       break;
-               case PP_ERROR_MAP_NOT_INIT:
-                       printf("ERROR: Map not initialized\n");
-                       FSM_SIGNAL(MOTION, EV_MOVE_STOP, NULL);
-                       FSM_SIGNAL(MAIN, EV_GOAL_NOT_REACHABLE, NULL);
-                       return -1;
-                       break;
-               case PP_ERROR_GOAL_IS_OBSTACLE:
-                       printf("ERROR: Goal is obstacle\n");
-                       FSM_SIGNAL(MOTION, EV_MOVE_STOP, NULL);
-                       FSM_SIGNAL(MAIN, EV_GOAL_NOT_REACHABLE, NULL);
-                       return -1;
-                       break;
-               case PP_ERROR_GOAL_NOT_REACHABLE:
-                       FSM_SIGNAL(MOTION, EV_MOVE_STOP, NULL);
-                       FSM_SIGNAL(MAIN, EV_GOAL_NOT_REACHABLE, NULL);
-                       return -1;
-                       break;
-               default:
-                       break;
-               // shouldn't we call freePathMemory() here? No, because no memory has been allocanted for the path, path is only a pointer to NULL
-       }
-
-       bool backward = false;
-       Trajectory *t = new Trajectory(tc, backward);
-
-       // Add this  path to the trajectory.
-       for (tmp_point = path; tmp_point!=NULL; tmp_point=tmp_point->next) {
-               //DBG("ADDDING POINT (%f, %f)\n", tmp_point->x, tmp_point->y);
-               t->addPoint(tmp_point->x, tmp_point->y);
-       }
-
-       // add the path to the robot trajectory
-       t->finalHeading = robot.goal_final_heading; // NAN should be OK here, if not, it is error.
-
-       // Free path allocated memory
-       freePathMemory(path);
-
-       if (t->prepare(start)) {
-               go(t);
-       } else {
-               DBG("ERROR preparing trajectory\n");
-               delete(t);
-               FSM_SIGNAL(MAIN, EV_TRAJECTORY_ERROR, NULL);
-               return -1;
-       }
-
-       return 0;
-}
-
-
-/**
- * Starts moving on trajectory prepared by functions in
- * movehelper.cc. In case of error it sends the proper event to MAIN
- * FSM.
- *
- * @return Zero on succes, non-zero on error. 
- */
-static int new_trajectory(void)
-{
-       Trajectory *t;
-       Pos pos;
-       ROBOT_LOCK(new_trajectory);
-       t = (Trajectory*) robot.new_trajectory;
-       if (t) robot.new_trajectory = NULL;
-       else {
-               ROBOT_UNLOCK(new_trajectory);
-               DBG("No trajectory\n");
-               FSM_SIGNAL(MAIN, EV_TRAJECTORY_ERROR, NULL);
-               return -1;
-       }
-       ROBOT_UNLOCK(new_trajectory);
-
-
-       ROBOT_LOCK(est_pos);
-       pos.x = robot.est_pos.x;
-       pos.y = robot.est_pos.y;
-       pos.phi = robot.est_pos.phi;
-       ROBOT_UNLOCK(est_pos);
-
-       if (t->prepare(pos)) {
-               go(t);
-       } else {
-               FSM_SIGNAL(MAIN, EV_MOTION_DONE, NULL); // FIXME: Is this correct?
-               return -1;
-       }
-       return 0;
-}
-
-/*******************************************************************************
- * The automaton
- *******************************************************************************/
-
-FSM_STATE_DECL(movement);
-FSM_STATE_DECL(close_to_target);
-FSM_STATE_DECL(wait_for_command);
-
-
-FSM_STATE(move_init)
-{
-       pthread_attr_t tattr;
-       sched_param param;
-       int ret;
-
-       if (FSM_EVENT == EV_ENTRY) {
-               actual_trajectory = NULL;
-
-               // Trajectory follower thread
-               pthread_attr_init (&tattr);
-               pthread_attr_getschedparam (&tattr, &param);
-               param.sched_priority = TRAJ_FOLLOWER_PRIO;
-               ret = pthread_attr_setschedparam (&tattr, &param);
-               if(ret) {
-                       perror("pthread_attr_setschedparam");
-                       exit(1);
-               }
-               ret = pthread_create(&thr_trajctory_follower, &tattr, trajectory_follower, NULL);
-               if(ret) {
-                       perror("pthread_create");
-                       exit(1);
-               }
-               // Thread of trajectory recalc
-               pthread_attr_init (&tattr);
-               pthread_attr_getschedparam (&tattr, &param);
-               param.sched_priority = TRAJ_RECALC_PRIO;
-               ret = pthread_attr_setschedparam (&tattr, &param);
-               if(ret) {
-                       perror("pthread_attr_setschedparam");
-                       exit(1);
-               }
-               pthread_create(&thr_trajctory_recalc, NULL, trajctory_recalc, NULL);
-               
-               // Thread update Map
-               pthread_attr_init (&tattr);
-               pthread_attr_getschedparam (&tattr, &param);
-               param.sched_priority = UPDATE_MAP_PRIO;
-               ret = pthread_attr_setschedparam (&tattr, &param);
-               if(ret) {
-                       perror("pthread_attr_setschedparam");
-                       exit(1);
-               }
-               pthread_create(&thr_update_map, NULL, thread_update_map, NULL);
-               
-               FSM_TRANSITION(wait_for_command);
-       }
-}
-
-FSM_STATE(wait_for_command)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       stop();
-                       break;
-               case EV_NEW_GOAL:
-                       if (new_goal() != 0) {
-                               // The event must be the return value of new_goal()
-                               DBG("Goal error\n");
-                               break;
-                       }
-                       FSM_TRANSITION(movement);
-                       break;
-               case EV_NEW_TRAJECTORY:
-                       if (new_trajectory() != 0) {
-                               break;
-                       }
-                       FSM_TRANSITION(movement);
-                       break;
-               default:
-                       break;
-       }
-}
-
-
-
-FSM_STATE(movement)
-{
-       switch (FSM_EVENT) {
-               case EV_TRAJECTORY_DONE:
-                       FSM_TRANSITION(close_to_target);
-                       break;
-               case EV_TRAJECTORY_DONE_AND_CLOSE:
-                       FSM_SIGNAL(MAIN, EV_MOTION_DONE, NULL);
-                       FSM_TRANSITION(wait_for_command);
-                       break;
-               case EV_TRAJECTORY_LOST:
-                       FSM_SIGNAL(MAIN, EV_LOST_DURING_MOTION, NULL);
-                       FSM_TRANSITION(wait_for_command);
-                       break;
-               case EV_MOVE_STOP:
-                       FSM_TRANSITION(wait_for_command);
-                       break;
-               case EV_EXIT:
-                       stop();
-                       break;
-               default:
-                       // TODO: Macro FSM_DEFAULT prints an ungandled event
-                       break;
-       }
-}
-
-
-FSM_STATE(close_to_target)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       FSM_TIMER(MAX_WAIT_FOR_CLOSE_MS);
-                       break;
-               case EV_TRAJECTORY_DONE_AND_CLOSE:
-                       FSM_SIGNAL(MAIN, EV_MOTION_DONE, NULL);
-                       FSM_TRANSITION(wait_for_command);
-                       break;
-               case EV_TRAJECTORY_LOST:
-               case EV_TIMER:
-                       stop();
-                       FSM_SIGNAL(MAIN, EV_LOST_DURING_MOTION, NULL);
-                       FSM_TRANSITION(wait_for_command);
-                       break;
-               case EV_MOVE_STOP:
-                       FSM_TRANSITION(wait_for_command);
-                       break;
-               case EV_EXIT:
-                       stop();
-                       break;
-               case EV_TRAJECTORY_DONE:
-               case EV_NEW_TRAJECTORY:
-               case EV_LOC_UPDATED:
-               case EV_NEW_GOAL:
-               case EV_LOC_LOST:
-               case EV_RETURN:
-                       DBG_PRINT_EVENT("unhandled event");
-                       break;
-       }
-}
diff --git a/src/robofsm/eb2007/fsmpickup.c b/src/robofsm/eb2007/fsmpickup.c
deleted file mode 100644 (file)
index 7acc7d6..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-#define FSM_PICKUP
-
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <fsm.h>
-#include <sharp.h>
-#include <servos_eb2007.h>
-
-/* bad attempts counter. pickup tries to pickup until the limit is exceeded */
-int pickup_bad_attemp_cnt = 0;
-#define PICKUP_MAX_BAD_ATTEMPTS        3
-
-/**
- * Time constants
- */
-/* time to wait for the waste rolling up to the stack. If time exceeded, the 
- * attempt is considered as jammed */
-#define WASTE_ROLL_IN_WAIT     2000
-/* time to wait for waste disengagement during the jam */
-#define WASTE_DISENGAGEMENT_WAIT       2500
-/* time period between unsuccessful attempts */
-#define PICK_UP_TRY_PERIOD     1000
-
-
-/**
- * Convert sharp`s measured values to mm.
- *
- * @ingroup    fsmpickup
- * @param sharp        Sharp values in mm
- */
-void get_short_sharp_mm(int *sharp)
-{
-       ROBOT_LOCK(sharpsWaste);
-       sharp[0] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short1);
-       sharp[1] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short2);
-       sharp[2] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short3);
-       sharp[3] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short4);
-       ROBOT_UNLOCK(sharpsWaste);
-}
-
-/**
- * Evaluation function for waste pickuping.
- *
- * @ingroup    fsmpickup
- * @return     return true if waste entered inside the entry.
- */
-int waste_entered()
-{
-       int sharp[4];
-       int cnt = 0, i;
-
-       get_short_sharp_mm(sharp);
-       printf("sharp: %d %d %d %d\n", sharp[0], sharp[1], sharp[2], sharp[3]);
-       for (i=0; i<4; i++)
-               if (sharp[i] > 1 && sharp[i] < 40)
-                       cnt++;
-
-       return ((cnt >= 1) ? 1 : 0);
-}
-
-/**
- * Sharp evaluation funtion.
- * 
- * @ingroup    fsmpickup
- * @return     Returns true if sharps are covered. This means the front 
- *             door is closed.
- */
-int short_sharp_enclosed()
-{
-       int sharp[4];
-       int cnt = 0, i;
-
-       get_short_sharp_mm(sharp);
-       printf("sharp: %d %d %d %d\n", sharp[0], sharp[1], sharp[2], sharp[3]);
-       for (i=0; i<4; i++)
-               if (sharp[i] < 20)
-                       cnt++;
-
-       return ((cnt >= 3) ? 1 : 0);
-}
-
-/**
- * Evaluation function to detect waste jammed went pinking up.
- *
- * @ingroup    fsmpickup
- * @return     Returns true when the door is unable to closed fully.
- */
-int front_door_jammed()
-{
-       int rv;
-
-       ROBOT_LOCK(frontDoorAngle);
-       rv = (robot.frontDoorAngle.state > 0x220) ? 0 : 1;
-       ROBOT_UNLOCK(frontDoorAngle);
-
-       return rv;
-}
-
-/**
- * Try to detect type of the waste using sensors at the front door.
- *
- * @return     waste type
- */
-int recognize_waste_phase1()
-{
-       char status;
-       int front_door_angle;
-       int type = WASTE_UNKNOWN;
-       int i, cnt = 0;
-       char bit = 0x01;
-
-       ROBOT_LOCK(frontDoorAngle);
-       front_door_angle = robot.frontDoorAngle.state;
-       ROBOT_UNLOCK(frontDoorAngle);
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.front;
-       ROBOT_UNLOCK(IRsensors);
-
-       if (front_door_angle > 0x220)
-               return type;
-
-       for (i=0; i<8; i++)
-               if (status & (bit << i))
-                       cnt++;
-
-       switch (cnt) {
-               case 0:
-                       type = WASTE_UNKNOWN;
-                       break;
-               case 1:
-               case 2: type = WASTE_BOTTLE;
-                       break;
-               default: 
-                       type = WASTE_CAN;
-                       break;
-       }
-
-       return type;
-}
-
-/**
- * FSM states start here.
- */
-FSM_STATE_DECL(pickup_wait);
-FSM_STATE_DECL(pickup_try);
-FSM_STATE_DECL(waste_recognition);
-FSM_STATE_DECL(pickup_wait_for_success);
-FSM_STATE_DECL(jam_avoidance);
-FSM_STATE_DECL(pickup_jam);
-
-/**
- * FSM State: Pickup state machine initialization. Release front rolling belt 
- * and release front door down.
- *
- * @ingroup    fsmpickup
- */
-FSM_STATE(pickup_init)
-{
-       switch (FSM_EVENT) {
-               default:
-                       releaseFront();
-                       //frontDoorDown();
-                       FSM_TIMER(1500);
-                       break;
-               case EV_TIMER:
-                       FSM_TRANSITION(pickup_wait);
-                       break;
-       }
-}
-
-/**
- * FSM State: Pickup main waiting loop. Wait for events from main FSM.
- *
- * @ingroup    fsmpickup
- */
-FSM_STATE(pickup_wait) {
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       /*printf("fsmpickup ready to serve\n");*/
-                       break;
-               case EV_PICKUP_START:
-                       printf("start picking up waste\n");
-                       pickup_bad_attemp_cnt = 0;
-                       frontTransporterForward();
-                       FSM_SIGNAL(MAIN, EV_PICKUP_READY, NULL);
-                       break;
-               case EV_PICKUP_TRY:
-                       /*printf("try to pick up a waste\n");*/
-                       FSM_TRANSITION(pickup_try);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Wait until the waste entered the front and try to close front door to 
- * pick up the it. If maximal attempt exceeds, picking up is considered as
- * unsuccessful. In other way try to pick up again.
- *
- * @ingroup    fsmpickup
- */
-FSM_STATE(pickup_try)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-               case EV_TIMER:
-                       if (waste_entered()) {
-                               printf("waste entered: continue!!!!!!!!!\n");
-                               frontDoorUp();
-                               FSM_TRANSITION(pickup_wait_for_success);
-                       } else {
-                               pickup_bad_attemp_cnt++;
-                               printf("waste not entered: bad attempts: %d\n", 
-                                       pickup_bad_attemp_cnt);
-                               if (pickup_bad_attemp_cnt >= PICKUP_MAX_BAD_ATTEMPTS) {
-                                       FSM_SIGNAL(MAIN, EV_PICKUP_FAILED, NULL);
-                                       FSM_TRANSITION(pickup_wait);
-                               } else {
-                                       FSM_TIMER(PICK_UP_TRY_PERIOD);
-                               }
-                       }
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Try to identify the type of waste with front sensors.
- * 
- * @ingroup    fsmpickup
- */
-FSM_STATE(waste_recognition)
-{
-       int type;
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       FSM_TIMER(50);
-                       break;
-               case EV_TIMER:
-                       type = recognize_waste_phase1();
-                       switch (type) {
-                               case WASTE_CAN:
-                                       printf("it`s a can\n");
-                                       break;
-                               case WASTE_BOTTLE:
-                                       printf("it`s a bottle\n");
-                                       break;
-                               default:
-                                       printf("unidentified\n");
-                                       break;
-                       }
-                       FSM_TRANSITION(pickup_wait_for_success);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Front door is closed up, so the waste should goes up. If the door can`t be 
- * closed up fully means, that waste is jammed so try to release it out.
- *
- * @ingroup    fsmpickup
- */
-FSM_STATE(pickup_wait_for_success) {
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       FSM_TIMER(WASTE_ROLL_IN_WAIT);
-                       break;
-               case EV_TIMER:
-                       if(short_sharp_enclosed()
-                               || !front_door_jammed()) {
-                               /*printf("waste pick up done\n");*/
-                               frontDoorDown();
-                               FSM_TRANSITION(jam_avoidance);
-                       } else {        
-                               /*printf("waste pick up failed\n");*/
-                               FSM_TRANSITION(pickup_jam);
-                       }
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Avoid waste jammed under the front door when trying to pick up the waste.
- */
-FSM_STATE(jam_avoidance)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       frontTransporterBackward();
-                       FSM_TIMER(400);
-                       break;
-               case EV_TIMER:
-                       FSM_TRANSITION(pickup_wait);
-                       FSM_SIGNAL(MAIN, EV_PICKUP_DONE, NULL);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Try to release the waste from the jammed state.
- *
- * @ingroup    fsmpickup
- */
-FSM_STATE(pickup_jam) {
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       printf("trying to released jammed waste\n");
-                       frontDoorDown();
-                       frontTransporterBackward();
-                       FSM_TIMER(WASTE_DISENGAGEMENT_WAIT);
-                       break;
-               case EV_TIMER:
-                       /*printf("waste release: done\n");*/
-                       frontTransporterStop();
-                       FSM_SIGNAL(MAIN, EV_PICKUP_JAMMED, NULL);
-                       FSM_TRANSITION(pickup_wait);
-                       break;
-               default: break;
-       }
-}
diff --git a/src/robofsm/eb2007/movehelper_eb2007.cc b/src/robofsm/eb2007/movehelper_eb2007.cc
deleted file mode 100644 (file)
index 25b6a3a..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * @file   movehelper.cc
- * @author Michal Sojka
- * @date   Wed Jun 13 13:27:58 2007
- * 
- * @brief  Conveniency functions for motion control.
- * 
- * 
- */
-
-#include "trgen.h"
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <movehelper_eb2007.h>
-#include <path_simplifier.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <math.h>
-#include <map.h>
-#include <robomath.h>
-
-#if 1
-struct TrajectoryConstraints trajectoryConstraintsDefault = {
-       maxv: 0.5,              // m/s
-       maxomega: 1.5,          // rad/s
-       maxangacc: 2,           // rad/s^2
-       maxacc: 0.6,            // m/s^2
-       maxcenacc: 1,           // m/s^2
-       maxe: (double)ROBOT_WIDTH_MM/2.0/1000.0 // m
-};
-#else
-struct TrajectoryConstraints trajectoryConstraintsDefault = {
-       maxv: 0.9,              // m/s
-       maxomega: 4.5,          // rad/s
-       maxangacc: 3*1,         // rad/s^2
-       maxacc: 3*0.3,          // m/s^2
-       maxcenacc: 3*1,         // m/s^2
-       maxe: (double)ROBOT_WIDTH_MM/2.0/1000.0 // m
-};
-#endif
-
-/** 
- * 
- * 
- * 
- */
-static void robot_trajectory_new_ex(struct TrajectoryConstraints *tc, bool backward)
-{
-       Trajectory *ot, *nt;
-       
-       if (!tc) tc = &trajectoryConstraintsDefault;
-
-       nt = new Trajectory(*tc, backward);
-       ROBOT_LOCK(new_trajectory);
-       ot = (Trajectory*)robot.new_trajectory;
-       robot.new_trajectory = nt;
-
-       ROBOT_UNLOCK(new_trajectory);
-       if (ot) delete(ot);
-}
-
-
-/** 
- * Initializes new trajectory object for adding points. Path planner
- * will not be used.
- * 
- * @param tc Constrains for the trajectory.
- */
-void robot_trajectory_new(struct TrajectoryConstraints *tc) {
-       robot_trajectory_new_ex(tc, false);
-}
-void robot_trajectory_new_backward(struct TrajectoryConstraints *tc) {
-       robot_trajectory_new_ex(tc, true);
-}
-
-/** Sets actual position of the robot and with respoect to color of
- * the team. Should be used for setting initial position of the
- * robot. */
-void robot_set_act_pos_notrans(double x, double y, double phi)
-{
-       if (x<0) x=0;
-       if (x>PLAYGROUND_WIDTH_M) x=PLAYGROUND_WIDTH_M;
-       if (y<0) y=0;
-       if (y>PLAYGROUND_HEIGHT_M) y=PLAYGROUND_HEIGHT_M;
-       ROBOT_LOCK(est_pos);
-       robot.est_pos.x = x;
-       robot.est_pos.y = y;
-       robot.est_pos.phi = phi;
-       ROBOT_UNLOCK(est_pos);
-}
-
-/** 
- * Adds point in absolute coordinates to previously initialized trajectory object.
- * 
- * @param x_m X coordinate in meters.
- * @param y_m Y coordinate in meters.
- */
-void robot_trajectory_add_point_notrans(double x_m, double y_m)
-{
-       Trajectory *w;
-       
-       ROBOT_LOCK(new_trajectory);
-       w = (Trajectory*)robot.new_trajectory;
-       if (w) {
-               w->addPoint(x_m, y_m);
-       }
-       ROBOT_UNLOCK(new_trajectory);
-}
-
-double target_x, target_y;
-
-/** 
- * Adds final point to trajectory objects and starts robot movement.
- * 
- * @param x_m X coordinate in meters.
- * @param y_m Y coordinate in meters.
- * @param heading Desired heading (in degrees) of the robot in this
- *                point. NAN means don't care. Positive number or zero
- *                means turn counter-clockwise, negative number means
- *                turn clockwise. Example: DEG2RAD(90) means turn up
- *                counter-clockwise and DEG2RAD(-270) means turn up
- *                clockwise.
- */
-void robot_trajectory_add_final_point_notrans(double x_m, double y_m, struct final_heading *heading)
-{
-       target_x = x_m;
-       target_y = y_m;
-       robot_trajectory_add_point_notrans(target_x, target_y);
-       
-       Trajectory *w;
-       ROBOT_LOCK(new_trajectory);
-       w = (Trajectory*)robot.new_trajectory;
-       if (w) {
-               w->finalHeading = *heading;
-       }
-       ROBOT_UNLOCK(new_trajectory);
-
-       FSM_SIGNAL(MOTION, EV_NEW_TRAJECTORY, NULL);
-}
-
-
-/** 
- * Stops actual movement.
- * 
- */
-void robot_stop()
-{
-       FSM_SIGNAL(MOTION, EV_MOVE_STOP, NULL);
-}
-
-
-void robot_send_speed(double left, double right) {
-       double mul;
-       unsigned l, r;
-
-       mul = 1000.0 / ROBOT_WHEEL_RADIUS_MM; // to angular speed
-       mul *= 28.0/(2.0*M_PI)/*gear*/*(1<<8);  // to pxmc speed
-
-       // I hope it is not neccessary to lock here
-       l = (int)(left * mul);
-       r = (int)(right * mul);
-       robot.orte_speed.left = l;//(l&0xff) << 8 | (l&0xff00) >> 8;
-       robot.orte_speed.right = r;//(r&0xff) << 8 | (r&0xff00) >> 8;
-//     DBG("speed l=%8.3g (%6d) r=%8.3g (%6d)", 
-//         left, l, // robot.orte_speed.left, 
-//         right, r //robot.orte_speed.right
-//         );
-       ORTEPublicationSend(robot.publisherMotor);
-}
-
-/** 
- * Makes move the robot to a target position. Use path panner to find
- * the trajectory. This function is intended to be called from main
- * FSM.
- * 
- * @param x X coordinate in meters.
- * @param y Y coordinate in meters.
- * @param heading Desired heading (in degrees) of the robot at goal
- *                point. NAN means don't care. Positive number or zero
- *                means turn counter-clockwise, negative number means
- *                turn clockwise. Example: DEG2RAD(90) means turn up
- *                counter-clockwise and DEG2RAD(-270) means turn up
- *                clockwise.
- */
-void robot_goto_notrans(double x, double y, struct final_heading *heading, struct TrajectoryConstraints *tc)
-{
-       ROBOT_LOCK(goal);
-       robot.goal.x = x;
-       robot.goal.y = y;
-       robot.goal_final_heading = *heading;
-       if (tc) robot.goal_trajectory_constraints = *tc;
-       else robot.goal_trajectory_constraints = trajectoryConstraintsDefault;
-       ROBOT_UNLOCK(goal);
-       FSM_SIGNAL(MOTION, EV_NEW_GOAL, NULL);
-}
diff --git a/src/robofsm/eb2007/movehelper_eb2007.h b/src/robofsm/eb2007/movehelper_eb2007.h
deleted file mode 100644 (file)
index 0d64ffb..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef MOVEHELPER_EB2007_H
-#define MOVEHELPER_EB2007_H
-
-#include <robodata.h>
-#include <robot_eb2007.h>
-#include <trgenconstr.h>
-#include <math.h>
-
-extern struct TrajectoryConstraints trajectoryConstraintsDefault;
-
-#ifdef __cplusplus
-extern "C" {
-#endif 
-
-/* extern double target_x, target_y; */
-
-#if defined(WE_ARE_RED) && defined(WE_ARE_BLUE)
-#error Both colors defined
-#endif
-
-#if !defined(WE_ARE_RED) && !defined(WE_ARE_BLUE)
-#error No colors defined
-#endif
-
-#ifdef WE_ARE_RED
-static inline double __trans_ang(double phi)
-{
-       double a;
-       a = M_PI/2.0 - phi + M_PI/2.0;
-       a = fmod(a, 2.0*M_PI);
-       if (phi >= 0 && a >= 0) a -= 2.0*M_PI;
-       if (phi < 0 && a < 0) a += 2.0*M_PI;
-       return a;
-}
-static inline struct final_heading* __trans_heading(struct final_heading *h)
-{
-       if (h->turn_type != FH_DONT_TURN) {
-               h->heading = __trans_ang(h->heading);
-               switch (h->turn_type) {
-                       case FH_CW:
-                               h->turn_type = FH_CCW;
-                               break;
-                       case FH_CCW:
-                               h->turn_type = FH_CW;
-                               break;
-                       default:
-                               break;
-               }
-       }
-       return h;
-}
-
-#define TRANS_X(x) (PLAYGROUND_WIDTH_M - (x))
-#define TRANS_Y(y) (y)
-#define TRANS_ANG(a) __trans_ang(a)
-#define TRANS_HEADING(h) __trans_heading(h)
-#endif
-
-#ifdef WE_ARE_BLUE
-#define TRANS_X(x) (x)
-#define TRANS_Y(y) (y)
-#define TRANS_ANG(a) (a)
-#define TRANS_HEADING(h) (h)
-#endif
-
-
-
-void robot_set_act_pos_notrans(double x, double y, double phi);
-#define robot_set_act_pos_trans(x, y, phi) robot_set_act_pos_notrans(TRANS_X(x), TRANS_Y(y), TRANS_ANG(phi))
-
-void robot_trajectory_new(struct TrajectoryConstraints *tc);
-void robot_trajectory_new_backward(struct TrajectoryConstraints *tc);
-
-void robot_trajectory_add_point_notrans(double x_m, double y_m);
-#define robot_trajectory_add_point_trans(x, y) robot_trajectory_add_point_notrans(TRANS_X(x), TRANS_Y(y))
-
-void robot_trajectory_add_final_point_notrans(double x_m, double y_m, struct final_heading *heading);
-#define robot_trajectory_add_final_point_trans(x, y, heading) robot_trajectory_add_final_point_notrans(TRANS_X(x), TRANS_Y(y), TRANS_HEADING(heading))
-
-void robot_stop();
-
-void robot_send_speed(double left, double right);
-
-void robot_goto_notrans(double x, double y, struct final_heading *heading, struct TrajectoryConstraints *tc);
-#define robot_goto_trans(x, y, heading, tc) robot_goto_notrans(TRANS_X(x), TRANS_Y(y), TRANS_HEADING(heading), tc)
-
-static inline void robot_translate_coordinates(double *x, double *y, double *phi)
-{
-       if (x) {
-               *x = TRANS_X(*x);
-       }
-       if (phi) {
-               *phi = TRANS_ANG(*phi);
-       }
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif 
-
-
-#endif /* MOVEHELPER_EB2007_H */
diff --git a/src/robofsm/eb2007/roboevent_eb2007.py b/src/robofsm/eb2007/roboevent_eb2007.py
deleted file mode 100644 (file)
index ee1e7dd..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-events = {
-    "main" : {
-        "EV_START" : "Competition started.",
-        "EV_SHORT_TIME_TO_END" : "Time to go for the deposition regarless of what do we have.",
-       "EV_COLLECT_WASTE" : "",
-       "EV_DEPOSITE_BOTTLE" : "",
-       "EV_DEPOSITE_CAN" : "",
-       "EV_DEPOSITE_DONE" : "",
-       "EV_WAIT_DEPOSITE_BOTTLE" : "",
-       "EV_WAIT_DEPOSITE_CAN" : "",
-       "EV_STACK_FULL" : "",
-
-       "EV_MOTION_DONE" : "Previously submitted motion is finished",
-       "EV_LOST_DURING_MOTION" : "Actual position of the robot is too far from reference",
-       "EV_TRAJECTORY_ERROR" : "The trajectory submitted by ::EV_NEW_TRAJECTORY can't be prepared for execution.",
-
-       "EV_GOAL_NOT_REACHABLE" : "Path planner can't calculate a path to the goal. Probably obstacles are on the way.",
-
-       "EV_DETECTED_BOTTLE" : "",
-       "EV_DETECTED_CAN" : "",
-       "EV_DETECTED_BATTERY" : "",
-       "EV_DETECTED_WASTE" : "",
-       "EV_OBSTRUCTION_AHEAD" : "",
-       "EV_ENEMY_AHEAD" : "",
-
-       "EV_PICKUP_READY" : "Pickup FSM is ready to try pickup waste.",
-       "EV_PICKUP_DONE" : "Pickup FSM sucessfully moved the waste to stock.",
-       "EV_PICKUP_FAILED" : "Pick up failed.",
-       "EV_PICKUP_JAMMED" : "Waste seems to be jammed.",
-    },
-    "detect" : {
-    },
-    "loc" : {
-       "EV_LOC_INIT" : "",
-       "EV_LOC_LOCATE" : "",
-       "EV_ODOMETRY_RECEIVED" : "",
-       "EV_LASER_RECEIVED" : "",
-       "EV_POSITION_UPDATED" : "",
-    },
-    "pickup" : {
-       "EV_PICKUP_START" : "",
-       "EV_TRASH_GOES_UP" : "",
-       "EV_PICKUP_TRY" : "",
-       "EV_PICKUP_FREE" : "",
-    },
-    "motion" : {
-       "EV_MOVE_STOP" : "Stop current motion as fast as possible",
-       "EV_NEW_TRAJECTORY" : "New trajectory submitted to robot.new_trajectory",
-       "EV_NEW_GOAL" : "A new goal is received",
-        "EV_TRAJECTORY_LOST" : "Actual position of the robot is too far from reference",
-        "EV_TRAJECTORY_DONE" : "Reference position is at the end of the previously submitted trajectory",
-       "EV_TRAJECTORY_DONE_AND_CLOSE" : "::EV_TRAJECTORY_DONE + distance of actual position to the target is less than XXX",
-       "EV_LOC_UPDATED" : "Localization updated the estimate of the robot position",
-       "EV_LOC_LOST" : "Localization can't estimate the position of the robot.",
-    },
-    "joystick" : {
-    },
-    "display" : {
-       "EV_SWITCH_TO_CONS" : "Switch display mode to CONSOLE",
-       "EV_SWITCH_TO_STATUS" : "Switch display mode to STATUS",
-       "EV_SWITCH_TO_MAP" : "Switch display mode to MAP",
-       "EV_SWITCH_TO_MISC" : "Switch display mode to MISC",
-    }
-}
diff --git a/src/robofsm/eb2007/roboorte.c b/src/robofsm/eb2007/roboorte.c
deleted file mode 100644 (file)
index 42c95fb..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-#include <orte.h>
-#include <movehelper_eb2007.h>
-
-#ifdef CONFIG_ORTE_RTL
-#include <linux/module.h>
-#include <posix/pthread.h>
-#define printf rtl_printf
-#elif defined CONFIG_ORTE_RTAI
-#include <linux/module.h>
-#include <rtai/compat.h>  
-#define printf rt_printk
-#else
-#include <stdio.h>
-#endif
-
-#include <robot_eb2007.h>
-#include <robottype.h>
-#include <robottype_eb2007.h>
-#include <math.h>
-#include <string.h>
-
-ORTEDomain *d=NULL;
-double k0 = 0;
-double k1 = 0;
-double rozvor = 0.255; // rozvor - zjistit
-double aktUhel = 0;
-int firstRun = 1;
-struct motion_irc_type initPos;
-
-struct sharpShorts_type sharpWaste;
-struct sharpLongs_type sharpOpponent;
-struct stateInnerIR_type IRsensors;
-
-static void recvCallBackLaser(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       struct laserData_type *instance=(struct laserData_type*)vinstance;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       ROBOT_LOCK(laser_recv);
-                       //robot.laser_recv.cnt = instance->cnt;
-                       //robot.laser_recv.period = ((struct laserData_type *)vinstance)->measures[0];
-                       //memcpy(&robot.laser_recv.measures, instance->measures, sizeof(short)*10);
-                       robot.laser_recv = *instance;
-                       //printf("laser data received\n");
-                       ROBOT_UNLOCK(laser_recv);
-                       FSM_SIGNAL(LOC, EV_LASER_RECEIVED, NULL);
-                       break;
-               case DEADLINE:
-                       printf("laser data deadline\n");
-                       //DBG("laser deadline occurred\n");
-                       break;
-       }
-}
-
-static void *subscriberLaserCreate(void *arg) {
-       //static struct laserData_type orte_laserData;
-
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       laserData_type_register(d);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "laser", "laserData", 
-                                &robot.laser_recv, &deadline, &minimumSeparation, 
-     recvCallBackLaser, NULL, IPADDRESS_INVALID);
-       return arg;
-}
-
-static void *subscriberAngleCreate(void *arg) {
-       //static struct laserData_type orte_laserData;
-
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       stateFrontDoor_type_register(d);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "FD", "stateFrontDoor", 
-                                &robot.frontDoorAngle, &deadline, &minimumSeparation, 
-     NULL, NULL, IPADDRESS_INVALID);
-       return arg;
-}
-
-static void recvSharp1CallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       //struct sharpLongs_type *instance=(struct sharpLongs_type*)vinstance;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       ROBOT_LOCK(sharpsOpponent);
-                       robot.sharpsOpponent = sharpOpponent;
-                       ROBOT_UNLOCK(sharpsOpponent);
-                       //DBG("Callback\n");
-                       //fsm_signal(FSM(LOC), EV_LASER_RECEIVED); 
-                       break;
-               case DEADLINE:
-                       //DBG("long sharps deadline occurred\n");
-                       break;
-       }
-}
-
-static void recvSharp2CallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       //struct sharpShorts_type *instance=(struct sharpShorts_type*)vinstance;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       ROBOT_LOCK(sharpsWaste);
-                       robot.sharpsWaste = sharpWaste;
-                       ROBOT_UNLOCK(sharpsWaste);
-                       
-                       //fsm_signal(FSM(LOC), EV_LASER_RECEIVED); 
-                       break;
-               case DEADLINE:
-                       //DBG("short sharps deadline occurred\n");
-                       break;
-       }
-}
-
-static void recvIRCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       //struct stateInnerIR_type *instance=(struct stateInnerIR_type*)vinstance;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       ROBOT_LOCK(IRsensors);
-                       robot.IRsensors = IRsensors;
-                       ROBOT_UNLOCK(IRsensors);
-                       
-                       //fsm_signal(FSM(LOC), EV_LASER_RECEIVED); 
-                       break;
-               case DEADLINE:
-                       //DBG("IR deadline occurred\n");
-                       break;
-       }
-}
-
-static void recvOdoCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       struct motion_irc_type *instance=(struct motion_irc_type*)vinstance;
-       static struct motion_irc_type prevInstance;
-       static int firstRun = 1;
-       double n = (double)(28.0 / 1.0); // spocitat prevodovy pomer
-       double c = (M_PI*2*ROBOT_WHEEL_RADIUS_MM/1000) / (n * 4*500.0); // vzdalenost na pulz - 4.442 je empiricka konstanta :)
-        
-       double aktk0 = 0;
-       double aktk1 = 0;
-       double deltaU = 0;
-       double dk0 = 0;
-       double dk1 = 0;
-       double deltAlfa = 0;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       robot.odometry = *instance;
-                       if(firstRun) {
-                               prevInstance = *instance;
-                               firstRun = 0;
-                               break;
-                       }
-                       else {
-                               robot.odometry.left -= initPos.left;
-                               robot.odometry.right -= initPos.right;
-                       }
-                       
-                       aktk0 = (prevInstance.left - instance->left) >> 8;
-                       aktk1 = (instance->right - prevInstance.right) >> 8;                    
-                       prevInstance = *instance;
-                       dk0 = aktk0;
-                       dk1 = aktk1;    
-
-                       k0 = aktk0;
-                       k1 = aktk1;
-
-                       dk0 *= c;
-                       dk1 *= c;
-                       //printf("dk.left=%f dk.right=%f\n",dk0,dk1);
-                       deltaU = (dk0 + dk1) / 2;
-
-                       deltAlfa = (dk1 - dk0) / (2.0*ROBOT_ROTATION_RADIUS_MM/1000);    // dk1 - dk0
-                       /* FIXME */
-/*                     ROBOT_LOCK(act_pos); */
-/*                     aktUhel = robot.act_pos.phi; */
-/*                     ROBOT_UNLOCK(act_pos); */
-                       
-                       aktUhel += deltAlfa;            // aktualni uhel
-
-                       double x, y, phi;
-/*                     ROBOT_LOCK(act_pos); */
-/*                     x = robot.act_pos.x + deltaU * cos(aktUhel); */
-/*                     y = robot.act_pos.y + deltaU * sin(aktUhel); */
-/*                     phi = robot.act_pos.phi = aktUhel; */
-/*                     ROBOT_UNLOCK(act_pos); */
-                       robot_set_act_pos_notrans(x, y, phi);
-                       break;
-               case DEADLINE:
-                       break;
-       }
-}
-
-static void recvStartCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       struct stateDigIn_type *instance=(struct stateDigIn_type*)vinstance;
-       static int lastState = 0;
-       switch (info->status) {
-               case NEW_DATA:
-                       if((instance->state==0) && (lastState==0)) //ZAVOLAM STARTOVACI FUNKCI;
-                               lastState=1;
-                       robot.start = 0;
-                       if((instance->state==1) && (lastState==1)) //ZAVOLAM STARTOVACI FUNKCI;
-                       {
-                               lastState = 2;
-                               robot.start = 1;
-                               FSM_SIGNAL(MAIN, EV_START, NULL);
-                       }
-                       //fsm_signal(FSM(LOC), EV_LASER_RECEIVED); 
-                       break;
-               case DEADLINE:
-                       //DBG("IR deadline occurred\n");
-                       break;
-       }
-}
-
-static void recvJoyCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-       struct joy_data_type *instance=(struct joy_data_type*)vinstance;
-
-       switch (info->status) {
-               case NEW_DATA:
-                       ROBOT_LOCK(joy);
-                       robot.joy = *instance;
-                       ROBOT_UNLOCK(joy);
-                       
-                       //fsm_signal(FSM(LOC), EV_LASER_RECEIVED); 
-                       break;
-               case DEADLINE:
-                       //DBG("IR deadline occurred\n");
-                       break;
-       }
-}
-
-void *subscriberJoyCreate(void *arg) {
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       joy_data_type_register(d);
-//     ORTETypeRegisterAdd(d,"SharpMsg1",NULL,NULL,NULL,sizeof(sharpToRecv)); 
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "joy", "joy_data", 
-                               &(robot.joy), &deadline, &minimumSeparation, recvJoyCallBack, arg, IPADDRESS_INVALID);
-       return arg;
-}
-
-void *subscriberIRCreate(void *arg) {
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       stateInnerIR_type_register(d);
-//     ORTETypeRegisterAdd(d,"SharpMsg1",NULL,NULL,NULL,sizeof(sharpToRecv)); 
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "IR", "stateInnerIR", &IRsensors, &deadline, &minimumSeparation, recvIRCallBack, arg, IPADDRESS_INVALID);
-       return arg;
-}
-
-void *subscriberOdoCreate(void *arg) {
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       motion_irc_type_register(d);
-//     ORTETypeRegisterAdd(d,"SharpMsg1",NULL,NULL,NULL,sizeof(sharpToRecv)); 
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "position", "motion_irc",          &(robot.odometry), &deadline, &minimumSeparation, recvOdoCallBack, arg, IPADDRESS_INVALID);
-       return arg;
-}
-
-void *subscriberDICreate(void *arg) {
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       stateDigIn_type_register(d);
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "DI", "stateDigIn",                &(robot.startBit), &deadline, &minimumSeparation, recvStartCallBack, arg, IPADDRESS_INVALID);
-       return arg;
-}
-
-void *subscriberSharp1Create(void *arg) {
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       sharpLongs_type_register(d);
-//     ORTETypeRegisterAdd(d,"SharpMsg1",NULL,NULL,NULL,sizeof(sharpToRecv));
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "sharpSouper", "sharpLongs",
-                                &sharpOpponent, &deadline, &minimumSeparation, recvSharp1CallBack, arg, IPADDRESS_INVALID);
-                                //FIXME: ^ Orte to prepisuje? Neni to lockovany!!!!
-       return arg;
-}
-
-void *subscriberSharp2Create(void *arg) {
-       ORTESubscription    *s;
-       NtpTime             deadline,minimumSeparation;
-
-       sharpShorts_type_register(d);
-//     ORTETypeRegisterAdd(d,"SharpMsg1",NULL,NULL,NULL,sizeof(sharpToRecv)); 
-       NTPTIME_BUILD(deadline,10);
-       NTPTIME_BUILD(minimumSeparation,0);
-       s=ORTESubscriptionCreate(d, IMMEDIATE, BEST_EFFORTS, "sharpLahve", "sharpShorts",               &sharpWaste, &deadline, &minimumSeparation, recvSharp2CallBack, arg, IPADDRESS_INVALID);
-       return arg;
-}
-
-void sendCallBackMotor(const ORTESendInfo *info,void *instance, void *sendCallBackParam) {
-       switch (info->status) {
-               case NEED_DATA:
-                       //DBG("need data\n");
-                       break;
-               case CQL:
-                       //DBG("cql\n");
-                       break;
-       }
-}
-static void *publisherMotorCreate(void *arg) {
-       NtpTime             persistence, delay;
-
-       motion_speed_type_register(d);
-
-       NTPTIME_BUILD(persistence,3);
-       NTPTIME_BUILD(delay,1); 
-       robot.publisherMotor=ORTEPublicationCreate(d, "motor", "motion_speed", &robot.orte_speed, &persistence, 2, sendCallBackMotor,  NULL, &delay);
-       return arg;
-}
-
-void sendCallBackServo(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam) {
-       //struct stateServa_type *instance=(struct stateServa_type*)vinstance;
-
-       switch (info->status) {
-               case NEED_DATA:         
-                       break;
-               case CQL:  //criticalQueueLevel
-                       break;
-       }
-}
-
-void *publisherCreateServo(void *arg) {
-       NtpTime             persistence, delay;
-
-       stateServa_type_register(d);
-       NTPTIME_BUILD(persistence,3);
-       NTPTIME_BUILD(delay,1); 
-       robot.publisherServa=ORTEPublicationCreate(d, "serva", "stateServa", &(robot.serva), &persistence, 2, sendCallBackServo, arg, &delay);
-       return arg;
-}
-
-void sendCallBackPosition(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam) {
-       act_pos *instance=(act_pos*)vinstance;
-
-       switch (info->status) {
-               case NEED_DATA:
-                       instance = &(robot.act_pos);
-                       break;
-                       case CQL:  //criticalQueueLevel
-                               break;
-       }
-}
-
-void *publisherCreatePosition(void *arg) {
-       NtpTime             persistence, delay;
-
-       act_pos_type_register(d);
-       NTPTIME_BUILD(persistence,3);
-       NtpTimeAssembFromMs(delay,0,40); 
-       robot.publisherPosition=ORTEPublicationCreate(d, "pos", "act_pos", &(robot.act_pos), &persistence, 2, sendCallBackPosition, arg, &delay);
-       return arg;
-}
-
-void sendCallBackEstPosition(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam) {
-       est_pos *instance=(est_pos*)vinstance;
-
-       switch (info->status) {
-               case NEED_DATA:
-                       ROBOT_LOCK(est_pos);
-                       instance = &(robot.est_pos);
-                       ROBOT_UNLOCK(est_pos);
-                       break;
-                       case CQL:  //criticalQueueLevel
-                               break;
-       }
-}
-
-void *publisherCreateEstPosition(void *arg) {
-       NtpTime             persistence, delay;
-
-       est_pos_type_register(d);
-       NTPTIME_BUILD(persistence,3);
-       NtpTimeAssembFromMs(delay,0,40); 
-       robot.publisherEstPosition=ORTEPublicationCreate(d, "est_pos", "est_pos", &(robot.est_pos), &persistence, 2, sendCallBackEstPosition, arg, &delay);
-       return arg;
-}
-
-void sendCallBackAccu(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam) {
-
-       switch (info->status) {
-               case NEED_DATA:
-                       break;
-                       case CQL:  //criticalQueueLevel
-                               break;
-       }
-}
-
-void *publisherCreateAccu(void *arg) {
-       NtpTime             persistence, delay;
-
-       accumulator_type_register(d);
-       NTPTIME_BUILD(persistence,3);
-       NTPTIME_BUILD(delay,1); 
-       robot.publisherAccumulator=ORTEPublicationCreate(d, "accu", "accumulator", &(robot.accu), &persistence, 2, sendCallBackAccu, arg, &delay);
-       return arg;
-}
-
-void initOrte() {
-       ORTEInit();
-
-       ORTEVerbositySetOptions("ALL.0");
-       d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,NULL,NULL,ORTE_FALSE);
-       if (!d) {
-               printf("ORTEDomainAppCreate failed!\n");
-       }
-       subscriberJoyCreate(NULL);
-       subscriberLaserCreate(NULL);
-       publisherMotorCreate(NULL);
-       publisherCreateServo(NULL);
-       subscriberSharp1Create(NULL);
-       subscriberSharp2Create(NULL);
-       subscriberIRCreate(NULL);
-       subscriberDICreate(NULL);
-       subscriberOdoCreate(NULL);
-       subscriberAngleCreate(NULL);
-       publisherCreatePosition(NULL);
-       publisherCreateEstPosition(NULL);
-}
-
-void terminateOrte() {
-       ORTEDomainAppDestroy(d);
-}
diff --git a/src/robofsm/eb2007/robot_eb2007.c b/src/robofsm/eb2007/robot_eb2007.c
deleted file mode 100644 (file)
index e9fee85..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-#include <robot_eb2007.h>
-#include <signal.h>
-#include <unistd.h>
-#include <servos_eb2007.h>
-#include <movehelper_eb2007.h>
-
-static int thread_priorities[] = {
-       [FSM_ID_MOTION] = 25,
-       [FSM_ID_MAIN] = 20,
-       [FSM_ID_DET] = 15,
-       [FSM_ID_JOY] = 15,
-       [FSM_ID_LOC] = 10
-};
-
-static char *fsm_name[] = {
-       [FSM_ID_MOTION] = "motion",
-       [FSM_ID_MAIN] = "main",
-       [FSM_ID_DET] = "detection",
-       [FSM_ID_JOY] = "joystick",
-       [FSM_ID_LOC] = "localization",
-       [FSM_ID_PICKUP] = "pickup"
-};
-
-struct robot_eb2007 robot;
-
-static void block_signals()
-{
-       sigset_t sigset;
-       int i;
-
-       sigemptyset(&sigset);
-       for (i=0; i<7; i++)
-               sigaddset(&sigset, SIGRTMIN+i);
-
-       pthread_sigmask(SIG_BLOCK, &sigset, (sigset_t*)NULL);
-}
-
-static void int_handler(int sig)
-{
-       robot_exit();
-}
-
-int fsm_det_in(struct robo_fsm *fsm, int ret_code);
-
-/** 
- * Initializes the robot.
- * Setup fields in robot structure, initializes FSMs and ORTE.
- * 
- * @return 0
- */
-int robot_init()
-{
-       int i;
-       robot.mode = ROBO_TESTING;
-
-       pthread_mutex_init(&robot.lock, NULL);
-       pthread_mutex_init(&robot.lock_act_pos, NULL);
-
-       /* FSM initialization */
-       for (i=0; i<FSM_CNT; i++)
-               fsm_init(&robot.fsm[i], fsm_name[i]);
-
-#ifdef WE_ARE_RED
-       printf("We are RED!\n");
-#endif
-#ifdef WE_ARE_BLUE
-       printf("We are BLUE!\n");
-#endif
-
-       signal(SIGINT, int_handler);
-       block_signals();
-
-       robot.serva.release = FRONT_LAUNCH_LOCK;
-       robot.serva.frontDoor = FRONT_DOOR_UP;
-       robot.serva.innerDoor = INNER_DOOR_UP;
-       robot.serva.backDoor = BACK_DOOR_UP;
-       robot.serva.transporterFront = FRONT_TRANSPORTER_STOP;
-       robot.serva.transporterInner = INNER_TRANSPORTER_STOP;
-
-       robot.sharpsOpponent.longSharpDist1 = 2.0;
-       robot.sharpsOpponent.longSharpDist2 = 2.0;
-       robot.sharpsOpponent.longSharpDist3 = 2.0;
-
-       initOrte();
-       ORTEPublicationSend(robot.publisherServa);
-       
-       return 0;
-}
-/** 
- * Starts the robot threads.
- * @todo Don't exit() in case of error.
- * @return 0
- */
-int robot_start()
-{
-       int i;
-
-       /* start FSM threads */
-       for(i=0; i<FSM_CNT; i++) {
-               pthread_attr_t attr;
-               struct sched_param param;
-
-               pthread_attr_init(&attr);
-
-               param.sched_priority = thread_priorities[i];
-               pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
-               if (pthread_attr_setschedparam(&attr, &param)) {
-                       perror("pthread_attr_setschedparam");
-                       exit(1);
-               }
-
-               
-               if (fsm_start(&robot.fsm[i], &attr) != 0) {
-                       perror("fsm_start");
-                       exit(1);
-               }
-       }
-
-       return 0;
-}
-
-/** 
- * Signals all the robot threads to finish.
- * @return 0
- */
-int robot_exit()
-{
-       int i;
-       /* start FSM threads */
-       for(i=0; i<FSM_CNT; i++) {
-               fsm_event e = { EV_EXIT, NULL };
-               __fsm_signal(&robot.fsm[i], e, FSM_WAIT_FOREVER);
-       }
-       return 0;
-}
-
-/** 
- * Wait for finishing the robot threads after calling robot_exit(). *
- * 
- * @return 0
- */
-int robot_wait()
-{
-       int i;
-       /* wait for threads */
-       for (i=0; i<FSM_CNT; i++) {
-               pthread_join(robot.fsm[i].threadid, NULL);
-       }
-       return 0;
-}
-
-/** 
- * Stops the robot. All resources alocated by robot_init() or
- * robot_start() are dealocated here.
-
- * @return 0
- */
-int robot_destroy()
-{
-       int i;
-       printf("\n\n\n");
-       for (i=0;i<3;i++) {     /* For better reliability :( */
-               frontDoorDown();
-               frontDoorUp();
-               innerDoorUp();
-               backDoorUp();
-               frontTransporterStop();
-               innerTransporterStop();
-               lockFront();
-               usleep(100000);
-       }
-
-       for (i=0; i<FSM_CNT; i++)
-               fsm_destroy(&robot.fsm[i]);
-       DBG("robofsm: stop.\n");
-       terminateOrte();
-       return 0;
-}
-
diff --git a/src/robofsm/eb2007/robot_eb2007.h b/src/robofsm/eb2007/robot_eb2007.h
deleted file mode 100644 (file)
index e744e3d..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * robot_eb2007.h                      07/04/18
- *
- * Robot's data structures for the Eurobot 2007.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#ifndef ROBOT_EB2007_H
-#define ROBOT_EB2007_H
-
-#include <stdint.h>
-#include <stdio.h>
-#include <mcl.h>
-#include <trgenconstr.h>
-#include <robottype.h>
-#include <robottype_eb2007.h>
-#include <robodim_eb2007.h>
-#include <roboevent_eb2007.h>
-#include <fsm.h>
-#include <servos_eb2007.h>
-
-/* Select robot color. If we are BLUE, no coordinate transformation will
- * be performed. */
-// #define WE_ARE_RED
-#define WE_ARE_BLUE
-
-/**
- * FSM
- */
-/* amount of FSM */
-#define FSM_CNT                6
-
-/* FSM ids */
-enum robot_fsm_id {
-       FSM_ID_MAIN     = 0,
-       FSM_ID_DET      = 1,
-       FSM_ID_LOC      = 2,
-       FSM_ID_MOTION   = 3,
-       FSM_ID_PICKUP   = 4,
-       FSM_ID_JOY      = 5
-};
-
-#define LAS_CNT                12      /* dont forget to change CRA!! */
-/* index of information in times array */
-#define LAS_MEAS_CNTI  0       /* counter index of measured times */
-#define LAS_MEAS_PERI  1       /* period index */
-#define LAS_MEAS_DATAI 2       /* data index */
-
-enum {
-       WASTE_BOTTLE,
-       WASTE_CAN,
-       WASTE_UNKNOWN
-};
-
-enum bottle_sens_state {
-       NOTHING = 0,
-       FAR,
-       CLOSE
-};
-
-struct bottle_sens {
-       uint8_t sens1;
-       uint8_t sens2;  
-       uint8_t sens3;  
-       uint8_t sens4;
-};
-
-/* Mapping of robot structure fields to locks */
-//#define __robot_lock_ lock   /* ROBOT_LOCK() */
-#define __robot_lock_ref_pos           lock_ref_pos
-#define __robot_lock_est_pos           lock
-#define __robot_lock_des_pos           lock
-#define __robot_lock_goal              lock
-#define __robot_lock_IRsensors         lock
-#define __robot_lock_joy               lock
-#define __robot_lock_laser_recv                lock
-#define __robot_lock_new_trajectory    lock
-#define __robot_lock_sharpsOpponent    lock
-#define __robot_lock_sharpsWaste       lock
-#define __robot_lock_waste_cnt         lock
-#define __robot_lock_frontDoorAngle    lock
-
-/* robot's main data structure */
-struct robot_eb2007 {
-       long long cnt;
-       unsigned char   mode;   
-       pthread_mutex_t lock;
-       pthread_mutex_t lock_ref_pos;
-
-       /** Temporary storage for new trajectory. After the trajectory creation is
-        * finished, this trajectory is submitted to fsmmove. */
-       void *new_trajectory;
-       
-       unsigned char isTrajectory;
-       unsigned char start;
-       
-       /* partial FSMs */
-       struct robo_fsm fsm[FSM_CNT];
-
-       /* mcl model */
-       struct mcl_model mcl;
-       /* actual position */
-       struct ref_pos_type ref_pos;
-
-       /* estimated position */
-       struct est_pos_type est_pos;
-       /* goal position */
-       struct ref_pos_type goal;
-       struct TrajectoryConstraints goal_trajectory_constraints;
-       struct final_heading goal_final_heading;
-       /* move */
-       struct ref_pos_type move_dpos;
-
-       /* orte */
-       struct laserData_type laser_recv;
-       struct motion_speed_type orte_speed;
-
-       struct stateServa_type serva;
-       struct sharpShorts_type sharpsWaste;
-       struct sharpLongs_type sharpsOpponent;
-       struct stateInnerIR_type IRsensors;
-       struct stateDigIn_type startBit;
-       struct stateFrontDoor_type frontDoorAngle;
-       
-       struct bottle_sens bott_sens;
-       
-       struct motion_irc_type odometry;
-       
-       struct accumulator_type accu;
-       
-       struct joy_data_type joy;
-
-       ORTEPublication *publisherMotor;
-       ORTEPublication *publisherServa;
-       ORTEPublication *publisherPosition;
-       ORTEPublication *publisherEstPosition;
-       ORTEPublication *publisherAccumulator;
-
-       int bottle_under_belt;
-       int waste_cnt;
-}; /* robot_eb2007 */
-
-extern struct robot_eb2007 robot;
-
-#ifdef __cplusplus
-extern "C" {
-#endif 
-
-void initOrte();
-void terminateOrte();
-int robot_init();
-int robot_start();
-int robot_exit();
-int robot_wait();
-int robot_destroy();
-
-FSM_STATE_DECL(main_init);
-FSM_STATE_DECL(pickup_init);
-FSM_STATE_DECL(move_init);
-FSM_STATE_DECL(det_start);
-FSM_STATE_DECL(loc_init);
-FSM_STATE_DECL(joy_init);
-
-#ifdef __cplusplus
-}
-#endif 
-
-/*Thread priorities*/
-#define TRAJ_FOLLOWER_PRIO 255 /* As high as possible */
-#define OBST_FORGETING_PRIOTR 10       /* Priority of the thread for forgeting detected obstacles. */
-#define TRAJ_RECALC_PRIO 0
-
-#endif /* ROBOT_EB2007_H */
diff --git a/src/robofsm/eb2007/servos_eb2007.c b/src/robofsm/eb2007/servos_eb2007.c
deleted file mode 100644 (file)
index 5d6126b..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * servos_eb2007.c                     07/04/18
- *
- * Robot's servos control.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#include <robot_eb2007.h>
-#include <servos_eb2007.h>
-
-void releaseFront(void) {
-       robot.serva.release = FRONT_LAUNCH_OPEN;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void lockFront(void) {
-       robot.serva.release = FRONT_LAUNCH_LOCK;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void frontDoorUp(void) {
-       robot.serva.frontDoor = FRONT_DOOR_UP;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void frontDoorDown(void) {
-       robot.serva.frontDoor = FRONT_DOOR_DOWN;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void innerDoorUp(void) {
-       robot.serva.innerDoor = INNER_DOOR_UP;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void innerDoorDown(void) {
-       robot.serva.innerDoor = INNER_DOOR_DOWN;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void backDoorUp(void) {
-       robot.serva.backDoor = BACK_DOOR_UP;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void backDoorDown(void) {
-       robot.serva.backDoor = BACK_DOOR_DOWN;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void frontTransporterForward(void) {
-       robot.serva.transporterFront = FRONT_TRANSPORTER_FORWARD;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void frontTransporterForwardFast(void) {
-       robot.serva.transporterFront = FRONT_TRANSPORTER_FORWARD_FAST;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void frontTransporterStop(void) {
-       robot.serva.transporterFront = FRONT_TRANSPORTER_STOP;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void frontTransporterBackward(void) {
-       robot.serva.transporterFront = FRONT_TRANSPORTER_BACKWARD;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void innerTransporterLeft(void) {
-       robot.serva.transporterInner = INNER_TRANSPORTER_LEFT;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void innerTransporterRight(void) {
-       robot.serva.transporterInner = INNER_TRANSPORTER_RIGHT;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
-void innerTransporterStop(void) {
-       robot.serva.transporterInner = INNER_TRANSPORTER_STOP;
-       ORTEPublicationSend(robot.publisherServa);
-}
-
diff --git a/src/robofsm/eb2007/servos_eb2007.h b/src/robofsm/eb2007/servos_eb2007.h
deleted file mode 100644 (file)
index 4cecf8b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * servos_eb2007.h                     07/04/18
- *
- * Robot's servos control.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#ifndef SERVOS_EB2007_H
-#define SERVOS_EB2007_H
-
-#define FRONT_DOOR_UP 20
-#define FRONT_DOOR_DOWN 251
-#define INNER_DOOR_UP 255
-#define INNER_DOOR_DOWN 1
-#define BACK_DOOR_UP 160
-#define BACK_DOOR_DOWN 1
-#define TRANSPORTER_OFF 127
-#define FRONT_LAUNCH_LOCK 195
-#define FRONT_LAUNCH_OPEN 66
-#define FRONT_TRANSPORTER_FORWARD (127+60)
-#define FRONT_TRANSPORTER_FORWARD_FAST (127+60)
-#define FRONT_TRANSPORTER_STOP 127
-#define FRONT_TRANSPORTER_BACKWARD (127-20)
-#define INNER_TRANSPORTER_LEFT (127-26)
-#define INNER_TRANSPORTER_STOP 127
-#define INNER_TRANSPORTER_RIGHT (127+16)
-
-#ifdef __cplusplus
-extern "C" {
-#endif 
-
-
-void releaseFront(void);
-void lockFront(void);
-void frontDoorUp(void);
-void frontDoorDown(void);
-void innerDoorUp(void);
-void innerDoorDown(void);
-void backDoorUp(void);
-void backDoorDown(void);
-void frontTransporterForward(void);
-void frontTransporterForwardFast(void);
-void frontTransporterBackward(void);
-void frontTransporterStop(void);
-void innerTransporterLeft(void);
-void innerTransporterStop(void);
-void innerTransporterRight(void);
-
-#ifdef __cplusplus
-}
-#endif 
-
-#endif /* SERVOS_EB2007_H */
diff --git a/src/robofsm/eb2007/test/Makefile b/src/robofsm/eb2007/test/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/robofsm/eb2007/test/Makefile.omk b/src/robofsm/eb2007/test/Makefile.omk
deleted file mode 100644 (file)
index 2909ce3..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- makefile -*-
-
-test_PROGRAMS += follower
-follower_SOURCES = follower.cc
-
-test_PROGRAMS += testpickup
-testpickup_SOURCES = testpickup.cc
-
-test_PROGRAMS += testcollavoid
-testcollavoid_SOURCES = testcollavoid.cc
-
-# Libraries linked to all programs in this Makefile
-lib_LOADLIBES = robot_eb2007 mcl laser-nav robomath robottype robottype_eb2007 pthread \
-               rt m orte pathplan sharp map fsm rbtree motion
-
diff --git a/src/robofsm/eb2007/test/follower.cc b/src/robofsm/eb2007/test/follower.cc
deleted file mode 100644 (file)
index 56696b7..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * follower.cc                 07/10/01
- *
- * Test waste tracking down.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#define FSM_MAIN
-#include <sharp.h>
-#include <robomath.h>
-#include <robot_eb2007.h>
-#include <movehelper_eb2007.h>
-#include <trgen.h>
-#include <servos_eb2007.h>
-#include <map.h>
-
-#define HOMOLOGACE
-/**
- * Time constants.
- */
-/* time before stopping the deposition belt resp. closing the back door */
-#define DEPOSITE_WAIT          1000
-/* the same as above, but we need to wait a little bit longer for the last one */
-#define LAST_DEPOSITE_WAIT     1500
-/* time before closing the inner door */
-#define WASTE_ROLL_OUT_WAIT    900
-/* time before another pickup */
-#define NEW_PICK_UP_WAIT       1000
-/* waste detection period */
-#define WASTE_DETECTION_PERIOD 100
-
-struct ref_pos_type des_pos;
-
-enum {
-       UNKNOWN = 0,
-       BOTTLE,
-       CAN
-};
-
-/**
- * Convert sharp`s measured values to mm.
- *
- * @ingroup    fsmmain
- */
-void get_short_sharp_mm(int *sharp)
-{
-       ROBOT_LOCK(sharpsWaste);
-       sharp[0] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short1);
-       sharp[1] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short2);
-       sharp[2] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short3);
-       sharp[3] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short4);
-       ROBOT_UNLOCK(sharpsWaste);
-}
-
-/**
- * Check out sharp values to evaluate, if waste is in our reach. 
- * 
- * @ingroup    fsmmain
- * @return     returns true if waste is in our reach.
- */
-int waste_ahead()
-{
-       int sharp[4];
-       int cnt = 0, i;
-
-       get_short_sharp_mm(sharp);
-       printf("sharp: %d %d %d %d\n", sharp[0], sharp[1], sharp[2], sharp[3]);
-       for (i=0; i<4; i++)
-               if (sharp[i] > 0 && sharp[i] < 130)
-                       cnt++;
-
-       return ((cnt >= 1) ? 1 : 0);
-}
-
-/**
- * Check out if stack is empty. Use back innerIR sensors to do it.
- *
- * @return     returns true if IR sensors indicate the waste
- */
-int stack_empty()
-{
-       int status;
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.back & 0xe0;
-       ROBOT_UNLOCK(IRsensors);
-       return ((status == 0) ? 1 : 0);
-}
-
-/**
- * Evaluation function to be sure the basket is behind us.
- * 
- * @ingroup    fsmmain
- * @return
- */
-int basket_behind()
-{
-       /* FIXME: return true by now, until the back sharps are connected */
-       return 1;
-}
-
-/**
- * Try to detect type of the waste.
- * 
- * @ingroup    fsmmain
- * @return     returns type of the waste.
- */
-int recognize_waste()
-{
-       int type = UNKNOWN;
-       char bit = 0x01;
-       char status;
-       int i, cnt = 0;
-
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.back & 0x1f;
-       ROBOT_UNLOCK(IRsensors);
-
-       for (i=0; i<8; i++)
-               if (status & (bit << i))
-                       cnt++;
-
-       switch (cnt) {
-               case 0:
-                       type = UNKNOWN;
-                       break;
-                       case 1: type = BOTTLE;
-                       break;
-               default: 
-                       type = CAN;
-                       break;
-       }
-
-       return type;
-}
-
-/**
- * Evaluation function to see in what direction the waste is.
- * 
- * @ingroup    fsmmain
- * @return     Returns enum value LEFT = 0, CENTER = 1, RIGHT = 2
- */
-
-enum {
-       LEFT = 0,
- CENTER,
- RIGHT
-};
-
-int waste_direction() {
-       int sharp[4];
-       int window[3];
-
-       get_short_sharp_mm(sharp);
-       window[0] = sharp[0] + sharp[1];
-       window[1] = sharp[1] + sharp[2];
-       window[2] = sharp[2] + sharp[3];
-       
-       printf("windows: %d %d %d\n",window[0],window[1],window[2]);
-       
-       if((window[0] < window[1]) && (window[0] < window[2])) return LEFT;
-       if((window[1] <= window[0]) && (window[1] <= window[2])) return CENTER;
-       if((window[2] < window[0]) && (window[2] < window[1])) return RIGHT;
-       return CENTER;
-}
-
-void get_new_pos(struct est_pos_type *est, struct ref_pos_type *req, 
-                       double l, double phi)
-{
-       req->x = est->x + l*cos(est->phi + phi);
-       req->y = est->y + l*sin(est->phi + phi);
-       req->phi = est->phi + phi;
-}
-
-void robot_turn(struct est_pos_type des_pos)
-{
-       struct TrajectoryConstraints tc = trajectoryConstraintsDefault;
-
-       robot_trajectory_new(&tc);
-
-       // Add random point to the trajectory.
-//     robot_trajectory_add_point(1, 1.5);
-       robot_trajectory_add_final_point_notrans(des_pos.x, des_pos.y, TURN(DEG2RAD(90)));
-}
-
-FSM_STATE_DECL(main_init);
-FSM_STATE_DECL(search_waste);
-FSM_STATE_DECL(turn_robot);
-FSM_STATE_DECL(go_for_waste);
-
-FSM_STATE(main_init) 
-{
-       /* start event ocurred */
-       switch (FSM_EVENT) {
-               /* FIXME: delete default: for the competititon */
-               default:
-               case EV_START:
-                       /* start competition timer */
-//                     pthread_create(&thid, NULL, wait_for_end, NULL);
-                       /* init map and shared memory if required */
-                       ShmapInit(1);
-                       /* starting position of the robot */
-                       ROBOT_LOCK(est_pos);
-                       robot.est_pos.x = 1.0;
-                       robot.est_pos.y = 1.0;
-                       robot.est_pos.phi = 0;
-//                     robot.est_pos.x = 2.98;
-//                     robot.est_pos.y = 1.88;
-//                     robot.est_pos.phi = M_PI;
-                       ROBOT_UNLOCK(est_pos);
-                       frontDoorDown();
-                       /* safety zone around playground`s wall  */
-//                     ShmapSetRectangleFlag(0.0, 0.0, 0.1, 2.1, MAP_FLAG_WALL, 0);
-//                     ShmapSetRectangleFlag(0.0, 0.0, 3.0, 0.1, MAP_FLAG_WALL, 0);
-//                     ShmapSetRectangleFlag(0.0, 2.0, 3.0, 2.1, MAP_FLAG_WALL, 0);
-//                     ShmapSetRectangleFlag(2.9, 0.0, 3.0, 2.1, MAP_FLAG_WALL, 0);
-                       /* cup for batteries */
-                       ShmapSetRectangleFlag(1.5, 1.4, 1.8, 1.0, MAP_FLAG_WALL, 0);
-                       /* waste counter */
-                       ROBOT_LOCK(waste_cnt);
-                       robot.waste_cnt = 0;
-                       printf("waste_cnt = %d\n", robot.waste_cnt);
-                       ROBOT_UNLOCK(waste_cnt);
-                       FSM_TIMER(2000);
-                       break;
-               case EV_TIMER:
-                       /* start to do something */
-                       FSM_TRANSITION(search_waste);
-//                     FSM_TRANSITION(waste_grab);
-                       break;
-//             default: break;
-       }
-}
-
-
-FSM_STATE(search_waste) {
-       struct est_pos_type est_pos;
-       int dir;
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       frontTransporterStop();
-                       if(waste_ahead()) {
-                               printf("waste is in front of me\n");
-                               ROBOT_LOCK(est_pos);
-                               est_pos = robot.est_pos;
-                               ROBOT_UNLOCK(est_pos);
-
-                               dir = waste_direction();
-                               switch(dir) {
-                                       case LEFT:                                              
-
-                                               get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(10));
-                                               printf("saw waste on left, actual phi is %f and desired %f\n",
-                                                       DEGREES(act_pos.phi), DEGREES(des_pos.phi));
-                                               break;
-                                       case CENTER:
-                                               get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(0));
-                                               printf("saw waste on center, actual phi is %f and desired %f\n",
-                                                       DEGREES(act_pos.phi), DEGREES(des_pos.phi));
-                                               break;
-                                               
-                                       case RIGHT:
-                                               get_new_pos(&act_pos, &des_pos, 0.1, DEG2RAD(-40));
-                                               printf("saw waste on right, actual phi is %f and desired %f\n",
-                                                       DEGREES(act_pos.phi), DEGREES(des_pos.phi));
-                                               break;
-                                       default:
-                                               printf("dont know where the waste is, direction returned %d\n",dir);
-                                               FSM_TRANSITION(search_waste);
-                                               break;
-                               }
-                               FSM_TRANSITION(go_for_waste);
-                       }
-                       else {
-                               printf("i can't see any waste, sorry\n");
-                               
-//                             robot_goto_trans(robot.act_pos.x-0.1, robot.act_pos.y, 
-//                                             TURN_CW(robot.act_pos.phi), NULL);
-                               FSM_TIMER(1000);
-                       }
-                       break;
-               case EV_TIMER:
-                       FSM_TRANSITION(search_waste);
-                       break;
-               default: 
-                       break;
-       }
-}
-
-FSM_STATE(go_for_waste) {
-       struct act_pos_type act_pos;
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       ROBOT_LOCK(act_pos);
-                       act_pos = robot.act_pos;
-                       ROBOT_UNLOCK(act_pos);
-                       printf("going for waste: \n");
-
-                       printf("actual position is %f %f %f and final one %f %f %f\n",
-                               act_pos.x,act_pos.y,DEGREES(act_pos.phi),
-                               des_pos.x,des_pos.y,DEGREES(des_pos.phi));
-                       robot_turn(des_pos);
-//                     robot_goto_trans(des_pos.x, des_pos.y, TURN_CW(des_pos.phi), NULL);
-                       break;
-                       
-               case EV_MOTION_DONE:
-                       printf("went for waste and finished\n");
-                       FSM_TRANSITION(search_waste);
-                       break;
-                       default: break;
-       }
-}
-
-int main()
-{
-       /* robot initialization */
-       robot_init();
-
-       FSM(MAIN)->debug_states = 1;
-//     FSM(MOVE)->debug_states = 1;
-
-       robot.fsm[FSM_ID_MAIN].state = &fsm_state_main_init;
-       robot.fsm[FSM_ID_MOTION].state = &fsm_state_move_init;
-
-        /* Start threads and wait */
-        robot_start();
-       robot_wait();
-
-       /* clean up */
-       robot_destroy();
-
-       return 0;
-}
diff --git a/src/robofsm/eb2007/test/testcollavoid.cc b/src/robofsm/eb2007/test/testcollavoid.cc
deleted file mode 100644 (file)
index c2506b6..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * testcollavoid.cc                    07/10/02
- *
- * Test collision avoidance using pathplan library.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#define FSM_MAIN
-#include <unistd.h>
-#include <math.h>
-#include <sharp.h>
-#include <robomath.h>
-#include <robot_eb2007.h>
-#include <fsm.h>
-#include <movehelper_eb2007.h>
-#include <trgen.h>
-#include <servos_eb2007.h>
-#include <map.h>
-
-/* fixed points of the trayectory */
-struct act_pos_type trayectory[] = { 
-                               {0.0, 0.0, 0.0}, 
-                               {2.98, 1.88, 0.0}, 
-                               {2.98, 0, DEG2RAD(270)}, 
-                               {0.0, 1.88, 0.0} };
-                               
-struct TrajectoryConstraints tc = {
-                                       maxv: 0.1,              // m/s
-     maxomega: 0.5,            // rad/s
-     maxangacc: 2,             // rad/s^2
-     maxacc: 0.6,              // m/s^2
-     maxcenacc: 1,             // m/s^2
-     maxe: (double)ROBOT_WIDTH_MM/2.0/1000.0 // m
-};
-
-#define TRAYECTORY_CNT 4
-static int trind = 0;
-
-/**
- * FSM states start here.
- */
-FSM_STATE_DECL(main_init);
-FSM_STATE_DECL(plan_go);
-
-/**
- * Set starting position, playground`s safety zone and other obstacles.
- * 
- * @ingroup fsmmain
- */
-FSM_STATE(main_init) 
-{
-       
-       
-       
-       FSM_TIMER(100);
-       /* start event ocurred */
-       switch (FSM_EVENT) {
-               default:
-               case EV_START:
-               case EV_ENTRY:
-                       /* init map and shared memory if required */
-                       ShmapInit(1);
-                       /* starting position of the robot */
-                       robot_set_act_pos_notrans(trayectory[trind].x, trayectory[trind].y,
-                                                 trayectory[trind].phi);
-                       /* safety zone around playground`s wall  */
-//                     ShmapSetRectangleType(0.0, 0.0, 0.1, 2.1, MAP_WALL_CSPACE);
-//                     ShmapSetRectangleType(0.0, 0.0, 3.0, 0.1, MAP_WALL_CSPACE);
-//                     ShmapSetRectangleType(0.0, 2.0, 3.0, 2.1, MAP_WALL_CSPACE);
-//                     ShmapSetRectangleType(2.9, 0.0, 3.0, 2.1, MAP_WALL_CSPACE);
-                       /* cup for batteries */
-                       ShmapSetRectangleFlag(1.5, 1.4, 1.8, 1.0, MAP_FLAG_WALL, 0);
-                       break;
-               case EV_TIMER:
-                       /* start to do something */
-                       FSM_TRANSITION(plan_go);
-                       break;
-//             default: break;
-       }
-}
-
-/**
- * Go and try to avoid collision.
- * 
- * @ingroup fsmmain
- */
-FSM_STATE(plan_go)
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       trind++;
-                       trind = (trind >= TRAYECTORY_CNT) ? 0 : trind;
-                       robot_goto_trans(trayectory[trind].x, trayectory[trind].y, 
-                                        TURN(trayectory[trind].phi), &tc);
-                       break;
-               case EV_MOTION_DONE:
-                       printf("target achieved! \n");
-                       FSM_TRANSITION(plan_go);
-                       break;
-               case EV_GOAL_NOT_REACHABLE:
-                       DBG("Goal is not reachable: %s\n",fsm_event_str(FSM_EVENT));
-                       break;
-               case EV_START:
-                       break;
-               case EV_EXIT:
-                       //ShmapFree();
-                       break;
-               default: break;
-       }
-}
-
-/* main loop */
-int main()
-{
-       /* robot initialization */
-       robot_init();
-
-       FSM(MAIN)->debug_states = 1;
-
-       robot.fsm[FSM_ID_MAIN].state = &fsm_state_main_init;
-       robot.fsm[FSM_ID_MOTION].state = &fsm_state_move_init;
-//     robot.fsm[FSM_ID_LOC].state = &fsm_state_loc_init;
-
-        /* Start threads and wait */
-        robot_start();
-       robot_wait();
-
-       /* clean up */
-       robot_destroy();
-
-       return 0;
-}
diff --git a/src/robofsm/eb2007/test/testpickup.cc b/src/robofsm/eb2007/test/testpickup.cc
deleted file mode 100644 (file)
index 3fb4e94..0000000
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * testpickup.cc                       07/10/01
- *
- * Test pickup mechanism of the robot.
- *
- * Copyright: (c) 2007 CTU Dragons
- *            CTU FEE - Department of Control Engineering
- * License: GNU GPL v.2
- */
-
-#define FSM_MAIN
-#include <unistd.h>
-#include <math.h>
-#include <robot_eb2007.h>
-#include <sharp.h>
-#include <robomath.h>
-#include <fsm.h>
-#include <trgen.h>
-#include <movehelper_eb2007.h>
-#include <servos_eb2007.h>
-#include <map.h>
-
-#define STACK_SIZE     3 /* maximal number of bottles before the deposition */
-
-/**
- * Time constants.
- */
-/* time before stopping the deposition belt resp. closing the back door */
-#define DEPOSITE_WAIT          1000
-/* the same as above, but we need to wait a little bit longer for the last one */
-#define LAST_DEPOSITE_WAIT     1500
-/* time before closing the inner door */
-#define WASTE_ROLL_OUT_WAIT    1500
-/* time before another pickup */
-#define NEW_PICK_UP_WAIT       1000
-/* waste detection period */
-#define WASTE_DETECTION_PERIOD 100
-
-enum {
-       UNKNOWN = 0,
-       BOTTLE,
-       CAN
-};
-
-/**
- * Convert sharp`s measured values to mm.
- *
- * @ingroup    fsmmain
- */
-void get_short_sharp_mm(int *sharp)
-{
-       ROBOT_LOCK(sharpsWaste);
-       sharp[0] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short1);
-       sharp[1] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short2);
-       sharp[2] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short3);
-       sharp[3] = s_gp2d120_ir2mmShort(robot.sharpsWaste.short4);
-       ROBOT_UNLOCK(sharpsWaste);
-}
-
-/**
- * Check out sharp values to evaluate, if waste is in our reach. 
- * 
- * @ingroup    fsmmain
- * @return     returns true if waste is in our reach.
- */
-int waste_ahead()
-{
-       int sharp[4];
-       int cnt = 0, i;
-
-       get_short_sharp_mm(sharp);
-       printf("sharp: %d %d %d %d\n", sharp[0], sharp[1], sharp[2], sharp[3]);
-       for (i=0; i<4; i++)
-               if (sharp[i] > 0 && sharp[i] < 170)
-                       cnt++;
-
-       return ((cnt >= 1) ? 1 : 0);
-}
-
-/**
- * Check out if stack is empty. Use back innerIR sensors to do it.
- *
- * @return     returns true if IR sensors indicate the waste
- */
-int stack_empty()
-{
-       int status;
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.back & 0xe0;
-       ROBOT_UNLOCK(IRsensors);
-       return ((status == 0) ? 1 : 0);
-}
-
-/**
- * Evaluation function to be sure the basket is behind us.
- * 
- * @ingroup    fsmmain
- * @return
- */
-int basket_behind()
-{
-       /* FIXME: return true by now, until the back sharps are connected */
-       return 1;
-}
-
-/**
- * Try to detect type of the waste using sensors at the front door.
- *
- * @return     waste type
- */
-int recognize_waste_phase1()
-{
-       char status;
-       int front_door_angle;
-       int type = UNKNOWN;
-       int i, cnt = 0;
-       char bit = 0x01;
-
-       ROBOT_LOCK(frontDoorAngle);
-       front_door_angle = robot.frontDoorAngle.state;
-       ROBOT_UNLOCK(frontDoorAngle);
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.front;
-       ROBOT_UNLOCK(IRsensors);
-
-       if (front_door_angle > 0x220)
-               return type;
-
-       for (i=0; i<8; i++)
-               if (status & (bit << i))
-                       cnt++;
-
-       switch (cnt) {
-               case 0:
-                       type = UNKNOWN;
-                       break;
-               case 1:
-               case 2: type = BOTTLE;
-                       break;
-               default: 
-                       type = CAN;
-                       break;
-       }
-
-       return type;
-}
-
-/**
- * Try to detect type of the waste using sensors in the back release space.
- * 
- * @ingroup    fsmmain
- * @return     returns type of the waste.
- */
-int recognize_waste_phase2()
-{
-       int type = UNKNOWN;
-       char bit = 0x01;
-       char status;
-       int i, cnt = 0;
-
-       ROBOT_LOCK(IRsensors);
-       status = robot.IRsensors.back & 0x1f;
-       ROBOT_UNLOCK(IRsensors);
-
-       for (i=0; i<8; i++)
-               if (status & (bit << i))
-                       cnt++;
-
-       switch (cnt) {
-               case 0:
-                       type = UNKNOWN;
-                       break;
-               case 1: type = BOTTLE;
-                       break;
-               default: 
-                       type = CAN;
-                       break;
-       }
-
-       return type;
-}
-
-/**
- * Try to detect type of the waste.
- * 
- * @ingroup    fsmmain
- * @return     returns type of the waste.
- */
-int recognize_waste()
-{
-       int type = UNKNOWN;
-//     type = recognize_waste_phase1();
-       type = recognize_waste_phase2();
-       return type;
-}
-
-/**
- * Deposite bottle to correct basket according to the actual position and 
- * the color of our team.
- */
-void deposite_bottle()
-{
-       struct act_pos_type act_pos;
-       void (*servo)(void);
-
-       ROBOT_LOCK(act_pos);
-       act_pos = robot.act_pos;
-       ROBOT_UNLOCK(act_pos);
-
-#ifdef WE_ARE_BLUE
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = innerTransporterRight;
-       else
-               servo = backDoorDown;
-#else
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = innerTransporterLeft;
-       else
-               servo = backDoorDown;
-#endif
-       (*servo)();
-}
-
-/**
- * Deposite can to correct basket according to the actual position and 
- * the color of our team.
- */
-void deposite_can()
-{
-       struct act_pos_type act_pos;
-       void (*servo)();
-
-       ROBOT_LOCK(act_pos);
-       act_pos = robot.act_pos;
-       ROBOT_UNLOCK(act_pos);
-
-#ifdef WE_ARE_BLUE
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = backDoorDown;
-       else
-               servo = innerTransporterLeft;
-#else
-       if (fabs(act_pos.phi - DEG2RAD(90)) < DEG2RAD(30))
-               servo = backDoorDown;
-       else
-               servo = innerTransporterRight;
-#endif
-       (*servo)();
-}
-
-/**
- * FSM states start here.
- */
-FSM_STATE_DECL(main_init);
-FSM_STATE_DECL(waste_grab);
-FSM_STATE_DECL(waste_deposite);
-FSM_STATE_DECL(waste_deposite_wait);
-
-/**
- * @ingroup fsmmain
- */
-FSM_STATE(main_init) 
-{
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       /* set actual position of the robot */
-                       robot_set_act_pos_trans(PLAYGROUND_WIDTH_M - ROBOT_WIDTH_M/2,
-                                               0.0,
-                                               DEG2RAD(180));
-                       /* waste counter */
-                       ROBOT_LOCK(waste_cnt);
-                       robot.waste_cnt = 0;
-                       printf("waste_cnt = %d\n", robot.waste_cnt);
-                       ROBOT_UNLOCK(waste_cnt);
-                       FSM_TIMER(2000);
-                       break;
-               case EV_TIMER:
-                       frontDoorDown();
-                       FSM_TRANSITION(waste_grab);
-                       break;
-               default: break;
-       }
-}
-
-FSM_STATE(waste_grab) {
-       int waste_cnt;
-       
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       FSM_SIGNAL(PICKUP, EV_PICKUP_START, NULL);
-                       break;
-               case EV_PICKUP_READY:
-                       FSM_SIGNAL(PICKUP, EV_PICKUP_TRY, NULL);
-                       break;
-               case EV_PICKUP_DONE:
-                       ROBOT_LOCK(waste_cnt);
-                       robot.waste_cnt++;
-                       waste_cnt = robot.waste_cnt;
-                       ROBOT_UNLOCK(waste_cnt);
-                       if (waste_cnt == 1 && stack_empty()) {
-                               printf("fsmmain: pickup done. Youuhouuu, I have "
-                                       "a bottle!! In total: %d\n", waste_cnt);
-                       } else {
-                               printf("fsmmain: pickup done. But sensors detect "
-                                       "empty stack!! In total: %d\n", waste_cnt);
-                       }
-                       /* go to deposite waste if the stack is full */
-                       if (waste_cnt >= STACK_SIZE) {
-                               FSM_TRANSITION(waste_deposite);
-                       /* continue grabbing waste if there`s space in the stack */
-                       } else {
-                               FSM_TIMER(NEW_PICK_UP_WAIT);
-                       }
-                       break;
-               case EV_PICKUP_JAMMED:
-                       printf("fsmmain: waste jammed\n");      
-                       FSM_TRANSITION(waste_grab);
-                       break;
-               case EV_PICKUP_FAILED:
-                       printf("fsmmain: pickup failed, try again\n");  
-//                     FSM_SIGNAL(PICKUP, EV_PICKUP_TRY, NULL);
-                       FSM_TRANSITION(waste_grab);
-                       break;
-               case EV_TIMER:
-                       printf("timeout: continue grabbing waste\n");
-                       FSM_TRANSITION(waste_grab);
-                       break;
-               default: 
-                       break;
-       }
-}
-
-/**
- * Deposite waste.
- * 
- * @ingroup    fsmmain
- */
-FSM_STATE(waste_deposite)
-{
-       int waste_cnt, type;
-
-       ROBOT_LOCK(waste_cnt);
-       waste_cnt = robot.waste_cnt;
-       ROBOT_UNLOCK(waste_cnt);
-
-       if (stack_empty() && waste_cnt != 0) {
-               printf("waste_cnt is %d, but I detect stack empty!!!\n", 
-                       waste_cnt);
-       }
-
-       switch (FSM_EVENT) {
-               case EV_ENTRY:
-                       printf("deposite waste: %d\n", waste_cnt);
-                       innerDoorDown();
-                       FSM_TIMER(WASTE_ROLL_OUT_WAIT);
-                       break;
-               case EV_TIMER:
-                       innerDoorUp();
-                       type = recognize_waste_phase2();
-                       printf("waste recognition: ");
-                       switch (type) {
-                               case WASTE_CAN:
-                                       printf("it`s a can\n");
-                                       deposite_can();
-                                       break;
-                               case WASTE_BOTTLE:
-                                       printf("it`s a bottle\n");
-                                       deposite_bottle();
-                                       break;
-                               default:
-                                       deposite_bottle();
-                                       printf("unidentified\n");
-                                       break;
-                       }
-                       /* need to recognize type of waste here */
-                       FSM_TRANSITION(waste_deposite_wait);
-                       break;
-               default: break;
-       }
-}
-
-/**
- * Wait until deposition terminated.
- *
- */
-FSM_STATE(waste_deposite_wait)
-{
-       int waste_cnt;
-       switch(FSM_EVENT) {
-               case EV_ENTRY:
-                       printf("wait for waste`s deposition\n");
-                       ROBOT_LOCK(waste_cnt);
-                       waste_cnt = robot.waste_cnt;
-                       ROBOT_UNLOCK(waste_cnt);
-                       if (waste_cnt > 1)
-                               FSM_TIMER(DEPOSITE_WAIT);
-                       else
-                               FSM_TIMER(LAST_DEPOSITE_WAIT);
-                       break;
-               case EV_TIMER:
-                       ROBOT_LOCK(waste_cnt);
-                       if (robot.waste_cnt > 0)
-                               robot.waste_cnt--;
-                       waste_cnt = robot.waste_cnt;
-                       ROBOT_UNLOCK(waste_cnt);
-                       innerTransporterStop();
-                       backDoorUp();
-                       if (waste_cnt > 0) {
-                               FSM_TRANSITION(waste_deposite);
-                       } else {
-                               FSM_TRANSITION(waste_grab);
-                       }
-                       break;
-               default: break;
-       }
-}
-
-/* main loop */
-int main()
-{
-       /* robot initialization */
-       robot_init();
-
-//     FSM(MAIN)->debug_states = 1;
-       robot.fsm[FSM_ID_MAIN].state = &fsm_state_main_init;
-       robot.fsm[FSM_ID_MOTION].state = &fsm_state_move_init;
-//     robot.fsm[FSM_ID_LOC].state = &fsm_state_loc_init;
-//     robot.fsm[FSM_ID_DET].state = &fsm_state_det_start;
-       robot.fsm[FSM_ID_PICKUP].state = &fsm_state_pickup_init;
-
-        /* Start threads and wait */
-        robot_start();
-       robot_wait();
-
-       /* clean up */
-       robot_destroy();
-
-       return 0;
-}
diff --git a/src/robofsm/eb2008/test/Makefile b/src/robofsm/eb2008/test/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
similarity index 97%
rename from src/robofsm/eb2008/fsmdisplay.c
rename to src/robofsm/fsmdisplay.c
index 069e63c4d081d6179b3a8c0bc9b19975d619f2d4..f8a3dc712015d8f99996ec877a1a7cb1d83b2106 100644 (file)
@@ -7,7 +7,7 @@
 #define FSM_DISP
 
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <signal.h>
 #include <pthread.h>
 #include <unistd.h>
@@ -260,11 +260,11 @@ FSM_STATE(status)
                        FSM_TIMER(1000);
                        break;
                case EV_TIMER:
-                       uoled_send_voltage(&robot.gorte.pwr_voltage);
+                       uoled_send_voltage(&robot.orte.pwr_voltage);
                        uoled_send_state(robot.act_fsm_state_name, strlen(robot.act_fsm_state_name), FSM_STATE_MSG);
                        uoled_send_state(robot.move_fsm_state_name, strlen(robot.move_fsm_state_name), MOVE_FSM_STATE_MSG);
                        uoled_set_balls((uint8_t*)&robot.carousel);
-                       uoled_send_position(&robot.gorte.est_pos);
+                       uoled_send_position(&robot.orte.est_pos);
                        uoled_send_hw_status(robot.hw_status);
                        ROBOT_LOCK(disp);
                        if(msg_waiting) {
@@ -297,7 +297,7 @@ FSM_STATE(status_send_voltage)
 
        switch (FSM_EVENT) {
                case EV_ENTRY:
-                       uoled_send_voltage(&robot.gorte.pwr_voltage);
+                       uoled_send_voltage(&robot.orte.pwr_voltage);
                        FSM_TIMER(400);
                        break;
                case EV_TIMER:
@@ -436,7 +436,7 @@ FSM_STATE(status_send_position)
 
        switch (FSM_EVENT) {
                case EV_ENTRY:
-                       uoled_send_position(&robot.gorte.est_pos);
+                       uoled_send_position(&robot.orte.est_pos);
                        FSM_TIMER(400);
                        break;
                case EV_TIMER:
similarity index 98%
rename from src/robofsm/eb2008/fsmjoy.c
rename to src/robofsm/fsmjoy.c
index 5169c1cceee6683f747c61793072f3feaff8e70f..dc95cf640ddbb3202f0400b08804373eb82cfe7d 100644 (file)
 
 #define FSM_JOY
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <fsm.h>
-#include <movehelper_eb2008.h>
-#include <servos_eb2008.h>
+#include <movehelper.h>
+#include <servos.h>
 #include <math.h>
 
 #define CLOSE_LIMIT 850
similarity index 98%
rename from src/robofsm/eb2008/fsmloc.c
rename to src/robofsm/fsmloc.c
index 68845fe03012809c4c32e75723f0b86e6da887dc..d443bdac922c61a8842098b19fdf33301d0adc29 100644 (file)
@@ -14,7 +14,7 @@
 #include <laser-nav.h>
 #include <mcl.h>
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <fsm.h>
 
 struct mcl_laser l;
similarity index 99%
rename from src/robofsm/eb2008/fsmmain.c
rename to src/robofsm/fsmmain.c
index c10f1290d2f14c7459b3bf6745a18e7373a34cab..41ec98954cc7ba81e5221e6b378db46ff69b09fd 100644 (file)
 
 #define FSM_MAIN
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <fsm.h>
 #include <unistd.h>
-#include <servos_eb2008.h>
+#include <servos.h>
 #include <math.h>
-#include <movehelper_eb2008.h>
+#include <movehelper.h>
 #include <map.h>
 #include <sharp.h>
 #include <robomath.h>
similarity index 99%
rename from src/robofsm/eb2008/fsmmove.cc
rename to src/robofsm/fsmmove.cc
index 411a50347fc78e8a67a05894a380ef8632b9ac4a..70db92397900a57f049ecd7f732fe3ce755a7cf0 100644 (file)
 #include "trgen.h"
 #include "balet.h"
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <pthread.h>
 #include <path_planner.h>
 #include <signal.h>
-#include <movehelper_eb2008.h>
+#include <movehelper.h>
 #include <sharp.h>
 #include <unistd.h>
 #include <map.h>
similarity index 97%
rename from src/robofsm/eb2008/main.cc
rename to src/robofsm/main.cc
index 5ee763af0948b91ec7d25e927760185f64ba4987..fa5816040ed410019dee9b6b574f8f00ee2a847d 100644 (file)
@@ -1,4 +1,4 @@
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <fsm.h>
 #include <string.h>
 #include "robodata.h"
similarity index 99%
rename from src/robofsm/eb2008/map_handling.c
rename to src/robofsm/map_handling.c
index ce29471b5d453532742e85cedcf4fc932b789ce5..abe884ba1b1e17c29e8c70e43db95017911729ab 100644 (file)
@@ -1,5 +1,5 @@
-#include <robot_eb2008.h>
-#include <robodim_eb2008.h>
+#include <robot.h>
+#include <robodim.h>
 #include <map.h>
 #include <robomath.h>
 #include <hokuyo.h>
similarity index 87%
rename from src/robofsm/eb2008/map_handling.h
rename to src/robofsm/map_handling.h
index 45ab168f2081abab51060fe9592bdd99d1500189..b6d260c96930acfe9e074561a036225c8b0c73e9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _MAP_HANDLING_H
 #define _MAP_HANDLING_H
 
-#include <robodim_eb2008.h>
+#include <robodim.h>
 
 void * thread_obstacle_forgeting(void * arg);
 void update_map(struct sharps_type *s);
similarity index 94%
rename from src/robofsm/eb2008/movehelper_eb2008.cc
rename to src/robofsm/movehelper.cc
index 396cb3e3bea16fcd4b302fae0933a0d3b0ce3c56..5d004bfdbdb521899b9de44e902fb148a79b39f6 100644 (file)
@@ -10,8 +10,8 @@
 
 #include <trgen.h>
 #include <robodata.h>
-#include <robot_eb2008.h>
-#include <movehelper_eb2008.h>
+#include <robot.h>
+#include <movehelper.h>
 #include <path_simplifier.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -168,13 +168,13 @@ void robot_send_speed(double left, double right) {
        // I hope it is not neccessary to lock here
        l = (int)(left * mul);
        r = (int)(right * mul);
-       robot.gorte.motion_speed.left = l;//(l&0xff) << 8 | (l&0xff00) >> 8;
-       robot.gorte.motion_speed.right = r;//(r&0xff) << 8 | (r&0xff00) >> 8;
+       robot.orte.motion_speed.left = l;//(l&0xff) << 8 | (l&0xff00) >> 8;
+       robot.orte.motion_speed.right = r;//(r&0xff) << 8 | (r&0xff00) >> 8;
 //     DBG("speed l=%8.3g (%6d) r=%8.3g (%6d)", 
-//         left, l, // robot.gorte.motion_speed.left, 
-//         right, r //robot.gorte.motion_speed.right
+//         left, l, // robot.orte.motion_speed.left, 
+//         right, r //robot.orte.motion_speed.right
 //         );
-       ORTEPublicationSend(robot.gorte.publication_motion_speed);
+       ORTEPublicationSend(robot.orte.publication_motion_speed);
 }
 
 /** 
similarity index 99%
rename from src/robofsm/eb2008/movehelper_eb2008.h
rename to src/robofsm/movehelper.h
index 33a70c9cc34b20cc4a94c2f319113a8a854167eb..d4fc953f2909c6ba573bea70a0e0f9e0e4dba70c 100644 (file)
@@ -2,7 +2,7 @@
 #define MOVEHELPER_EB2008_H
 
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <trgenconstr.h>
 #include <math.h>
 
similarity index 93%
rename from src/robofsm/eb2008/robot_eb2008.c
rename to src/robofsm/robot.c
index a6eb86562f31071390bf2804ca4241fd20596b1c..d531af86f64b7a1c6195d1c7e82c222ae3f6a148 100644 (file)
@@ -9,12 +9,12 @@
  */
 
 #include <map.h>
-#include <movehelper_eb2008.h>
+#include <movehelper.h>
 #include <pthread.h>
 #include <robomath.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <robot_orte.h>
-#include <servos_eb2008.h>
+#include <servos.h>
 #include <signal.h>
 #include <sys/time.h>
 #include <time.h>
@@ -139,12 +139,12 @@ int robot_init()
        block_signals();
 
        /* initial values */
-       robot.gorte.motion_speed.left = 0;
-       robot.gorte.motion_speed.right = 0;
+       robot.orte.motion_speed.left = 0;
+       robot.orte.motion_speed.right = 0;
 
-       robot.gorte.pwr_ctrl.voltage33 = 1;
-       robot.gorte.pwr_ctrl.voltage50 = 1;
-       robot.gorte.pwr_ctrl.voltage80 = 1;
+       robot.orte.pwr_ctrl.voltage33 = 1;
+       robot.orte.pwr_ctrl.voltage50 = 1;
+       robot.orte.pwr_ctrl.voltage80 = 1;
 
        brushes_in();
        open_bottom_door();
@@ -258,12 +258,11 @@ int robot_orte_destroy()
        off_bagr();
        off_brush_left();
        off_brush_right();
-       robot.gorte.motion_speed.right = 0;
-       robot.gorte.motion_speed.left = 0;
-       ORTEPublicationSend(robot.gorte.publication_motion_speed);                      
+       robot.orte.motion_speed.right = 0;
+       robot.orte.motion_speed.left = 0;
+       ORTEPublicationSend(robot.orte.publication_motion_speed);                       
        
-       eb2008_roboorte_destroy(&robot.orte);
-       generic_roboorte_destroy(&robot.gorte);
+       robottype_roboorte_destroy(&robot.orte);
 
        return 0;
 }
similarity index 95%
rename from src/robofsm/eb2008/robot_eb2008.h
rename to src/robofsm/robot.h
index adf3a9f2928795d609801e94ecdbcd73d4dcca29..31f3645116be16cc097a4c32ae47714c6db4e1c3 100644 (file)
 #include <mcl_laser.h>
 #include <trgenconstr.h>
 #include <robottype.h>
-#include <robottype_eb2008.h>
-#include <roboorte_generic.h>
-#include <roboorte_eb2008.h>
-#include <robodim_eb2008.h>
-#include <roboevent_eb2008.h>
+#include <robottype.h>
+#include <roboorte_robottype.h>
+#include <roboorte.h>
+#include <robodim.h>
+#include <roboevent.h>
 #include <fsm.h>
-#include <servos_eb2008.h>
+#include <servos.h>
 #include <robot_config.h>
 
 #define FSM_STATE_NAME_MAX_LEN 20
@@ -174,8 +174,7 @@ struct robot_eb2008 {
        struct drives_type drives;
 
        /* orte */
-       struct eb2008_orte_data orte;
-       struct generic_orte_data gorte;
+       struct robottype_orte_data orte;
 
        /* sensors */
        struct sharps_type sharps;
similarity index 82%
rename from src/robofsm/eb2008/robot_orte.c
rename to src/robofsm/robot_orte.c
index c7093cf754677bfe0b59ea8ccf766dd7992567a0..9d183888f83bc0f37b5b189741559c428a4c7132 100644 (file)
@@ -9,11 +9,11 @@
  */
 
 #include <orte.h>
-#include <roboorte_generic.h>
-#include <roboorte_eb2008.h>
+#include <roboorte_robottype.h>
+#include <roboorte.h>
 #include <robodata.h>
-#include <robot_eb2008.h>
-#include <movehelper_eb2008.h>
+#include <robot.h>
+#include <movehelper.h>
 #include <math.h>
 #include <robomath.h>
 #include <laser-nav.h>
@@ -427,47 +427,42 @@ int robot_init_orte()
        int rv = 0;
 
        robot.orte.strength = 20;
-       robot.gorte.strength = 20;
 
-       rv = eb2008_roboorte_init(&robot.orte);
-       if (rv)
-               return rv;
-
-       rv = generic_roboorte_init(&robot.gorte);
+       rv = robottype_roboorte_init(&robot.orte);
        if (rv)
                return rv;
 
        /* creating publishers */
-       generic_publisher_motion_irc_create(&robot.gorte, NULL, &robot.gorte);
-       generic_publisher_motion_speed_create(&robot.gorte, NULL, &robot.gorte);
-       generic_publisher_motion_status_create(&robot.gorte, NULL, &robot.gorte);
-       generic_publisher_ref_pos_create(&robot.gorte, send_ref_pos_cb, &robot.gorte);
-       generic_publisher_est_pos_create(&robot.gorte, send_est_pos_cb, &robot.gorte);
-       generic_publisher_joy_data_create(&robot.gorte, NULL, &robot.gorte);
-       generic_publisher_pwr_voltage_create(&robot.gorte, NULL, &robot.gorte);
-       generic_publisher_pwr_ctrl_create(&robot.gorte, NULL, &robot.gorte);
-
-       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);
+       robottype_publisher_motion_irc_create(&robot.orte, NULL, &robot.orte);
+       robottype_publisher_motion_speed_create(&robot.orte, NULL, &robot.orte);
+       robottype_publisher_motion_status_create(&robot.orte, NULL, &robot.orte);
+       robottype_publisher_ref_pos_create(&robot.orte, send_ref_pos_cb, &robot.orte);
+       robottype_publisher_est_pos_create(&robot.orte, send_est_pos_cb, &robot.orte);
+       robottype_publisher_joy_data_create(&robot.orte, NULL, &robot.orte);
+       robottype_publisher_pwr_voltage_create(&robot.orte, NULL, &robot.orte);
+       robottype_publisher_pwr_ctrl_create(&robot.orte, NULL, &robot.orte);
+
+       robottype_publisher_servos_create(&robot.orte, send_dummy_cb, &robot.orte);
+       robottype_publisher_drives_create(&robot.orte, send_dummy_cb, &robot.orte);
+       robottype_publisher_laser_cmd_create(&robot.orte, NULL, NULL);
 
        /* create generic subscribers */
-       generic_subscriber_motion_irc_create(&robot.gorte, rcv_motion_irc_cb, &robot.gorte);
-       generic_subscriber_motion_speed_create(&robot.gorte, rcv_motion_speed_cb, &robot.gorte);
-       generic_subscriber_motion_status_create(&robot.gorte, rcv_motion_status_cb, &robot.gorte);
-       generic_subscriber_joy_data_create(&robot.gorte, rcv_joy_data_cb, &robot.gorte);
-       generic_subscriber_pwr_voltage_create(&robot.gorte, rcv_pwr_voltage_cb, &robot.gorte);
-       generic_subscriber_pwr_ctrl_create(&robot.gorte, rcv_pwr_ctrl_cb, &robot.gorte);
-       generic_subscriber_robot_cmd_create(&robot.gorte, rcv_robot_cmd_cb, &robot.gorte);
-       generic_subscriber_hokuyo_scan_create(&robot.gorte, rcv_hokuyo_scan_cb, &robot.gorte);
+       robottype_subscriber_motion_irc_create(&robot.orte, rcv_motion_irc_cb, &robot.orte);
+       robottype_subscriber_motion_speed_create(&robot.orte, rcv_motion_speed_cb, &robot.orte);
+       robottype_subscriber_motion_status_create(&robot.orte, rcv_motion_status_cb, &robot.orte);
+       robottype_subscriber_joy_data_create(&robot.orte, rcv_joy_data_cb, &robot.orte);
+       robottype_subscriber_pwr_voltage_create(&robot.orte, rcv_pwr_voltage_cb, &robot.orte);
+       robottype_subscriber_pwr_ctrl_create(&robot.orte, rcv_pwr_ctrl_cb, &robot.orte);
+       robottype_subscriber_robot_cmd_create(&robot.orte, rcv_robot_cmd_cb, &robot.orte);
+       robottype_subscriber_hokuyo_scan_create(&robot.orte, rcv_hokuyo_scan_cb, &robot.orte);
 
        /* create eb2008 subscribers */
-       eb2008_subscriber_servos_create(&robot.orte, rcv_servos_cb, &robot.orte);
-       eb2008_subscriber_drives_create(&robot.orte, rcv_drives_cb, &robot.orte);
-       eb2008_subscriber_laser_data_create(&robot.orte, rcv_laser_data_cb, &robot.orte);
-       eb2008_subscriber_cmu_create(&robot.orte, rcv_cmu_cb, &robot.orte);
-       eb2008_subscriber_bumper_create(&robot.orte, rcv_bumper_cb, &robot.orte);
-       eb2008_subscriber_sharps_create(&robot.orte, rcv_sharps_cb, &robot.orte);
+       robottype_subscriber_servos_create(&robot.orte, rcv_servos_cb, &robot.orte);
+       robottype_subscriber_drives_create(&robot.orte, rcv_drives_cb, &robot.orte);
+       robottype_subscriber_laser_data_create(&robot.orte, rcv_laser_data_cb, &robot.orte);
+       robottype_subscriber_cmu_create(&robot.orte, rcv_cmu_cb, &robot.orte);
+       robottype_subscriber_bumper_create(&robot.orte, rcv_bumper_cb, &robot.orte);
+       robottype_subscriber_sharps_create(&robot.orte, rcv_sharps_cb, &robot.orte);
 
        return rv;
 }
similarity index 97%
rename from src/robofsm/eb2008/servos_eb2008.c
rename to src/robofsm/servos.c
index 230107621d2aa3b2631e28bec0faac31660084b6..4b2f33f974b5fb8dcef842d3f3835a515d1088e5 100644 (file)
@@ -8,8 +8,8 @@
  * License: GNU GPL v.2
  */
 
-#include <robot_eb2008.h>
-#include <servos_eb2008.h>
+#include <robot.h>
+#include <servos.h>
 
 /* SERVOS */
 void open_top_door()
similarity index 71%
rename from src/robofsm/eb2008/test/Makefile.omk
rename to src/robofsm/test/Makefile.omk
index cd6a136f67bebec4bdaaf296c43dafa8397f6886..d2fffd5b3fd95618f11a41ffd02783cc71698843 100644 (file)
@@ -25,7 +25,7 @@ test_PROGRAMS += sharpcalib
 sharpcalib_SOURCES = sharpcalib.cc
 
 # Libraries linked to all programs in this Makefile
-lib_LOADLIBES = robot_eb2008 mcl robodim_eb2008 laser-nav robomath uoled oledlib sercom roboorte_generic roboorte_eb2008 \
-               robottype robottype_eb2008 pthread \
-               rt m orte pathplan sharp map fsm rbtree motion 
+lib_LOADLIBES = robot mcl robodim laser-nav robomath uoled oledlib     \
+               sercom roboorte robottype pthread rt m orte pathplan    \
+               sharp map fsm rbtree motion
 
similarity index 95%
rename from src/robofsm/eb2008/test/display.cc
rename to src/robofsm/test/display.cc
index 816b89c8fa2c13a908163f363f0dc09bee48b18a..dbcbe122d31e339a8277ff2d38e2cd027861c252 100644 (file)
@@ -8,8 +8,8 @@
  */
 
 #define FSM_MAIN
-#include <robot_eb2008.h>
-#include <movehelper_eb2008.h>
+#include <robot.h>
+#include <movehelper.h>
 #include <trgen.h>
 #include <robomath.h>
 #include <uoled.h>
similarity index 98%
rename from src/robofsm/eb2008/test/goto.cc
rename to src/robofsm/test/goto.cc
index fa5f648c06154f96f0241a2385ed9c8939e93d0c..b04a37a6c51aaaf95d6e0dc81fc34517e37ca9bf 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 #define FSM_MAIN
-#include <movehelper_eb2008.h>
-#include <robot_eb2008.h>
+#include <movehelper.h>
+#include <robot.h>
 #include <trgen.h>
 #include <path_planner.h>
 #include <stdio.h>
similarity index 99%
rename from src/robofsm/eb2008/test/homologation.cc
rename to src/robofsm/test/homologation.cc
index ede468694c5618d419356465f2a39f4ea4e66442..965a18c876d1ccaa8ed31232d9e47ae5f56057f0 100644 (file)
 
 #define FSM_MAIN
 #include <robodata.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <fsm.h>
 #include <unistd.h>
-#include <servos_eb2008.h>
+#include <servos.h>
 #include <math.h>
 #include "trgen.h"
-#include <movehelper_eb2008.h>
+#include <movehelper.h>
 #include <map.h>
 #include <sharp.h>
 #include <robomath.h>
similarity index 97%
rename from src/robofsm/eb2008/test/line.cc
rename to src/robofsm/test/line.cc
index f9f03e665eab5ec776a64af5ce65ab17f73ccc41..c625ff5f798bc04a30f495a3b811488309fb545c 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 #define FSM_MAIN
-#include <robot_eb2008.h>
-#include <movehelper_eb2008.h>
+#include <robot.h>
+#include <movehelper.h>
 #include <trgen.h>
 #include <robomath.h>
 #include <string.h>
similarity index 97%
rename from src/robofsm/eb2008/test/mcl-laser.cc
rename to src/robofsm/test/mcl-laser.cc
index 13eb2b7b7f015bf336d65f21be06a3873bde22f5..ac5c1a206f5f126cb4e54f82d8e78dc44cbcb31d 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 #define FSM_MAIN
-#include <movehelper_eb2008.h>
-#include <robot_eb2008.h>
+#include <movehelper.h>
+#include <robot.h>
 #include <trgen.h>
 #include <robomath.h>
 #include <string.h>
similarity index 97%
rename from src/robofsm/eb2008/test/odometry.cc
rename to src/robofsm/test/odometry.cc
index 25c344b1b7162ac6944f72ef08e26ea3ee05833c..9788d14dc4b4f9567f320070ad50ad6f1761cf54 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 #define FSM_MAIN
-#include <movehelper_eb2008.h>
-#include <robot_eb2008.h>
+#include <movehelper.h>
+#include <robot.h>
 #include <trgen.h>
 #include <robomath.h>
 #include <string.h>
similarity index 97%
rename from src/robofsm/eb2008/test/rectangle.cc
rename to src/robofsm/test/rectangle.cc
index a9bfde135879a9a8cd20ce6100cf3c9a6c71a775..ae1d347c9bc6c24875f6a87761051c80d4db4371 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 #define FSM_MAIN
-#include <movehelper_eb2008.h>
-#include <robot_eb2008.h>
+#include <movehelper.h>
+#include <robot.h>
 #include <trgen.h>
 #include <robomath.h>
 #include <string.h>
similarity index 96%
rename from src/robofsm/eb2008/test/sharpcalib.cc
rename to src/robofsm/test/sharpcalib.cc
index 4a46c656f58f2c4ba1729d5970dd86c774e6be90..3a5b01fef4a37c26b43452013d0869b86d3068ea 100644 (file)
@@ -1,7 +1,7 @@
 
 #define FSM_MAIN
-#include <robot_eb2008.h>
-#include <movehelper_eb2008.h>
+#include <robot.h>
+#include <movehelper.h>
 #include <trgen.h>
 #include <robomath.h>
 
index c277743c84f6cd10c614ab21a64146f8ad92ae75..4674eea3ddf965bef4b51563dcbf045f1469b5ab 100644 (file)
@@ -4,5 +4,5 @@ bin_PROGRAMS += joystick
 joystick_SOURCES = joystick.cc
 
 # Libraries linked to all programs in this Makefile
-lib_LOADLIBES = robot_eb2008 mcl robodim_eb2008 laser-nav robomath roboorte_eb2008 roboorte_generic \
-               robottype robottype_eb2008 pthread rt m orte pathplan sharp map fsm rbtree motion uoled oledlib sercom
+lib_LOADLIBES = robot mcl robodim laser-nav robomath roboorte roboorte \
+               robottype robottype pthread rt m orte pathplan sharp map fsm rbtree motion uoled oledlib sercom
index 17de5dd07921f26a27e29acdf3ffa46046222f23..58ba549cb74b7b41207959bd4efea09373880969 100644 (file)
 #include <math.h>
 #include <robomath.h>
 #include <sharp.h>
-#include <robot_eb2008.h>
+#include <robot.h>
 #include <fsm.h>
-#include <movehelper_eb2008.h>
-#include <servos_eb2008.h>
+#include <movehelper.h>
+#include <servos.h>
 #include <trgen.h>
 #include <map.h>
 
index db7379ae97f785d3d209c57878456c4eef0ea114..034d43f7eca1b84007f210c92fb7bdb46b156809 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <robottype.h>
 #include <robottype_eb2007.h>
-#include <robottype_eb2008.h>
+#include <robottype.h>
 #include <trgen.h>
 #include "playgroundscene.h"
 
index f3f44b666baaac57de78bbd3f994b7e4705857d7..a68c9a7af3cecf20014f656e6a32a8f7a7e549d4 100644 (file)
@@ -12,8 +12,6 @@
 #include <QtGui>
 
 #include "MainWindow.h"
-#include "RobomonRecycling.h"
-#include "RobomonExplorer.h"
 #include "RobomonTuning.h"
 #include "RobomonAtlantis.h"
 #include "SimMcl.h"
@@ -41,20 +39,6 @@ void MainWindow::closeEvent(QCloseEvent *event)
        event->accept();
 }
 
-void MainWindow::addRobomonRecyclingTab()
-{
-       RobomonRecycling *robomonRecycling = new RobomonRecycling();
-       tabWidget->addTab(robomonRecycling, tr("Robomon Recycling"));
-       tabWidget->setCurrentWidget(robomonRecycling);
-}
-
-void MainWindow::addRobomonExplorerTab()
-{
-       RobomonExplorer *robomonExplorer = new RobomonExplorer();
-       tabWidget->addTab(robomonExplorer, tr("Robomon Explorer"));
-       tabWidget->setCurrentWidget(robomonExplorer);
-}
-
 void MainWindow::addRobomonTuningTab()
 {
        RobomonTuning *robomonTuning = new RobomonTuning();
@@ -117,20 +101,6 @@ void MainWindow::createActions()
        exitAct->setStatusTip(tr("Exit the application"));
        connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
 
-       robomonRecyclingAct = new QAction(QIcon(":/images/robomon_recycling.png"), 
-                                               tr("Robot &Recycling"), this);
-       robomonRecyclingAct->setShortcut(tr("Ctrl+R"));
-       robomonRecyclingAct->setStatusTip(tr("Robomon of the Robot Recycling"));
-       connect(robomonRecyclingAct, SIGNAL(triggered()), 
-                       this, SLOT(addRobomonRecyclingTab()));
-
-       robomonExplorerAct = new QAction(QIcon(":/images/robomon_explorer.png"), 
-                                               tr("Robot &Explorer"), this);
-       robomonExplorerAct->setShortcut(tr("Ctrl+E"));
-       robomonExplorerAct->setStatusTip(tr("Robomon of the Robot Explorer"));
-       connect(robomonExplorerAct, SIGNAL(triggered()), 
-                       this, SLOT(addRobomonExplorerTab()));
-
        robomonTuningAct = new QAction(QIcon(":/images/tuning.png"), 
                                                tr("Robot &Tuning"), this);
        robomonTuningAct->setShortcut(tr("Ctrl+T"));
@@ -177,8 +147,6 @@ void MainWindow::createMenus()
        fileMenu->addAction(exitAct);
        
        toolsMenu = menuBar()->addMenu(tr("&Tools"));
-       toolsMenu->addAction(robomonRecyclingAct);
-       toolsMenu->addAction(robomonExplorerAct);
        toolsMenu->addAction(robomonTuningAct);
        toolsMenu->addAction(robomonAtlantisAct);
        toolsMenu->addAction(mclAct);
@@ -196,8 +164,6 @@ void MainWindow::createToolBars()
        fileToolBar = addToolBar(tr("File"));
        
        toolsToolBar = addToolBar(tr("Tools"));
-       toolsToolBar->addAction(robomonRecyclingAct);
-       toolsToolBar->addAction(robomonExplorerAct);
        toolsToolBar->addAction(robomonTuningAct);
        toolsToolBar->addAction(robomonAtlantisAct);
        toolsToolBar->addAction(mclAct);
index d85aae202ddcef512f9b7df41f3b05f5c61031de..377589d69dbacd670733d3604a94be8916cf7022 100644 (file)
@@ -33,8 +33,6 @@ protected:
 private slots:
        void help();
        void about();
-       void addRobomonRecyclingTab();
-       void addRobomonExplorerTab();
        void addRobomonTuningTab();
        void addRobomonAtlantisTab();
        void addMclTab();
@@ -62,8 +60,6 @@ private:
 
        /* actions */
        QAction *exitAct;
-       QAction *robomonRecyclingAct;
-       QAction *robomonExplorerAct;
        QAction *robomonTuningAct;
        QAction *robomonAtlantisAct;
        QAction *mclAct;
index 36e1607be5d6f7ab3f4ef5dad3e4e942cc55757c..e1b17b0885f77a0864d5baca44a9870fe43e58dc 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <orte.h>
 #include <path_planner.h>
-#include <robodim_eb2008.h>
+#include <robodim.h>
 #include <sharp.h>
 #include <trgen.h>
 #include <map.h>
@@ -39,7 +39,7 @@
 #include <QKeyEvent>
 #include <QDebug>
 #include <QMessageBox>
-#include <servos_eb2008.h>
+#include <servos.h>
 
 RobomonAtlantis::RobomonAtlantis(QWidget *parent)
        : QWidget(parent)
@@ -516,25 +516,25 @@ void RobomonAtlantis::createActions()
 void RobomonAtlantis::setVoltage33(int state)
 {
        if (state)
-               orte_generic.pwr_ctrl.voltage33 = true;
+               orte.pwr_ctrl.voltage33 = true;
        else
-               orte_generic.pwr_ctrl.voltage33 = false;
+               orte.pwr_ctrl.voltage33 = false;
 }
 
 void RobomonAtlantis::setVoltage50(int state)
 {
        if (state)
-               orte_generic.pwr_ctrl.voltage50 = true;
+               orte.pwr_ctrl.voltage50 = true;
        else
-               orte_generic.pwr_ctrl.voltage50 = false;
+               orte.pwr_ctrl.voltage50 = false;
 }
 
 void RobomonAtlantis::setVoltage80(int state)
 {
        if (state)
-               orte_generic.pwr_ctrl.voltage80 = true;
+               orte.pwr_ctrl.voltage80 = true;
        else
-               orte_generic.pwr_ctrl.voltage80 = false;
+               orte.pwr_ctrl.voltage80 = false;
 }
 
 void RobomonAtlantis::setLeftMotor(int value)
@@ -548,8 +548,8 @@ void RobomonAtlantis::setLeftMotor(int value)
        leftMotor = (short int)(MOTOR_LIMIT * (leftMotorSlider->value()/100.0));
        rightMotor = (short int)(MOTOR_LIMIT * (rightMotorSlider->value()/100.0));
        
-       orte_generic.motion_speed.left = leftMotor;
-       orte_generic.motion_speed.right = rightMotor;
+       orte.motion_speed.left = leftMotor;
+       orte.motion_speed.right = rightMotor;
        
 }
 
@@ -564,8 +564,8 @@ void RobomonAtlantis::setRightMotor(int value)
        leftMotor = (short int)(MOTOR_LIMIT * (leftMotorSlider->value()/100.0));
        rightMotor = (short int)(MOTOR_LIMIT * (rightMotorSlider->value()/100.0));
        
-       orte_generic.motion_speed.left = leftMotor;
-       orte_generic.motion_speed.right = rightMotor;
+       orte.motion_speed.left = leftMotor;
+       orte.motion_speed.right = rightMotor;
        
 }
 
@@ -583,75 +583,75 @@ void RobomonAtlantis::moveServos(int value)
 void RobomonAtlantis::moveFrontDoor(int state)
 {
        if (state)
-               orte_eb2008.servos.door_bottom = BOTTOM_DOOR_OPEN;
+               orte.servos.door_bottom = BOTTOM_DOOR_OPEN;
        else
-               orte_eb2008.servos.door_bottom = BOTTOM_DOOR_CLOSE;
+               orte.servos.door_bottom = BOTTOM_DOOR_CLOSE;
 }
 
 void RobomonAtlantis::moveTopDoor(int state)
 {
        if (state)
-               orte_eb2008.servos.door_top = TOP_DOOR_OPEN;
+               orte.servos.door_top = TOP_DOOR_OPEN;
        else
-               orte_eb2008.servos.door_top = TOP_DOOR_CLOSE;
+               orte.servos.door_top = TOP_DOOR_CLOSE;
 }
 
 void RobomonAtlantis::moveBackDoor(int state)
 {
        if (state)
-               orte_eb2008.servos.door_back = BACK_DOOR_OPEN;
+               orte.servos.door_back = BACK_DOOR_OPEN;
        else
-               orte_eb2008.servos.door_back = BACK_DOOR_CLOSE;
+               orte.servos.door_back = BACK_DOOR_CLOSE;
 }
 
 void RobomonAtlantis::moveLeftBrush(int state)
 {
        if (state)
-               orte_eb2008.servos.brush_left = BRUSH_LEFT_OPEN;
+               orte.servos.brush_left = BRUSH_LEFT_OPEN;
        else
-               orte_eb2008.servos.brush_left = BRUSH_LEFT_CLOSE;
+               orte.servos.brush_left = BRUSH_LEFT_CLOSE;
 }
 
 void RobomonAtlantis::moveRightBrush(int state)
 {
        if (state)
-               orte_eb2008.servos.brush_right = BRUSH_RIGHT_OPEN;
+               orte.servos.brush_right = BRUSH_RIGHT_OPEN;
        else
-               orte_eb2008.servos.brush_right = BRUSH_RIGHT_CLOSE;
+               orte.servos.brush_right = BRUSH_RIGHT_CLOSE;
 }
 
 void RobomonAtlantis::setDrives(int state)
 {
-       orte_eb2008.drives.brush_left = leftBrushDial->value();
-       orte_eb2008.drives.brush_right = rightBrushDial->value();
-       orte_eb2008.drives.bagr = bagrDial->value();
-       orte_eb2008.drives.carousel_pos = carouselDial->value();
+       orte.drives.brush_left = leftBrushDial->value();
+       orte.drives.brush_right = rightBrushDial->value();
+       orte.drives.bagr = bagrDial->value();
+       orte.drives.carousel_pos = carouselDial->value();
 }
 
 void RobomonAtlantis::setLeftBrushDriveCB(int state) {
 
        if(state)
-               orte_eb2008.drives.brush_left = LEFT_BRUSH_DRIVE_ON;
+               orte.drives.brush_left = LEFT_BRUSH_DRIVE_ON;
        else
-               orte_eb2008.drives.brush_left = LEFT_BRUSH_DRIVE_OFF;
+               orte.drives.brush_left = LEFT_BRUSH_DRIVE_OFF;
 }
 
 
 void RobomonAtlantis::setRightBrushDriveCB(int state) {
 
        if(state)
-               orte_eb2008.drives.brush_right = RIGHT_BRUSH_DRIVE_ON;
+               orte.drives.brush_right = RIGHT_BRUSH_DRIVE_ON;
        else
-               orte_eb2008.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
+               orte.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
 }
 
 
 void RobomonAtlantis::setBagrDriveCB(int state) {
 
        if(state)
-               orte_eb2008.drives.bagr = BAGR_DRIVE_ON;
+               orte.drives.bagr = BAGR_DRIVE_ON;
        else
-               orte_eb2008.drives.bagr = BAGR_DRIVE_OFF;
+               orte.drives.bagr = BAGR_DRIVE_OFF;
 }
 
 void RobomonAtlantis::setDO(int state)
@@ -662,10 +662,10 @@ void RobomonAtlantis::setDO(int state)
 void RobomonAtlantis::setLaser(int state) {
 
        if(state)
-               orte_eb2008.laser_cmd.speed = LASER_DRIVE_ON;
+               orte.laser_cmd.speed = LASER_DRIVE_ON;
        else
-               orte_eb2008.laser_cmd.speed = LASER_DRIVE_OFF;
-       ORTEPublicationSend(orte_eb2008.publication_laser_cmd);
+               orte.laser_cmd.speed = LASER_DRIVE_OFF;
+       ORTEPublicationSend(orte.publication_laser_cmd);
 }
 
 void RobomonAtlantis::showMap()
@@ -789,12 +789,12 @@ void RobomonAtlantis::setSharpValues(int value)
 void RobomonAtlantis::setSimulation(int state)
 {
        if(state) { 
-               eb2008_publisher_sharps_create(&orte_eb2008
+               robottype_publisher_sharps_create(&orte
                                               dummy_publisher_callback, this);
        } else {
                if (!simulationEnabled)
                        return;
-               eb2008_publisher_sharps_destroy(&orte_eb2008);
+               robottype_publisher_sharps_destroy(&orte);
        }
        simulationEnabled = state;
 }
@@ -816,11 +816,11 @@ void RobomonAtlantis::setObstacleSimulation(int state)
                if (obstacleSimulationTimer) 
                        delete obstacleSimulationTimer;
                double distance = 0.8;
-               orte_eb2008.sharps.left = distance;
-               orte_eb2008.sharps.front_left = distance;
-               orte_eb2008.sharps.front_right = distance;
-               orte_eb2008.sharps.right = distance;
-               ORTEPublicationSend(orte_eb2008.publication_sharps);
+               orte.sharps.left = distance;
+               orte.sharps.front_left = distance;
+               orte.sharps.front_right = distance;
+               orte.sharps.right = distance;
+               ORTEPublicationSend(orte.publication_sharps);
        }
 }
 
@@ -832,10 +832,10 @@ void RobomonAtlantis::simulateObstacles()
        double distance, wall_distance;
        int i;
        double *sharp[4] = {
-               &orte_eb2008.sharps.left,
-               &orte_eb2008.sharps.right,
-               &orte_eb2008.sharps.front_left,
-               &orte_eb2008.sharps.front_right
+               &orte.sharps.left,
+               &orte.sharps.right,
+               &orte.sharps.front_left,
+               &orte.sharps.front_right
        };
 
        
@@ -846,7 +846,7 @@ void RobomonAtlantis::simulateObstacles()
                        distance = wall_distance;
                *sharp[i] = distance;
        }
-       ORTEPublicationSend(orte_eb2008.publication_sharps);
+       ORTEPublicationSend(orte.publication_sharps);
        
 }
 
@@ -1025,8 +1025,7 @@ void RobomonAtlantis::keyReleaseEvent(QKeyEvent *event)
 
 void RobomonAtlantis::closeEvent(QCloseEvent *event)
 {
-       generic_roboorte_destroy(&orte_generic);
-       eb2008_roboorte_destroy(&orte_eb2008);
+       robottype_roboorte_destroy(&orte);
 }
 
 /**********************************************************************
@@ -1036,58 +1035,53 @@ void RobomonAtlantis::createOrte()
 {
        int rv;
 
-       orte_generic.strength = 11;
-       orte_eb2008.strength = 11;
+       orte.strength = 11;
        
-       rv = generic_roboorte_init(&orte_generic);
-       if (rv) {
-               printf("RobomonAtlantis: Unable to initialize ORTE\n");
-       }
-       rv = eb2008_roboorte_init(&orte_eb2008);
+       rv = robottype_roboorte_init(&orte);
        if (rv) {
                printf("RobomonAtlantis: Unable to initialize ORTE\n");
        }
 
        /* publishers */
-       generic_publisher_motion_speed_create(&orte_generic, dummy_publisher_callback, NULL);
+       robottype_publisher_motion_speed_create(&orte, dummy_publisher_callback, NULL);
 
-       generic_publisher_pwr_ctrl_create(&orte_generic, dummy_publisher_callback, NULL);
+       robottype_publisher_pwr_ctrl_create(&orte, dummy_publisher_callback, NULL);
 
-       eb2008_publisher_servos_create(&orte_eb2008, dummy_publisher_callback, NULL);
-       eb2008_publisher_drives_create(&orte_eb2008, dummy_publisher_callback, NULL);
-       eb2008_publisher_laser_cmd_create(&orte_eb2008, NULL, NULL);
+       robottype_publisher_servos_create(&orte, dummy_publisher_callback, NULL);
+       robottype_publisher_drives_create(&orte, dummy_publisher_callback, NULL);
+       robottype_publisher_laser_cmd_create(&orte, NULL, NULL);
 
        /* subscribers */
-       generic_subscriber_pwr_voltage_create(&orte_generic
+       robottype_subscriber_pwr_voltage_create(&orte
                                receivePowerVoltageCallBack, this);
-       generic_subscriber_motion_status_create(&orte_generic
+       robottype_subscriber_motion_status_create(&orte
                                receiveMotionStatusCallBack, this);
-       generic_subscriber_ref_pos_create(&orte_generic
+       robottype_subscriber_ref_pos_create(&orte
                                receiveActualPositionCallBack, this);
-       generic_subscriber_est_pos_create(&orte_generic
+       robottype_subscriber_est_pos_create(&orte
                                receiveEstimatedPositionCallBack, this);
 
-       eb2008_subscriber_sharps_create(&orte_eb2008
+       robottype_subscriber_sharps_create(&orte
                                receiveSharpsCallBack, this);
 
        /*createDISubscriber(this, &orteData);*/
        /*createAccelerometerSubscriber(this, &orteData);*/
        /*createAccumulatorSubscriber(this, &orteData);*/
        /* motors */
-       orte_generic.motion_speed.left = 0;
-       orte_generic.motion_speed.right = 0;
+       orte.motion_speed.left = 0;
+       orte.motion_speed.right = 0;
        /* power management */
-        orte_generic.pwr_ctrl.voltage33 = true;
-        orte_generic.pwr_ctrl.voltage50 = true;
-        orte_generic.pwr_ctrl.voltage80 = true;
+        orte.pwr_ctrl.voltage33 = true;
+        orte.pwr_ctrl.voltage50 = true;
+        orte.pwr_ctrl.voltage80 = true;
        voltage33CheckBox->setChecked(true);
        voltage50CheckBox->setChecked(true);
        voltage80CheckBox->setChecked(true);
 
        /* servos */
-        orte_eb2008.servos.door_bottom = FRONT_DOOR_UP; //FIXME
-        orte_eb2008.servos.door_back = BACK_DOOR_UP; //FIXME
-        orte_eb2008.servos.door_top = TOP_DOOR_UP; //FIXME
+        orte.servos.door_bottom = FRONT_DOOR_UP; //FIXME
+        orte.servos.door_back = BACK_DOOR_UP; //FIXME
+        orte.servos.door_top = TOP_DOOR_UP; //FIXME
        bottomDoorCheckBox->setChecked(true);
        backDoorCheckBox->setChecked(true);
        topDoorCheckBox->setChecked(true);
@@ -1123,24 +1117,24 @@ void RobomonAtlantis::motionStatusReceived()
 
 void RobomonAtlantis::actualPositionReceived()
 {
-       actPosX->setText(QString("%1").arg(orte_generic.ref_pos.x, 0, 'f', 3));
-       actPosY->setText(QString("%1").arg(orte_generic.ref_pos.y, 0, 'f', 3));
+       actPosX->setText(QString("%1").arg(orte.ref_pos.x, 0, 'f', 3));
+       actPosY->setText(QString("%1").arg(orte.ref_pos.y, 0, 'f', 3));
        actPosPhi->setText(QString("%1(%2)")
-                       .arg(DEGREES(orte_generic.ref_pos.phi), 0, 'f', 0)
-                       .arg(orte_generic.ref_pos.phi, 0, 'f', 1));
-       robotActPos->moveRobot(orte_generic.ref_pos.x, 
-               orte_generic.ref_pos.y, orte_generic.ref_pos.phi);
+                       .arg(DEGREES(orte.ref_pos.phi), 0, 'f', 0)
+                       .arg(orte.ref_pos.phi, 0, 'f', 1));
+       robotActPos->moveRobot(orte.ref_pos.x, 
+               orte.ref_pos.y, orte.ref_pos.phi);
 }
 
 void RobomonAtlantis::estimatedPositionReceived()
 {
-       estPosX->setText(QString("%1").arg(orte_generic.est_pos.x, 0, 'f', 3));
-       estPosY->setText(QString("%1").arg(orte_generic.est_pos.y, 0, 'f', 3));
+       estPosX->setText(QString("%1").arg(orte.est_pos.x, 0, 'f', 3));
+       estPosY->setText(QString("%1").arg(orte.est_pos.y, 0, 'f', 3));
        estPosPhi->setText(QString("%1(%2)")
-                       .arg(DEGREES(orte_generic.est_pos.phi), 0, 'f', 0)
-                       .arg(orte_generic.est_pos.phi, 0, 'f', 1));
-       robotEstPos->moveRobot(orte_generic.est_pos.x, 
-               orte_generic.est_pos.y, orte_generic.est_pos.phi);
+                       .arg(DEGREES(orte.est_pos.phi), 0, 'f', 0)
+                       .arg(orte.est_pos.phi, 0, 'f', 1));
+       robotEstPos->moveRobot(orte.est_pos.x, 
+               orte.est_pos.y, orte.est_pos.phi);
 }
 
 void RobomonAtlantis::sharpsReceived()
@@ -1150,13 +1144,13 @@ void RobomonAtlantis::sharpsReceived()
 
 //     WDBG("ORTE received: sharps");
 
-       val_long[0] = (int)((double)orte_eb2008.sharps.left * 1000);
-       val_long[1] = (int)((double)orte_eb2008.sharps.front_left * 1000);
-       val_long[2] = (int)((double)orte_eb2008.sharps.front_right * 1000);
-       val_long[3] = (int)((double)orte_eb2008.sharps.right * 1000);
+       val_long[0] = (int)((double)orte.sharps.left * 1000);
+       val_long[1] = (int)((double)orte.sharps.front_left * 1000);
+       val_long[2] = (int)((double)orte.sharps.front_right * 1000);
+       val_long[3] = (int)((double)orte.sharps.right * 1000);
 
-       val_short[0] = (int)((double)orte_eb2008.sharps.back_left * 1000);
-       val_short[1] = (int)((double)orte_eb2008.sharps.back_right * 1000);
+       val_short[0] = (int)((double)orte.sharps.back_left * 1000);
+       val_short[1] = (int)((double)orte.sharps.back_right * 1000);
 
        for (int i=0; i<SHARP_LONG_CNT; i++) {
                sharpLongsLabel[i]->setText(QString("%1mm").arg(val_long[i]));
@@ -1192,13 +1186,13 @@ void RobomonAtlantis::accumulatorReceived()
 void RobomonAtlantis::powerVoltageReceived()
 {
        voltage33LineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltage33, 0, 'f', 3));
+                       orte.pwr_voltage.voltage33, 0, 'f', 3));
        voltage50LineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltage50, 0, 'f', 3));
+                       orte.pwr_voltage.voltage50, 0, 'f', 3));
        voltage80LineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltage80, 0, 'f', 3));
+                       orte.pwr_voltage.voltage80, 0, 'f', 3));
        voltageBATLineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltageBAT, 0, 'f', 3));
+                       orte.pwr_voltage.voltageBAT, 0, 'f', 3));
 
 }
 
@@ -1272,7 +1266,7 @@ double RobomonAtlantis::distanceToWall(int sharpnum)
  */    
 double RobomonAtlantis::distanceToObstacle(int sharpnum, Point obstacle, double obstacleSize)
 {  
-       struct est_pos_type e = orte_generic.est_pos;
+       struct est_pos_type e = orte.est_pos;
        double sensor_a;
        struct sharp_pos s = sharp[sharpnum];
        Point sensor(e.x + s.x*cos(e.phi) - s.y*sin(e.phi),
index fc181aabd0bccd8912ee044b47128a565b7a3b6f..a8a630cd4a2d0f3a86b65e354c27146f466d8228 100644 (file)
@@ -24,8 +24,8 @@
 #include <trgen.h>
 #include "PlaygroundScene.h"
 #include "Robot.h"
-#include <roboorte_generic.h>
-#include <roboorte_eb2008.h>
+#include <roboorte_robottype.h>
+#include <roboorte.h>
 
 class QHBoxLayout;
 class QVBoxLayout;
@@ -248,8 +248,7 @@ private:
         ************************************************************/
        void createOrte();
 
-       struct generic_orte_data orte_generic;
-       struct eb2008_orte_data orte_eb2008;
+       struct robottype_orte_data orte;
 };
 
 #endif /* ROBOMON_ATLANTIS_H */
index 8a5f9e877b62fde4bedcee689bfcd3e748d82a73..0438b086dfb1c0f7baed7f34cddecd48ccda4527 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <orte.h>
 #include <path_planner.h>
-#include <robodim_eb2008.h>
+#include <robodim.h>
 #include <sharp.h>
 #include <trgen.h>
 #include <map.h>
@@ -39,7 +39,7 @@
 #include <QKeyEvent>
 #include <QDebug>
 #include <QMessageBox>
-#include <servos_eb2008.h>
+#include <servos.h>
 
 RobomonExplorer::RobomonExplorer(QWidget *parent)
        : QWidget(parent)
@@ -516,25 +516,25 @@ void RobomonExplorer::createActions()
 void RobomonExplorer::setVoltage33(int state)
 {
        if (state)
-               orte_generic.pwr_ctrl.voltage33 = true;
+               orte.pwr_ctrl.voltage33 = true;
        else
-               orte_generic.pwr_ctrl.voltage33 = false;
+               orte.pwr_ctrl.voltage33 = false;
 }
 
 void RobomonExplorer::setVoltage50(int state)
 {
        if (state)
-               orte_generic.pwr_ctrl.voltage50 = true;
+               orte.pwr_ctrl.voltage50 = true;
        else
-               orte_generic.pwr_ctrl.voltage50 = false;
+               orte.pwr_ctrl.voltage50 = false;
 }
 
 void RobomonExplorer::setVoltage80(int state)
 {
        if (state)
-               orte_generic.pwr_ctrl.voltage80 = true;
+               orte.pwr_ctrl.voltage80 = true;
        else
-               orte_generic.pwr_ctrl.voltage80 = false;
+               orte.pwr_ctrl.voltage80 = false;
 }
 
 void RobomonExplorer::setLeftMotor(int value)
@@ -548,8 +548,8 @@ void RobomonExplorer::setLeftMotor(int value)
        leftMotor = (short int)(MOTOR_LIMIT * (leftMotorSlider->value()/100.0));
        rightMotor = (short int)(MOTOR_LIMIT * (rightMotorSlider->value()/100.0));
        
-       orte_generic.motion_speed.left = leftMotor;
-       orte_generic.motion_speed.right = rightMotor;
+       orte.motion_speed.left = leftMotor;
+       orte.motion_speed.right = rightMotor;
        
 }
 
@@ -564,8 +564,8 @@ void RobomonExplorer::setRightMotor(int value)
        leftMotor = (short int)(MOTOR_LIMIT * (leftMotorSlider->value()/100.0));
        rightMotor = (short int)(MOTOR_LIMIT * (rightMotorSlider->value()/100.0));
        
-       orte_generic.motion_speed.left = leftMotor;
-       orte_generic.motion_speed.right = rightMotor;
+       orte.motion_speed.left = leftMotor;
+       orte.motion_speed.right = rightMotor;
        
 }
 
@@ -583,75 +583,75 @@ void RobomonExplorer::moveServos(int value)
 void RobomonExplorer::moveFrontDoor(int state)
 {
        if (state)
-               orte_eb2008.servos.door_bottom = BOTTOM_DOOR_OPEN;
+               orte.servos.door_bottom = BOTTOM_DOOR_OPEN;
        else
-               orte_eb2008.servos.door_bottom = BOTTOM_DOOR_CLOSE;
+               orte.servos.door_bottom = BOTTOM_DOOR_CLOSE;
 }
 
 void RobomonExplorer::moveTopDoor(int state)
 {
        if (state)
-               orte_eb2008.servos.door_top = TOP_DOOR_OPEN;
+               orte.servos.door_top = TOP_DOOR_OPEN;
        else
-               orte_eb2008.servos.door_top = TOP_DOOR_CLOSE;
+               orte.servos.door_top = TOP_DOOR_CLOSE;
 }
 
 void RobomonExplorer::moveBackDoor(int state)
 {
        if (state)
-               orte_eb2008.servos.door_back = BACK_DOOR_OPEN;
+               orte.servos.door_back = BACK_DOOR_OPEN;
        else
-               orte_eb2008.servos.door_back = BACK_DOOR_CLOSE;
+               orte.servos.door_back = BACK_DOOR_CLOSE;
 }
 
 void RobomonExplorer::moveLeftBrush(int state)
 {
        if (state)
-               orte_eb2008.servos.brush_left = BRUSH_LEFT_OPEN;
+               orte.servos.brush_left = BRUSH_LEFT_OPEN;
        else
-               orte_eb2008.servos.brush_left = BRUSH_LEFT_CLOSE;
+               orte.servos.brush_left = BRUSH_LEFT_CLOSE;
 }
 
 void RobomonExplorer::moveRightBrush(int state)
 {
        if (state)
-               orte_eb2008.servos.brush_right = BRUSH_RIGHT_OPEN;
+               orte.servos.brush_right = BRUSH_RIGHT_OPEN;
        else
-               orte_eb2008.servos.brush_right = BRUSH_RIGHT_CLOSE;
+               orte.servos.brush_right = BRUSH_RIGHT_CLOSE;
 }
 
 void RobomonExplorer::setDrives(int state)
 {
-       orte_eb2008.drives.brush_left = leftBrushDial->value();
-       orte_eb2008.drives.brush_right = rightBrushDial->value();
-       orte_eb2008.drives.bagr = bagrDial->value();
-       orte_eb2008.drives.carousel_pos = carouselDial->value();
+       orte.drives.brush_left = leftBrushDial->value();
+       orte.drives.brush_right = rightBrushDial->value();
+       orte.drives.bagr = bagrDial->value();
+       orte.drives.carousel_pos = carouselDial->value();
 }
 
 void RobomonExplorer::setLeftBrushDriveCB(int state) {
 
        if(state)
-               orte_eb2008.drives.brush_left = LEFT_BRUSH_DRIVE_ON;
+               orte.drives.brush_left = LEFT_BRUSH_DRIVE_ON;
        else
-               orte_eb2008.drives.brush_left = LEFT_BRUSH_DRIVE_OFF;
+               orte.drives.brush_left = LEFT_BRUSH_DRIVE_OFF;
 }
 
 
 void RobomonExplorer::setRightBrushDriveCB(int state) {
 
        if(state)
-               orte_eb2008.drives.brush_right = RIGHT_BRUSH_DRIVE_ON;
+               orte.drives.brush_right = RIGHT_BRUSH_DRIVE_ON;
        else
-               orte_eb2008.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
+               orte.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
 }
 
 
 void RobomonExplorer::setBagrDriveCB(int state) {
 
        if(state)
-               orte_eb2008.drives.bagr = BAGR_DRIVE_ON;
+               orte.drives.bagr = BAGR_DRIVE_ON;
        else
-               orte_eb2008.drives.bagr = BAGR_DRIVE_OFF;
+               orte.drives.bagr = BAGR_DRIVE_OFF;
 }
 
 void RobomonExplorer::setDO(int state)
@@ -662,10 +662,10 @@ void RobomonExplorer::setDO(int state)
 void RobomonExplorer::setLaser(int state) {
 
        if(state)
-               orte_eb2008.laser_cmd.speed = LASER_DRIVE_ON;
+               orte.laser_cmd.speed = LASER_DRIVE_ON;
        else
-               orte_eb2008.laser_cmd.speed = LASER_DRIVE_OFF;
-       ORTEPublicationSend(orte_eb2008.publication_laser_cmd);
+               orte.laser_cmd.speed = LASER_DRIVE_OFF;
+       ORTEPublicationSend(orte.publication_laser_cmd);
 }
 
 void RobomonExplorer::showMap()
@@ -789,12 +789,12 @@ void RobomonExplorer::setSharpValues(int value)
 void RobomonExplorer::setSimulation(int state)
 {
        if(state) { 
-               eb2008_publisher_sharps_create(&orte_eb2008
+               robottype_publisher_sharps_create(&orte
                                               dummy_publisher_callback, this);
        } else {
                if (!simulationEnabled)
                        return;
-               eb2008_publisher_sharps_destroy(&orte_eb2008);
+               robottype_publisher_sharps_destroy(&orte);
        }
        simulationEnabled = state;
 }
@@ -816,11 +816,11 @@ void RobomonExplorer::setObstacleSimulation(int state)
                if (obstacleSimulationTimer) 
                        delete obstacleSimulationTimer;
                double distance = 0.8;
-               orte_eb2008.sharps.left = distance;
-               orte_eb2008.sharps.front_left = distance;
-               orte_eb2008.sharps.front_right = distance;
-               orte_eb2008.sharps.right = distance;
-               ORTEPublicationSend(orte_eb2008.publication_sharps);
+               orte.sharps.left = distance;
+               orte.sharps.front_left = distance;
+               orte.sharps.front_right = distance;
+               orte.sharps.right = distance;
+               ORTEPublicationSend(orte.publication_sharps);
        }
 }
 
@@ -832,10 +832,10 @@ void RobomonExplorer::simulateObstacles()
        double distance, wall_distance;
        int i;
        double *sharp[4] = {
-               &orte_eb2008.sharps.left,
-               &orte_eb2008.sharps.right,
-               &orte_eb2008.sharps.front_left,
-               &orte_eb2008.sharps.front_right
+               &orte.sharps.left,
+               &orte.sharps.right,
+               &orte.sharps.front_left,
+               &orte.sharps.front_right
        };
 
        
@@ -846,7 +846,7 @@ void RobomonExplorer::simulateObstacles()
                        distance = wall_distance;
                *sharp[i] = distance;
        }
-       ORTEPublicationSend(orte_eb2008.publication_sharps);
+       ORTEPublicationSend(orte.publication_sharps);
        
 }
 
@@ -1025,8 +1025,8 @@ void RobomonExplorer::keyReleaseEvent(QKeyEvent *event)
 
 void RobomonExplorer::closeEvent(QCloseEvent *event)
 {
-       generic_roboorte_destroy(&orte_generic);
-       eb2008_roboorte_destroy(&orte_eb2008);
+       robottype_roboorte_destroy(&orte);
+       robottype_roboorte_destroy(&orte);
 }
 
 /**********************************************************************
@@ -1036,58 +1036,54 @@ void RobomonExplorer::createOrte()
 {
        int rv;
 
-       orte_generic.strength = 11;
-       orte_eb2008.strength = 11;
+       orte.strength = 11;
+       orte.strength = 11;
        
-       rv = generic_roboorte_init(&orte_generic);
-       if (rv) {
-               printf("RobomonExplorer: Unable to initialize ORTE\n");
-       }
-       rv = eb2008_roboorte_init(&orte_eb2008);
+       rv = robottype_roboorte_init(&orte);
        if (rv) {
                printf("RobomonExplorer: Unable to initialize ORTE\n");
        }
 
        /* publishers */
-       generic_publisher_motion_speed_create(&orte_generic, dummy_publisher_callback, NULL);
+       robottype_publisher_motion_speed_create(&orte, dummy_publisher_callback, NULL);
 
-       generic_publisher_pwr_ctrl_create(&orte_generic, dummy_publisher_callback, NULL);
+       robottype_publisher_pwr_ctrl_create(&orte, dummy_publisher_callback, NULL);
 
-       eb2008_publisher_servos_create(&orte_eb2008, dummy_publisher_callback, NULL);
-       eb2008_publisher_drives_create(&orte_eb2008, dummy_publisher_callback, NULL);
-       eb2008_publisher_laser_cmd_create(&orte_eb2008, NULL, NULL);
+       robottype_publisher_servos_create(&orte, dummy_publisher_callback, NULL);
+       robottype_publisher_drives_create(&orte, dummy_publisher_callback, NULL);
+       robottype_publisher_laser_cmd_create(&orte, NULL, NULL);
 
        /* subscribers */
-       generic_subscriber_pwr_voltage_create(&orte_generic
+       robottype_subscriber_pwr_voltage_create(&orte
                                receivePowerVoltageCallBack, this);
-       generic_subscriber_motion_status_create(&orte_generic
+       robottype_subscriber_motion_status_create(&orte
                                receiveMotionStatusCallBack, this);
-       generic_subscriber_ref_pos_create(&orte_generic
+       robottype_subscriber_ref_pos_create(&orte
                                receiveActualPositionCallBack, this);
-       generic_subscriber_est_pos_create(&orte_generic
+       robottype_subscriber_est_pos_create(&orte
                                receiveEstimatedPositionCallBack, this);
 
-       eb2008_subscriber_sharps_create(&orte_eb2008
+       robottype_subscriber_sharps_create(&orte
                                receiveSharpsCallBack, this);
 
        /*createDISubscriber(this, &orteData);*/
        /*createAccelerometerSubscriber(this, &orteData);*/
        /*createAccumulatorSubscriber(this, &orteData);*/
        /* motors */
-       orte_generic.motion_speed.left = 0;
-       orte_generic.motion_speed.right = 0;
+       orte.motion_speed.left = 0;
+       orte.motion_speed.right = 0;
        /* power management */
-        orte_generic.pwr_ctrl.voltage33 = true;
-        orte_generic.pwr_ctrl.voltage50 = true;
-        orte_generic.pwr_ctrl.voltage80 = true;
+        orte.pwr_ctrl.voltage33 = true;
+        orte.pwr_ctrl.voltage50 = true;
+        orte.pwr_ctrl.voltage80 = true;
        voltage33CheckBox->setChecked(true);
        voltage50CheckBox->setChecked(true);
        voltage80CheckBox->setChecked(true);
 
        /* servos */
-        orte_eb2008.servos.door_bottom = FRONT_DOOR_UP; //FIXME
-        orte_eb2008.servos.door_back = BACK_DOOR_UP; //FIXME
-        orte_eb2008.servos.door_top = TOP_DOOR_UP; //FIXME
+        orte.servos.door_bottom = FRONT_DOOR_UP; //FIXME
+        orte.servos.door_back = BACK_DOOR_UP; //FIXME
+        orte.servos.door_top = TOP_DOOR_UP; //FIXME
        bottomDoorCheckBox->setChecked(true);
        backDoorCheckBox->setChecked(true);
        topDoorCheckBox->setChecked(true);
@@ -1123,24 +1119,24 @@ void RobomonExplorer::motionStatusReceived()
 
 void RobomonExplorer::actualPositionReceived()
 {
-       actPosX->setText(QString("%1").arg(orte_generic.ref_pos.x, 0, 'f', 3));
-       actPosY->setText(QString("%1").arg(orte_generic.ref_pos.y, 0, 'f', 3));
+       actPosX->setText(QString("%1").arg(orte.ref_pos.x, 0, 'f', 3));
+       actPosY->setText(QString("%1").arg(orte.ref_pos.y, 0, 'f', 3));
        actPosPhi->setText(QString("%1(%2)")
-                       .arg(DEGREES(orte_generic.ref_pos.phi), 0, 'f', 0)
-                       .arg(orte_generic.ref_pos.phi, 0, 'f', 1));
-       robotActPos->moveRobot(orte_generic.ref_pos.x, 
-               orte_generic.ref_pos.y, orte_generic.ref_pos.phi);
+                       .arg(DEGREES(orte.ref_pos.phi), 0, 'f', 0)
+                       .arg(orte.ref_pos.phi, 0, 'f', 1));
+       robotActPos->moveRobot(orte.ref_pos.x, 
+               orte.ref_pos.y, orte.ref_pos.phi);
 }
 
 void RobomonExplorer::estimatedPositionReceived()
 {
-       estPosX->setText(QString("%1").arg(orte_generic.est_pos.x, 0, 'f', 3));
-       estPosY->setText(QString("%1").arg(orte_generic.est_pos.y, 0, 'f', 3));
+       estPosX->setText(QString("%1").arg(orte.est_pos.x, 0, 'f', 3));
+       estPosY->setText(QString("%1").arg(orte.est_pos.y, 0, 'f', 3));
        estPosPhi->setText(QString("%1(%2)")
-                       .arg(DEGREES(orte_generic.est_pos.phi), 0, 'f', 0)
-                       .arg(orte_generic.est_pos.phi, 0, 'f', 1));
-       robotEstPos->moveRobot(orte_generic.est_pos.x, 
-               orte_generic.est_pos.y, orte_generic.est_pos.phi);
+                       .arg(DEGREES(orte.est_pos.phi), 0, 'f', 0)
+                       .arg(orte.est_pos.phi, 0, 'f', 1));
+       robotEstPos->moveRobot(orte.est_pos.x, 
+               orte.est_pos.y, orte.est_pos.phi);
 }
 
 void RobomonExplorer::sharpsReceived()
@@ -1150,13 +1146,13 @@ void RobomonExplorer::sharpsReceived()
 
 //     WDBG("ORTE received: sharps");
 
-       val_long[0] = (int)((double)orte_eb2008.sharps.left * 1000);
-       val_long[1] = (int)((double)orte_eb2008.sharps.front_left * 1000);
-       val_long[2] = (int)((double)orte_eb2008.sharps.front_right * 1000);
-       val_long[3] = (int)((double)orte_eb2008.sharps.right * 1000);
+       val_long[0] = (int)((double)orte.sharps.left * 1000);
+       val_long[1] = (int)((double)orte.sharps.front_left * 1000);
+       val_long[2] = (int)((double)orte.sharps.front_right * 1000);
+       val_long[3] = (int)((double)orte.sharps.right * 1000);
 
-       val_short[0] = (int)((double)orte_eb2008.sharps.back_left * 1000);
-       val_short[1] = (int)((double)orte_eb2008.sharps.back_right * 1000);
+       val_short[0] = (int)((double)orte.sharps.back_left * 1000);
+       val_short[1] = (int)((double)orte.sharps.back_right * 1000);
 
        for (int i=0; i<SHARP_LONG_CNT; i++) {
                sharpLongsLabel[i]->setText(QString("%1mm").arg(val_long[i]));
@@ -1192,13 +1188,13 @@ void RobomonExplorer::accumulatorReceived()
 void RobomonExplorer::powerVoltageReceived()
 {
        voltage33LineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltage33, 0, 'f', 3));
+                       orte.pwr_voltage.voltage33, 0, 'f', 3));
        voltage50LineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltage50, 0, 'f', 3));
+                       orte.pwr_voltage.voltage50, 0, 'f', 3));
        voltage80LineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltage80, 0, 'f', 3));
+                       orte.pwr_voltage.voltage80, 0, 'f', 3));
        voltageBATLineEdit->setText(QString("%1").arg(
-                       orte_generic.pwr_voltage.voltageBAT, 0, 'f', 3));
+                       orte.pwr_voltage.voltageBAT, 0, 'f', 3));
 
 }
 
@@ -1272,7 +1268,7 @@ double RobomonExplorer::distanceToWall(int sharpnum)
  */    
 double RobomonExplorer::distanceToObstacle(int sharpnum, Point obstacle, double obstacleSize)
 {  
-       struct est_pos_type e = orte_generic.est_pos;
+       struct est_pos_type e = orte.est_pos;
        double sensor_a;
        struct sharp_pos s = sharp[sharpnum];
        Point sensor(e.x + s.x*cos(e.phi) - s.y*sin(e.phi),
index 2032fc8f59d2e7da6f967829c7206abfd018a6fa..88c57bf0fbff9be36bad370a80a1116001e52b35 100644 (file)
@@ -24,8 +24,8 @@
 #include <trgen.h>
 #include "PlaygroundScene.h"
 #include "Robot.h"
-#include <roboorte_generic.h>
-#include <roboorte_eb2008.h>
+#include <roboorte_robottype.h>
+#include <roboorte.h>
 
 class QHBoxLayout;
 class QVBoxLayout;
@@ -248,8 +248,7 @@ private:
         ************************************************************/
        void createOrte();
 
-       struct generic_orte_data orte_generic;
-       struct eb2008_orte_data orte_eb2008;
+       struct robottype_orte_data orte;
 };
 
 #endif /* ROBOMON_EXPLORER_H */
index 54612834ee4105b976db01f537c2a63fe7799d6d..0ead442713e5d45558258c33e03ff2c7f2ff7865 100644 (file)
@@ -19,8 +19,8 @@
 #include <trgen.h>
 #include "PlaygroundScene.h"
 #include "Robot.h"
-#include <roboorte_eb2007.h>
-#include <roboorte_generic.h>
+#include <roboorte.h>
+#include <roboorte_robottype.h>
 #include "robomon_orte.h"
 
 class QHBoxLayout;
@@ -224,8 +224,7 @@ private:
         ************************************************************/
        void createOrte();
 
-       struct generic_orte_data orte_generic;
-       struct eb2007_orte_data orte_eb2007;
+       struct robottype_orte_data orte;
 };
 
 #endif /* ROBOMON_RECYCLING_H */
index da9499101c51b63486fc1865c7932de002984e7e..623e63fc3588d572992987b9205ee682bf00030d 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <orte.h>
 #include <path_planner.h>
-#include <robodim_eb2007.h>
+#include <robodim.h>
 #include <sharp.h>
 #include <trgen.h>
 #include <map.h>
@@ -278,30 +278,30 @@ void RobomonTuning::createActions()
 void RobomonTuning::setServos(int value)
 {
        
-       orte_eb2008.servos.door_top = (u_int8_t)servoDoorTop->value();
-       servoDoorTopLEdit->setText(QString("%1").arg(orte_eb2008.servos.door_top));
-       orte_eb2008.servos.door_back = (u_int8_t)servoDoorBack->value();
-       servoDoorBackLEdit->setText(QString("%1").arg(orte_eb2008.servos.door_back));
-       orte_eb2008.servos.door_bottom = (u_int8_t)servoDoorBottom->value();
-       servoDoorBottomLEdit->setText(QString("%1").arg(orte_eb2008.servos.door_bottom));
-       orte_eb2008.servos.brush_left = (u_int8_t)servoBrushLeft->value();
-       servoBrushLeftLEdit->setText(QString("%1").arg(orte_eb2008.servos.brush_left));
-       orte_eb2008.servos.brush_right = (u_int8_t)servoBrushRight->value();
-       servoBrushRightLEdit->setText(QString("%1").arg(orte_eb2008.servos.brush_right));
-
-       printf("setting servos: %d, %d, %d, %d, %d\n",orte_eb2008.servos.door_top,orte_eb2008.servos.door_back,
-                               orte_eb2008.servos.door_bottom,orte_eb2008.servos.brush_left,orte_eb2008.servos.brush_right);
-
-       ORTEPublicationSend(orte_eb2008.publication_servos);
+       orte.servos.door_top = (u_int8_t)servoDoorTop->value();
+       servoDoorTopLEdit->setText(QString("%1").arg(orte.servos.door_top));
+       orte.servos.door_back = (u_int8_t)servoDoorBack->value();
+       servoDoorBackLEdit->setText(QString("%1").arg(orte.servos.door_back));
+       orte.servos.door_bottom = (u_int8_t)servoDoorBottom->value();
+       servoDoorBottomLEdit->setText(QString("%1").arg(orte.servos.door_bottom));
+       orte.servos.brush_left = (u_int8_t)servoBrushLeft->value();
+       servoBrushLeftLEdit->setText(QString("%1").arg(orte.servos.brush_left));
+       orte.servos.brush_right = (u_int8_t)servoBrushRight->value();
+       servoBrushRightLEdit->setText(QString("%1").arg(orte.servos.brush_right));
+
+       printf("setting servos: %d, %d, %d, %d, %d\n",orte.servos.door_top,orte.servos.door_back,
+                               orte.servos.door_bottom,orte.servos.brush_left,orte.servos.brush_right);
+
+       ORTEPublicationSend(orte.publication_servos);
 }
 
 void RobomonTuning::setPwrAlert(int value)
 {
        if(value) {
-               orte_generic.pwr_alert.value = 2;
+               orte.pwr_alert.value = 2;
        }
        else {
-               orte_generic.pwr_alert.value = 0;
+               orte.pwr_alert.value = 0;
        }
 
 
@@ -309,33 +309,33 @@ void RobomonTuning::setPwrAlert(int value)
 
 void RobomonTuning::setCanMsg()
 {
-       orte_generic.can_msg.data1 = canData1->text().toInt();
-       orte_generic.can_msg.data2 = canData2->text().toInt();
-       orte_generic.can_msg.data3 = canData3->text().toInt();
-       orte_generic.can_msg.data4 = canData4->text().toInt();
-       orte_generic.can_msg.data5 = canData5->text().toInt();
-       orte_generic.can_msg.data6 = canData6->text().toInt();
-       orte_generic.can_msg.data7 = canData7->text().toInt();
-       orte_generic.can_msg.data8 = canData8->text().toInt();
+       orte.can_msg.data1 = canData1->text().toInt();
+       orte.can_msg.data2 = canData2->text().toInt();
+       orte.can_msg.data3 = canData3->text().toInt();
+       orte.can_msg.data4 = canData4->text().toInt();
+       orte.can_msg.data5 = canData5->text().toInt();
+       orte.can_msg.data6 = canData6->text().toInt();
+       orte.can_msg.data7 = canData7->text().toInt();
+       orte.can_msg.data8 = canData8->text().toInt();
 
-       orte_generic.can_msg.len = canMsgLen->text().toInt();
-       orte_generic.can_msg.id = canId->text().toInt();
+       orte.can_msg.len = canMsgLen->text().toInt();
+       orte.can_msg.id = canId->text().toInt();
 
-       ORTEPublicationSend(orte_generic.publication_can_msg);
+       ORTEPublicationSend(orte.publication_can_msg);
 
 }
 void RobomonTuning::setMotors(int state)
 {
-       orte_eb2008.drives.brush_left = brushLeft->value();
-       orte_eb2008.drives.brush_right = brushRight->value();
-       orte_eb2008.drives.bagr = roboBagr->value();
-       orte_eb2008.drives.carousel_pos = carousel->value();
-       ORTEPublicationSend(orte_eb2008.publication_drives);
-
-       brushLeftLEdit->setText(QString("%1").arg(orte_eb2008.drives.brush_left));
-       brushRightLEdit->setText(QString("%1").arg(orte_eb2008.drives.brush_right));
-       roboBagrLEdit->setText(QString("%1").arg(orte_eb2008.drives.bagr));
-       carouselLEdit->setText(QString("%1").arg(orte_eb2008.drives.carousel_pos));
+       orte.drives.brush_left = brushLeft->value();
+       orte.drives.brush_right = brushRight->value();
+       orte.drives.bagr = roboBagr->value();
+       orte.drives.carousel_pos = carousel->value();
+       ORTEPublicationSend(orte.publication_drives);
+
+       brushLeftLEdit->setText(QString("%1").arg(orte.drives.brush_left));
+       brushRightLEdit->setText(QString("%1").arg(orte.drives.brush_right));
+       roboBagrLEdit->setText(QString("%1").arg(orte.drives.bagr));
+       carouselLEdit->setText(QString("%1").arg(orte.drives.carousel_pos));
 }
 
 
@@ -443,8 +443,7 @@ void RobomonTuning::keyReleaseEvent(QKeyEvent *event)
 
 void RobomonTuning::closeEvent(QCloseEvent *event)
 {
-       generic_roboorte_destroy(&orte_generic);
-       eb2008_roboorte_destroy(&orte_eb2008);
+       robottype_roboorte_destroy(&orte);
 }
 
 /**********************************************************************
@@ -453,26 +452,24 @@ void RobomonTuning::closeEvent(QCloseEvent *event)
 void RobomonTuning::createOrte()
 {
 
-       orte_generic.strength = 12;
-       orte_eb2008.strength = 12;
+       orte.strength = 12;
 
-       generic_roboorte_init(&orte_generic);
-       eb2008_roboorte_init(&orte_eb2008);
+       robottype_roboorte_init(&orte);
 
-       orte_generic.pwr_alert.value = 0;
+       orte.pwr_alert.value = 0;
 
        /* publishers */
-       generic_publisher_can_msg_create(&orte_generic, NULL, NULL);
-       generic_publisher_pwr_ctrl_create(&orte_generic, NULL, NULL);
-       generic_publisher_pwr_alert_create(&orte_generic, dummy_publisher_callback, NULL);
+       robottype_publisher_can_msg_create(&orte, NULL, NULL);
+       robottype_publisher_pwr_ctrl_create(&orte, NULL, NULL);
+       robottype_publisher_pwr_alert_create(&orte, dummy_publisher_callback, NULL);
 
-       eb2008_publisher_servos_create(&orte_eb2008, NULL, NULL);
-       eb2008_publisher_drives_create(&orte_eb2008, NULL, NULL);
+       robottype_publisher_servos_create(&orte, NULL, NULL);
+       robottype_publisher_drives_create(&orte, NULL, NULL);
 
        /*Power supply hack*/
-       orte_generic.pwr_ctrl.voltage33 = true;
-       orte_generic.pwr_ctrl.voltage50 = true;
-       orte_generic.pwr_ctrl.voltage80 = true;
+       orte.pwr_ctrl.voltage33 = true;
+       orte.pwr_ctrl.voltage50 = true;
+       orte.pwr_ctrl.voltage80 = true;
 }
 
 /**********************************************************************
index 2329e26ca6748496300516bbabd98b42e2ea85bf..7683173a54d26db68726ae3538f8a5e0686a505d 100644 (file)
@@ -20,8 +20,8 @@
 #include "PlaygroundScene.h"
 #include "Robot.h"
 #include "robomon_orte.h"
-#include <roboorte_generic.h>
-#include <roboorte_eb2008.h>
+#include <roboorte_robottype.h>
+#include <roboorte.h>
 
 class QHBoxLayout;
 class QVBoxLayout;
@@ -134,8 +134,7 @@ private:
         ************************************************************/
        void createOrte();
 
-       struct generic_orte_data orte_generic;
-       struct eb2008_orte_data orte_eb2008;
+       struct robottype_orte_data orte;
 };
 
 #endif /* ROBOMON_TUNING_H */
index 8349a441b911225e6846751cab45c1e7d77cf843..40581295976857c17abd5255d92a6a16ab8a684a 100644 (file)
 
 #include <math.h>
 #include <robomath.h>
-#include <robodim_eb2008.h>
+#include <robodim.h>
 #include <mcl.h>
 #include <laser-nav.h>
-#include <roboorte_eb2007.h>
+#include <roboorte.h>
 
 #include "PlaygroundScene.h"
 #include "MiscGui.h"
@@ -823,8 +823,7 @@ void SimMcl::keyReleaseEvent(QKeyEvent *event)
 
 void SimMcl::closeEvent(QCloseEvent *event)
 {
-       generic_roboorte_destroy(&orte_generic);
-       eb2008_roboorte_destroy(&orte_eb2008);
+       robottype_roboorte_destroy(&orte);
 }
 
 /**********************************************************************
@@ -834,22 +833,16 @@ void SimMcl::createOrte()
 {
        int rv;
 
-       orte_generic.strength = 12;
-       orte_eb2008.strength = 12;
+       orte.strength = 12;
 
-       rv = generic_roboorte_init(&orte_generic);
+       rv = robottype_roboorte_init(&orte);
        if (!rv) {
                printf("SimMcl: Unable to initialize ORTE\n");
        }
 
-       rv = eb2008_roboorte_init(&orte_eb2008);
-       if (rv) {
-               printf("SimMcl: Unable to initialize ORTE\n");
-       }
-
-       generic_subscriber_motion_irc_create(&orte_generic, 
+       robottype_subscriber_motion_irc_create(&orte, 
                                rcv_motion_irc_cb, this);
-       eb2008_subscriber_laser_data_create(&orte_eb2008
+       robottype_subscriber_laser_data_create(&orte
                                receiveLaserCallBack, this);
 
        /* set actions to do when we receive data from orte */
@@ -867,8 +860,8 @@ void SimMcl::laserReceived()
        /*WDBG("ORTE received: laser");*/
 
        measuredAngles.count = 1;
-       measuredAngles.val[0] = TIME2ANGLE(orte_eb2008.laser_data.period, 
-                               orte_eb2008.laser_data.measure);
+       measuredAngles.val[0] = TIME2ANGLE(orte.laser_data.period, 
+                               orte.laser_data.measure);
 
        /*QString dbg = QString("theta=%1")
                        .arg(RAD2DEG(measuredAngles.val[0]), 0, 'f', 3);
@@ -897,7 +890,7 @@ void SimMcl::updateOdometry()
 
 //     WDBG("ORTE received: motion_irc");
 
-       curr_irc = orte_generic.motion_irc;
+       curr_irc = orte.motion_irc;
 
        if(firstRun) {
                prev_irc = curr_irc;
index f9218554d61889f8db0452ea9626a679ca043d61..5504f55a3a4ec5967f9208260ba1a746a453f4f7 100644 (file)
@@ -23,8 +23,8 @@
 #include "MclPainter.h"
 #include "AnglesHistogramPainter.h"
 #include "robomon_orte.h"
-#include <roboorte_eb2008.h>
-#include <roboorte_generic.h>
+#include <roboorte.h>
+#include <roboorte_robottype.h>
 
 #define OPENGL_DEFAULT         false
 #define ALIASING_DEFAULT       true
@@ -191,8 +191,7 @@ private:
         ************************************************************/
        void createOrte();
 
-       struct generic_orte_data orte_generic;
-       struct eb2008_orte_data orte_eb2008;
+       struct robottype_orte_data orte;
 
        /************************************************************
         * PLN - Passive Laser Navigation
index ca945121cd6e30715997df0f43639f0f6efcc40f..e8e26a4629de9355952144209187394c67c247e6 100644 (file)
@@ -23,8 +23,6 @@
 #endif
 
 #include <robottype.h>
-#include <robottype_eb2007.h>
-#include <robottype_eb2008.h>
 #include <QCoreApplication>
 
 #include "robomon_orte.h"
index b3fcd33c7e6f08b7e399f81960caf99f48925a7f..1216e5ad1127abb0c6af30161c5fa348fb219403 100644 (file)
@@ -14,8 +14,8 @@
 
 #include <orte.h>
 #include <robottype.h>
-#include <robottype_eb2007.h>
-#include <robottype_eb2008.h>
+#include <robottype.h>
+#include <robottype.h>
 
 /* post event to the receiver, which is a QObject instance */
 #define QEVENT(event) (QEvent::Type)(QEvent::User+(event))
index e06320a77161c4f3d389228c6d11c1e2fbc4fa32..972fa36d5cc0d0f82d1f38abe3b1ff6ecfffe232 100644 (file)
@@ -1,8 +1,6 @@
 QT += opengl
 SOURCES += main.cpp \
            MainWindow.cpp \
-           RobomonRecycling.cpp \
-           RobomonExplorer.cpp \
            RobomonAtlantis.cpp \
            RobomonTuning.cpp \
            SimMcl.cpp \
@@ -30,8 +28,6 @@ LIBPATH += ../../../build/linux/_compiled/lib
 RESOURCES = robomon.qrc
 
 HEADERS += MainWindow.h \
-           RobomonRecycling.h \
-           RobomonExplorer.h \
            RobomonAtlantis.h \
            RobomonTuning.h \
            SimMcl.h \
@@ -47,7 +43,7 @@ HEADERS += MainWindow.h \
            MiscGui.h \
            robomon_orte.h
 
-LIBS += -lm -lpthread -lmcl -llaser-nav -lrobodim_eb2008 -lrobomath -lroboorte_generic -lroboorte_eb2008 -lroboorte_eb2007 -lrobottype -lrobottype_eb2007 -lrobottype_eb2008 -lorte  -lsharp -lmap -lrobodim_eb2008
+LIBS += -lm -lpthread -lmcl -llaser-nav -lrobodim -lrobomath -lroboorte -lrobottype -lorte  -lsharp -lmap
 
 OBJECTS_DIR = ../../../build/linux/_build/user/robomon2/
 MOC_DIR = ../../../build/linux/_build/user/robomon2/
index 85033471466ae7d42050ad6e912015ae47d6d769..87ea8bbf0fc1f8e6a7a89446ffac9bed7c8a39db 100644 (file)
@@ -1,6 +1,15 @@
 # -*- makefile -*-
 #  Robot's ORTE library
 
-SUBDIRS = eb2007 eb2008 generic #utils
-
 include_HEADERS = roboorte.h
+
+include-pass_HOOKS = roboorte_robottype.c roboorte_robottype.h
+
+roboorte_robottype.c roboorte_robottype.h: $(SOURCES_DIR)/utils/roboortegen.pl $(SOURCES_DIR)/../types/robottype.idl
+       @$(QUIET_CMD_ECHO) "  ROBOORTE $@"
+       $(Q)perl -Mlib=$(SOURCES_DIR)/utils/ $(SOURCES_DIR)/utils/roboortegen.pl $(SOURCES_DIR)/../types/robottype.idl
+
+lib_LIBRARIES += roboorte
+roboorte_GEN_SOURCES = roboorte_robottype.c
+include_GEN_HEADERS += roboorte_robottype.h
+
diff --git a/src/roboorte/eb2007/Makefile b/src/roboorte/eb2007/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/roboorte/eb2007/Makefile.omk b/src/roboorte/eb2007/Makefile.omk
deleted file mode 100644 (file)
index a0440c2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- makefile -*-
-#  Robot's ORTE library
-
-include-pass_HOOKS = roboorte_eb2007.c roboorte_eb2007.h
-
-roboorte_eb2007.c roboorte_eb2007.h: $(SOURCES_DIR)/../utils/roboortegen.pl $(SOURCES_DIR)/../../types/robottype_eb2007.idl
-       @$(QUIET_CMD_ECHO) "  ROBOORTE $@"
-       $(Q)perl -Mlib=$(SOURCES_DIR)/../utils/ $(SOURCES_DIR)/../utils/roboortegen.pl $(SOURCES_DIR)/../../types/robottype_eb2007.idl eb2007
-
-lib_LIBRARIES += roboorte_eb2007
-roboorte_eb2007_GEN_SOURCES = roboorte_eb2007.c
-include_GEN_HEADERS += roboorte_eb2007.h
-
diff --git a/src/roboorte/eb2008/Makefile b/src/roboorte/eb2008/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/roboorte/eb2008/Makefile.omk b/src/roboorte/eb2008/Makefile.omk
deleted file mode 100644 (file)
index 6c819c6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- makefile -*-
-#  Robot's ORTE library
-
-include-pass_HOOKS = roboorte_eb2008.c roboorte_eb2008.h
-
-roboorte_eb2008.c roboorte_eb2008.h: $(SOURCES_DIR)/../utils/roboortegen.pl $(SOURCES_DIR)/../../types/robottype_eb2008.idl
-       @$(QUIET_CMD_ECHO) "  ROBOORTE $@"
-       $(Q)perl -Mlib=$(SOURCES_DIR)/../utils/ $(SOURCES_DIR)/../utils/roboortegen.pl $(SOURCES_DIR)/../../types/robottype_eb2008.idl eb2008
-
-lib_LIBRARIES += roboorte_eb2008
-roboorte_eb2008_GEN_SOURCES = roboorte_eb2008.c
-include_GEN_HEADERS += roboorte_eb2008.h
-
diff --git a/src/roboorte/generic/Makefile b/src/roboorte/generic/Makefile
deleted file mode 100644 (file)
index 08cf5ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generic directory or leaf node makefile for OCERA make framework
-
-ifndef MAKERULES_DIR
-MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
-endif
-
-ifeq ($(MAKERULES_DIR),)
-all : default
-.DEFAULT::
-       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
-else   
-include $(MAKERULES_DIR)/Makefile.rules
-endif
-
diff --git a/src/roboorte/generic/Makefile.omk b/src/roboorte/generic/Makefile.omk
deleted file mode 100644 (file)
index 2573bb3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- makefile -*-
-#  Robot's ORTE library
-
-include-pass_HOOKS = roboorte_generic.c roboorte_generic.h
-
-roboorte_generic.c roboorte_generic.h: $(SOURCES_DIR)/../utils/roboortegen.pl $(SOURCES_DIR)/../../types/robottype.idl
-       @$(QUIET_CMD_ECHO) "  ROBOORTE $@"
-       $(Q)perl -Mlib=$(SOURCES_DIR)/../utils/ $(SOURCES_DIR)/../utils/roboortegen.pl $(SOURCES_DIR)/../../types/robottype.idl generic
-
-lib_LIBRARIES += roboorte_generic
-roboorte_generic_GEN_SOURCES = roboorte_generic.c
-include_GEN_HEADERS += roboorte_generic.h
-
index 06e6bdcfb78958bc861ec686e496f85dc5e958cb..d444a0be0158f909cf6f9161668d51b1431cce70 100644 (file)
@@ -1,11 +1,3 @@
 include_HEADERS += robottype.h
 lib_LIBRARIES = robottype
 robottype_SOURCES = robottype.c
-
-include_HEADERS += robottype_eb2007.h
-lib_LIBRARIES += robottype_eb2007
-robottype_eb2007_SOURCES = robottype_eb2007.c
-
-include_HEADERS += robottype_eb2008.h
-lib_LIBRARIES += robottype_eb2008
-robottype_eb2008_SOURCES = robottype_eb2008.c
index 9915673215571082635077a24611cedaaf8ed413..37dbd715dfeaf7d1e182a3400dd450d704809ac7 100644 (file)
@@ -622,3 +622,337 @@ hokuyo_scan_type_register(ORTEDomain *d) {
   return ret;
 }
 
+/****************************************************************/
+/* struct - servos                                              */
+/****************************************************************/
+
+void servos_serialize(CDR_Codec *cdrCodec,servos *object) {
+  CORBA_octet_serialize(cdrCodec,&(object->brush_left));
+  CORBA_octet_serialize(cdrCodec,&(object->brush_right));
+  CORBA_octet_serialize(cdrCodec,&(object->door_bottom));
+  CORBA_octet_serialize(cdrCodec,&(object->door_top));
+  CORBA_octet_serialize(cdrCodec,&(object->door_back));
+  CORBA_octet_serialize(cdrCodec,&(object->reserve));
+}
+
+void
+servos_deserialize(CDR_Codec *cdrCodec,servos *object) {
+  CORBA_octet_deserialize(cdrCodec,&(object->brush_left));
+  CORBA_octet_deserialize(cdrCodec,&(object->brush_right));
+  CORBA_octet_deserialize(cdrCodec,&(object->door_bottom));
+  CORBA_octet_deserialize(cdrCodec,&(object->door_top));
+  CORBA_octet_deserialize(cdrCodec,&(object->door_back));
+  CORBA_octet_deserialize(cdrCodec,&(object->reserve));
+}
+
+int
+servos_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+servos_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "servos",
+                          (ORTETypeSerialize)servos_serialize,
+                          (ORTETypeDeserialize)servos_deserialize,
+                          servos_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - drives                                              */
+/****************************************************************/
+
+void drives_serialize(CDR_Codec *cdrCodec,drives *object) {
+  CORBA_octet_serialize(cdrCodec,&(object->brush_left));
+  CORBA_octet_serialize(cdrCodec,&(object->brush_right));
+  CORBA_octet_serialize(cdrCodec,&(object->bagr));
+  CORBA_octet_serialize(cdrCodec,&(object->carousel_pos));
+}
+
+void
+drives_deserialize(CDR_Codec *cdrCodec,drives *object) {
+  CORBA_octet_deserialize(cdrCodec,&(object->brush_left));
+  CORBA_octet_deserialize(cdrCodec,&(object->brush_right));
+  CORBA_octet_deserialize(cdrCodec,&(object->bagr));
+  CORBA_octet_deserialize(cdrCodec,&(object->carousel_pos));
+}
+
+int
+drives_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+drives_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "drives",
+                          (ORTETypeSerialize)drives_serialize,
+                          (ORTETypeDeserialize)drives_deserialize,
+                          drives_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - laser_cmd                                           */
+/****************************************************************/
+
+void laser_cmd_serialize(CDR_Codec *cdrCodec,laser_cmd *object) {
+  CORBA_octet_serialize(cdrCodec,&(object->speed));
+}
+
+void
+laser_cmd_deserialize(CDR_Codec *cdrCodec,laser_cmd *object) {
+  CORBA_octet_deserialize(cdrCodec,&(object->speed));
+}
+
+int
+laser_cmd_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_octet_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+laser_cmd_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "laser_cmd",
+                          (ORTETypeSerialize)laser_cmd_serialize,
+                          (ORTETypeDeserialize)laser_cmd_deserialize,
+                          laser_cmd_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - laser_data                                          */
+/****************************************************************/
+
+void laser_data_serialize(CDR_Codec *cdrCodec,laser_data *object) {
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->period));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measure));
+}
+
+void
+laser_data_deserialize(CDR_Codec *cdrCodec,laser_data *object) {
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->period));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measure));
+}
+
+int
+laser_data_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+laser_data_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "laser_data",
+                          (ORTETypeSerialize)laser_data_serialize,
+                          (ORTETypeDeserialize)laser_data_deserialize,
+                          laser_data_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - laser_meas                                          */
+/****************************************************************/
+
+void laser_meas_serialize(CDR_Codec *cdrCodec,laser_meas *object) {
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->cnt));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->period));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures0));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures1));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures2));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures3));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures4));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures5));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures6));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures7));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures8));
+  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures9));
+}
+
+void
+laser_meas_deserialize(CDR_Codec *cdrCodec,laser_meas *object) {
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->cnt));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->period));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures0));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures1));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures2));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures3));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures4));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures5));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures6));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures7));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures8));
+  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures9));
+}
+
+int
+laser_meas_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  CORBA_unsigned_short_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+laser_meas_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "laser_meas",
+                          (ORTETypeSerialize)laser_meas_serialize,
+                          (ORTETypeDeserialize)laser_meas_deserialize,
+                          laser_meas_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - sharps                                              */
+/****************************************************************/
+
+void sharps_serialize(CDR_Codec *cdrCodec,sharps *object) {
+  CORBA_double_serialize(cdrCodec,&(object->left));
+  CORBA_double_serialize(cdrCodec,&(object->right));
+  CORBA_double_serialize(cdrCodec,&(object->front_left));
+  CORBA_double_serialize(cdrCodec,&(object->front_right));
+  CORBA_double_serialize(cdrCodec,&(object->back_left));
+  CORBA_double_serialize(cdrCodec,&(object->back_right));
+}
+
+void
+sharps_deserialize(CDR_Codec *cdrCodec,sharps *object) {
+  CORBA_double_deserialize(cdrCodec,&(object->left));
+  CORBA_double_deserialize(cdrCodec,&(object->right));
+  CORBA_double_deserialize(cdrCodec,&(object->front_left));
+  CORBA_double_deserialize(cdrCodec,&(object->front_right));
+  CORBA_double_deserialize(cdrCodec,&(object->back_left));
+  CORBA_double_deserialize(cdrCodec,&(object->back_right));
+}
+
+int
+sharps_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_double_get_max_size(gms);
+  CORBA_double_get_max_size(gms);
+  CORBA_double_get_max_size(gms);
+  CORBA_double_get_max_size(gms);
+  CORBA_double_get_max_size(gms);
+  CORBA_double_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+sharps_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "sharps",
+                          (ORTETypeSerialize)sharps_serialize,
+                          (ORTETypeDeserialize)sharps_deserialize,
+                          sharps_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - cmu                                                 */
+/****************************************************************/
+
+void cmu_serialize(CDR_Codec *cdrCodec,cmu *object) {
+  CORBA_octet_serialize(cdrCodec,&(object->color));
+}
+
+void
+cmu_deserialize(CDR_Codec *cdrCodec,cmu *object) {
+  CORBA_octet_deserialize(cdrCodec,&(object->color));
+}
+
+int
+cmu_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_octet_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+cmu_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "cmu",
+                          (ORTETypeSerialize)cmu_serialize,
+                          (ORTETypeDeserialize)cmu_deserialize,
+                          cmu_get_max_size,
+                          0);
+  return ret;
+}
+
+/****************************************************************/
+/* struct - bumper                                              */
+/****************************************************************/
+
+void bumper_serialize(CDR_Codec *cdrCodec,bumper *object) {
+  CORBA_octet_serialize(cdrCodec,&(object->left));
+  CORBA_octet_serialize(cdrCodec,&(object->right));
+}
+
+void
+bumper_deserialize(CDR_Codec *cdrCodec,bumper *object) {
+  CORBA_octet_deserialize(cdrCodec,&(object->left));
+  CORBA_octet_deserialize(cdrCodec,&(object->right));
+}
+
+int
+bumper_get_max_size(ORTEGetMaxSizeParam *gms) {
+  CORBA_octet_get_max_size(gms);
+  CORBA_octet_get_max_size(gms);
+  return gms->csize;
+}
+
+Boolean
+bumper_type_register(ORTEDomain *d) {
+  Boolean ret;
+
+  ret=ORTETypeRegisterAdd(d,
+                          "bumper",
+                          (ORTETypeSerialize)bumper_serialize,
+                          (ORTETypeDeserialize)bumper_deserialize,
+                          bumper_get_max_size,
+                          0);
+  return ret;
+}
+
index 3265b07263570af9e17951d401506bf42a9c03b2..c16be07e894a34819dfe71e71d52effe65b3b1df 100644 (file)
@@ -187,6 +187,96 @@ CORBA_unsigned_short data33;
 CORBA_unsigned_short data34;
 };
 
+#endif
+#if !defined(_servos_defined)
+#define _servos_defined 1
+typedef struct servos_type servos;
+struct servos_type {
+CORBA_octet brush_left;
+CORBA_octet brush_right;
+CORBA_octet door_bottom;
+CORBA_octet door_top;
+CORBA_octet door_back;
+CORBA_octet reserve;
+};
+
+#endif
+#if !defined(_drives_defined)
+#define _drives_defined 1
+typedef struct drives_type drives;
+struct drives_type {
+CORBA_octet brush_left;
+CORBA_octet brush_right;
+CORBA_octet bagr;
+CORBA_octet carousel_pos;
+};
+
+#endif
+#if !defined(_laser_cmd_defined)
+#define _laser_cmd_defined 1
+typedef struct laser_cmd_type laser_cmd;
+struct laser_cmd_type {
+CORBA_octet speed;
+};
+
+#endif
+#if !defined(_laser_data_defined)
+#define _laser_data_defined 1
+typedef struct laser_data_type laser_data;
+struct laser_data_type {
+CORBA_unsigned_short period;
+CORBA_unsigned_short measure;
+};
+
+#endif
+#if !defined(_laser_meas_defined)
+#define _laser_meas_defined 1
+typedef struct laser_meas_type laser_meas;
+struct laser_meas_type {
+CORBA_unsigned_short cnt;
+CORBA_unsigned_short period;
+CORBA_unsigned_short measures0;
+CORBA_unsigned_short measures1;
+CORBA_unsigned_short measures2;
+CORBA_unsigned_short measures3;
+CORBA_unsigned_short measures4;
+CORBA_unsigned_short measures5;
+CORBA_unsigned_short measures6;
+CORBA_unsigned_short measures7;
+CORBA_unsigned_short measures8;
+CORBA_unsigned_short measures9;
+};
+
+#endif
+#if !defined(_sharps_defined)
+#define _sharps_defined 1
+typedef struct sharps_type sharps;
+struct sharps_type {
+CORBA_double left;
+CORBA_double right;
+CORBA_double front_left;
+CORBA_double front_right;
+CORBA_double back_left;
+CORBA_double back_right;
+};
+
+#endif
+#if !defined(_cmu_defined)
+#define _cmu_defined 1
+typedef struct cmu_type cmu;
+struct cmu_type {
+CORBA_octet color;
+};
+
+#endif
+#if !defined(_bumper_defined)
+#define _bumper_defined 1
+typedef struct bumper_type bumper;
+struct bumper_type {
+CORBA_octet left;
+CORBA_octet right;
+};
+
 #endif
 
 /** impls declarations **/
@@ -250,6 +340,46 @@ void hokuyo_scan_deserialize(CDR_Codec *cdrCodec,hokuyo_scan *object);
 int hokuyo_scan_get_max_size(ORTEGetMaxSizeParam *gms);
 Boolean hokuyo_scan_type_register(ORTEDomain *d);
 
+void servos_serialize(CDR_Codec *cdrCodec,servos *object);
+void servos_deserialize(CDR_Codec *cdrCodec,servos *object);
+int servos_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean servos_type_register(ORTEDomain *d);
+
+void drives_serialize(CDR_Codec *cdrCodec,drives *object);
+void drives_deserialize(CDR_Codec *cdrCodec,drives *object);
+int drives_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean drives_type_register(ORTEDomain *d);
+
+void laser_cmd_serialize(CDR_Codec *cdrCodec,laser_cmd *object);
+void laser_cmd_deserialize(CDR_Codec *cdrCodec,laser_cmd *object);
+int laser_cmd_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean laser_cmd_type_register(ORTEDomain *d);
+
+void laser_data_serialize(CDR_Codec *cdrCodec,laser_data *object);
+void laser_data_deserialize(CDR_Codec *cdrCodec,laser_data *object);
+int laser_data_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean laser_data_type_register(ORTEDomain *d);
+
+void laser_meas_serialize(CDR_Codec *cdrCodec,laser_meas *object);
+void laser_meas_deserialize(CDR_Codec *cdrCodec,laser_meas *object);
+int laser_meas_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean laser_meas_type_register(ORTEDomain *d);
+
+void sharps_serialize(CDR_Codec *cdrCodec,sharps *object);
+void sharps_deserialize(CDR_Codec *cdrCodec,sharps *object);
+int sharps_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean sharps_type_register(ORTEDomain *d);
+
+void cmu_serialize(CDR_Codec *cdrCodec,cmu *object);
+void cmu_deserialize(CDR_Codec *cdrCodec,cmu *object);
+int cmu_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean cmu_type_register(ORTEDomain *d);
+
+void bumper_serialize(CDR_Codec *cdrCodec,bumper *object);
+void bumper_deserialize(CDR_Codec *cdrCodec,bumper *object);
+int bumper_get_max_size(ORTEGetMaxSizeParam *gms);
+Boolean bumper_type_register(ORTEDomain *d);
+
 
 #ifdef __cplusplus
 }
index 4d57801a28eca9da3f8a0d4c0c857a7fa6072309..a102494c818ce215691f93a335777c154890eca9 100644 (file)
@@ -123,3 +123,60 @@ struct hokuyo_scan {
     unsigned short data33;
     unsigned short data34;
 };
+struct servos {
+       octet brush_left;
+       octet brush_right;
+       octet door_bottom;
+       octet door_top;
+       octet door_back;
+       octet reserve;
+};
+
+struct drives {
+       octet brush_left;
+       octet brush_right;
+       octet bagr;
+       octet carousel_pos;
+};
+
+struct laser_cmd {
+       octet speed;
+};
+
+struct laser_data {
+       unsigned short period;
+       unsigned short measure;
+};
+
+struct laser_meas {
+       unsigned short cnt;
+       unsigned short period;
+       unsigned short measures0;
+       unsigned short measures1;
+       unsigned short measures2;
+       unsigned short measures3;
+       unsigned short measures4;
+       unsigned short measures5;
+       unsigned short measures6;
+       unsigned short measures7;
+       unsigned short measures8;
+       unsigned short measures9;
+};
+
+struct sharps {
+       double left;
+       double right;
+       double front_left;
+       double front_right;
+       double back_left;
+       double back_right;
+};
+
+struct cmu {
+       octet color;
+};
+
+struct bumper {
+       octet left;
+       octet right;
+};
diff --git a/src/types/robottype_eb2007.c b/src/types/robottype_eb2007.c
deleted file mode 100644 (file)
index eb6af75..0000000
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * This file was generated by orte-idl - DO NOT EDIT!
- */
-
-#include "robottype_eb2007.h"
-
-/****************************************************************/
-/* struct - stateInnerIR                                        */
-/****************************************************************/
-
-void stateInnerIR_serialize(CDR_Codec *cdrCodec,stateInnerIR *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->front));
-  CORBA_octet_serialize(cdrCodec,&(object->back));
-}
-
-void
-stateInnerIR_deserialize(CDR_Codec *cdrCodec,stateInnerIR *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->front));
-  CORBA_octet_deserialize(cdrCodec,&(object->back));
-}
-
-int
-stateInnerIR_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-stateInnerIR_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "stateInnerIR",
-                          (ORTETypeSerialize)stateInnerIR_serialize,
-                          (ORTETypeDeserialize)stateInnerIR_deserialize,
-                          stateInnerIR_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - stateDigIn                                          */
-/****************************************************************/
-
-void stateDigIn_serialize(CDR_Codec *cdrCodec,stateDigIn *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->state));
-}
-
-void
-stateDigIn_deserialize(CDR_Codec *cdrCodec,stateDigIn *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->state));
-}
-
-int
-stateDigIn_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-stateDigIn_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "stateDigIn",
-                          (ORTETypeSerialize)stateDigIn_serialize,
-                          (ORTETypeDeserialize)stateDigIn_deserialize,
-                          stateDigIn_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - stateServa                                          */
-/****************************************************************/
-
-void stateServa_serialize(CDR_Codec *cdrCodec,stateServa *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->frontDoor));
-  CORBA_octet_serialize(cdrCodec,&(object->innerDoor));
-  CORBA_octet_serialize(cdrCodec,&(object->backDoor));
-  CORBA_octet_serialize(cdrCodec,&(object->topDoor));
-  CORBA_octet_serialize(cdrCodec,&(object->bottomDoor));
-  CORBA_octet_serialize(cdrCodec,&(object->leftBrush));
-  CORBA_octet_serialize(cdrCodec,&(object->rightBrush));
-  CORBA_octet_serialize(cdrCodec,&(object->reserve));
-  CORBA_octet_serialize(cdrCodec,&(object->release));
-  CORBA_octet_serialize(cdrCodec,&(object->transporterFront));
-  CORBA_octet_serialize(cdrCodec,&(object->transporterInner));
-}
-
-void
-stateServa_deserialize(CDR_Codec *cdrCodec,stateServa *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->frontDoor));
-  CORBA_octet_deserialize(cdrCodec,&(object->innerDoor));
-  CORBA_octet_deserialize(cdrCodec,&(object->backDoor));
-  CORBA_octet_deserialize(cdrCodec,&(object->topDoor));
-  CORBA_octet_deserialize(cdrCodec,&(object->bottomDoor));
-  CORBA_octet_deserialize(cdrCodec,&(object->leftBrush));
-  CORBA_octet_deserialize(cdrCodec,&(object->rightBrush));
-  CORBA_octet_deserialize(cdrCodec,&(object->reserve));
-  CORBA_octet_deserialize(cdrCodec,&(object->release));
-  CORBA_octet_deserialize(cdrCodec,&(object->transporterFront));
-  CORBA_octet_deserialize(cdrCodec,&(object->transporterInner));
-}
-
-int
-stateServa_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-stateServa_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "stateServa",
-                          (ORTETypeSerialize)stateServa_serialize,
-                          (ORTETypeDeserialize)stateServa_deserialize,
-                          stateServa_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - lowerSharps                                         */
-/****************************************************************/
-
-void lowerSharps_serialize(CDR_Codec *cdrCodec,lowerSharps *object) {
-  CORBA_short_serialize(cdrCodec,&(object->sharp1));
-  CORBA_short_serialize(cdrCodec,&(object->sharp2));
-  CORBA_short_serialize(cdrCodec,&(object->sharp3));
-  CORBA_short_serialize(cdrCodec,&(object->sharp4));
-}
-
-void
-lowerSharps_deserialize(CDR_Codec *cdrCodec,lowerSharps *object) {
-  CORBA_short_deserialize(cdrCodec,&(object->sharp1));
-  CORBA_short_deserialize(cdrCodec,&(object->sharp2));
-  CORBA_short_deserialize(cdrCodec,&(object->sharp3));
-  CORBA_short_deserialize(cdrCodec,&(object->sharp4));
-}
-
-int
-lowerSharps_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_short_get_max_size(gms);
-  CORBA_short_get_max_size(gms);
-  CORBA_short_get_max_size(gms);
-  CORBA_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-lowerSharps_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "lowerSharps",
-                          (ORTETypeSerialize)lowerSharps_serialize,
-                          (ORTETypeDeserialize)lowerSharps_deserialize,
-                          lowerSharps_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - adcs                                                */
-/****************************************************************/
-
-void adcs_serialize(CDR_Codec *cdrCodec,adcs *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->sharpLong1));
-  CORBA_octet_serialize(cdrCodec,&(object->sharpLong2));
-  CORBA_octet_serialize(cdrCodec,&(object->sharpLong3));
-  CORBA_octet_serialize(cdrCodec,&(object->sharpShort1));
-  CORBA_octet_serialize(cdrCodec,&(object->sharpShort2));
-  CORBA_octet_serialize(cdrCodec,&(object->sharpShort3));
-  CORBA_octet_serialize(cdrCodec,&(object->sharpShort4));
-  CORBA_octet_serialize(cdrCodec,&(object->frontDoor));
-}
-
-void
-adcs_deserialize(CDR_Codec *cdrCodec,adcs *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpLong1));
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpLong2));
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpLong3));
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpShort1));
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpShort2));
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpShort3));
-  CORBA_octet_deserialize(cdrCodec,&(object->sharpShort4));
-  CORBA_octet_deserialize(cdrCodec,&(object->frontDoor));
-}
-
-int
-adcs_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-adcs_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "adcs",
-                          (ORTETypeSerialize)adcs_serialize,
-                          (ORTETypeDeserialize)adcs_deserialize,
-                          adcs_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - stateFrontDoor                                      */
-/****************************************************************/
-
-void stateFrontDoor_serialize(CDR_Codec *cdrCodec,stateFrontDoor *object) {
-  CORBA_short_serialize(cdrCodec,&(object->state));
-}
-
-void
-stateFrontDoor_deserialize(CDR_Codec *cdrCodec,stateFrontDoor *object) {
-  CORBA_short_deserialize(cdrCodec,&(object->state));
-}
-
-int
-stateFrontDoor_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-stateFrontDoor_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "stateFrontDoor",
-                          (ORTETypeSerialize)stateFrontDoor_serialize,
-                          (ORTETypeDeserialize)stateFrontDoor_deserialize,
-                          stateFrontDoor_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - sharpShorts                                         */
-/****************************************************************/
-
-void sharpShorts_serialize(CDR_Codec *cdrCodec,sharpShorts *object) {
-  CORBA_short_serialize(cdrCodec,&(object->short1));
-  CORBA_short_serialize(cdrCodec,&(object->short2));
-  CORBA_short_serialize(cdrCodec,&(object->short3));
-  CORBA_short_serialize(cdrCodec,&(object->short4));
-}
-
-void
-sharpShorts_deserialize(CDR_Codec *cdrCodec,sharpShorts *object) {
-  CORBA_short_deserialize(cdrCodec,&(object->short1));
-  CORBA_short_deserialize(cdrCodec,&(object->short2));
-  CORBA_short_deserialize(cdrCodec,&(object->short3));
-  CORBA_short_deserialize(cdrCodec,&(object->short4));
-}
-
-int
-sharpShorts_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_short_get_max_size(gms);
-  CORBA_short_get_max_size(gms);
-  CORBA_short_get_max_size(gms);
-  CORBA_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-sharpShorts_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "sharpShorts",
-                          (ORTETypeSerialize)sharpShorts_serialize,
-                          (ORTETypeDeserialize)sharpShorts_deserialize,
-                          sharpShorts_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - sharpLongs                                          */
-/****************************************************************/
-
-void sharpLongs_serialize(CDR_Codec *cdrCodec,sharpLongs *object) {
-  CORBA_double_serialize(cdrCodec,&(object->longSharpDist1));
-  CORBA_double_serialize(cdrCodec,&(object->longSharpDist2));
-  CORBA_double_serialize(cdrCodec,&(object->longSharpDist3));
-}
-
-void
-sharpLongs_deserialize(CDR_Codec *cdrCodec,sharpLongs *object) {
-  CORBA_double_deserialize(cdrCodec,&(object->longSharpDist1));
-  CORBA_double_deserialize(cdrCodec,&(object->longSharpDist2));
-  CORBA_double_deserialize(cdrCodec,&(object->longSharpDist3));
-}
-
-int
-sharpLongs_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-sharpLongs_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "sharpLongs",
-                          (ORTETypeSerialize)sharpLongs_serialize,
-                          (ORTETypeDeserialize)sharpLongs_deserialize,
-                          sharpLongs_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - laserData                                           */
-/****************************************************************/
-
-void laserData_serialize(CDR_Codec *cdrCodec,laserData *object) {
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->cnt));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->period));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures0));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures1));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures2));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures3));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures4));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures5));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures6));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures7));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures8));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures9));
-}
-
-void
-laserData_deserialize(CDR_Codec *cdrCodec,laserData *object) {
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->cnt));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->period));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures0));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures1));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures2));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures3));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures4));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures5));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures6));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures7));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures8));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures9));
-}
-
-int
-laserData_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-laserData_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "laserData",
-                          (ORTETypeSerialize)laserData_serialize,
-                          (ORTETypeDeserialize)laserData_deserialize,
-                          laserData_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - accumulator                                         */
-/****************************************************************/
-
-void accumulator_serialize(CDR_Codec *cdrCodec,accumulator *object) {
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->position1));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->position2));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->position3));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->position4));
-}
-
-void
-accumulator_deserialize(CDR_Codec *cdrCodec,accumulator *object) {
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->position1));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->position2));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->position3));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->position4));
-}
-
-int
-accumulator_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-accumulator_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "accumulator",
-                          (ORTETypeSerialize)accumulator_serialize,
-                          (ORTETypeDeserialize)accumulator_deserialize,
-                          accumulator_get_max_size,
-                          0);
-  return ret;
-}
-
diff --git a/src/types/robottype_eb2007.h b/src/types/robottype_eb2007.h
deleted file mode 100644 (file)
index 4641fb8..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * This file was generated by orte-idl - DO NOT EDIT!
- */
-
-#ifndef robottype_eb2007_H
-#define robottype_eb2007_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#ifndef EXCLUDE_ORTE_H
-#include <orte.h>
-#endif /* EXCLUDE_ORTE_H */
-
-/** typedefs **/
-#if !defined(_stateInnerIR_defined)
-#define _stateInnerIR_defined 1
-typedef struct stateInnerIR_type stateInnerIR;
-struct stateInnerIR_type {
-CORBA_octet front;
-CORBA_octet back;
-};
-
-#endif
-#if !defined(_stateDigIn_defined)
-#define _stateDigIn_defined 1
-typedef struct stateDigIn_type stateDigIn;
-struct stateDigIn_type {
-CORBA_octet state;
-};
-
-#endif
-#if !defined(_stateServa_defined)
-#define _stateServa_defined 1
-typedef struct stateServa_type stateServa;
-struct stateServa_type {
-CORBA_octet frontDoor;
-CORBA_octet innerDoor;
-CORBA_octet backDoor;
-CORBA_octet topDoor;
-CORBA_octet bottomDoor;
-CORBA_octet leftBrush;
-CORBA_octet rightBrush;
-CORBA_octet reserve;
-CORBA_octet release;
-CORBA_octet transporterFront;
-CORBA_octet transporterInner;
-};
-
-#endif
-#if !defined(_lowerSharps_defined)
-#define _lowerSharps_defined 1
-typedef struct lowerSharps_type lowerSharps;
-struct lowerSharps_type {
-CORBA_short sharp1;
-CORBA_short sharp2;
-CORBA_short sharp3;
-CORBA_short sharp4;
-};
-
-#endif
-#if !defined(_adcs_defined)
-#define _adcs_defined 1
-typedef struct adcs_type adcs;
-struct adcs_type {
-CORBA_octet sharpLong1;
-CORBA_octet sharpLong2;
-CORBA_octet sharpLong3;
-CORBA_octet sharpShort1;
-CORBA_octet sharpShort2;
-CORBA_octet sharpShort3;
-CORBA_octet sharpShort4;
-CORBA_octet frontDoor;
-};
-
-#endif
-#if !defined(_stateFrontDoor_defined)
-#define _stateFrontDoor_defined 1
-typedef struct stateFrontDoor_type stateFrontDoor;
-struct stateFrontDoor_type {
-CORBA_short state;
-};
-
-#endif
-#if !defined(_sharpShorts_defined)
-#define _sharpShorts_defined 1
-typedef struct sharpShorts_type sharpShorts;
-struct sharpShorts_type {
-CORBA_short short1;
-CORBA_short short2;
-CORBA_short short3;
-CORBA_short short4;
-};
-
-#endif
-#if !defined(_sharpLongs_defined)
-#define _sharpLongs_defined 1
-typedef struct sharpLongs_type sharpLongs;
-struct sharpLongs_type {
-CORBA_double longSharpDist1;
-CORBA_double longSharpDist2;
-CORBA_double longSharpDist3;
-};
-
-#endif
-#if !defined(_laserData_defined)
-#define _laserData_defined 1
-typedef struct laserData_type laserData;
-struct laserData_type {
-CORBA_unsigned_short cnt;
-CORBA_unsigned_short period;
-CORBA_unsigned_short measures0;
-CORBA_unsigned_short measures1;
-CORBA_unsigned_short measures2;
-CORBA_unsigned_short measures3;
-CORBA_unsigned_short measures4;
-CORBA_unsigned_short measures5;
-CORBA_unsigned_short measures6;
-CORBA_unsigned_short measures7;
-CORBA_unsigned_short measures8;
-CORBA_unsigned_short measures9;
-};
-
-#endif
-#if !defined(_accumulator_defined)
-#define _accumulator_defined 1
-typedef struct accumulator_type accumulator;
-struct accumulator_type {
-CORBA_unsigned_short position1;
-CORBA_unsigned_short position2;
-CORBA_unsigned_short position3;
-CORBA_unsigned_short position4;
-};
-
-#endif
-
-/** impls declarations **/
-void stateInnerIR_serialize(CDR_Codec *cdrCodec,stateInnerIR *object);
-void stateInnerIR_deserialize(CDR_Codec *cdrCodec,stateInnerIR *object);
-int stateInnerIR_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean stateInnerIR_type_register(ORTEDomain *d);
-
-void stateDigIn_serialize(CDR_Codec *cdrCodec,stateDigIn *object);
-void stateDigIn_deserialize(CDR_Codec *cdrCodec,stateDigIn *object);
-int stateDigIn_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean stateDigIn_type_register(ORTEDomain *d);
-
-void stateServa_serialize(CDR_Codec *cdrCodec,stateServa *object);
-void stateServa_deserialize(CDR_Codec *cdrCodec,stateServa *object);
-int stateServa_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean stateServa_type_register(ORTEDomain *d);
-
-void lowerSharps_serialize(CDR_Codec *cdrCodec,lowerSharps *object);
-void lowerSharps_deserialize(CDR_Codec *cdrCodec,lowerSharps *object);
-int lowerSharps_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean lowerSharps_type_register(ORTEDomain *d);
-
-void adcs_serialize(CDR_Codec *cdrCodec,adcs *object);
-void adcs_deserialize(CDR_Codec *cdrCodec,adcs *object);
-int adcs_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean adcs_type_register(ORTEDomain *d);
-
-void stateFrontDoor_serialize(CDR_Codec *cdrCodec,stateFrontDoor *object);
-void stateFrontDoor_deserialize(CDR_Codec *cdrCodec,stateFrontDoor *object);
-int stateFrontDoor_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean stateFrontDoor_type_register(ORTEDomain *d);
-
-void sharpShorts_serialize(CDR_Codec *cdrCodec,sharpShorts *object);
-void sharpShorts_deserialize(CDR_Codec *cdrCodec,sharpShorts *object);
-int sharpShorts_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean sharpShorts_type_register(ORTEDomain *d);
-
-void sharpLongs_serialize(CDR_Codec *cdrCodec,sharpLongs *object);
-void sharpLongs_deserialize(CDR_Codec *cdrCodec,sharpLongs *object);
-int sharpLongs_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean sharpLongs_type_register(ORTEDomain *d);
-
-void laserData_serialize(CDR_Codec *cdrCodec,laserData *object);
-void laserData_deserialize(CDR_Codec *cdrCodec,laserData *object);
-int laserData_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean laserData_type_register(ORTEDomain *d);
-
-void accumulator_serialize(CDR_Codec *cdrCodec,accumulator *object);
-void accumulator_deserialize(CDR_Codec *cdrCodec,accumulator *object);
-int accumulator_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean accumulator_type_register(ORTEDomain *d);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
diff --git a/src/types/robottype_eb2007.idl b/src/types/robottype_eb2007.idl
deleted file mode 100644 (file)
index dc8c61e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-struct stateInnerIR {
-       octet front;
-       octet back;
-};
-
-struct stateDigIn {
-       octet state;
-};
-
-struct stateServa {
-       octet frontDoor;
-       octet innerDoor;
-       octet backDoor;
-       octet topDoor;
-       octet bottomDoor;
-       octet leftBrush;
-       octet rightBrush;
-       octet reserve;
-       octet release;
-       octet transporterFront;
-       octet transporterInner;
-};
-
-struct lowerSharps {
-       short sharp1;
-       short sharp2;
-       short sharp3;
-       short sharp4;
-};
-
-struct adcs {
-       octet sharpLong1;
-       octet sharpLong2;
-       octet sharpLong3;
-       octet sharpShort1;
-       octet sharpShort2;
-       octet sharpShort3;
-       octet sharpShort4;      
-       octet frontDoor;
-};
-
-struct stateFrontDoor {
-       short state;    
-};
-
-struct sharpShorts {
-       short short1;
-       short short2;
-       short short3;
-       short short4;
-};
-
-struct sharpLongs {
-       double longSharpDist1;
-       double longSharpDist2;
-       double longSharpDist3;  
-};
-
-struct laserData {
-       unsigned short cnt;
-       unsigned short period;
-       unsigned short measures0;
-       unsigned short measures1;
-       unsigned short measures2;
-       unsigned short measures3;
-       unsigned short measures4;
-       unsigned short measures5;
-       unsigned short measures6;
-       unsigned short measures7;
-       unsigned short measures8;
-       unsigned short measures9;
-};
-
-struct accumulator {
-       unsigned short position1;
-       unsigned short position2;
-       unsigned short position3;
-       unsigned short position4;       
-};
diff --git a/src/types/robottype_eb2008.c b/src/types/robottype_eb2008.c
deleted file mode 100644 (file)
index e1be4b7..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * This file was generated by orte-idl - DO NOT EDIT!
- */
-
-#include "robottype_eb2008.h"
-
-/****************************************************************/
-/* struct - servos                                              */
-/****************************************************************/
-
-void servos_serialize(CDR_Codec *cdrCodec,servos *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->brush_left));
-  CORBA_octet_serialize(cdrCodec,&(object->brush_right));
-  CORBA_octet_serialize(cdrCodec,&(object->door_bottom));
-  CORBA_octet_serialize(cdrCodec,&(object->door_top));
-  CORBA_octet_serialize(cdrCodec,&(object->door_back));
-  CORBA_octet_serialize(cdrCodec,&(object->reserve));
-}
-
-void
-servos_deserialize(CDR_Codec *cdrCodec,servos *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->brush_left));
-  CORBA_octet_deserialize(cdrCodec,&(object->brush_right));
-  CORBA_octet_deserialize(cdrCodec,&(object->door_bottom));
-  CORBA_octet_deserialize(cdrCodec,&(object->door_top));
-  CORBA_octet_deserialize(cdrCodec,&(object->door_back));
-  CORBA_octet_deserialize(cdrCodec,&(object->reserve));
-}
-
-int
-servos_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-servos_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "servos",
-                          (ORTETypeSerialize)servos_serialize,
-                          (ORTETypeDeserialize)servos_deserialize,
-                          servos_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - drives                                              */
-/****************************************************************/
-
-void drives_serialize(CDR_Codec *cdrCodec,drives *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->brush_left));
-  CORBA_octet_serialize(cdrCodec,&(object->brush_right));
-  CORBA_octet_serialize(cdrCodec,&(object->bagr));
-  CORBA_octet_serialize(cdrCodec,&(object->carousel_pos));
-}
-
-void
-drives_deserialize(CDR_Codec *cdrCodec,drives *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->brush_left));
-  CORBA_octet_deserialize(cdrCodec,&(object->brush_right));
-  CORBA_octet_deserialize(cdrCodec,&(object->bagr));
-  CORBA_octet_deserialize(cdrCodec,&(object->carousel_pos));
-}
-
-int
-drives_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-drives_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "drives",
-                          (ORTETypeSerialize)drives_serialize,
-                          (ORTETypeDeserialize)drives_deserialize,
-                          drives_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - laser_cmd                                           */
-/****************************************************************/
-
-void laser_cmd_serialize(CDR_Codec *cdrCodec,laser_cmd *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->speed));
-}
-
-void
-laser_cmd_deserialize(CDR_Codec *cdrCodec,laser_cmd *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->speed));
-}
-
-int
-laser_cmd_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-laser_cmd_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "laser_cmd",
-                          (ORTETypeSerialize)laser_cmd_serialize,
-                          (ORTETypeDeserialize)laser_cmd_deserialize,
-                          laser_cmd_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - laser_data                                          */
-/****************************************************************/
-
-void laser_data_serialize(CDR_Codec *cdrCodec,laser_data *object) {
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->period));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measure));
-}
-
-void
-laser_data_deserialize(CDR_Codec *cdrCodec,laser_data *object) {
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->period));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measure));
-}
-
-int
-laser_data_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-laser_data_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "laser_data",
-                          (ORTETypeSerialize)laser_data_serialize,
-                          (ORTETypeDeserialize)laser_data_deserialize,
-                          laser_data_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - laser_meas                                          */
-/****************************************************************/
-
-void laser_meas_serialize(CDR_Codec *cdrCodec,laser_meas *object) {
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->cnt));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->period));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures0));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures1));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures2));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures3));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures4));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures5));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures6));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures7));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures8));
-  CORBA_unsigned_short_serialize(cdrCodec,&(object->measures9));
-}
-
-void
-laser_meas_deserialize(CDR_Codec *cdrCodec,laser_meas *object) {
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->cnt));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->period));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures0));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures1));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures2));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures3));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures4));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures5));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures6));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures7));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures8));
-  CORBA_unsigned_short_deserialize(cdrCodec,&(object->measures9));
-}
-
-int
-laser_meas_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  CORBA_unsigned_short_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-laser_meas_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "laser_meas",
-                          (ORTETypeSerialize)laser_meas_serialize,
-                          (ORTETypeDeserialize)laser_meas_deserialize,
-                          laser_meas_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - sharps                                              */
-/****************************************************************/
-
-void sharps_serialize(CDR_Codec *cdrCodec,sharps *object) {
-  CORBA_double_serialize(cdrCodec,&(object->left));
-  CORBA_double_serialize(cdrCodec,&(object->right));
-  CORBA_double_serialize(cdrCodec,&(object->front_left));
-  CORBA_double_serialize(cdrCodec,&(object->front_right));
-  CORBA_double_serialize(cdrCodec,&(object->back_left));
-  CORBA_double_serialize(cdrCodec,&(object->back_right));
-}
-
-void
-sharps_deserialize(CDR_Codec *cdrCodec,sharps *object) {
-  CORBA_double_deserialize(cdrCodec,&(object->left));
-  CORBA_double_deserialize(cdrCodec,&(object->right));
-  CORBA_double_deserialize(cdrCodec,&(object->front_left));
-  CORBA_double_deserialize(cdrCodec,&(object->front_right));
-  CORBA_double_deserialize(cdrCodec,&(object->back_left));
-  CORBA_double_deserialize(cdrCodec,&(object->back_right));
-}
-
-int
-sharps_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  CORBA_double_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-sharps_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "sharps",
-                          (ORTETypeSerialize)sharps_serialize,
-                          (ORTETypeDeserialize)sharps_deserialize,
-                          sharps_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - cmu                                                 */
-/****************************************************************/
-
-void cmu_serialize(CDR_Codec *cdrCodec,cmu *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->color));
-}
-
-void
-cmu_deserialize(CDR_Codec *cdrCodec,cmu *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->color));
-}
-
-int
-cmu_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-cmu_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "cmu",
-                          (ORTETypeSerialize)cmu_serialize,
-                          (ORTETypeDeserialize)cmu_deserialize,
-                          cmu_get_max_size,
-                          0);
-  return ret;
-}
-
-/****************************************************************/
-/* struct - bumper                                              */
-/****************************************************************/
-
-void bumper_serialize(CDR_Codec *cdrCodec,bumper *object) {
-  CORBA_octet_serialize(cdrCodec,&(object->left));
-  CORBA_octet_serialize(cdrCodec,&(object->right));
-}
-
-void
-bumper_deserialize(CDR_Codec *cdrCodec,bumper *object) {
-  CORBA_octet_deserialize(cdrCodec,&(object->left));
-  CORBA_octet_deserialize(cdrCodec,&(object->right));
-}
-
-int
-bumper_get_max_size(ORTEGetMaxSizeParam *gms) {
-  CORBA_octet_get_max_size(gms);
-  CORBA_octet_get_max_size(gms);
-  return gms->csize;
-}
-
-Boolean
-bumper_type_register(ORTEDomain *d) {
-  Boolean ret;
-
-  ret=ORTETypeRegisterAdd(d,
-                          "bumper",
-                          (ORTETypeSerialize)bumper_serialize,
-                          (ORTETypeDeserialize)bumper_deserialize,
-                          bumper_get_max_size,
-                          0);
-  return ret;
-}
-
diff --git a/src/types/robottype_eb2008.h b/src/types/robottype_eb2008.h
deleted file mode 100644 (file)
index 0ccef39..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * This file was generated by orte-idl - DO NOT EDIT!
- */
-
-#ifndef robottype_eb2008_H
-#define robottype_eb2008_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#ifndef EXCLUDE_ORTE_H
-#include <orte.h>
-#endif /* EXCLUDE_ORTE_H */
-
-/** typedefs **/
-#if !defined(_servos_defined)
-#define _servos_defined 1
-typedef struct servos_type servos;
-struct servos_type {
-CORBA_octet brush_left;
-CORBA_octet brush_right;
-CORBA_octet door_bottom;
-CORBA_octet door_top;
-CORBA_octet door_back;
-CORBA_octet reserve;
-};
-
-#endif
-#if !defined(_drives_defined)
-#define _drives_defined 1
-typedef struct drives_type drives;
-struct drives_type {
-CORBA_octet brush_left;
-CORBA_octet brush_right;
-CORBA_octet bagr;
-CORBA_octet carousel_pos;
-};
-
-#endif
-#if !defined(_laser_cmd_defined)
-#define _laser_cmd_defined 1
-typedef struct laser_cmd_type laser_cmd;
-struct laser_cmd_type {
-CORBA_octet speed;
-};
-
-#endif
-#if !defined(_laser_data_defined)
-#define _laser_data_defined 1
-typedef struct laser_data_type laser_data;
-struct laser_data_type {
-CORBA_unsigned_short period;
-CORBA_unsigned_short measure;
-};
-
-#endif
-#if !defined(_laser_meas_defined)
-#define _laser_meas_defined 1
-typedef struct laser_meas_type laser_meas;
-struct laser_meas_type {
-CORBA_unsigned_short cnt;
-CORBA_unsigned_short period;
-CORBA_unsigned_short measures0;
-CORBA_unsigned_short measures1;
-CORBA_unsigned_short measures2;
-CORBA_unsigned_short measures3;
-CORBA_unsigned_short measures4;
-CORBA_unsigned_short measures5;
-CORBA_unsigned_short measures6;
-CORBA_unsigned_short measures7;
-CORBA_unsigned_short measures8;
-CORBA_unsigned_short measures9;
-};
-
-#endif
-#if !defined(_sharps_defined)
-#define _sharps_defined 1
-typedef struct sharps_type sharps;
-struct sharps_type {
-CORBA_double left;
-CORBA_double right;
-CORBA_double front_left;
-CORBA_double front_right;
-CORBA_double back_left;
-CORBA_double back_right;
-};
-
-#endif
-#if !defined(_cmu_defined)
-#define _cmu_defined 1
-typedef struct cmu_type cmu;
-struct cmu_type {
-CORBA_octet color;
-};
-
-#endif
-#if !defined(_bumper_defined)
-#define _bumper_defined 1
-typedef struct bumper_type bumper;
-struct bumper_type {
-CORBA_octet left;
-CORBA_octet right;
-};
-
-#endif
-
-/** impls declarations **/
-void servos_serialize(CDR_Codec *cdrCodec,servos *object);
-void servos_deserialize(CDR_Codec *cdrCodec,servos *object);
-int servos_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean servos_type_register(ORTEDomain *d);
-
-void drives_serialize(CDR_Codec *cdrCodec,drives *object);
-void drives_deserialize(CDR_Codec *cdrCodec,drives *object);
-int drives_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean drives_type_register(ORTEDomain *d);
-
-void laser_cmd_serialize(CDR_Codec *cdrCodec,laser_cmd *object);
-void laser_cmd_deserialize(CDR_Codec *cdrCodec,laser_cmd *object);
-int laser_cmd_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean laser_cmd_type_register(ORTEDomain *d);
-
-void laser_data_serialize(CDR_Codec *cdrCodec,laser_data *object);
-void laser_data_deserialize(CDR_Codec *cdrCodec,laser_data *object);
-int laser_data_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean laser_data_type_register(ORTEDomain *d);
-
-void laser_meas_serialize(CDR_Codec *cdrCodec,laser_meas *object);
-void laser_meas_deserialize(CDR_Codec *cdrCodec,laser_meas *object);
-int laser_meas_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean laser_meas_type_register(ORTEDomain *d);
-
-void sharps_serialize(CDR_Codec *cdrCodec,sharps *object);
-void sharps_deserialize(CDR_Codec *cdrCodec,sharps *object);
-int sharps_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean sharps_type_register(ORTEDomain *d);
-
-void cmu_serialize(CDR_Codec *cdrCodec,cmu *object);
-void cmu_deserialize(CDR_Codec *cdrCodec,cmu *object);
-int cmu_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean cmu_type_register(ORTEDomain *d);
-
-void bumper_serialize(CDR_Codec *cdrCodec,bumper *object);
-void bumper_deserialize(CDR_Codec *cdrCodec,bumper *object);
-int bumper_get_max_size(ORTEGetMaxSizeParam *gms);
-Boolean bumper_type_register(ORTEDomain *d);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
diff --git a/src/types/robottype_eb2008.idl b/src/types/robottype_eb2008.idl
deleted file mode 100644 (file)
index bca7de4..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-struct servos {
-       octet brush_left;
-       octet brush_right;
-       octet door_bottom;
-       octet door_top;
-       octet door_back;
-       octet reserve;
-};
-
-struct drives {
-       octet brush_left;
-       octet brush_right;
-       octet bagr;
-       octet carousel_pos;
-};
-
-struct laser_cmd {
-       octet speed;
-};
-
-struct laser_data {
-       unsigned short period;
-       unsigned short measure;
-};
-
-struct laser_meas {
-       unsigned short cnt;
-       unsigned short period;
-       unsigned short measures0;
-       unsigned short measures1;
-       unsigned short measures2;
-       unsigned short measures3;
-       unsigned short measures4;
-       unsigned short measures5;
-       unsigned short measures6;
-       unsigned short measures7;
-       unsigned short measures8;
-       unsigned short measures9;
-};
-
-struct sharps {
-       double left;
-       double right;
-       double front_left;
-       double front_right;
-       double back_left;
-       double back_right;
-};
-
-struct cmu {
-       octet color;
-};
-
-struct bumper {
-       octet left;
-       octet right;
-};
index 6c83ded98e365ca0076f4688e1a2fb918df129d6..10c3fc25ff03718a0963333051c9993674176ccc 100644 (file)
@@ -7,8 +7,8 @@
 #include <string.h>
 
 #include <robottype.h>
-#include <robottype_eb2008.h>
-#include <robot_eb2008.h>
+#include <robottype.h>
+#include <robot.h>
 
 #include "oledlib.h"
 
index 56648a9a40f20c16579a952f725acebe83d1cc81..0b0c8ffa23fd4f0991e7fe8b7f5fbaa01b06004b 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <stdint.h>
 #include <robottype.h>
-#include <robottype_eb2008.h>
+#include <robottype.h>
 
 #define HW_STATUS_MSG_SIZE 9
 #define SWITCH_MODE_MSG_SIZE 5
index f1225530c7c181289773022eecb401aedb0abd71..9dab3bde29edb6329ff0b1eb5f9ae814e040ba33 100644 (file)
@@ -15,7 +15,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <robottype.h>
-#include <robottype_eb2008.h>
+#include <robottype.h>
 #include "uoled.h"
 #include "uoled_config.h"