You can subscribe to this list here.
| 2008 |
Jan
|
Feb
(58) |
Mar
(15) |
Apr
(23) |
May
(8) |
Jun
(92) |
Jul
(66) |
Aug
(6) |
Sep
(9) |
Oct
(44) |
Nov
(8) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(10) |
Feb
(8) |
Mar
(2) |
Apr
(8) |
May
(19) |
Jun
(11) |
Jul
(8) |
Aug
(6) |
Sep
(5) |
Oct
(4) |
Nov
(26) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
(16) |
Sep
(7) |
Oct
(3) |
Nov
(7) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <rus...@us...> - 2009-02-18 02:55:26
|
Revision: 383
http://gearbox.svn.sourceforge.net/gearbox/?rev=383&view=rev
Author: russo2503v
Date: 2009-02-18 01:42:52 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Tagging release 9.02
Added Paths:
-----------
gearbox/tags/RELEASE_9.02/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-02-13 07:58:33
|
Revision: 381
http://gearbox.svn.sourceforge.net/gearbox/?rev=381&view=rev
Author: borax00
Date: 2009-02-13 07:58:24 +0000 (Fri, 13 Feb 2009)
Log Message:
-----------
warn on WARNING only, not INFO
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
gearbox/trunk/src/gbxsickacfr/sickdefines.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2009-02-09 01:40:32 UTC (rev 380)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2009-02-13 07:58:24 UTC (rev 381)
@@ -193,7 +193,7 @@
if ( SUPER_DEBUG )
{
stringstream ssDebug;
- ssDebug << "SerialDeviceHandler::processSerialBuffer: buffer is: " << toHexString(buffer_);
+ ssDebug << "SerialDeviceHandler::processSerialBuffer: buffer is: " << toAsciiString(buffer_);
tracer_.debug( ssDebug.str() );
}
@@ -259,6 +259,12 @@
{
break;
}
+
+ // If we've parsed the entire thing we can stop.
+ if ( buffer_.size() == 0 )
+ {
+ break;
+ }
}
return statusOK;
}
@@ -280,4 +286,15 @@
return ss.str();
}
+std::string
+toAsciiString( const char *buf, int bufLen )
+{
+ stringstream ss;
+ ss << "[ ";
+ for ( int i=0; i < bufLen; i++ )
+ ss <<buf[i];
+ ss << " ]";
+ return ss.str();
+}
+
} // namespace
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2009-02-09 01:40:32 UTC (rev 380)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2009-02-13 07:58:24 UTC (rev 381)
@@ -150,11 +150,13 @@
//////////////////////////////////////////////////////////////////////
std::string toHexString( const char *buf, int bufLen );
-// inline std::string toHexString( char *buf, int bufLen )
-// { return toHexString( (const unsigned char *)buf, bufLen ); }
inline std::string toHexString( const std::vector<char> &buf )
{return toHexString( &(buf[0]), buf.size() );}
+std::string toAsciiString( const char *buf, int bufLen );
+inline std::string toAsciiString( const std::vector<char> &buf )
+{return toAsciiString( &(buf[0]), buf.size() );}
+
} // namespace
#endif
Modified: gearbox/trunk/src/gbxsickacfr/sickdefines.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/sickdefines.cpp 2009-02-09 01:40:32 UTC (rev 380)
+++ gearbox/trunk/src/gbxsickacfr/sickdefines.cpp 2009-02-13 07:58:24 UTC (rev 381)
@@ -261,8 +261,10 @@
bool generalStatusIsWarn( uChar generalStatus )
{
- return ( generalStatus == STATUS_INFO ||
- generalStatus == STATUS_WARNING );
+// AlexB: don't warn on 'INFO', just warn on 'WARNING'.
+// return ( generalStatus == STATUS_INFO ||
+// generalStatus == STATUS_WARNING );
+ return ( generalStatus == STATUS_WARNING );
}
bool generalStatusIsError( uChar generalStatus )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-02-09 02:22:09
|
Revision: 380
http://gearbox.svn.sourceforge.net/gearbox/?rev=380&view=rev
Author: rumataxyz
Date: 2009-02-09 01:40:32 +0000 (Mon, 09 Feb 2009)
Log Message:
-----------
removed spurious reference to libIceUtil, shouldn't be needed anymore
Modified Paths:
--------------
gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt
Modified: gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt 2009-02-01 23:42:12 UTC (rev 379)
+++ gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt 2009-02-09 01:40:32 UTC (rev 380)
@@ -4,9 +4,6 @@
SET( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
-#INCLUDE( ${GBX_CMAKE_DIR}/FindIceUtil.cmake )
-#GBX_REQUIRE_VAR( build LIB ${lib_name} ICEUTIL_FOUND "libIceUtil not found" )
-
SET( int_libs GbxUtilAcfr GbxSerialAcfr )
GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${int_libs} )
@@ -18,7 +15,6 @@
ADD_SUBDIRECTORY( gbxnovatelutilacfr)
INCLUDE( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
- INCLUDE( ${GBX_CMAKE_DIR}/UseIceUtil.cmake )
FILE( GLOB hdrs *.h )
FILE( GLOB srcs *.cpp )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-02-01 23:42:21
|
Revision: 379
http://gearbox.svn.sourceforge.net/gearbox/?rev=379&view=rev
Author: rumataxyz
Date: 2009-02-01 23:42:12 +0000 (Sun, 01 Feb 2009)
Log Message:
-----------
cosmetic
Modified Paths:
--------------
gearbox/trunk/src/gbxnovatelacfr/test/test.cpp
Modified: gearbox/trunk/src/gbxnovatelacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/test/test.cpp 2009-02-01 23:37:57 UTC (rev 378)
+++ gearbox/trunk/src/gbxnovatelacfr/test/test.cpp 2009-02-01 23:42:12 UTC (rev 379)
@@ -32,8 +32,8 @@
"\t\t\t\"ins\" to run INS/GPS mode (default)\n");
printf("\t[port]:\t\tSerial port the receiver is connecteed to (default \"/dev/ttyS0\")\n");
printf("\t[baud]:\t\tBaud rate to set up the serial port (9600, 19200, 38400, 115200, 230400), default is 115200\n");
- printf("\t[imutype]:\ttype of imu you are using(default \"IMU_HG1700_AG62\")\n");
- printf("\t[time to run]:\trun for so many seconds (after we get data the first time)\n");
+ printf("\t[imutype]:\ttype of imu you are using (default \"IMU_HG1700_AG62\")\n");
+ printf("\t[time to run]:\trun for so many seconds after we get data the first time (default 10)\n");
printf("\t-d:\t\tshow debug info (default is off)\n");
printf("\t-v:\t\tbe verbose, actually print out the data (default is off)\n");
printf("\t-h:\t\tprint this message\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-02-01 23:38:03
|
Revision: 378
http://gearbox.svn.sourceforge.net/gearbox/?rev=378&view=rev
Author: rumataxyz
Date: 2009-02-01 23:37:57 +0000 (Sun, 01 Feb 2009)
Log Message:
-----------
modified test-program with Al's suggestions: commandline-parameter for run-time, removed some advanced settings (SBAS, rtk)
Modified Paths:
--------------
gearbox/trunk/src/gbxnovatelacfr/test/test.cpp
Modified: gearbox/trunk/src/gbxnovatelacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/test/test.cpp 2009-01-31 09:03:48 UTC (rev 377)
+++ gearbox/trunk/src/gbxnovatelacfr/test/test.cpp 2009-02-01 23:37:57 UTC (rev 378)
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
+#include <limits.h>
#include <gbxutilacfr/trivialtracer.h>
#include <gbxutilacfr/exceptions.h>
@@ -26,27 +27,29 @@
namespace gna = gbxnovatelacfr;
void usage(char *progName, const char *optString){
- printf("Usage: %s -m [mode] -p [port] -b [baud] -i [imutype] -d -v -h\n", progName);
- printf("\t[mode]:\t\"gps\" to set the system up in GPS only mode\n"
- "\t\t\"ins\" to run INS/GPS mode (default)\n");
- printf("\t[port]:\tSerial port the receiver is connecteed to (default \"/dev/ttyS0\")\n");
+ printf("Usage: %s -m [mode] -p [port] -b [baud] -i [imutype] -t [time to run] -d -v -h\n", progName);
+ printf("\t[mode]:\t\t\"gps\" to set the system up in GPS only mode\n"
+ "\t\t\t\"ins\" to run INS/GPS mode (default)\n");
+ printf("\t[port]:\t\tSerial port the receiver is connecteed to (default \"/dev/ttyS0\")\n");
+ printf("\t[baud]:\t\tBaud rate to set up the serial port (9600, 19200, 38400, 115200, 230400), default is 115200\n");
printf("\t[imutype]:\ttype of imu you are using(default \"IMU_HG1700_AG62\")\n");
- printf("\t[baud]:\tBaud rate to set up the serial port (9600, 19200, 38400, 115200, 230400), default is 115200\n");
- printf("\t-d:\tshow debug info (default is off)\n");
- printf("\t-v:\tbe verbose, actually print out the data (default is off)\n");
- printf("\t-h:\tprint this message\n");
- printf("Options to decode: \"%s\"\n", optString);
+ printf("\t[time to run]:\trun for so many seconds (after we get data the first time)\n");
+ printf("\t-d:\t\tshow debug info (default is off)\n");
+ printf("\t-v:\t\tbe verbose, actually print out the data (default is off)\n");
+ printf("\t-h:\t\tprint this message\n");
+ printf("Options to decode: \t\"%s\"\n", optString);
return;
}
int main(int argc, char *argv[]){
int opt;
- const char *optString = ":m:p:b:i:dvh";
+ const char *optString = ":m:p:b:i:t:dvh";
//use sensible defaults
string mode = "ins";
string port = "/dev/ttyS0";
int baud = 115200;
+ double runTime = 10.0;
string imuType = "IMU_HG1700_AG62";
bool showDebug = false;
bool verbose = false;
@@ -68,6 +71,9 @@
case 'i':
imuType = optarg;
break;
+ case 't':
+ runTime = atof( optarg );
+ break;
case 'd':
showDebug = true;
break;
@@ -95,12 +101,44 @@
cout << "| Starting with:\n";
cout << "|\tmode:\t\t" << mode << "\n";
cout << "|\tport:\t\t" << port << "\n";
- cout << "|\tbaud:\t\t" << baud << "\n";
+ cout << "|\tbaud:\t\t" << baud << "\t\t[bps]\n";
+ cout << "|\truntime:\t" << runTime << "\t\t[sec]\n";
cout << "|\tImu:\t\t" << imuType << "\n";
cout << "|\tverbose:\t" << verbose << "\n";
cout << "|\tshow debug:\t" << showDebug << "\n";
cout << "-------------------------------------------------\n";
+ //read data from the driver for ~ [runTime] sec
+ int maxGpsPosCnt;
+ int maxGpsVelCnt;
+ int maxInsPvaCnt;
+ int maxRawImuCnt;
+ int maxFaultCnt = 2;
+ // bit dodgy to do this with counters, at least make sure we don't overflow
+ if(20.0*runTime < INT_MAX){
+ maxGpsPosCnt = 20*runTime;
+ maxGpsVelCnt = 20*runTime;
+ }
+ else{
+ maxGpsPosCnt = INT_MAX;
+ maxGpsVelCnt = INT_MAX;
+ cout << "!runtime too high, reset to " << INT_MAX/20 << "sec!\n";
+ }
+ if(100.0*runTime < INT_MAX){
+ maxInsPvaCnt = 100*runTime;
+ maxRawImuCnt = 100*runTime;
+ }
+ else{
+ maxInsPvaCnt = INT_MAX;
+ maxRawImuCnt = INT_MAX;
+ cout << "!runtime too high, reset to " << INT_MAX/100 << "sec!\n";
+ }
+ cout << "\n";
+
+ /**************************************************
+ * This is roughly what user-code should look like
+ **************************************************/
+
//create a config (the easy way)
auto_ptr<gna::Config > cfg;
auto_ptr<gna::SimpleConfig > simpleCfg;
@@ -119,8 +157,9 @@
cfg.reset( new gna::Config(*gpsOnlyCfg.get()) );
assert(0 != cfg.get());
// set up a couple of extra parameters
- cfg->enableSBAS_ = true;
- cfg->enableCDGPS_ = true;
+ // some hardware combinations may not support this
+ // cfg->enableSBAS_ = true;
+ // cfg->enableCDGPS_ = true;
}
else{
cout << "invalid mode: " << mode << "\n";
@@ -155,13 +194,6 @@
return EXIT_FAILURE;
}
- //read data from the driver for ~ 10 sec
- int maxGpsPosCnt = 200;
- int maxGpsVelCnt = 200;
- int maxInsPvaCnt = 1000;
- int maxRawImuCnt = 1000;
- int maxFaultCnt = 2;
-
while(0 < maxRawImuCnt
&& 0 < maxInsPvaCnt
&& 0 < maxGpsVelCnt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-01-31 09:03:55
|
Revision: 377
http://gearbox.svn.sourceforge.net/gearbox/?rev=377&view=rev
Author: rumataxyz
Date: 2009-01-31 09:03:48 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
changed all fancy modes to "false" by default (might not be supported by some HW combinations)
Modified Paths:
--------------
gearbox/trunk/src/gbxnovatelacfr/driver.cpp
Modified: gearbox/trunk/src/gbxnovatelacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/driver.cpp 2009-01-31 07:50:48 UTC (rev 376)
+++ gearbox/trunk/src/gbxnovatelacfr/driver.cpp 2009-01-31 09:03:48 UTC (rev 377)
@@ -581,10 +581,10 @@
imuToGpsOffset_(simpleCfg.imuToGpsOffset_),
imuToGpsOffsetUncertainty_(0,0.0),
enableInsOffset_(false),
- enableInsPhaseUpdate_(true),
- enableCDGPS_(true),
- enableSBAS_(true),
- enableRTK_(true),
+ enableInsPhaseUpdate_(false),
+ enableCDGPS_(false),
+ enableSBAS_(false),
+ enableRTK_(false),
enableUseOfOmniStarCarrier_(false),
enableSetImuOrientation_(false),
enableVehicleBodyRotation_(false) {
@@ -601,9 +601,9 @@
dtGpsPos_(0.05),
dtGpsVel_(0.05),
fixInvalidRateSettings_(false),
- enableCDGPS_(true),
- enableSBAS_(true),
- enableRTK_(true),
+ enableCDGPS_(false),
+ enableSBAS_(false),
+ enableRTK_(false),
enableUseOfOmniStarCarrier_(false) {
}
Config::Config() :
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <to...@us...> - 2009-01-31 07:50:49
|
Revision: 376
http://gearbox.svn.sourceforge.net/gearbox/?rev=376&view=rev
Author: tobasco
Date: 2009-01-31 07:50:48 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
reduced chattiness
Modified Paths:
--------------
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.cpp
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp 2009-01-31 00:32:58 UTC (rev 375)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp 2009-01-31 07:50:48 UTC (rev 376)
@@ -45,7 +45,7 @@
ss << "OceanServer: " << __func__ << ": Caught a parsing exception: "
<< e.what() << endl
<< "This can happen sometimes. Will continue regardless.";
- tracer_.info( ss.str() );
+ tracer_.debug( ss.str(), 3 );
exceptionCounter_++;
if (exceptionCounter_ >= MAX_EXCEPTIONS_ROW)
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.cpp 2009-01-31 00:32:58 UTC (rev 375)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.cpp 2009-01-31 07:50:48 UTC (rev 376)
@@ -76,7 +76,7 @@
void
OceanServerReader::checkConnection()
{
- tracer_.info( "OceanServerReader: Checking connection to serial port" );
+ tracer_.debug( "OceanServerReader: Checking connection to serial port", 3 );
// a blank will get us into menu mode
const char menuMode = ' ';
@@ -88,7 +88,7 @@
while(true)
{
ss.str(""); ss << "OceanServerReader: " << __func__ << ": Trying to read from serial port with timeout of " << TIMEOUT_SEC << "s" << endl;
- tracer_.info( ss.str() );
+ tracer_.debug( ss.str(), 3 );
// reading from serial port
string serialData;
@@ -99,14 +99,14 @@
// checking whether we are connected to an oceanserver system
if ( isOceanServerSystem(serialData) ) {
- tracer_.info( "OceanServerReader: We are connected to an Oceanserver system. Good." );
+ tracer_.debug( "OceanServerReader: We are connected to an Oceanserver system. Good.", 3 );
break;
}
// count the number of tries
numTries++;
ss.str(""); ss << "OceanServerReader: Trying to find out whether this is an oceanserver system. Attempt number " << numTries << "/" << MAX_TRIES << ".";
- tracer_.info( ss.str() );
+ tracer_.debug( ss.str(), 3 );
if ( numTries >= MAX_TRIES ) {
throw HardwareReadingException( ERROR_INFO, "Didn't recognize any of the strings. We may be connected to the wrong serial port.");
@@ -198,7 +198,7 @@
stringstream ss;
ss << "OceanServerReader: Caught ParsingException: " << e.what() << ". ";
ss << "It's not critical, we will try to find the beginning of a new record.";
- tracer_.info( ss.str() );
+ tracer_.debug( ss.str(), 3 );
firstTime_ = true;
// we have to rethrow, so that the caller knows that it may receive a corrupt record
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-01-31 00:33:05
|
Revision: 375
http://gearbox.svn.sourceforge.net/gearbox/?rev=375&view=rev
Author: russo2503v
Date: 2009-01-31 00:32:58 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
more debug info
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2009-01-29 06:51:07 UTC (rev 374)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2009-01-31 00:32:58 UTC (rev 375)
@@ -80,6 +80,12 @@
void
SerialDeviceHandler::send( const char *commandBytes, int numCommandBytes )
{
+ if ( SUPER_DEBUG )
+ {
+ stringstream ss;
+ ss << "SerialDeviceHandler::"<<__func__<<"(): Sending "<<numCommandBytes<<" bytes";
+ tracer_.debug( ss.str(), 5 );
+ }
serial_.write( commandBytes, numCommandBytes );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-01-29 06:51:11
|
Revision: 374
http://gearbox.svn.sourceforge.net/gearbox/?rev=374&view=rev
Author: russo2503v
Date: 2009-01-29 06:51:07 +0000 (Thu, 29 Jan 2009)
Log Message:
-----------
made test names more readable
Modified Paths:
--------------
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxserialacfr/lockfile/test/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/CMakeLists.txt
gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/CMakeLists.txt 2009-01-28 21:41:38 UTC (rev 373)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/CMakeLists.txt 2009-01-29 06:51:07 UTC (rev 374)
@@ -1,4 +1,4 @@
LINK_LIBRARIES( GbxNovatelUtilAcfr )
ADD_EXECUTABLE( crc32test crc32test.cpp )
-GBX_ADD_TEST( GbxNovatelUtilAcfrCrc32Test crc32test )
+GBX_ADD_TEST( GbxNovatelUtilAcfr_Crc32Test crc32test )
Modified: gearbox/trunk/src/gbxserialacfr/lockfile/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxserialacfr/lockfile/test/CMakeLists.txt 2009-01-28 21:41:38 UTC (rev 373)
+++ gearbox/trunk/src/gbxserialacfr/lockfile/test/CMakeLists.txt 2009-01-29 06:51:07 UTC (rev 374)
@@ -2,4 +2,4 @@
ADD_EXECUTABLE( locktest locktest.cpp )
TARGET_LINK_LIBRARIES( locktest GbxLockFileAcfr )
-GBX_ADD_TEST( GbxLockFileAcfr locktest )
\ No newline at end of file
+GBX_ADD_TEST( GbxLockFileAcfr_Test locktest )
\ No newline at end of file
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt 2009-01-28 21:41:38 UTC (rev 373)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt 2009-01-29 06:51:07 UTC (rev 374)
@@ -3,16 +3,16 @@
LINK_LIBRARIES( GbxIceUtilAcfr )
ADD_EXECUTABLE( buffertest buffertest.cpp )
-GBX_ADD_TEST( GbxIceUtilAcfrBufferTest buffertest )
+GBX_ADD_TEST( GbxIceUtilAcfr_BufferTest buffertest )
ADD_EXECUTABLE( storetest storetest.cpp )
-GBX_ADD_TEST( GbxIceUtilAcfrStoreTest storetest )
+GBX_ADD_TEST( GbxIceUtilAcfr_StoreTest storetest )
ADD_EXECUTABLE( notifytest notifytest.cpp )
-GBX_ADD_TEST( GbxIceUtilAcfrNotifyTest notifytest )
+GBX_ADD_TEST( GbxIceUtilAcfr_NotifyTest notifytest )
ADD_EXECUTABLE( threadtest threadtest.cpp )
-GBX_ADD_TEST( GbxIceUtilAcfrThreadTest threadtest )
+GBX_ADD_TEST( GbxIceUtilAcfr_ThreadTest threadtest )
ADD_EXECUTABLE( safethreadtest safethreadtest.cpp )
-GBX_ADD_TEST( GbxIceUtilAcfrSafeThreadTest safethreadtest )
+GBX_ADD_TEST( GbxIceUtilAcfr_SafeThreadTest safethreadtest )
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/CMakeLists.txt 2009-01-28 21:41:38 UTC (rev 373)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/CMakeLists.txt 2009-01-29 06:51:07 UTC (rev 374)
@@ -1,4 +1,4 @@
INCLUDE( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
GBX_ADD_EXECUTABLE( gbxsmartbatterychecksumtest checksumtest.cpp )
-GBX_ADD_TEST( GbxSmartBatteryChecksumTest gbxsmartbatterychecksumtest )
\ No newline at end of file
+GBX_ADD_TEST( GbxSmartBattery_ChecksumTest gbxsmartbatterychecksumtest )
\ No newline at end of file
Modified: gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt 2009-01-28 21:41:38 UTC (rev 373)
+++ gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt 2009-01-29 06:51:07 UTC (rev 374)
@@ -3,13 +3,13 @@
LINK_LIBRARIES( GbxUtilAcfr )
ADD_EXECUTABLE( mathtest mathtest.cpp )
-GBX_ADD_TEST( GbxUtilAcfrMathTest mathtest )
+GBX_ADD_TEST( GbxUtilAcfr_MathTest mathtest )
ADD_EXECUTABLE( tokenisetest tokenisetest.cpp )
-GBX_ADD_TEST( GbxUtilAcfrTokeniseTest tokenisetest )
+GBX_ADD_TEST( GbxUtilAcfr_TokeniseTest tokenisetest )
ADD_EXECUTABLE( trivialtracertest trivialtracertest.cpp )
-GBX_ADD_TEST( GbxUtilAcfrTrivialTracerTest trivialtracertest )
+GBX_ADD_TEST( GbxUtilAcfr_TrivialTracerTest trivialtracertest )
ADD_EXECUTABLE( trivialstatustest trivialstatustest.cpp )
-GBX_ADD_TEST( GbxUtilAcfrTrivialStatusTest trivialstatustest )
+GBX_ADD_TEST( GbxUtilAcfr_TrivialStatusTest trivialstatustest )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-01-28 22:22:20
|
Revision: 373
http://gearbox.svn.sourceforge.net/gearbox/?rev=373&view=rev
Author: rumataxyz
Date: 2009-01-28 21:41:38 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
removed gbxnovatelacfr from submitted
Modified Paths:
--------------
gearbox/trunk/submitted/CMakeLists.txt
Modified: gearbox/trunk/submitted/CMakeLists.txt
===================================================================
--- gearbox/trunk/submitted/CMakeLists.txt 2009-01-28 08:42:30 UTC (rev 372)
+++ gearbox/trunk/submitted/CMakeLists.txt 2009-01-28 21:41:38 UTC (rev 373)
@@ -10,6 +10,5 @@
# When adding new directories, please maintain order of inter-dependencies.
# Otherwise, maintain alphabetical order.
# E.g. ADD_SUBDIRECTORY( mydir )
- ADD_SUBDIRECTORY( gbxnovatelacfr )
ENDIF( GBX_BUILD_SUBMITTED )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-01-28 08:42:34
|
Revision: 372
http://gearbox.svn.sourceforge.net/gearbox/?rev=372&view=rev
Author: rumataxyz
Date: 2009-01-28 08:42:30 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
enabled gbxnovatelspan after acceptance
Modified Paths:
--------------
gearbox/trunk/src/CMakeLists.txt
Modified: gearbox/trunk/src/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/CMakeLists.txt 2009-01-28 08:39:24 UTC (rev 371)
+++ gearbox/trunk/src/CMakeLists.txt 2009-01-28 08:42:30 UTC (rev 372)
@@ -11,6 +11,7 @@
ADD_SUBDIRECTORY( gbxserialacfr )
ADD_SUBDIRECTORY( gbxutilacfr )
ADD_SUBDIRECTORY( gbxgarminacfr )
+ADD_SUBDIRECTORY( gbxnovatelacfr )
ADD_SUBDIRECTORY( gbxsickacfr )
ADD_SUBDIRECTORY( gbxsmartbatteryacfr )
ADD_SUBDIRECTORY( hokuyo_aist )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-01-28 08:39:33
|
Revision: 371
http://gearbox.svn.sourceforge.net/gearbox/?rev=371&view=rev
Author: rumataxyz
Date: 2009-01-28 08:39:24 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
moving gbxnovatelacfr to src after Alen's review. Checked that it still compiles/tests; didn't check on HW
Added Paths:
-----------
gearbox/trunk/src/gbxnovatelacfr/
Removed Paths:
-------------
gearbox/trunk/submitted/gbxnovatelacfr/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-01-28 08:20:47
|
Revision: 370
http://gearbox.svn.sourceforge.net/gearbox/?rev=370&view=rev
Author: rumataxyz
Date: 2009-01-28 08:20:35 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
small cleanup, mostly spelling, added tested HW
Modified Paths:
--------------
gearbox/trunk/submitted/gbxnovatelacfr/novatel.dox
Modified: gearbox/trunk/submitted/gbxnovatelacfr/novatel.dox
===================================================================
--- gearbox/trunk/submitted/gbxnovatelacfr/novatel.dox 2009-01-28 08:19:20 UTC (rev 369)
+++ gearbox/trunk/submitted/gbxnovatelacfr/novatel.dox 2009-01-28 08:20:35 UTC (rev 370)
@@ -19,12 +19,17 @@
NovatelSPAN is a proprietary Novatel navigation system.
It minimally consists out of a Novatel OEMV GPS receiver (OEM4 receivers should be compatible).
If combined with an IMU, a SPAN system can provide an INS navigation solution at high rate (up to 100Hz).
-The driver initialises the hardware and reports navigation data continously.
+The driver initialises the hardware and reports navigation data continuously.
for a full list of functions see @ref gbxnovatelacfr
+@par Tested Hardware
+Specific devices this driver has been tested with:
+- @ref gbxnovatelacfr_hw_reviews_michael
+- @ref gbxnovatelacfr_hw_reviews_alen
+
@par Header file
@verbatim
@@ -44,7 +49,7 @@
LGPL
@par Dependencies.
- @ref gbx_library_gbxserialacfr
+ @ref gbx_library_gbxserialacfr, @ref gbx_library_gbxutilacfr
@par Example
@@ -140,7 +145,7 @@
@par References
-This driver was programmed based on the protocoll/message descriptions in Novatel's manuals, it does not contain any code from Novatel.
+This driver was programmed based on the protocol/message descriptions in Novatel's manuals, it does not contain any code from Novatel.
The main source for information was:
- http://www.novatel.com/Documents/Manuals/om-20000094.pdf (Novatel OEMV reference)
- http://www.novatel.com/Documents/Manuals/om-20000104.pdf (SPAN-system manual)
@@ -158,7 +163,7 @@
- The binary parser currently works on little endian architectures (e.g. x86) only. This is checked at run-time.
- Driver currently treats the hardware as data-source only, communication _to_ the hardware is possible only during initialization.
- Driver does limited checking if configuring the receiver was successful/as-intended:
- - Driver checks for 'acks' for commands, reports 'no-acks' and retries
+ - Driver checks for 'ack' for commands, reports 'no-ack' and retries
- This detects malformed commands _only_
- The receiver (and hence the driver) will accept commands to e.g. setup an IMU, even if no IMU is present
- Driver does not deal with persistent storage:
@@ -167,16 +172,16 @@
- There are cases where persistent settings could interfere with normal operation of the driver. This is particularly likely
to happen when the hardware is shared between projects. There is no easy way to test for this, and the current implementation
ignores the problem completely (the user is always right).
- - Workaround: To make sure that there are no lingering persisten settings,
+ - Workaround: To make sure that there are no lingering persistent settings,
use the receiver's 'freset' command to bring it back to factory-defaults. The driver itself does not do this,
on the grounds that it also might delete settings that were made persistent with good reason and purpose.
- If you are shareing equipment, check with everybody involved, before you use this approach.
+ If you are sharing equipment, check with everybody involved, before you use this approach.
*/
/*!
@namespace gbxnovatelacfr
@brief Novatel GPS/INS driver
-This namespace contains the public interface of a library to access and run a NovatelSpan system.
+This namespace contains the public interface of a library to access and run a NovatelSPAN system.
@see @ref gbx_library_gbxnovatelacfr
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-01-28 08:19:29
|
Revision: 369
http://gearbox.svn.sourceforge.net/gearbox/?rev=369&view=rev
Author: rumataxyz
Date: 2009-01-28 08:19:20 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
first commit, included HW revies in the doco
Added Paths:
-----------
gearbox/trunk/submitted/gbxnovatelacfr/hw_review.dox
Added: gearbox/trunk/submitted/gbxnovatelacfr/hw_review.dox
===================================================================
--- gearbox/trunk/submitted/gbxnovatelacfr/hw_review.dox (rev 0)
+++ gearbox/trunk/submitted/gbxnovatelacfr/hw_review.dox 2009-01-28 08:19:20 UTC (rev 369)
@@ -0,0 +1,129 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Michael Moser
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+/*!
+@page gbxnovatelacfr_hw_reviews Hardware Reviews for GbxNovatelAcfr
+
+These tests were done to qualify the driver for acceptance according to the principles of project operation (@ref gbx_doc_principles_operation_lifecycle_accept).
+The original versions (and following discussions) can be found in the archives for the devel <a href="http://sourceforge.net/mail/?group_id=216468">mailing list</a>.
+
+@section gbxnovatelacfr_hw_reviews_michael Novatel ProPak V3 (OEMV) receiver with Honeywell HG1700AG62 IMU (Michael Moser)
+
+@par Setup:
+
+- Hardware:
+ - Novatel ProPak V3 (OEMV) receiver
+ - Honeywell HG1700AG62 IMU
+
+- Software:
+ - gbxnovatelacfrtest, built as per example.readme.
+
+
+@par Tests:
+
+- Hooked up receiver and ran test program with different parameters (-m
+ins/gps -v):
+Enables the expected messages, prints out message-types/contents
+(depending on -v)
+
+- Set baudrate too low (9600 for -m gps, 38400 for ins):
+Fails as expected in Config.isValid() (with appropriate message).
+
+- BestGpsPos:
+Roughly checked lat/lon (google-earth, marker on our lab), heightAMSL
+(~30m sounds right for our lab), sigmas look ok (~2m lat/lon, double
+that for height), GpsWeekNr 1487 sounds right (~28 years * 52),
+timestamps are consistent with report-frequency, number of observations
+is sensible (6-10).
+
+- BestGpsVel:
+Same as pos, speed hor/vert is zero as expected, heading meaningless as
+expected
+
+- RawImu:
+ - Accelerations: verified values and signs by aligning different axis with
+ gravity (checked 0, 1g, -1g for all axis)
+ - Gyros: verified values and signs by turning 180deg, and integrating
+ program output manually (done for all axis)
+
+
+@par Roughly verified:
+
+- InsPva status: goes through the expected cycle (inactive, aligning,
+need to perform maneuvers)
+- BestGpsVel/Pos: status/solutionStatus/solutionType
+
+
+@par Not Tested:
+
+- InsOffset_, vehicleBodyRotation_, setImuOrientation_, InsPva (signs,
+values), BestGpsVel (signs, values): These guys are not testable in a
+bench-top setup
+
+
+
+
+
+@section gbxnovatelacfr_hw_reviews_alen Novatel Pro-Pak-G2 plus receiver (Alen Alempijevic)
+
+@par Setup:
+
+- Hardware:
+ - Novatel Pro-Pak-G2 plus receiver
+ - assorted cables (RS232 connection)
+ - GPS antenna
+ - 12V power supply
+
+- Software:
+ - gbxnovatelacfrtest, built as per example.readme.
+
+@par Tests:
+
+- All tests performed with Novatel GPS unit, no IMU unit connected on
+moving vehicle
+
+- Antenna cable disconnected from GPS receiver:
+Driver displays [Antenna power status: Powered; Antenna open flag: Open;
+Antenna shorted flag: OK], terminates after 10 seconds
+
+- Started driver with antenna disconnected, connected antenna as soon as
+possible:
+Driver displays [Antenna power status: Powered; Antenna open flag: Open;
+Antenna shorted flag: OK], termination occurs after 10 seconds without
+reflecting the status, possible insufficient time to detect hardware
+change..
+
+- Connected driver at different baud rates (19200, 38400, 57600, 115200)
+Driver displays BestGpsPos data, no error messages and terminates after
+10 seconds
+
+- Connected driver at 9600 baud rates
+Driver displays error message and terminates
+The combined data-rate of the messages/message rates you configured
+exceeds the configured baud rate 28800 / 9600
+Invalid configuration!
+
+@par Roughly verified:
+
+- Temperature (ambient, rising during parking under sunlight).
+- Position reported: drove the vehicle with GPS mounted and position
+reflect the vehicle motion
+- Velocity reported: drove the vehicle with GPS mounted and recorded
+velocity readings appeared to reflect the vehicle motion
+
+@par Not Tested:
+
+- Connecting the IMU and getting the integrated solution
+
+@par Questions:
+
+- SBAS and RTK
+Is there a way to select these as configuration parameters on command line?
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-01-14 02:46:06
|
Revision: 368
http://gearbox.svn.sourceforge.net/gearbox/?rev=368&view=rev
Author: russo2503v
Date: 2009-01-14 01:52:30 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
added optional parameter to Tracer functions to make tracing local-only. No changes to existing code is required.
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/gbxutilacfr/tracer.h
gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp
gearbox/trunk/src/gbxutilacfr/trivialtracer.h
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2008-12-19 08:11:45 UTC (rev 367)
+++ gearbox/trunk/doc/history.dox 2009-01-14 01:52:30 UTC (rev 368)
@@ -34,6 +34,9 @@
- Changed interface for Tracer:
- when querying verbosity, default destination argument is 'ToAny' (AlexB).
- moved trace type and destination enums out of the class into the namespace (alexm)
+ - added optional 'localOnly' parameter to all Tracer output function, i.e. info(), warn(), error(), debug().
+ This is to allow the use of Tracer for tracing network problems (otherwise a trace of a network problem will
+ lead to another trace, etc) (alexm)
- Changed implementation of TrivialTracer to allow multiple levels of tracing verbosity (AlexB).
- Changed interface for Status:
- status of subsystems is described in two orthogonal dimensions: state and health. (alexm)
Modified: gearbox/trunk/src/gbxutilacfr/tracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/tracer.h 2008-12-19 08:11:45 UTC (rev 367)
+++ gearbox/trunk/src/gbxutilacfr/tracer.h 2009-01-14 01:52:30 UTC (rev 368)
@@ -39,7 +39,7 @@
enum DestinationType {
//! Write to stardard display
ToDisplay=0,
- //! Send over the network, details specific to Tracer implementation
+ //! Send over the network, details are specific to Tracer implementation
ToNetwork,
//! Write to SysLog on Unix, EventLog on windows
ToLog,
@@ -116,16 +116,24 @@
virtual void print( const std::string &message ) = 0;
//! Routing is determined by InfoToXxx parameter.
- virtual void info( const std::string &message, int level=1 ) = 0;
+ //! If localOnly is set to TRUE, messages are not sent over the network (useful when traces
+ //! is caused by network errors).
+ virtual void info( const std::string &message, int level=1, bool localOnly=false ) = 0;
//! Routing is determined by WarningToXxx parameter.
- virtual void warning( const std::string &message, int level=1 ) = 0;
+ //! If localOnly is set to TRUE, messages are not sent over the network (useful when traces
+ //! is caused by network errors).
+ virtual void warning( const std::string &message, int level=1, bool localOnly=false ) = 0;
//! Routing is determined by ErrorToXxx parameter.
- virtual void error( const std::string &message, int level=1 ) = 0;
+ //! If localOnly is set to TRUE, messages are not sent over the network (useful when traces
+ //! is caused by network errors).
+ virtual void error( const std::string &message, int level=1, bool localOnly=false ) = 0;
//! Routing is determined by DebugToXxx parameter.
- virtual void debug( const std::string &message, int level=1 ) = 0;
+ //! If localOnly is set to TRUE, messages are not sent over the network (useful when traces
+ //! is caused by network errors).
+ virtual void debug( const std::string &message, int level=1, bool localOnly=false ) = 0;
//! Returns the verbosity level for traceType to destType. This test is performed
//! internally by all tracing functions, e.g. error(). You may want to call this
Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp 2008-12-19 08:11:45 UTC (rev 367)
+++ gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp 2009-01-14 01:52:30 UTC (rev 368)
@@ -31,28 +31,28 @@
}
void
-TrivialTracer::info( const std::string &message, int level )
+TrivialTracer::info( const std::string &message, int level, bool localOnly )
{
if ( traceLevels_[InfoTrace] >= level )
cout << "info: " << message << endl;
}
void
-TrivialTracer::warning( const std::string &message, int level )
+TrivialTracer::warning( const std::string &message, int level, bool localOnly )
{
if ( traceLevels_[WarningTrace] >= level )
cout << "warn: " << message << endl;
}
void
-TrivialTracer::error( const std::string &message, int level )
+TrivialTracer::error( const std::string &message, int level, bool localOnly )
{
if ( traceLevels_[ErrorTrace] >= level )
cout << "error: " << message << endl;
}
void
-TrivialTracer::debug( const std::string &message, int level )
+TrivialTracer::debug( const std::string &message, int level, bool localOnly )
{
if ( traceLevels_[DebugTrace] >= level )
cout << "debug: " << message << endl;
Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2008-12-19 08:11:45 UTC (rev 367)
+++ gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2009-01-14 01:52:30 UTC (rev 368)
@@ -33,10 +33,10 @@
int error=9 );
virtual void print( const std::string &message );
- virtual void info( const std::string &message, int level=1 );
- virtual void warning( const std::string &message, int level=1 );
- virtual void error( const std::string &message, int level=1 );
- virtual void debug( const std::string &message, int level=1 );
+ virtual void info( const std::string &message, int level=1, bool localOnly=false );
+ virtual void warning( const std::string &message, int level=1, bool localOnly=false );
+ virtual void error( const std::string &message, int level=1, bool localOnly=false );
+ virtual void debug( const std::string &message, int level=1, bool localOnly=false );
virtual int verbosity( TraceType traceType, DestinationType destType=ToAny ) const;
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2008-12-19 08:11:50
|
Revision: 367
http://gearbox.svn.sourceforge.net/gearbox/?rev=367&view=rev
Author: gbiggs
Date: 2008-12-19 08:11:45 +0000 (Fri, 19 Dec 2008)
Log Message:
-----------
Added baud rate probing for serial connections to hokuyo_aist, and allowed baud rate 38400
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2008-11-29 12:16:54 UTC (rev 366)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2008-12-19 08:11:45 UTC (rev 367)
@@ -930,6 +930,91 @@
GetDefaults ();
}
+unsigned int HokuyoLaser::OpenWithProbing (string portOptions)
+{
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ << "() Creating and opening port using options: " <<
+ portOptions << endl;
+ }
+ _port = flexiport::CreatePort (portOptions);
+ _port->Open ();
+
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ << "() Connected using " << _port->GetPortType () <<
+ " connection." << endl;
+ cerr << _port->GetStatus ();
+ }
+ _port->Flush ();
+
+ try
+ {
+ // Figure out the SCIP version currently in use and switch to a higher one if possible
+ GetAndSetSCIPVersion ();
+ // Get some values we need for providing default ranges
+ GetDefaults ();
+ }
+ catch (HokuyoError)
+ {
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ <<
+ "() Failed to connect at the default baud rate." << endl;
+ }
+ if (_port->GetPortType () == "serial")
+ {
+ // Failed at the default baud rate, so try again at the other rates
+ const unsigned int bauds[] = {750000, 500000, 250000, 115200, 57600, 38400, 19200};
+ const unsigned int numBauds = 7;
+ for (unsigned int ii = 0; ii < numBauds; ii++)
+ {
+ reinterpret_cast<SerialPort*> (_port)->SetBaudRate (bauds[ii]);
+ try
+ {
+ GetAndSetSCIPVersion ();
+ GetDefaults ();
+ // If the above two functions succeed, break out of the loop and be happy
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ << "() Connected at " <<
+ bauds[ii] << endl;
+ }
+ return bauds[ii];
+ }
+ catch (HokuyoError)
+ {
+ if (ii == numBauds - 1)
+ {
+ // Last baud rate, give up and rethrow
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ <<
+ "() Failed to connect at any baud rate." << endl;
+ }
+ throw;
+ }
+ // Otherwise go around again
+ }
+ }
+ }
+ else
+ {
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ << "() Port is not serial, cannot probe." <<
+ endl;
+ }
+ throw;
+ }
+ }
+
+ if (_port->GetPortType () == "serial")
+ return reinterpret_cast<SerialPort*> (_port)->GetBaudRate ();
+ else
+ return 0;
+}
+
void HokuyoLaser::Close (void)
{
if (!_port)
@@ -997,8 +1082,8 @@
char newBaud[13];
memset (newBaud, 0, sizeof (char) * 13);
- if (baud != 19200 && baud != 57600 && baud != 115200 &&
- baud != 250000 && baud != 500000 && baud != 750000)
+ if (baud != 19200 && baud != 38400 && baud != 57600 && baud != 115200 &&
+ baud != 250000 && baud != 500000 && baud != 750000)
{
stringstream ss;
ss << "Bad baud rate: " << baud << endl;
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2008-11-29 12:16:54 UTC (rev 366)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2008-12-19 08:11:45 UTC (rev 367)
@@ -306,6 +306,16 @@
/// @brief Open the laser scanner and begin scanning.
void Open (std::string portOptions);
+ /** @brief Open the laser scanner and begin scanning, probing the baud rate as necessary.
+
+ If the port is a serial connection and communication with the laser fails at the given
+ baud rate, the alternative baud rates supported by the device are tried (see @ref SetBaud
+ for these) in order from fastest to slowest.
+
+ @return The baud rate at which connection with the laser succeeded, or 0 for non-serial
+ connections. */
+ unsigned int OpenWithProbing (std::string portOptions);
+
/// @brief Close the connection to the laser scanner.
void Close (void);
@@ -317,7 +327,7 @@
/** @brief Change the baud rate when using a serial connection.
- Valid baud rates are: 19.2Kbps, 57.6Kbps, 115.2Kbps, 250.0Kbps, 500.0Kbps, 750.0Kbps
+ Valid rates are 19.2Kbps, 38.4Kbps, 57.6Kbps, 115.2Kbps, 250.0Kbps, 500.0Kbps, 750.0Kbps
(dependent on those available in FlexiPort). */
void SetBaud (unsigned int baud);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-11-29 12:17:04
|
Revision: 366
http://gearbox.svn.sourceforge.net/gearbox/?rev=366&view=rev
Author: russo2503v
Date: 2008-11-29 12:16:54 +0000 (Sat, 29 Nov 2008)
Log Message:
-----------
turned the docco on, the 2nd time. dont know what happened before
Modified Paths:
--------------
gearbox/trunk/doc/doxyfile
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/gbxserialdeviceacfr.h
Modified: gearbox/trunk/doc/doxyfile
===================================================================
--- gearbox/trunk/doc/doxyfile 2008-11-16 15:16:16 UTC (rev 365)
+++ gearbox/trunk/doc/doxyfile 2008-11-29 12:16:54 UTC (rev 366)
@@ -83,7 +83,7 @@
*.c \
*.cc
RECURSIVE = YES
-EXCLUDE = ../src/gbxsickacfr/gbxiceutilacfr/
+EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH = ../src
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h 2008-11-16 15:16:16 UTC (rev 365)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h 2008-11-29 12:16:54 UTC (rev 366)
@@ -20,4 +20,12 @@
#include <gbxsickacfr/gbxiceutilacfr/buffer.h>
#include <gbxsickacfr/gbxiceutilacfr/store.h>
+/*!
+@brief Utility namespace (part of SICK-ACFR driver)
+@namespace gbxiceutilacfr
+
+Compiles into a library libGbxIceUtilAcfr
+
+*/
+
#endif
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/gbxserialdeviceacfr.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/gbxserialdeviceacfr.h 2008-11-16 15:16:16 UTC (rev 365)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/gbxserialdeviceacfr.h 2008-11-29 12:16:54 UTC (rev 366)
@@ -12,4 +12,13 @@
#include <gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h>
+/*!
+@brief Utility namespace (part of SICK-ACFR driver)
+@namespace gbxserialdeviceacf
+
+Compiles into a library libGbxSerialDeviceAcfr
+
+*/
+
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2008-11-16 15:16:25
|
Revision: 365
http://gearbox.svn.sourceforge.net/gearbox/?rev=365&view=rev
Author: gbiggs
Date: 2008-11-16 15:16:16 +0000 (Sun, 16 Nov 2008)
Log Message:
-----------
Fixed some errors in the side of the code that doesn't get built on any decent, POSIX-compliant operating system.
Modified Paths:
--------------
gearbox/trunk/src/flexiport/tcpport.cpp
gearbox/trunk/src/flexiport/udpport.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
Modified: gearbox/trunk/src/flexiport/tcpport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/tcpport.cpp 2008-11-15 04:43:57 UTC (rev 364)
+++ gearbox/trunk/src/flexiport/tcpport.cpp 2008-11-16 15:16:16 UTC (rev 365)
@@ -819,13 +819,22 @@
}
// Done with the listening socket so close it
+#if defined (WIN32)
+ if (closesocket (_listenSock) < 0)
+#else
if (close (_listenSock) < 0)
+#endif
{
stringstream ss;
ss << "TCPPort::" << __func__ << "() close(_listenSock) error: (" << ErrNo () << ") " <<
StrError (ErrNo ());
throw PortException (ss.str ());
}
+#if defined (WIN32)
+ _listenSock = INVALID_SOCKET;
+#else
+ _listenSock = -1;
+#endif
}
// Checks if data is available, waiting for the timeout if none is available immediatly
Modified: gearbox/trunk/src/flexiport/udpport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/udpport.cpp 2008-11-15 04:43:57 UTC (rev 364)
+++ gearbox/trunk/src/flexiport/udpport.cpp 2008-11-16 15:16:16 UTC (rev 365)
@@ -730,7 +730,7 @@
sockAddr.sin_port = htons (_destPort);
if (_debug >= 1)
- cerr << "UDPPort::" << __func__ << "() Connecting to " << _destIP << ":" << _port << "." << endl;
+ cerr << "UDPPort::" << __func__ << "() Connecting to " << _destIP << ":" << _destPort << "." << endl;
if (connect (_sendSock, reinterpret_cast<struct sockaddr*> (&sockAddr), sizeof (sockAddr)) < 0)
{
CloseSender ();
@@ -872,7 +872,7 @@
else
{
// Listen on the specified interface only
- if ((hp = gethostbyname (_ip.c_str ())) == NULL)
+ if ((hp = gethostbyname (_recvIP.c_str ())) == NULL)
{
throw PortException (string ("UDPPort::") + __func__ +
string (" gethostbyname() error."));
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2008-11-15 04:43:57 UTC (rev 364)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2008-11-16 15:16:16 UTC (rev 365)
@@ -1179,7 +1179,7 @@
// Now the fun part: parsing the line. It would be nice if we could use the POSIX regex
// functions, but since MS doesn't believe in POSIX we get to do it the hard way.
// Start by finding the first (
- char *valueStart;
+ const char *valueStart;
if ((valueStart = strchr (info->firmware.c_str (), '(')) == NULL)
{
// No bracket? Crud. Fail and use the hard-coded values from the manual.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-11-15 04:44:07
|
Revision: 364
http://gearbox.svn.sourceforge.net/gearbox/?rev=364&view=rev
Author: borax00
Date: 2008-11-15 04:43:57 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Minor simplifications. Functionality unchanged.
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/exceptions.cpp
gearbox/trunk/src/gbxutilacfr/exceptions.h
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2008-11-10 05:15:08 UTC (rev 363)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2008-11-15 04:43:57 UTC (rev 364)
@@ -16,15 +16,9 @@
namespace gbxutilacfr {
-Exception::Exception( const char *file, const char *line, const char *message )
-{
- setMsg( file, line, message );
-}
-
Exception::Exception( const char *file, const char *line, const std::string &message )
-{
- setMsg( file, line, message.c_str() );
-}
+ : message_(toMessageString(file,line,message))
+{}
Exception::~Exception() throw()
{
@@ -40,16 +34,16 @@
#endif
};
-void
-Exception::setMsg( const char *file, const char *line, const char *message )
+std::string
+Exception::toMessageString( const char *file, const char *line, const std::string &message )
{
- std::string msgString(message);
- message_ = "\n *** ERROR(";
+ std::string msg = "\n *** ERROR(";
// not to confuse our local basename() with gbxutilacfr::basename()
- message_ += this->basename(file);
- message_ += ":";
- message_ += line;
- message_ += "): " + msgString;
+ msg += this->basename(file);
+ msg += ":";
+ msg += line;
+ msg += "): " + message;
+ return msg;
}
} // namespace
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.h 2008-11-10 05:15:08 UTC (rev 363)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.h 2008-11-15 04:43:57 UTC (rev 364)
@@ -53,7 +53,6 @@
class Exception : public std::exception
{
public:
- Exception(const char *file, const char *line, const char *message);
Exception(const char *file, const char *line, const std::string &message);
virtual ~Exception() throw();
@@ -61,7 +60,7 @@
virtual const char* what() const throw() { return message_.c_str(); }
protected:
- void setMsg( const char *file, const char *line, const char *message );
+ std::string toMessageString( const char *file, const char *line, const std::string &message );
std::string message_;
@@ -73,8 +72,6 @@
class HardwareException : public gbxutilacfr::Exception
{
public:
- HardwareException(const char *file, const char *line, const char *message)
- : Exception( file, line, message ) {};
HardwareException(const char *file, const char *line, const std::string &message)
: Exception( file, line, message ) {};
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-11-10 05:15:14
|
Revision: 363
http://gearbox.svn.sourceforge.net/gearbox/?rev=363&view=rev
Author: russo2503v
Date: 2008-11-10 05:15:08 +0000 (Mon, 10 Nov 2008)
Log Message:
-----------
toString() for the subsys type and a convenicence function to set it
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.cpp
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/substatus.h
Modified: gearbox/trunk/src/gbxutilacfr/status.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.cpp 2008-11-08 05:19:57 UTC (rev 362)
+++ gearbox/trunk/src/gbxutilacfr/status.cpp 2008-11-10 05:15:08 UTC (rev 363)
@@ -60,4 +60,17 @@
return ss.str();
}
+std::string toString( SubsystemType type )
+{
+ switch ( type )
+ {
+ case SubsystemStandard :
+ return "Standard";
+ case SubsystemEarlyExit :
+ return "EarlyExit";
+ default:
+ assert( !"gbxutilacfr::toString(SubsystemType) should never get to default" );
+ }
+}
+
} // namespace
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-11-08 05:19:57 UTC (rev 362)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-11-10 05:15:08 UTC (rev 363)
@@ -86,6 +86,9 @@
SubsystemEarlyExit
};
+//! Returns string equivalent of subsystem type enumerator.
+std::string toString( SubsystemType type );
+
/*!
@brief Local interface to component status.
Modified: gearbox/trunk/src/gbxutilacfr/substatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/substatus.h 2008-11-08 05:19:57 UTC (rev 362)
+++ gearbox/trunk/src/gbxutilacfr/substatus.h 2008-11-10 05:15:08 UTC (rev 363)
@@ -47,6 +47,9 @@
void setMaxHeartbeatInterval( double interval ) { status_.setMaxHeartbeatInterval( subsysName_, interval ); };
//! Passes this information to the system Status.
+ void setSubsystemType( SubsystemType type ) { status_.setSubsystemType( subsysName_, type ); };
+
+ //! Passes this information to the system Status.
void heartbeat() { status_.heartbeat( subsysName_ ); };
//! Passes this information to the system Status.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-11-08 05:20:07
|
Revision: 362
http://gearbox.svn.sourceforge.net/gearbox/?rev=362&view=rev
Author: borax00
Date: 2008-11-08 05:19:57 +0000 (Sat, 08 Nov 2008)
Log Message:
-----------
handle non-binary debug level.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/test/test.cpp
Modified: gearbox/trunk/src/gbxsickacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/test/test.cpp 2008-11-08 04:51:58 UTC (rev 361)
+++ gearbox/trunk/src/gbxsickacfr/test/test.cpp 2008-11-08 05:19:57 UTC (rev 362)
@@ -31,7 +31,7 @@
int opt;
int baud = 38400;
string port = "/dev/ttyS0";
- bool debug = 0;
+ int debug = 0;
bool showScan = false;
// Get some options from the command line
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-11-08 04:52:07
|
Revision: 361
http://gearbox.svn.sourceforge.net/gearbox/?rev=361&view=rev
Author: borax00
Date: 2008-11-08 04:51:58 +0000 (Sat, 08 Nov 2008)
Log Message:
-----------
removed namespace concatenation.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-11-07 04:21:07 UTC (rev 360)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-11-08 04:51:58 UTC (rev 361)
@@ -14,7 +14,6 @@
using namespace std;
-namespace gbxsickacfr {
namespace gbxserialdeviceacfr {
namespace {
@@ -275,5 +274,4 @@
return ss.str();
}
-}
} // namespace
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2008-11-07 04:21:07 UTC (rev 360)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2008-11-08 04:51:58 UTC (rev 361)
@@ -16,7 +16,6 @@
#include <gbxsickacfr/gbxiceutilacfr/buffer.h>
#include <IceUtil/IceUtil.h>
-namespace gbxsickacfr {
namespace gbxserialdeviceacfr {
//! @brief A generic Response: a message received from the device
@@ -26,8 +25,10 @@
~IResponse() {}
// Does the response indicate a warning condition?
+ // If so, this will be reported to SerialDeviceHandler's status.
virtual bool isWarn() const=0;
// Does the response indicate an error condition?
+ // If so, this will be reported to SerialDeviceHandler's status.
virtual bool isError() const=0;
// Human-readable string
@@ -114,7 +115,8 @@
// The main thread function, inherited from SubsystemThread
virtual void walk();
- // Allow external non-const access direct to (thread-safe) responseBuffer
+ // Allow external non-const access direct to (thread-safe) responseBuffer.
+ // This is what you use to hear responses.
gbxiceutilacfr::Buffer<TimedResponse> &responseBuffer() { return responseBuffer_; }
private:
@@ -140,6 +142,8 @@
gbxutilacfr::Tracer& tracer_;
gbxutilacfr::SubStatus subStatus_;
};
+//! A smart pointer to the class.
+typedef IceUtil::Handle<SerialDeviceHandler> SerialDeviceHandlerPtr;
//////////////////////////////////////////////////////////////////////
// Printing Functions
@@ -151,7 +155,6 @@
inline std::string toHexString( const std::vector<char> &buf )
{return toHexString( &(buf[0]), buf.size() );}
-}
} // namespace
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-11-07 04:21:15
|
Revision: 360
http://gearbox.svn.sourceforge.net/gearbox/?rev=360&view=rev
Author: russo2503v
Date: 2008-11-07 04:21:07 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
added subsystem type
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
gearbox/trunk/src/gbxutilacfr/trivialstatus.h
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-11-07 01:35:28 UTC (rev 359)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-11-07 04:21:07 UTC (rev 360)
@@ -78,6 +78,14 @@
//! Returns human-readable string with subsystem status information.
std::string toString( const SubsystemStatus& status );
+//! Subsystem type which describes common behavior models of a subsystem.
+enum SubsystemType {
+ //! Standard model: subsystem's life cycle equal to the life cycle of the component.
+ SubsystemStandard,
+ //! Early exit model: subsystem will intentionally shutdown early.
+ SubsystemEarlyExit
+};
+
/*!
@brief Local interface to component status.
@@ -96,9 +104,8 @@
The default initial status of a subsystem is @c Idle with health @c OK.
After registering a subsystem, a subsystem can report its state and health.
-Each of the calls is sufficient to let
-the Status engine know that the subsystem is alive. The special call
-'heartbeat' lets Status know that the subsystem is alive without
+Each of the calls is sufficient to let the Status engine know that the subsystem is alive.
+The special call heartbeat() lets Status know that the subsystem is alive without
modifying its status.
The 'maxHeartbeatIntervalSec' parameter tells the Status engine how often it
@@ -173,12 +180,16 @@
An Exception is also raised when trying to add a subsystem with an existing name.
- It is also possible to specify the maximum expected interval between heartbeats. See setMaxHeartbeatInterval()
+ It is possible to specify the maximum expected interval between heartbeats. See setMaxHeartbeatInterval()
for details.
+
+ It is also possible to describe the expected behavior of the subsystem by specifying SubsystemType. See
+ setSubsystemType() for details.
The initial status of the new subsystem is the same as produced by the empty constructor of SubsystemStatus.
*/
- virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 )=0;
+ virtual void addSubsystem( const std::string& subsystem,
+ double maxHeartbeatIntervalSec=-1.0, SubsystemType type=SubsystemStandard )=0;
//! Removes a subsystem from the status descriptor.
//! Throws Exception if the subsystem does not exist.
@@ -194,12 +205,15 @@
//! Returns state of the component infrastructure.
virtual SubsystemState infrastructureState()=0;
- //! Modifies maximum expected interval between heartbeats (in seconds).
+ //! Sets the maximum expected interval between heartbeats (in seconds).
//! When time since the last heartbeat exceeds the specified value, the subsystem is considered stalled.
//! Negative interval means infinite interval.
//! Throws Exception if the subsystem does not exist.
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double intervalSec )=0;
+ //! Sets the subsystem type which describes the expected behavior of the subsystem.
+ virtual void setSubsystemType( const std::string& subsystem, SubsystemType type )=0;
+
//
// BOTH STATE AND HEALTH CHANGES
//
@@ -258,11 +272,11 @@
// INFRASTRUCTURE STATE CHANGES
//
//! Sets state of component infrastructure to Initialising.
- virtual void compInitialising()=0;
+ virtual void infrastructureInitialising()=0;
//! Sets state of component infrastructure to Working.
- virtual void compWorking()=0;
+ virtual void infrastructureWorking()=0;
//! Sets state of component infrastructure to Finalising.
- virtual void compFinalising()=0;
+ virtual void infrastructureFinalising()=0;
//
// Utility
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-11-07 01:35:28 UTC (rev 359)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-11-07 04:21:07 UTC (rev 360)
@@ -30,7 +30,7 @@
}
void
-TrivialStatus::addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec )
+TrivialStatus::addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec, SubsystemType type )
{
tracer_.warning( "TrivialStatus: this implementation of Status does not store status of the subsystems" );
}
@@ -66,6 +66,12 @@
}
void
+TrivialStatus::setSubsystemType( const std::string& subsystem, SubsystemType type )
+{
+ // does nothing
+}
+
+void
TrivialStatus::setSubsystemStatus( const std::string& subsystem, gbxutilacfr::SubsystemState state,
gbxutilacfr::SubsystemHealth health, const std::string& msg )
{
@@ -184,19 +190,19 @@
}
void
-TrivialStatus::compInitialising()
+TrivialStatus::infrastructureInitialising()
{
tracer_.info( "Component infrastructure changed state to Initialising." );
}
void
-TrivialStatus::compWorking()
+TrivialStatus::infrastructureWorking()
{
tracer_.info( "Component infrastructure changed state to Working." );
}
void
-TrivialStatus::compFinalising()
+TrivialStatus::infrastructureFinalising()
{
tracer_.info( "Component infrastructure changed state to Finalising." );
}
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-11-07 01:35:28 UTC (rev 359)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-11-07 04:21:07 UTC (rev 360)
@@ -31,7 +31,8 @@
TrivialStatus( Tracer& tracer,
bool stateChange=true, bool ok=false, bool warn=true, bool fault=true, bool heartbeat=false );
- virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 );
+ virtual void addSubsystem( const std::string& subsystem,
+ double maxHeartbeatIntervalSec=-1.0, SubsystemType type=SubsystemStandard );
virtual void removeSubsystem( const std::string& subsystem );
//! Does not keep track of subsystems, returns empty vector.
virtual std::vector<std::string> subsystems();
@@ -40,6 +41,7 @@
//! Does not keep track of infrastructure state, throws Exception on any query
virtual SubsystemState infrastructureState();
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double interval );
+ virtual void setSubsystemType( const std::string& subsystem, SubsystemType type );
virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& msg="" );
@@ -53,9 +55,9 @@
virtual void heartbeat( const std::string& subsystem );
virtual void message( const std::string& subsystem, const std::string& msg );
- virtual void compInitialising();
- virtual void compWorking();
- virtual void compFinalising();
+ virtual void infrastructureInitialising();
+ virtual void infrastructureWorking();
+ virtual void infrastructureFinalising();
virtual void process();
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-11-07 02:02:34
|
Revision: 359
http://gearbox.svn.sourceforge.net/gearbox/?rev=359&view=rev
Author: russo2503v
Date: 2008-11-07 01:35:28 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
moved Tracer enums out of the class. added infrastructure state to Status.
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
gearbox/trunk/src/gbxutilacfr/status.cpp
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/tracer.h
gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
gearbox/trunk/src/gbxutilacfr/trivialstatus.h
gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp
gearbox/trunk/src/gbxutilacfr/trivialtracer.h
Added Paths:
-----------
gearbox/trunk/src/gbxutilacfr/tracer.cpp
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/doc/history.dox 2008-11-07 01:35:28 UTC (rev 359)
@@ -31,9 +31,14 @@
- A bit more careful when dealing with chunks of buffer that can't be parsed, should be a bit more robust (AlexB).
- libGbxUtilAcfr
- - Changed interface for Tracer: when querying verbosity, default destination argument is 'ToAny' (AlexB).
+ - Changed interface for Tracer:
+ - when querying verbosity, default destination argument is 'ToAny' (AlexB).
+ - moved trace type and destination enums out of the class into the namespace (alexm)
- Changed implementation of TrivialTracer to allow multiple levels of tracing verbosity (AlexB).
- - Status now describes status of subsystems in two orthogonal dimensions: state and health. (alexm)
+ - Changed interface for Status:
+ - status of subsystems is described in two orthogonal dimensions: state and health. (alexm)
+ - added infrastructure state to the component status and functions to set it. (alexm)
+ - added message() which only changes the human-readable message (alexm)
@section gbx_doc_history_807 Changes in Release 8.07
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp 2008-11-07 01:35:28 UTC (rev 359)
@@ -257,7 +257,7 @@
// Debugging output
//
const int debugLevel = 10;
- if (tracer_.verbosity( gbxutilacfr::Tracer::DebugTrace, gbxutilacfr::Tracer::ToAny ) >= debugLevel)
+ if (tracer_.verbosity( gbxutilacfr::DebugTrace, gbxutilacfr::ToAny ) >= debugLevel)
{
stringstream ss;
for (unsigned int i=0; i<stringList.size(); i++)
Modified: gearbox/trunk/src/gbxutilacfr/status.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.cpp 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/status.cpp 2008-11-07 01:35:28 UTC (rev 359)
@@ -10,6 +10,7 @@
#include "status.h"
#include <sstream>
+#include <assert.h>
namespace gbxutilacfr {
@@ -26,9 +27,10 @@
case SubsystemIdle :
return "Idle";
case SubsystemShutdown :
- break;
+ return "Shutdown";
+ default:
+ assert( !"gbxutilacfr::toString(SubsystemState) should never get to default" );
}
- return "Shutdown";
}
std::string toString( SubsystemHealth health )
@@ -42,16 +44,19 @@
case SubsystemFault :
return "Fault";
case SubsystemStalled :
- break;
+ return "Stalled";
+ default:
+ assert( !"gbxutilacfr::toString(SubsystemHealth) should never get to default" );
}
- return "Stalled";
}
std::string toString( const SubsystemStatus& status )
{
std::stringstream ss;
- ss << "state="<<toString(status.state)<<" health="<<toString(status.health)
- << " msg='"<<status.message<<"' since hearbeat="<<status.sinceHeartbeat;
+ ss << "state="<<toString(status.state)
+ << " health="<<toString(status.health)
+ << " msg='"<<status.message<<"'"
+ << " since hearbeat="<<status.sinceHeartbeat;
return ss.str();
}
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-11-07 01:35:28 UTC (rev 359)
@@ -191,6 +191,9 @@
//! Throws Exception when the specified subsystem does not exist.
virtual SubsystemStatus subsystemStatus( const std::string& subsystem )=0;
+ //! Returns state of the component infrastructure.
+ virtual SubsystemState infrastructureState()=0;
+
//! Modifies maximum expected interval between heartbeats (in seconds).
//! When time since the last heartbeat exceeds the specified value, the subsystem is considered stalled.
//! Negative interval means infinite interval.
@@ -252,6 +255,16 @@
virtual void message( const std::string& subsystem, const std::string& message )=0;
//
+ // INFRASTRUCTURE STATE CHANGES
+ //
+ //! Sets state of component infrastructure to Initialising.
+ virtual void compInitialising()=0;
+ //! Sets state of component infrastructure to Working.
+ virtual void compWorking()=0;
+ //! Sets state of component infrastructure to Finalising.
+ virtual void compFinalising()=0;
+
+ //
// Utility
//
Added: gearbox/trunk/src/gbxutilacfr/tracer.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/tracer.cpp (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/tracer.cpp 2008-11-07 01:35:28 UTC (rev 359)
@@ -0,0 +1,37 @@
+/*
+ * 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 "tracer.h"
+#include <assert.h>
+
+namespace gbxutilacfr {
+
+std::string toString( TraceType type )
+{
+ switch ( type )
+ {
+ case InfoTrace :
+ return "info";
+ case WarningTrace :
+ return "warn";
+ case ErrorTrace :
+ return "error";
+ case DebugTrace :
+ return "debug";
+ case AnyTrace :
+ return "any";
+ case NumberOfTraceTypes :
+ return "number_of_trace_types";
+ default:
+ assert( !"gbxutilacfr::Tracer::toString() should never get to default" );
+ }
+}
+
+} // namespace
Modified: gearbox/trunk/src/gbxutilacfr/tracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/tracer.h 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/tracer.h 2008-11-07 01:35:28 UTC (rev 359)
@@ -15,6 +15,43 @@
namespace gbxutilacfr {
+//! Types of traced information
+enum TraceType {
+ //! Information
+ InfoTrace=0,
+ //! Warning
+ WarningTrace,
+ //! Error
+ ErrorTrace,
+ //! Debug statement
+ DebugTrace,
+ //! Use this index to find out the maximum verbosity among all trace types to
+ //! a particular destination.
+ AnyTrace,
+ //! Number of trace types
+ NumberOfTraceTypes,
+};
+
+//! Returns a string corresponding to the enum element.
+std::string toString( TraceType type );
+
+//! Types of destinations for traced information.
+enum DestinationType {
+ //! Write to stardard display
+ ToDisplay=0,
+ //! Send over the network, details specific to Tracer implementation
+ ToNetwork,
+ //! Write to SysLog on Unix, EventLog on windows
+ ToLog,
+ //! Write to a file
+ ToFile,
+ //! Use this index to request the maximum verbosity of a particular type among
+ //! all destinations
+ ToAny,
+ //! Number of destination types
+ NumberOfDestinationTypes
+};
+
//!
//! @brief Local and remote tracing.
//!
@@ -45,8 +82,8 @@
//! }
//! @endverbatim
//!
-//! Enum gbxutilacfr::Tracer::TraceType defines types of traced
-//! information. Enum gbxutilacfr::Tracer::DestinationType defines possible
+//! Enum gbxutilacfr::TraceType defines types of traced
+//! information. Enum gbxutilacfr::DestinationType defines possible
//! tracer destinations are. Verbosity levels range from 0 (nothing) to
//! 10 (everything). The built-in defaults are as follows:
//! @verbatim
@@ -64,44 +101,6 @@
public:
virtual ~Tracer() {};
- //! Types of traced information
- enum TraceType {
- //! Information
- InfoTrace=0,
- //! Warning
- WarningTrace,
- //! Error
- ErrorTrace,
- //! Debug statement
- DebugTrace,
- //! Use this index to find out the maximum verbosity among all trace types to
- //! a particular destination.
- AnyTrace,
- //! Number of trace types
- NumberOfTraceTypes,
- //! Other
- //! (not used by orcaice tracers, so it's verbosity level is not stored in
- //! our matrix, so it's safe to have it larger than NumberOfTraceTypes)
- OtherTrace
- };
-
- //! Types of destinations for traced information.
- enum DestinationType {
- //! Write to stardard display
- ToDisplay=0,
- //! Send over the network, details specific to Tracer implementation
- ToNetwork,
- //! Write to SysLog on Unix, EventLog on windows
- ToLog,
- //! Write to a file
- ToFile,
- //! Use this index to request the maximum verbosity of a particular type among
- //! all destinations
- ToAny,
- //! Number of destination types
- NumberOfDestinationTypes
- };
-
struct Config
{
//! array of verbosity levels
@@ -135,38 +134,6 @@
//! usage.
virtual int verbosity( TraceType traceType, DestinationType destType=ToAny ) const = 0;
- static std::string toString( Tracer::TraceType type )
- {
- switch ( type )
- {
- case Tracer::InfoTrace :
- return "info";
- case Tracer::WarningTrace :
- return "warn";
- case Tracer::ErrorTrace :
- return "error";
- case Tracer::DebugTrace :
- return "debug";
- default :
- return "other";
- }
- };
-
- static Tracer::TraceType toTraceType( const std::string& category )
- {
- if ( category==std::string("info") )
- return Tracer::InfoTrace;
- else if ( category==std::string("warn") )
- return Tracer::WarningTrace;
- else if ( category==std::string("error") )
- return Tracer::ErrorTrace;
- else if ( category==std::string("debug") )
- return Tracer::DebugTrace;
- else
- return Tracer::OtherTrace;
- };
-
-
//! @b EXPERIMENTAL. Sets debug level for an individual subsystem.
//! Only debug-to-display is supported.
virtual void setLevel( const std::string &subsystem, int level=0 ) {};
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-11-07 01:35:28 UTC (rev 359)
@@ -53,6 +53,12 @@
throw Exception( ERROR_INFO, "TrivialStatus: this implementation of Status does not store status of the subsystems" );
}
+SubsystemState
+TrivialStatus::infrastructureState()
+{
+ throw Exception( ERROR_INFO, "TrivialStatus: this implementation of Status does not store infrastructure state" );
+}
+
void
TrivialStatus::setMaxHeartbeatInterval( const std::string& subsystem, double maxHeartbeatIntervalSec )
{
@@ -118,13 +124,13 @@
TrivialStatus::internalSetStatus( const std::string& subsystemName, gbxutilacfr::SubsystemState state,
gbxutilacfr::SubsystemHealth health, const std::string& msg )
{
+// cout<<"DEBUG: state="<<state<<" health="<<health<<" msg="<<msg<<endl;
assert( state!=gbxutilacfr::SubsystemIdle && "Idle state should not be reported from within the subsystem" );
assert( health!=gbxutilacfr::SubsystemStalled && "Stalled health should not be reported from within the subsystem" );
// if this is a heartbeat, do nothing else
if ( state<0 && health<0 && msg.empty() )
return;
-
bool traceState = true;
// don't trace if we don't know it
if ( state < 0 )
@@ -144,8 +150,11 @@
// give tracer feedback on status
if ( traceHealth )
{
+ // ugly stuff because we don't remember our state.
+ string stateString = (state<0) ? "Unchanged" : gbxutilacfr::toString(state);
string trace = "Subsystem '"+subsystemName
- +"' status="+gbxutilacfr::toString(state)+"/"+gbxutilacfr::toString(health);
+ +"' status="+stateString+"/"+gbxutilacfr::toString(health);
+
if ( !msg.empty() )
trace =+ ": "+msg;
switch ( health )
@@ -174,4 +183,22 @@
// cannot determine stalls because we are not tracking subsystem status
}
+void
+TrivialStatus::compInitialising()
+{
+ tracer_.info( "Component infrastructure changed state to Initialising." );
}
+
+void
+TrivialStatus::compWorking()
+{
+ tracer_.info( "Component infrastructure changed state to Working." );
+}
+
+void
+TrivialStatus::compFinalising()
+{
+ tracer_.info( "Component infrastructure changed state to Finalising." );
+}
+
+}
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-11-07 01:35:28 UTC (rev 359)
@@ -33,10 +33,12 @@
virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 );
virtual void removeSubsystem( const std::string& subsystem );
- //! does not keep track of subsystems, returns empty vector.
+ //! Does not keep track of subsystems, returns empty vector.
virtual std::vector<std::string> subsystems();
- //! does not keep track of status, throws Exception on any query
+ //! Does not keep track of status, throws Exception on any query
virtual SubsystemStatus subsystemStatus( const std::string& subsystem );
+ //! Does not keep track of infrastructure state, throws Exception on any query
+ virtual SubsystemState infrastructureState();
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double interval );
virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& msg="" );
@@ -51,6 +53,9 @@
virtual void heartbeat( const std::string& subsystem );
virtual void message( const std::string& subsystem, const std::string& msg );
+ virtual void compInitialising();
+ virtual void compWorking();
+ virtual void compFinalising();
virtual void process();
private:
Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp 2008-11-07 01:35:28 UTC (rev 359)
@@ -18,10 +18,10 @@
TrivialTracer::TrivialTracer( int debug, int info, int warn, int error )
{
- traceLevels_[Tracer::InfoTrace] = info;
- traceLevels_[Tracer::WarningTrace] = warn;
- traceLevels_[Tracer::ErrorTrace] = error;
- traceLevels_[Tracer::DebugTrace] = debug;
+ traceLevels_[InfoTrace] = info;
+ traceLevels_[WarningTrace] = warn;
+ traceLevels_[ErrorTrace] = error;
+ traceLevels_[DebugTrace] = debug;
}
void
@@ -33,35 +33,35 @@
void
TrivialTracer::info( const std::string &message, int level )
{
- if ( traceLevels_[Tracer::InfoTrace] >= level )
+ if ( traceLevels_[InfoTrace] >= level )
cout << "info: " << message << endl;
}
void
TrivialTracer::warning( const std::string &message, int level )
{
- if ( traceLevels_[Tracer::WarningTrace] >= level )
+ if ( traceLevels_[WarningTrace] >= level )
cout << "warn: " << message << endl;
}
void
TrivialTracer::error( const std::string &message, int level )
{
- if ( traceLevels_[Tracer::ErrorTrace] >= level )
+ if ( traceLevels_[ErrorTrace] >= level )
cout << "error: " << message << endl;
}
void
TrivialTracer::debug( const std::string &message, int level )
{
- if ( traceLevels_[Tracer::DebugTrace] >= level )
+ if ( traceLevels_[DebugTrace] >= level )
cout << "debug: " << message << endl;
}
int
TrivialTracer::verbosity( TraceType traceType, DestinationType destType ) const
{
- assert( traceType >= 0 && traceType <= Tracer::NumberOfTraceTypes );
+ assert( traceType >= 0 && traceType <= NumberOfTraceTypes );
return traceLevels_[traceType];
}
Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2008-10-30 07:10:32 UTC (rev 358)
+++ gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2008-11-07 01:35:28 UTC (rev 359)
@@ -37,11 +37,11 @@
virtual void warning( const std::string &message, int level=1 );
virtual void error( const std::string &message, int level=1 );
virtual void debug( const std::string &message, int level=1 );
- virtual int verbosity( TraceType traceType, DestinationType destType=Tracer::ToAny ) const;
+ virtual int verbosity( TraceType traceType, DestinationType destType=ToAny ) const;
private:
- int traceLevels_[Tracer::NumberOfTraceTypes];
+ int traceLevels_[NumberOfTraceTypes];
};
} // namespace
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-30 07:10:44
|
Revision: 358
http://gearbox.svn.sourceforge.net/gearbox/?rev=358&view=rev
Author: russo2503v
Date: 2008-10-30 07:10:32 +0000 (Thu, 30 Oct 2008)
Log Message:
-----------
more docco, more standard outpout, new tests
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
gearbox/trunk/src/gbxutilacfr/trivialstatus.h
Added Paths:
-----------
gearbox/trunk/src/gbxutilacfr/test/trivialstatustest.cpp
gearbox/trunk/src/gbxutilacfr/test/trivialtracertest.cpp
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-29 12:25:17 UTC (rev 357)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-30 07:10:32 UTC (rev 358)
@@ -167,35 +167,34 @@
virtual ~Status() {};
/*!
- Adds subsystem to the system status monitor. This command must be called before any
- other. I.e. all other status commands are ignored unless a subsystem with that name
- already exists. When trying to add a subsystem with an existing name, the existing
- subsystem is left unchanged and warning trace is produced.
+ Adds a new subsystem to the system status descriptor. This command must be called before actually
+ modifying the subsystem status, i.e. all other status commands will raise an exception if a subsystem with
+ that name does not already exists.
+
+ An Exception is also raised when trying to add a subsystem with an existing name.
- May also specify the maximum expected interval between heartbeats.
- When time since last heartbeat exceeds this, an alarm is raised. Heartbeat interval is normally
- positive, measured in seconds. Negative interval means infinite interval, this is the default behavior.
+ It is also possible to specify the maximum expected interval between heartbeats. See setMaxHeartbeatInterval()
+ for details.
- The initial state of the subsystem is Initialising.
+ The initial status of the new subsystem is the same as produced by the empty constructor of SubsystemStatus.
*/
virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 )=0;
- //! Removes subsystem from the status monitor. This should be done for example, if one of
- //! the thread is shutting down or restarting.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Removes a subsystem from the status descriptor.
+ //! Throws Exception if the subsystem does not exist.
virtual void removeSubsystem( const std::string& subsystem )=0;
//! Returns a list of subsystem names.
virtual std::vector<std::string> subsystems()=0;
- //! Returns status of subsystem with the given name.
- //! Throws gbxutilacfr::Exception when the specified subsystem does not exist.
+ //! Returns status of the subsystem with the given name.
+ //! Throws Exception when the specified subsystem does not exist.
virtual SubsystemStatus subsystemStatus( const std::string& subsystem )=0;
//! Modifies maximum expected interval between heartbeats (in seconds).
- //! When time since last heartbeat exceeds this, alarm is raised.
+ //! When time since the last heartbeat exceeds the specified value, the subsystem is considered stalled.
//! Negative interval means infinite interval.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Throws Exception if the subsystem does not exist.
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double intervalSec )=0;
//
@@ -204,36 +203,39 @@
//! Sets the status of a subsystem (both state and health) in an atomic operation. Use this method
//! when both state and health have changed.
+ //! Throws Exception if the subsystem does not exist.
virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& message="" )=0;
//
// STATE CHANGES
//
- //! Sets state of the subsystem to Initialising. Note that empty message is assumed if none is supplied.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Sets state of the subsystem to Initialising. The old message is cleared if a new one is not supplied.
+ //! Throws Exception if the subsystem does not exist.
virtual void initialising( const std::string& subsystem, const std::string& message="" )=0;
- //! Sets state of the subsystem to Working. Note that empty message is assumed if none is supplied.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+
+ //! Sets state of the subsystem to Working. The old message is cleared if a new one is not supplied.
+ //! Throws Exception if the subsystem does not exist.
virtual void working( const std::string& subsystem, const std::string& message="" )=0;
- //! Sets state of the subsystem to Finalising. Note that empty message is assumed if none is supplied.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+
+ //! Sets state of the subsystem to Finalising. The old message is cleared if a new one is not supplied.
+ //! Throws Exception if the subsystem does not exist.
virtual void finalising( const std::string& subsystem, const std::string& message="" )=0;
//
// HEALTH CHANGES
//
- //! Sets subsystem health to Ok. Note that empty message is assumed if none is supplied.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Sets subsystem health to Ok. The old message is cleared if a new one is not supplied.
+ //! Throws Exception if the subsystem does not exist.
virtual void ok( const std::string& subsystem, const std::string& message="" )=0;
//! Sets subsystem health to Warning.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Throws Exception if the subsystem does not exist.
virtual void warning( const std::string& subsystem, const std::string& message )=0;
//! Sets subsystem health to Fault.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Throws Exception if the subsystem does not exist.
virtual void fault( const std::string& subsystem, const std::string& message )=0;
//
@@ -242,15 +244,19 @@
//! Record heartbeat from a subsystem: let Status know the subsystem is alive without
//! modifying its status.
- //! Throws gbxutilacfr::Exception if the subsystem does not exist.
+ //! Throws Exception if the subsystem does not exist.
virtual void heartbeat( const std::string& subsystem )=0;
+ //! Change the human-readable message for a subsystem but keep the previous state and health information.
+ //! Throws Exception if the subsystem does not exist.
+ virtual void message( const std::string& subsystem, const std::string& message )=0;
+
//
// Utility
//
- //! Some thread must call this function periodically in order for
- //! status publishing to happen and stalls identified.
+ //! This function must be called periodically in order for
+ //! status publishing to happen and stalled susbsystems identified.
virtual void process()=0;
};
Modified: gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt 2008-10-29 12:25:17 UTC (rev 357)
+++ gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt 2008-10-30 07:10:32 UTC (rev 358)
@@ -7,3 +7,9 @@
ADD_EXECUTABLE( tokenisetest tokenisetest.cpp )
GBX_ADD_TEST( GbxUtilAcfrTokeniseTest tokenisetest )
+
+ADD_EXECUTABLE( trivialtracertest trivialtracertest.cpp )
+GBX_ADD_TEST( GbxUtilAcfrTrivialTracerTest trivialtracertest )
+
+ADD_EXECUTABLE( trivialstatustest trivialstatustest.cpp )
+GBX_ADD_TEST( GbxUtilAcfrTrivialStatusTest trivialstatustest )
Added: gearbox/trunk/src/gbxutilacfr/test/trivialstatustest.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/test/trivialstatustest.cpp (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/test/trivialstatustest.cpp 2008-10-30 07:10:32 UTC (rev 358)
@@ -0,0 +1,72 @@
+/*
+ * 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 <cstdlib>
+#include <gbxutilacfr/trivialtracer.h>
+#include <gbxutilacfr/trivialstatus.h>
+#include <gbxutilacfr/exceptions.h>
+
+using namespace std;
+
+int main(int argc, char * argv[])
+{
+ gbxutilacfr::TrivialTracer tracer;
+
+ gbxutilacfr::TrivialStatus status( tracer );
+
+ cout<<"setMaxHeartbeatInterval on non-existent subsystems ...";
+ try {
+ status.setMaxHeartbeatInterval( "core", 10 );
+ }
+ catch ( const gbxutilacfr::Exception& e ) {
+ // ok
+ }
+ cout<<"ok"<<endl;
+
+ cout<<"adding subsystem ...";
+ status.addSubsystem( "core", 10 );
+
+ // not calling subsystems(), it throws
+
+ // not calling subsystemStatus(), it throws
+
+ status.setMaxHeartbeatInterval( "core", 20 );
+ status.initialising( "core", "holding fingers crossed" );
+
+ // this one should not appear
+ status.initialising( "core", "holding fingers crossed" );
+ status.initialising( "core", "still holding fingers crossed" );
+ status.heartbeat( "core" );
+
+ status.warning( "core", "all is weird" );
+ status.warning( "core", "all is weird" );
+ status.warning( "core", "still all is weird" );
+
+ status.fault( "core", "all is bad" );
+ status.fault( "core", "all is bad" );
+ status.fault( "core", "still all is bad" );
+
+ status.ok( "core", "all is good again" );
+ status.ok( "core" );
+ // this one will not get traced!
+ status.ok( "core" );
+
+ status.working( "core" );
+
+ status.finalising( "core" );
+
+ // should delete and start complaining again
+ cout<<"removing existing subsystem ...";
+ status.removeSubsystem( "core" );
+ cout<<"ok"<<endl;
+
+ return EXIT_SUCCESS;
+}
Added: gearbox/trunk/src/gbxutilacfr/test/trivialtracertest.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/test/trivialtracertest.cpp (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/test/trivialtracertest.cpp 2008-10-30 07:10:32 UTC (rev 358)
@@ -0,0 +1,32 @@
+/*
+ * 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 <cstdlib>
+#include <gbxutilacfr/trivialtracer.h>
+
+using namespace std;
+
+int main(int argc, char * argv[])
+{
+ cout<<"testing TrivialTracer() without props ..."<<endl;
+ gbxutilacfr::TrivialTracer tracer;
+ cout<<"ok"<<endl;
+
+ string message = "when you don't have anything nice to say...";
+
+ tracer.print( message );
+ tracer.info( message );
+ tracer.warning( message );
+ tracer.error( message );
+ tracer.debug( message );
+
+ return EXIT_SUCCESS;
+}
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-10-29 12:25:17 UTC (rev 357)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-10-30 07:10:32 UTC (rev 358)
@@ -32,17 +32,13 @@
void
TrivialStatus::addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec )
{
- stringstream ss;
- ss << "TrivialStatus::setMaxHeartbeatInterval(): Adding new subsystem: '"<<subsystem<<"'";
- tracer_.debug( ss.str() );
+ tracer_.warning( "TrivialStatus: this implementation of Status does not store status of the subsystems" );
}
void
TrivialStatus::removeSubsystem( const std::string& subsystem )
{
- stringstream ss;
- ss << "TrivialStatus::removeSubsystem(): Removing existing subsystem: '"<<subsystem<<"'";
- tracer_.debug( ss.str() );
+ tracer_.warning( "TrivialStatus: this implementation of Status does not store status of the subsystems" );
}
std::vector<std::string>
@@ -54,87 +50,128 @@
SubsystemStatus
TrivialStatus::subsystemStatus( const std::string& subsystem )
{
- throw Exception( ERROR_INFO, "This implementation of Status does not store status of the subsystems" );
+ throw Exception( ERROR_INFO, "TrivialStatus: this implementation of Status does not store status of the subsystems" );
}
void
TrivialStatus::setMaxHeartbeatInterval( const std::string& subsystem, double maxHeartbeatIntervalSec )
{
+ // does nothing
}
void
-TrivialStatus::setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& message )
+TrivialStatus::setSubsystemStatus( const std::string& subsystem, gbxutilacfr::SubsystemState state,
+ gbxutilacfr::SubsystemHealth health, const std::string& msg )
{
- string trace = "TrivialStatus: subsystem "+subsystem+" changed state to "+gbxutilacfr::toString(state)+" with health "+gbxutilacfr::toString(health);
- if (!message.empty() )
- trace =+ ": '" + message + "'";
- tracer_.info( trace );
+ internalSetStatus( subsystem, state, health, msg );
}
void
-TrivialStatus::initialising( const std::string& subsystem, const std::string& message )
+TrivialStatus::initialising( const std::string& subsystem, const std::string& msg )
{
- if ( stateChange_ ) {
- string trace = "TrivialStatus: subsystem "+subsystem+" changed state to Initialising";
- if (!message.empty() )
- trace =+ " and message: '" + message + "'";
- tracer_.info( trace );
- }
+ internalSetStatus( subsystem, gbxutilacfr::SubsystemInitialising, (gbxutilacfr::SubsystemHealth)-1, msg );
}
void
-TrivialStatus::working( const std::string& subsystem, const std::string& message )
+TrivialStatus::working( const std::string& subsystem, const std::string& msg )
{
- if ( stateChange_ ) {
- string trace = "TrivialStatus: subsystem "+subsystem+" changed state to Working";
- if (!message.empty() )
- trace =+ ": '" + message + "'";
- tracer_.info( trace );
- }
+ internalSetStatus( subsystem, gbxutilacfr::SubsystemWorking, (gbxutilacfr::SubsystemHealth)-1, msg );
}
void
-TrivialStatus::finalising( const std::string& subsystem, const std::string& message )
+TrivialStatus::finalising( const std::string& subsystem, const std::string& msg )
{
- if ( stateChange_ ) {
- string trace = "TrivialStatus: subsystem "+subsystem+" changed state to Finalising";
- if (!message.empty() )
- trace =+ ": '" + message + "'";
- tracer_.info( trace );
- }
+ internalSetStatus( subsystem, gbxutilacfr::SubsystemFinalising, (gbxutilacfr::SubsystemHealth)-1, msg );
}
void
-TrivialStatus::ok( const std::string& subsystem, const std::string& message )
+TrivialStatus::ok( const std::string& subsystem, const std::string& msg )
{
- if ( ok_ && !message.empty() )
- tracer_.info( "TrivialStatus: "+subsystem+" is ok : '"+message+"'" );
+ internalSetStatus( subsystem, (gbxutilacfr::SubsystemState)-1, gbxutilacfr::SubsystemOk, msg );
}
void
-TrivialStatus::warning( const std::string& subsystem, const std::string& message )
+TrivialStatus::warning( const std::string& subsystem, const std::string& msg )
{
- if ( warn_ )
- tracer_.warning( "TrivialStatus: "+subsystem+" issued warning : '"+message+"'" );
+ internalSetStatus( subsystem, (gbxutilacfr::SubsystemState)-1, gbxutilacfr::SubsystemWarning, msg );
}
void
-TrivialStatus::fault( const std::string& subsystem, const std::string& message )
+TrivialStatus::fault( const std::string& subsystem, const std::string& msg )
{
- if ( fault_ )
- tracer_.error( "TrivialStatus: "+subsystem+" issued fault : '"+message+"'" );
+ internalSetStatus( subsystem, (gbxutilacfr::SubsystemState)-1, gbxutilacfr::SubsystemFault, msg );
}
void
TrivialStatus::heartbeat( const std::string& subsystem )
{
- if ( heartbeat_ )
- tracer_.info( "TrivialStatus: heartbeat for subsystem "+subsystem );
+ internalSetStatus( subsystem, (gbxutilacfr::SubsystemState)-1, (gbxutilacfr::SubsystemHealth)-1 );
}
+
+void
+TrivialStatus::message( const std::string& subsystem, const std::string& msg )
+{
+ internalSetStatus( subsystem, (gbxutilacfr::SubsystemState)-1, (gbxutilacfr::SubsystemHealth)-1, msg );
+}
void
+TrivialStatus::internalSetStatus( const std::string& subsystemName, gbxutilacfr::SubsystemState state,
+ gbxutilacfr::SubsystemHealth health, const std::string& msg )
+{
+ assert( state!=gbxutilacfr::SubsystemIdle && "Idle state should not be reported from within the subsystem" );
+ assert( health!=gbxutilacfr::SubsystemStalled && "Stalled health should not be reported from within the subsystem" );
+
+ // if this is a heartbeat, do nothing else
+ if ( state<0 && health<0 && msg.empty() )
+ return;
+
+ bool traceState = true;
+ // don't trace if we don't know it
+ if ( state < 0 )
+ traceState = false;
+
+ bool traceHealth = true;
+ // don't trace if we don't know it
+ if ( health < 0 )
+ traceHealth = false;
+
+// bool publishStatus = false;
+
+ // give tracer feedback on state
+ if ( traceState )
+ tracer_.info( "Subsystem '"+subsystemName+"' changed state to "+gbxutilacfr::toString(state) );
+
+ // give tracer feedback on status
+ if ( traceHealth )
+ {
+ string trace = "Subsystem '"+subsystemName
+ +"' status="+gbxutilacfr::toString(state)+"/"+gbxutilacfr::toString(health);
+ if ( !msg.empty() )
+ trace =+ ": "+msg;
+ switch ( health )
+ {
+ case gbxutilacfr::SubsystemOk :
+ tracer_.info( trace );
+ break;
+ case gbxutilacfr::SubsystemWarning :
+ tracer_.warning( trace );
+ break;
+ case gbxutilacfr::SubsystemFault :
+ case gbxutilacfr::SubsystemStalled :
+ tracer_.error( trace );
+ break;
+ }
+ }
+
+ // publish updated status
+// if ( publishStatus )
+// localPublish();
+}
+
+void
TrivialStatus::process()
{
+ // cannot determine stalls because we are not tracking subsystem status
}
}
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-10-29 12:25:17 UTC (rev 357)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-10-30 07:10:32 UTC (rev 358)
@@ -39,21 +39,25 @@
virtual SubsystemStatus subsystemStatus( const std::string& subsystem );
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double interval );
- virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& message="" );
+ virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& msg="" );
- virtual void initialising( const std::string& subsystem, const std::string& message="" );
- virtual void working( const std::string& subsystem, const std::string& message="" );
- virtual void finalising( const std::string& subsystem, const std::string& message="" );
+ virtual void initialising( const std::string& subsystem, const std::string& msg="" );
+ virtual void working( const std::string& subsystem, const std::string& msg="" );
+ virtual void finalising( const std::string& subsystem, const std::string& msg="" );
- virtual void ok( const std::string& subsystem, const std::string& message="" );
- virtual void warning( const std::string& subsystem, const std::string& message );
- virtual void fault( const std::string& subsystem, const std::string& message );
+ virtual void ok( const std::string& subsystem, const std::string& msg="" );
+ virtual void warning( const std::string& subsystem, const std::string& msg );
+ virtual void fault( const std::string& subsystem, const std::string& msg );
virtual void heartbeat( const std::string& subsystem );
+ virtual void message( const std::string& subsystem, const std::string& msg );
virtual void process();
private:
+ void internalSetStatus( const std::string& subsystem, gbxutilacfr::SubsystemState state,
+ gbxutilacfr::SubsystemHealth health, const std::string& msg="" );
+
Tracer& tracer_;
bool stateChange_;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|