BugFix: TIVI-1912, 1918, 2126 33/13233/2 accepted/tizen/ivi/20131217.231400 submit/tizen/20131217.094302
authorHayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
Fri, 29 Nov 2013 10:16:55 +0000 (19:16 +0900)
committerHayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
Mon, 2 Dec 2013 04:32:32 +0000 (13:32 +0900)
Change-Id: I2cfb63d42df6807b3590d6cc7356f1db902a8399
Signed-off-by: Hayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
15 files changed:
G25.conf
G27.conf
configure.ac
packaging/ico-vic-carsimulator.changes
packaging/ico-vic-carsimulator.spec
src/CAvgCar.cpp
src/CAvgCar.h
src/CConf.cpp
src/CConf.h
src/CGtCtrl.cpp
src/CGtCtrl.h
src/CJoyStickEV.h
src/CJoyStickG25.cpp
src/CJoyStickG25.h
src/CarSim_Daemon.cpp

index f1fb17c..2448036 100644 (file)
--- a/G25.conf
+++ b/G25.conf
@@ -31,7 +31,9 @@ NUMBER=1
 TYPE=2
 NUMBER=2
 
-[LASTPOSTION]
-LAT=35.717931
-LNG=139.736518
+[LASTPOSITION]
+LAT=35.215908
+LNG=138.918739
 
+[AMBCONFIG]
+NAME=/etc/ambd/config.tizen
index 823f481..b6f4a39 100644 (file)
--- a/G27.conf
+++ b/G27.conf
@@ -46,7 +46,9 @@ NUMBER=2
 TYPE=2
 NUMBER=5
 
-[LASTPOSTION]
-LAT=35.717931
-LNG=139.736518
+[LASTPOSITION]
+LAT=35.215908
+LNG=138.918739
 
+[AMBCONFIG]
+NAME=/etc/ambd/config.tizen
index 384d754..f69421a 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.68])
-AC_INIT([ico-vic-carsim], [0.0.9], [shibata@mac.tec.toyota.co.jp])
+AC_INIT([ico-vic-carsim], [0.9.06], [shibata@mac.tec.toyota.co.jp])
 AM_INIT_AUTOMAKE([1.11 foreign])
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADERS([config.h])
index 3673f91..6ffb221 100644 (file)
@@ -1,3 +1,8 @@
+* Fri Nov 29 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> ivi_oct_m2@67d1f89
+- 0.9.07 release
+-- Abolition:Check the neutral gear and the parking gear of the engine ignition
+-- BugFix: TIVI-1912, 1918, 2126
+
 * Thu Sep 26 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/20130919.204144@1135dfb
 - 0.9.05 release.
 -- the program name is changed to "ico-vic-carsim" from "carsim".
index 3b98b3e..0e256dd 100644 (file)
@@ -1,7 +1,7 @@
 Name:       ico-vic-carsimulator
 Summary:    CarSimulator
-Version:    0.9.05
-Release:    1.1
+Version:    0.9.07
+Release:    2.3
 Group:      System Environment/Daemons
 License:    Apache 2.0
 Source0:    %{name}-%{version}.tar.bz2
@@ -46,7 +46,7 @@ install -m 0644 ico-vic-carsim.service %{buildroot}%{_unitdir_user}/ico-vic-cars
 %postun -p /sbin/ldconfig
 
 %files
-%attr(4755root,root,-) %{_bindir}/ico-vic-carsim
+%attr(4755,root,root) %{_bindir}/ico-vic-carsim
 %defattr(-,root,root,-)
 %{_bindir}/*
 /etc/ico-vic-carsim/*
index 82f434b..a0093a0 100644 (file)
@@ -555,12 +555,12 @@ void CAvgGear::setShiftMT(E_AT_GEAR tm) {
     case E_SHIFT_MT_FIFTH :
         m_transmissionOLD = m_transmission;
         m_transmission = E_SHIFT_MT_FIFTH;
-        m_transmissionValue = D_SHIFT_VALUE_DRIVE;
+        m_transmissionValue = D_SHIFT_VALUE_FIFTH;
         break;
     case E_SHIFT_MT_SIXTH :
         m_transmissionOLD = m_transmission;
         m_transmission = E_SHIFT_MT_SIXTH;
-        m_transmissionValue = D_SHIFT_VALUE_DRIVE;
+        m_transmissionValue = D_SHIFT_VALUE_SIXTH;
         break;
     case E_SHIFT_REVERSE :
         m_transmissionOLD = m_transmission;
@@ -616,22 +616,12 @@ void CAvgCar::chgThrottle(int throttle)
 {
     int x = abs((throttle - 32767));
     if (false == m_engine.isActive()) {
-        if ((true == isNeutral()) || (true == isParking())) {
-            m_engine.ignitionStart(D_RPM_IGNITION_VALUE);
-        }
-
-        for (int i; i < D_SAMPLE_SPACE_ACCPEDAL; i++) {
-            m_accPedalOpen.setSample(x);
-        }
-
-        return;
-    }
-    else {
-        m_engine.chgThrottle(x);
-        m_accPedalOpen.setSample(x);
-        m_bChgThrottle = true;
-        m_valThrottle  = x;
+        m_engine.ignitionStart();
     }
+    m_engine.chgThrottle(x);
+    m_accPedalOpen.setSample(x);
+    m_bChgThrottle = true;
+    m_valThrottle  = x;
 }
 
 /**
index 0f71289..111352b 100644 (file)
@@ -236,6 +236,8 @@ inline int CAvgBrake::calcPressure(int brakeVal) const
 #define D_SHIFT_VALUE_PARKING  0
 #define D_SHIFT_VALUE_REVERSE  128
 #define D_SHIFT_VALUE_NEUTRAL  64
+#define D_SHIFT_VALUE_SIXTH    6
+#define D_SHIFT_VALUE_FIFTH    5
 #define D_SHIFT_VALUE_DRIVE    4
 #define D_SHIFT_VALUE_THIRD    3
 #define D_SHIFT_VALUE_SECOND   2
index 904baa0..62aeb5a 100644 (file)
@@ -63,6 +63,10 @@ void CConf::LoadConfig(const char*filePath)
     memset(devname, 0, sizeof(devname));
     CConf::GetConfig(m_strConfPath, "DEVICE", "NAME", "Driving Force GT", devname, sizeof(devname));
     m_sDeviceName = std::string(devname);
+    char ambconfig[64];
+    memset(ambconfig, 0, sizeof(ambconfig));
+    CConf::GetConfig(m_strConfPath, "AMBCONFIG", "NAME", "/etc/ambd/config", ambconfig, sizeof(ambconfig));
+    m_sAmbConfigName = std::string(ambconfig);
 
     printf("Configuration[%s]:\n",m_sDeviceName.c_str());
     printf("  WINKER(R) button:%d\tWINKER(L) button:%d\n", m_nWinkR,
index 3aae683..12f8ffb 100644 (file)
@@ -70,6 +70,7 @@ class CConf
     double m_fLng;
     double m_fLat;
     std::string m_sDeviceName;
+    std::string m_sAmbConfigName;
 
 };
 
index fe52fe2..b49fb4a 100644 (file)
@@ -14,6 +14,7 @@
  * @file    CGtCtrl.cpp
  */
 #include <unistd.h>
+#include <fstream>
 #include "CJoyStick.h"
 #include "CJoyStickEV.h"
 #include "CGtCtrl.h"
@@ -24,7 +25,8 @@ extern bool gbDevJs;
 
 bool g_bStopFlag;
 std::queue < geoData > routeList;
-std::string msgQueue;
+std::string msgQueue = "";
+std::string orgmsgQueue = "";
 int Daemon_MS;
 int nClient = 0;
 int nDelayedCallback = 0;
@@ -169,10 +171,12 @@ bool CGtCtrl::Initialize()
     }
 
     myConf.LoadConfig(m_strConfPath.c_str());
+    m_stVehicleInfo.fLng = myConf.m_fLng;
+    m_stVehicleInfo.fLat = myConf.m_fLat;
 
     m_viList.init();
 
-    if (!LoadConfigJson(AMB_CONF)) {
+    if (!LoadConfigJson(myConf.m_sAmbConfigName.c_str())) {
         printf("AMB configfile read error\n");
         return false;
     }
@@ -194,6 +198,11 @@ bool CGtCtrl::Initialize()
     double location[] = { myConf.m_fLat, myConf.m_fLng, 0 };
     SendVehicleInfo(dataport_def, vi, &location[0], 3);
 
+    if (m_bDemoRunning) {
+        std::cout << "Demo Mode." << std::endl;
+        LoadRouteList();
+    }
+
     return true;
 }
 
@@ -249,6 +258,11 @@ void CGtCtrl::Run()
      */
     int nShiftPosBK = -1;
     char shiftpos = 255;
+
+    bool nextPointFlg = false;
+    geoData next;
+    double dx, dy, rad, theta;
+
     while (g_bStopFlag) {
 
         type = myJS->Read(&number, &value);
@@ -258,15 +272,33 @@ void CGtCtrl::Run()
         switch (type) {
         case JS_EVENT_AXIS:
             if (number == myConf.m_nSteering) {
+                int angle = 0;
                 if (value != 0) {
                     m_stVehicleInfo.nSteeringAngle +=
                         (value * 10 / 65536 - m_stVehicleInfo.nSteeringAngle);
                 }
+                if (value < 0) {
+                    angle = (((double)value / 32768) * 450) + 450 + 270;
+                    angle %= 360;
+                    //std:: cout << "value * (450 / 32768) = " << ((double)value / 32768) * 450 << "\n";
+                    //std:: cout << "value * (450 / 32768) + 450 = " << (double)value * (450 / 32768) + 450 << "\n";
+                    //std:: cout << "value * (450 / 32768) + 450 + 270 = " << (double)value * (450 / 32768) + 450 + 270 << "\n";
+                }
+                else {
+                    angle = ((double)value / 32768) * 450;
+                    angle %= 360;
+                    //std:: cout << "value * (450 / 32768) = " << ((double)value / 32768) * 450 << "\n";
+                }
+                //std::cout << "Steering value = " << value << " -> angle = " << angle << std::endl;
                 {
                     const char *vi = "STEERING";
 
+                    /*
                     SendVehicleInfo(dataport_def,
                                     vi, m_stVehicleInfo.nSteeringAngle);
+                    */
+                    SendVehicleInfo(dataport_def,
+                                    vi, angle);
                 }
             }
             else if (number == myConf.m_nAccel) {
@@ -526,6 +558,9 @@ void CGtCtrl::Run()
          * VELOCITY (SPEED)
          */
         int speedNew = (int)pmCar.getSpeed();
+        if (speedNew > 180) {
+            speedNew = 180;
+        }
         if (speedNew != nSpeed) {
             SendVehicleInfo(dataport_def, sVELOCITY, speedNew);
             m_stVehicleInfo.nVelocity = speedNew;
@@ -552,36 +587,123 @@ void CGtCtrl::Run()
         }
 
         if (iwc == 0) {
-            /**
-              * DIRECTION (AZIMUTH)
-              * Front wheel steering angle
-              */
-            double runMeters = pmCar.getTripmeter();
-            pmCar.tripmeterReset();
-            if (0 != runMeters) {
-                double stear = (double)m_stVehicleInfo.nSteeringAngle;
-                double dirNEW = CalcAzimuth(dir, stear, runMeters);
-                int nDir = (int)dirNEW;
-                dir = dirNEW;
-                if (nDir != m_stVehicleInfo.nDirection) {
-                    SendVehicleInfo(dataport_def, sDIRECTION, nDir);
-                    m_stVehicleInfo.nDirection = nDir;
+            if (m_bDemoRunning) {
+                next = routeList.front();
+                dy = next.lat - m_stVehicleInfo.fLat;
+                dx = next.lng - m_stVehicleInfo.fLng;
+                theta = (double) atan2(dy, dx) * 180.0 / (atan(1.0) * 4.0);
+                if (theta < 0) {
+                    theta = 360.0 + theta;
                 }
-            }
-            /**
-              * LOCATION
-              */
-            if ((!m_bUseGps) && (0 != runMeters)) {
+
+                rad = (theta / 180.0) * PIE;
+
+                m_stVehicleInfo.nDirection = 90 - theta;
+                if (m_stVehicleInfo.nDirection < 0) {
+                    m_stVehicleInfo.nDirection = 360 + m_stVehicleInfo.nDirection;
+                }
+                SendVehicleInfo(dataport_def, sDIRECTION, m_stVehicleInfo.nDirection);
+
+                dir = static_cast<double>(m_stVehicleInfo.nDirection);
+                double runMeters = pmCar.getTripmeter();
+                pmCar.tripmeterReset();
                 double tmpLat = m_stVehicleInfo.fLat;
                 double tmpLng = m_stVehicleInfo.fLng;
                 POINT pNEW = CalcDest(tmpLat, tmpLng, dir, runMeters);
-                if ((tmpLat != pNEW.lat) || (tmpLng != pNEW.lng)){
-                    double tmpLct[] = { pNEW.lat, pNEW.lng, 0 };
-                    SendVehicleInfo(dataport_def, sLOCATION, &tmpLct[0], 3);
-                    m_stVehicleInfo.fLat = pNEW.lat;
-                    m_stVehicleInfo.fLng = pNEW.lng;
+                double tmpLct[] = { pNEW.lat, pNEW.lng, 0 };
+                SendVehicleInfo(dataport_def, sLOCATION, &tmpLct[0], 3);
+                m_stVehicleInfo.fLat = pNEW.lat;
+                m_stVehicleInfo.fLng = pNEW.lng;
+
+                if (rad == 0) {
+                    if (m_stVehicleInfo.fLng >= next.lng) {
+                        nextPointFlg = true;
+                    }
+                }
+                else if (rad > 0 && rad < 0.5 * PIE) {
+                    if (m_stVehicleInfo.fLng >= next.lng
+                        && m_stVehicleInfo.fLat >= next.lat) {
+                        nextPointFlg = true;
+                    }
+                }
+                else if (rad == 0.5 * PIE) {
+                    if (m_stVehicleInfo.fLat >= next.lat) {
+                        nextPointFlg = true;
+                    }
+                }
+                else if (rad > 0.5 * PIE && rad < PIE) {
+                    if (m_stVehicleInfo.fLng <= next.lng
+                        && m_stVehicleInfo.fLat >= next.lat) {
+                        nextPointFlg = true;
+                    }
+                }
+                else if (rad == PIE) {
+                    if (m_stVehicleInfo.fLng <= next.lng) {
+                        nextPointFlg = true;
+                    }
+                }
+                else if (rad > PIE && rad < 1.5 * PIE) {
+                    if (m_stVehicleInfo.fLng <= next.lng
+                        && m_stVehicleInfo.fLat <= next.lat) {
+                        nextPointFlg = true;
+                    }
+                }
+                else if (rad == 1.5 * PIE) {
+                    if (m_stVehicleInfo.fLat <= next.lat) {
+                        nextPointFlg = true;
+                    }
+                }
+                else {
+                    if (m_stVehicleInfo.fLng >= next.lng
+                        && m_stVehicleInfo.fLat <= next.lat) {
+                        nextPointFlg = true;
+                    }
+                }
+
+                if (nextPointFlg) {
+                    std::cout << "routeList.size() = " << routeList.size() << std::endl;
+                    routeList.pop();
+                    if (routeList.empty()) {
+                        LoadRouteList();
+                        m_stVehicleInfo.fLng = myConf.m_fLng;
+                        m_stVehicleInfo.fLat = myConf.m_fLat;
+                    }
+                    next = routeList.front();
+                    nextPointFlg = false;
                 }
             }
+            else {
+                /**
+                  * DIRECTION (AZIMUTH)
+                  * Front wheel steering angle
+                  */
+                double runMeters = pmCar.getTripmeter();
+                pmCar.tripmeterReset();
+                if (0 != runMeters) {
+                    double stear = (double)m_stVehicleInfo.nSteeringAngle;
+                    double dirNEW = CalcAzimuth(dir, stear, runMeters);
+                    int nDir = (int)dirNEW;
+                    dir = dirNEW;
+                    if (nDir != m_stVehicleInfo.nDirection) {
+                        SendVehicleInfo(dataport_def, sDIRECTION, nDir);
+                        m_stVehicleInfo.nDirection = nDir;
+                    }
+                }
+                /**
+                  * LOCATION
+                  */
+                if ((!m_bUseGps) && (0 != runMeters)) {
+                    double tmpLat = m_stVehicleInfo.fLat;
+                    double tmpLng = m_stVehicleInfo.fLng;
+                    POINT pNEW = CalcDest(tmpLat, tmpLng, dir, runMeters);
+                    if ((tmpLat != pNEW.lat) || (tmpLng != pNEW.lng)){
+                        double tmpLct[] = { pNEW.lat, pNEW.lng, 0 };
+                        SendVehicleInfo(dataport_def, sLOCATION, &tmpLct[0], 3);
+                        m_stVehicleInfo.fLat = pNEW.lat;
+                        m_stVehicleInfo.fLng = pNEW.lng;
+                    }
+                }
+            } 
         }
         if (0 == iwc) {
             iwc = D_RUNLOOP_INTERVAL_COUNT;
@@ -954,11 +1076,14 @@ void CGtCtrl::Run2()
             }
 
             if (nextPointFlg) {
-                if (!routeList.empty()) {
-                    next = routeList.front();
-                    routeList.pop();
-                    nextPointFlg = false;
+                if (routeList.empty()) {
+                    LoadRouteList();
+                    m_stVehicleInfo.fLng = myConf.m_fLng;
+                    m_stVehicleInfo.fLat = myConf.m_fLat;
                 }
+                next = routeList.front();
+                routeList.pop();
+                nextPointFlg = false;
             }
         }
     }
@@ -1643,6 +1768,56 @@ void CGtCtrl::CheckSendResult(int mqid)
     }
 }
 
+void CGtCtrl::LoadRouteList() {
+    std::cout << "LoadRouteList:orgmsgQueue[" << orgmsgQueue << "]\n";
+    if (orgmsgQueue == "") {
+        std::ifstream fin;
+        fin.open(g_RouteListFile.c_str());
+        if (!fin) {
+            std::cerr << "Can't read " << g_RouteListFile << std::endl;
+        }
+        std::string line;
+        while (fin && getline(fin, line)) {
+            orgmsgQueue.append(line);
+            orgmsgQueue.append("\n");
+        }
+        msgQueue = orgmsgQueue;
+        fin.close();
+    }
+    else {
+        msgQueue = orgmsgQueue;
+    }
+    if (msgQueue.size() > 0) {
+        char buf[32];
+        int pos = 0;
+        int lastidx = 0;
+        geoData tmpGeo;
+        int i = 0;
+
+        tmpGeo.lat = GEORESET;
+        tmpGeo.lng = GEORESET;
+
+        for (i = 0; i < (int) msgQueue.size(); i++) {
+            if (msgQueue[i] == ',') {
+                tmpGeo.lat = atof(buf);
+                pos = 0;
+            }
+            else if (msgQueue[i] == '\n') {
+                tmpGeo.lng = atof(buf);
+                pos = 0;
+
+                routeList.push(tmpGeo);
+                lastidx = i;
+                tmpGeo.lat = GEORESET;
+                tmpGeo.lng = GEORESET;
+            }
+            else {
+                buf[pos++] = msgQueue[i];
+            }
+        }
+    }
+}
+
 /**
  * End of File. (CGtCtrl.cpp)
  */
index e436800..c74d318 100644 (file)
@@ -29,7 +29,6 @@
 #include <string>
 
 #include <cstddef>
-#include <strstream>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/ipc.h>
@@ -53,6 +52,7 @@ const useconds_t g_sleeptime = 10000; // = 10milli sec = 0.01 sec
 const int g_JoyStickTypeNum = 3;
 const std::string g_ConfPathG25 = "/etc/ico-vic-carsim/G25.conf";
 const std::string g_ConfPathG27 = "/etc/ico-vic-carsim/G27.conf";
+const std::string g_RouteListFile = "/etc/ico-vic-carsim/route.txt";
 #define D_RUNLOOP_INTERVAL_COUNT  5
 #define D_RUNLOOP_INTERVAL_COUNT2 50
 
@@ -270,6 +270,7 @@ class CGtCtrl
     CConf myConf;
     CJoyStick* myJS;
     bool m_bUseGps;
+    bool m_bDemoRunning;
 
     bool Initialize();
     bool Terminate();
@@ -322,6 +323,7 @@ class CGtCtrl
     void SetMQKeyData(char *buf, unsigned int bufsize, long &mtype,
                       const char *key, char status[], unsigned int size);
     void CheckSendResult(int mqid);
+    void LoadRouteList();
 };
 
 #endif /* CGTCTRL_H_ */
index 04d10a5..0dc1a01 100644 (file)
@@ -37,7 +37,7 @@ class CJoyStickEV : public CJoyStick
     virtual int ReadData();
     virtual bool getDeviceName(int fd, char* devNM, size_t sz);
     int getJS_EVENT_BUTTON(int& num, int& val, const struct input_event& s);
-    int getJS_EVENT_AXIS(int& num, int& val, const struct input_event& s);
+    virtual int getJS_EVENT_AXIS(int& num, int& val, const struct input_event& s);
     int calc1pm32767(int val, const struct input_absinfo& ai);
     int calc2p65535(int val, const struct input_absinfo& ai);
     int calc3p32767(int val, const struct input_absinfo& ai);
index 8caff56..b781850 100644 (file)
@@ -22,13 +22,13 @@ int CJoyStickG25::Open() {
     }
     if (0 > ioctl(rfd, EVIOCGABS(ABS_Y), &m_absInf[E_ABSY])) {
         std::cerr << "ioctl(EVIOCGABS(ABS_Y)) get error" << std::endl;
-        m_absInf[E_ABSY].minimum = 0;
-        m_absInf[E_ABSY].maximum = 255;
+        m_absInf[E_ABSY].minimum = -32767;
+        m_absInf[E_ABSY].maximum = 32767;
     }
     if (0 > ioctl(rfd, EVIOCGABS(ABS_Z), &m_absInf[E_ABSZ])) {
         std::cerr << "ioctl(EVIOCGABS(ABS_Z)) get error" << std::endl;
-        m_absInf[E_ABSZ].minimum = 0;
-        m_absInf[E_ABSZ].maximum = 255;
+        m_absInf[E_ABSZ].minimum = -32767;
+        m_absInf[E_ABSZ].maximum = 32767;
     }
     if (0 > ioctl(rfd, EVIOCGABS(ABS_HAT0X), &m_absInf[E_ABSHAT0X])) {
         std::cerr << "ioctl(EVIOCGABS(ABS_HAT0X)) get error" << std::endl;
@@ -43,3 +43,49 @@ int CJoyStickG25::Open() {
     return rfd;
 }
 
+/**
+ * @brief change input_event value to js_event value
+ * Since the direction of change value is different from the G27.
+ */
+int CJoyStickG25::getJS_EVENT_AXIS(int& num, int& val,
+                                   const struct input_event& s)
+{
+    int r = -1;
+    switch (s.code) {
+    case ABS_X:
+        // Convert value Steering
+        //    0 to 16353 -> -32766 to 32767
+        r = JS_EVENT_AXIS;
+        num = (int)s.code;
+        val = calc1pm32767((int)s.value, m_absInf[E_ABSX]);
+        break;
+    case ABS_Y:
+        r = JS_EVENT_AXIS;
+        num = (int)s.code;
+        val = calc3p32767Reverse((int)s.value, m_absInf[E_ABSY]);
+        break;
+    case ABS_Z:
+        r = JS_EVENT_AXIS;
+        num = (int)s.code;
+        val = calc3p32767((int)s.value, m_absInf[E_ABSZ]);
+        break;
+    case ABS_RZ:
+        r = JS_EVENT_AXIS;
+        num = (int)s.code;
+        val = calc3p32767Reverse((int)s.value, m_absInf[E_ABSRZ]);
+        break;
+    case ABS_HAT0X:
+        r = JS_EVENT_AXIS;
+        num = (int)s.code;
+        val = (int)s.value;
+        break;
+    case ABS_HAT0Y:
+        r = JS_EVENT_AXIS;
+        num = (int)s.code;
+        val = (int)s.value;
+        break;
+    defaulr:
+        break;
+    }
+    return r;
+}
index c8ac040..3767acf 100644 (file)
@@ -9,6 +9,7 @@ public:
     ~CJoyStickG25();
 
     virtual int Open();
+    virtual int getJS_EVENT_AXIS(int& num, int& val, const struct input_event& s);
 };
 
 #endif /* CJOYSTICKG25_H_ */
index ad20514..5ad305f 100644 (file)
@@ -15,6 +15,7 @@
 #include <iostream>
 #include <unistd.h>
 #include <getopt.h>
+#include <string>
 #include "CGtCtrl.h"
 using namespace std;
 
@@ -30,9 +31,10 @@ int main(int argc, char **argv)
     bool bTestMode = false;
     bool b;
     bool comFlg = false;
+    bool bDemoRunning = false;
 
     // parse command line
-    while ((result = getopt(argc, argv, "jhvgct")) != -1) {
+    while ((result = getopt(argc, argv, "jhvgctr")) != -1) {
         switch (result) {
         case 'h':
             printf("Usage: CarSim_Daemon [-g]\n");
@@ -56,6 +58,9 @@ int main(int argc, char **argv)
         case 'j':
             gbDevJs = true;
             break;
+        case 'r':
+            bDemoRunning = true;
+            break;
         }
     }
 
@@ -107,11 +112,11 @@ int main(int argc, char **argv)
         }
 
         CGtCtrl myGtCtrl;
+        myGtCtrl.m_bUseGps = bUseGps;
+        myGtCtrl.m_bDemoRunning = bDemoRunning;
         b = myGtCtrl.Initialize();
 
         if (b) {
-            myGtCtrl.m_bUseGps = bUseGps;
-
             myGtCtrl.Run();
         }
         myGtCtrl.Terminate();