|
From: <rus...@us...> - 2008-06-04 13:26:07
|
Revision: 155
http://gearbox.svn.sourceforge.net/gearbox/?rev=155&view=rev
Author: russo2503v
Date: 2008-06-04 06:26:14 -0700 (Wed, 04 Jun 2008)
Log Message:
-----------
removed climbRate field
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt
gearbox/trunk/submitted/gbxgarminacfr/driver.cpp
gearbox/trunk/submitted/gbxgarminacfr/driver.h
Removed Paths:
-------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h 2008-06-04 13:26:14 UTC (rev 155)
@@ -15,7 +15,7 @@
#ifndef GBXICEUTILACFR_GBXICEUTILACFRL_H
#define GBXICEUTILACFR_GBXICEUTILACFRL_H
-#include <gbxsickacfr/gbxiceutilacfr/subsystemthread.h>
+#include <gbxsickacfr/gbxiceutilacfr/safethread.h>
#include <gbxsickacfr/gbxiceutilacfr/timer.h>
#include <gbxsickacfr/gbxiceutilacfr/buffer.h>
#include <gbxsickacfr/gbxiceutilacfr/store.h>
Deleted: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp 2008-06-04 13:26:14 UTC (rev 155)
@@ -1,71 +0,0 @@
-/*
- * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
- * http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
- *
- * This distribution is licensed to you under the terms described in
- * the LICENSE file included in this distribution.
- *
- */
-
-#include <iostream>
-#include <sstream>
-
-#include "subsystemthread.h"
-
-using namespace gbxiceutilacfr;
-using namespace std;
-
-
-SubsystemThread::SubsystemThread( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status, const std::string& subsysName ) :
- tracer_(tracer),
- subStatus_( status, subsysName )
-{
-}
-
-void
-SubsystemThread::run()
-{
- stringstream ss;
- try
- {
- walk();
- }
- catch ( const IceUtil::Exception &e )
- {
- ss << "SubsystemThread::run() "<<subsysName()<<": Caught unexpected exception: " << e;
- }
- catch ( const std::exception &e )
- {
- ss << "SubsystemThread::run() "<<subsysName()<<": Caught unexpected exception: " << e.what();
- }
- catch ( const std::string &e )
- {
- ss << "SubsystemThread::run() "<<subsysName()<<": Caught unexpected string: " << e;
- }
- catch ( const char *e )
- {
- ss << "SubsystemThread::run() "<<subsysName()<<": Caught unexpected char *: " << e;
- }
- catch ( ... )
- {
- ss << "SubsystemThread::run() "<<subsysName()<<": Caught unexpected unknown exception.";
- }
-
- // report status fault if there was an exception and we are not stopping
- if ( !ss.str().empty() ) {
- if ( !isStopping() ) {
- tracer_.error( ss.str() );
- subStatus().fault( ss.str() );
- }
- else {
- tracer_.warning( subsysName()+": Caught exception when stopping: "+ss.str() );
- }
- }
- else {
- tracer_.debug( subsysName()+": dropping out from run() ", 4 );
- }
-
- // wait for somebody to realize that we are quitting and tell us to stop.
- waitForStop();
-}
Deleted: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h 2008-06-04 13:26:14 UTC (rev 155)
@@ -1,76 +0,0 @@
-/*
- * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
- * http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
- *
- * This distribution is licensed to you under the terms described in
- * the LICENSE file included in this distribution.
- *
- */
-
-#ifndef GBXICEUTILACFR_SUBSYSTEM_THREAD_H
-#define GBXICEUTILACFR_SUBSYSTEM_THREAD_H
-
-#include <gbxsickacfr/gbxiceutilacfr/thread.h>
-#include <gbxutilacfr/substatus.h>
-#include <gbxutilacfr/status.h>
-#include <gbxutilacfr/tracer.h>
-
-namespace gbxiceutilacfr {
-
-/*!
-@brief A version of the Thread class which catches all possible exceptions and integrates some Status operations.
-
-If an exception is caught when the thread is not stopping, a status fault is issued.
-Then the thread will wait for someone to call stop().
-
-To use this class, simply implement the pure virtual walk() function.
-@verbatim
-void MyThread::walk()
-{
- // initialize
-
- // main loop
- while ( !isStopping() )
- {
- // do something
- }
-
- // clean up
-}
-@endverbatim
-
-@see Thread, SafeThread.
- */
-class SubsystemThread : public Thread
-{
-public:
- //! Supply an optional Tracer and Status. The optional @c subsysName is used in reporting status changes
- //! as the subsystem name.
- SubsystemThread( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status, const std::string& subsysName="SubsystemThread" );
-
- // from IceUtil::Thread
- //! This implementation calls walk(), catches all possible exceptions, prints out
- //! errors and waits for someone to call stop().
- virtual void run();
-
- //! Implement this function in the derived class and put here all the stuff which your
- //! thread needs to do.
- virtual void walk()=0;
-
- //! Access to subsystem status.
- gbxutilacfr::SubStatus& subStatus() { return subStatus_; };
-
- //! Returns subsystem name assigned to this thread.
- std::string subsysName() const { return subStatus_.name(); };
-
-private:
- gbxutilacfr::Tracer& tracer_;
- gbxutilacfr::SubStatus subStatus_;
-};
-//! A smart pointer to the SubsystemThread class.
-typedef IceUtil::Handle<SubsystemThread> SubsystemThreadPtr;
-
-} // end namespace
-
-#endif
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt 2008-06-04 13:26:14 UTC (rev 155)
@@ -16,6 +16,3 @@
ADD_EXECUTABLE( safethreadtest safethreadtest.cpp )
GBX_ADD_TEST( GbxIceUtilAcfrSafeThreadTest safethreadtest )
-
-ADD_EXECUTABLE( subsystemthreadtest subsystemthreadtest.cpp )
-GBX_ADD_TEST( GbxIceUtilAcfrSubsystemThreadTest subsystemthreadtest )
Deleted: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp 2008-06-04 13:26:14 UTC (rev 155)
@@ -1,106 +0,0 @@
-/*
- * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
- * http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
- *
- * This distribution is licensed to you under the terms described in
- * the LICENSE file included in this distribution.
- *
- */
-
-#include <iostream>
-
-#include <IceUtil/Time.h>
-
-#include <gbxsickacfr/gbxiceutilacfr/subsystemthread.h>
-#include <gbxutilacfr/trivialtracer.h>
-#include <gbxutilacfr/trivialstatus.h>
-
-using namespace std;
-
-class TestThread : public gbxiceutilacfr::SubsystemThread
-{
-public:
- // it's safe to pass zero pointers
- TestThread( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status ) :
- SubsystemThread( tracer, status ) {};
- virtual void walk()
- {
- while ( !isStopping() ) {
- IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(50));
- }
- };
-};
-
-class TestThreadWithThrow : public gbxiceutilacfr::SubsystemThread
-{
-public:
- // it's safe to pass zero pointers
- TestThreadWithThrow( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status ) :
- SubsystemThread( tracer, status ) {};
- virtual void walk()
- {
- throw "throwing from walk";
- };
-};
-
-class TestThreadWithTools : public gbxiceutilacfr::SubsystemThread
-{
-public:
- TestThreadWithTools( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status ) :
- SubsystemThread( tracer, status, "MyName" )
- {
- };
- virtual void walk()
- {
- throw "throwing from walk";
- };
-};
-
-int main(int argc, char * argv[])
-{
- gbxutilacfr::TrivialTracer tracer;
- gbxutilacfr::TrivialStatus status( tracer );
-
- cout<<"testing start() and stop()... ";
- {
- gbxiceutilacfr::Thread* t=0;
- try
- {
- t = new TestThread( tracer, status );
- t->start();
- }
- catch (...)
- {
- cout<<"failed"<<endl<<"should be able to create thread"<<endl;
- exit(EXIT_FAILURE);
- }
- IceUtil::ThreadControl tc = t->getThreadControl();
- t->stop();
- tc.join();
- // do not delete t! it's already self-destructed.
- }
- cout<<"ok"<<endl;
-
- cout<<"testing SubsystemThread() with exceptions... ";
- {
- gbxiceutilacfr::Thread* t=0;
- try
- {
- t = new TestThreadWithThrow( tracer, status );
- t->start();
- }
- catch (...)
- {
- cout<<"failed"<<endl<<"all exception should've been caught."<<endl;
- // ok
- }
- IceUtil::ThreadControl tc = t->getThreadControl();
- t->stop();
- tc.join();
- // do not delete t! it's already self-destructed.
- }
- cout<<"ok"<<endl;
-
- return EXIT_SUCCESS;
-}
Modified: gearbox/trunk/submitted/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 13:26:14 UTC (rev 155)
@@ -107,7 +107,6 @@
data->headingTrue=0.0;
data->headingMagnetic=0.0;
data->speed=0.0;
- data->climbRate=0.0;
// NOTE: not processing the rest!
return data;
}
@@ -126,9 +125,6 @@
data->speed=atof(msg.getDataToken(SpeedKPH).c_str());
data->speed*=(1000/3600.0);
- //set to zero
- data->climbRate=0.0;
-
return data;
}
@@ -149,6 +145,7 @@
data->horizontalPositionError = atof(msg.getDataToken(HError).c_str());
data->verticalPositionError = atof(msg.getDataToken(VError).c_str());
+ data->estimatedPositionError = atof(msg.getDataToken(EPE).c_str());
return data;
}
Modified: gearbox/trunk/submitted/gbxgarminacfr/driver.h
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/driver.h 2008-06-04 05:37:33 UTC (rev 154)
+++ gearbox/trunk/submitted/gbxgarminacfr/driver.h 2008-06-04 13:26:14 UTC (rev 155)
@@ -144,12 +144,8 @@
double headingMagnetic;
//! Horizontal velocity [metres/second]
double speed;
- //! Vertical velocity [metres/second]
- double climbRate;
};
- enum VTGTokens{MsgType=0,HError,M1,VError,M2,EPE,M3};
-
//! Gps data structure
class RmeData : public GenericData
{
@@ -167,6 +163,9 @@
double horizontalPositionError;
//! Vertical position error: one standard deviation [metres]
double verticalPositionError;
+
+ //! Estimated position error.
+ double estimatedPositionError;
};
/*!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|