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: <gb...@us...> - 2011-06-10 01:04:21
|
Revision: 532
http://gearbox.svn.sourceforge.net/gearbox/?rev=532&view=rev
Author: gbiggs
Date: 2011-06-10 01:04:14 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
Fixed FindBoost usage
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h
gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/scan_data.h
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
gearbox/trunk/src/hokuyo_aist/sensor_info.h
gearbox/trunk/src/hokuyo_aist/test/example.cpp
gearbox/trunk/src/hokuyo_aist/utils.h
gearbox/trunk/submitted/CMakeLists.txt
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt 2011-06-10 01:04:14 UTC (rev 532)
@@ -17,9 +17,7 @@
LINK_DIRECTORIES (${Boost_LIBRARY_DIRS})
if(Boost_PYTHON_FOUND)
- GET_FILENAME_COMPONENT (boostPythonLib ${Boost_PYTHON_LIBRARY} NAME_WE CACHE)
- # Chop off the lib at the front, too, if present
- STRING (REGEX REPLACE "^lib" "" boostPythonLib ${boostPythonLib})
+ set(boostPythonLib ${Boost_PYTHON_LIBRARY})
else(Boost_PYTHON_FOUND)
MESSAGE (STATUS
"Boost::Python library was not found. Cannot build Python bindings for Hokuyo_aist.")
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.h 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
@@ -34,7 +34,6 @@
#include <cstdio>
#include <cerrno>
#include <cmath>
-#include <unistd.h>
#include <sstream>
#include <iostream>
#include <iomanip>
@@ -42,7 +41,10 @@
#include <fstream>
#if defined(WIN32)
+ #include <windows.h> // For Sleep()
#define __func__ __FUNCTION__
+#else
+ #include <unistd.h>
#endif
namespace hokuyo_aist
@@ -908,11 +910,16 @@
if(skew_sleep_time > 0)
{
// Sleep, then do it again to approximate a skew line
+ if(verbose_)
+ err_output_ << "Sleeping for " << skew_sleep_time << "s.\n";
+#if defined(WIN32)
+ DWORD sleep_time = skew_sleep_time * 1000;
+ Sleep(sleep_time);
+#else
struct timespec sleep_time = {0, 0};
sleep_time.tv_sec = skew_sleep_time;
- if(verbose_)
- err_output_ << "Sleeping for " << skew_sleep_time << "s.\n";
nanosleep(&sleep_time, NULL);
+#endif
if(verbose_)
err_output_ << "Gathering " << samples << " offset values.\n";
@@ -1862,10 +1869,16 @@
clock_gettime(CLOCK_REALTIME, &ts);
return ts.tv_sec * 1e9 + ts.tv_nsec;
#else
+#if defined(WIN32)
+ SYSTEMTIME sys_time;
+ GetSystemTime(&sys_time);
+ return sys_time.wSecond * 1e9 + sys_time.wMilliseconds * 1e3;
+#else
struct timeval tv;
gettimeofday(&tv, 0);
return tv.tv_sec * 1e9 + tv.tv_usec * 1e3;
#endif
+#endif
}
Modified: gearbox/trunk/src/hokuyo_aist/sensor.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.h 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/sensor.h 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.h 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
@@ -35,7 +35,7 @@
bool get_intensities(false), get_new(false), verbose(false);
#if defined(WIN32)
- port_options = "type=serial,device=COM3,timeout=1";
+ port_options = "type=serial,device=COM4,timeout=1";
#else
int opt;
// Get some options from the command line
Modified: gearbox/trunk/src/hokuyo_aist/utils.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/utils.h 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/src/hokuyo_aist/utils.h 2011-06-10 01:04:14 UTC (rev 532)
@@ -9,7 +9,7 @@
* LICENSE file included in this distribution.
*
* This work is a product of the National Institute of Advanced Industrial
- * Science and Technology, Japan. Registration number: H22PRO-1086.
+ * Science and Technology, Japan. Registration number: H22PRO-1195.
*
* This file is part of hokuyo_aist.
*
Modified: gearbox/trunk/submitted/CMakeLists.txt
===================================================================
--- gearbox/trunk/submitted/CMakeLists.txt 2010-11-05 02:28:37 UTC (rev 531)
+++ gearbox/trunk/submitted/CMakeLists.txt 2011-06-10 01:04:14 UTC (rev 532)
@@ -1,6 +1,6 @@
# Libraries submitted for consideration for inclusion in Gearbox.
-OPTION ( GBX_BUILD_SUBMITTED "Build submitted libraries" OFF )
+OPTION ( GBX_BUILD_SUBMITTED "Build submitted libraries" ON )
MARK_AS_ADVANCED ( FORCE GBX_BUILD_SUBMITTED )
if( GBX_BUILD_SUBMITTED )
@@ -10,5 +10,6 @@
# When adding new directories, please maintain order of inter-dependencies.
# Otherwise, maintain alphabetical order.
# E.g. add_subdirectory( mydir )
+ add_subdirectory( ekfvloc )
endif( GBX_BUILD_SUBMITTED )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:28:43
|
Revision: 531
http://gearbox.svn.sourceforge.net/gearbox/?rev=531&view=rev
Author: gbiggs
Date: 2010-11-05 02:28:37 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Post-release trunk
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2010-11-05 02:26:04 UTC (rev 530)
+++ gearbox/trunk/CMakeLists.txt 2010-11-05 02:28:37 UTC (rev 531)
@@ -13,7 +13,7 @@
#
set( GBX_PROJECT_VERSION_MAJOR "10" )
set( GBX_PROJECT_VERSION_MINOR "11" )
-set( GBX_PROJECT_VERSION_PATCH "0" )
+set( GBX_PROJECT_VERSION_PATCH "+" )
set( GBX_PROJECT_VERSION
${GBX_PROJECT_VERSION_MAJOR}.${GBX_PROJECT_VERSION_MINOR}.${GBX_PROJECT_VERSION_PATCH} )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:26:10
|
Revision: 530
http://gearbox.svn.sourceforge.net/gearbox/?rev=530&view=rev
Author: gbiggs
Date: 2010-11-05 02:26:04 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Tagging release 10.11
Added Paths:
-----------
gearbox/tags/RELEASE_10.11/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:25:22
|
Revision: 529
http://gearbox.svn.sourceforge.net/gearbox/?rev=529&view=rev
Author: gbiggs
Date: 2010-11-05 02:25:16 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Updated release instructions
Modified Paths:
--------------
gearbox/trunk/doc/release_instructions.dox
Modified: gearbox/trunk/doc/release_instructions.dox
===================================================================
--- gearbox/trunk/doc/release_instructions.dox 2010-11-05 02:24:47 UTC (rev 528)
+++ gearbox/trunk/doc/release_instructions.dox 2010-11-05 02:25:16 UTC (rev 529)
@@ -21,7 +21,7 @@
-# On a machine that doesn't build regularly:
-# Blow away old installation.
-# Check out clean copy.
- -# Modify the project version in the top-level CMakeLists.txt file.
+ -# Modify the project version in the top-level CMakeLists.txt file (remember to change + to 0 in the patch value).
-# Modify the 'news' section in the 'index.dox' file.
-# (Possibly) delete retired directory.
-# Update LICENSE information by running cmake with GBX_BUILD_LICENSE=ON.
@@ -32,9 +32,11 @@
@verbatim
$ svn copy https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/trunk https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/tags/RELEASE_9.02 -m 'Tagging release 9.02'
@endverbatim
- -# Delete all .svn directories (eg with 'find . -name .svn | xargs rm -rf')
- -# Delete @c build directory, if exists.
- -# Create tar-ball, named eg. 'gearbox-9.02.tar.gz'
+ -# Export a copy of the tag, e.g. with:
+@verbatim
+$ svn export https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/tags/RELEASE_9.02 gearbox-9.02
+@endverbatim
+ -# Create tarball from this exported directory, named eg. 'gearbox-9.02.tar.gz'
-# Now the tar-ball is ready to roll. But first test that the original untars and builds cleanly.
-# Copy the tar-ball to a machine with external access.
-# Create a new distro through the sourceforge web interface
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:24:53
|
Revision: 528
http://gearbox.svn.sourceforge.net/gearbox/?rev=528&view=rev
Author: gbiggs
Date: 2010-11-05 02:24:47 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Release version
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2010-11-05 02:24:12 UTC (rev 527)
+++ gearbox/trunk/CMakeLists.txt 2010-11-05 02:24:47 UTC (rev 528)
@@ -13,7 +13,7 @@
#
set( GBX_PROJECT_VERSION_MAJOR "10" )
set( GBX_PROJECT_VERSION_MINOR "11" )
-set( GBX_PROJECT_VERSION_PATCH "+" )
+set( GBX_PROJECT_VERSION_PATCH "0" )
set( GBX_PROJECT_VERSION
${GBX_PROJECT_VERSION_MAJOR}.${GBX_PROJECT_VERSION_MINOR}.${GBX_PROJECT_VERSION_PATCH} )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:24:18
|
Revision: 527
http://gearbox.svn.sourceforge.net/gearbox/?rev=527&view=rev
Author: gbiggs
Date: 2010-11-05 02:24:12 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Bad version number
Removed Paths:
-------------
gearbox/tags/RELEASE_10.11/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:19:12
|
Revision: 526
http://gearbox.svn.sourceforge.net/gearbox/?rev=526&view=rev
Author: gbiggs
Date: 2010-11-05 02:19:06 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Tagging release 10.11
Added Paths:
-----------
gearbox/tags/RELEASE_10.11/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-11-05 02:18:27
|
Revision: 525
http://gearbox.svn.sourceforge.net/gearbox/?rev=525&view=rev
Author: gbiggs
Date: 2010-11-05 02:18:21 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Preparing for release 10.11
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
gearbox/trunk/doc/history.dox
gearbox/trunk/doc/index.dox
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2010-10-29 07:40:33 UTC (rev 524)
+++ gearbox/trunk/CMakeLists.txt 2010-11-05 02:18:21 UTC (rev 525)
@@ -11,7 +11,7 @@
#
# project version
#
-set( GBX_PROJECT_VERSION_MAJOR "9" )
+set( GBX_PROJECT_VERSION_MAJOR "10" )
set( GBX_PROJECT_VERSION_MINOR "11" )
set( GBX_PROJECT_VERSION_PATCH "+" )
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2010-10-29 07:40:33 UTC (rev 524)
+++ gearbox/trunk/doc/history.dox 2010-11-05 02:18:21 UTC (rev 525)
@@ -29,6 +29,16 @@
@par Project wide
+@par New libraries
+
+@par Updated libraries
+
+@par Retired libraries
+
+@section gbx_doc_history_1011 Changes in Release 10.11
+
+@par Project wide
+
- Build system
- GBX_REQUIRE_LIB macro now uses a direct check for target existence.
- new GBX_ADD_HEADER_ONLY_LIBRARY macro for handling dependencies on header-only libraries.
@@ -53,9 +63,9 @@
- New, easier-to-use exceptions hierarchy.
- Added support for new lasers to hokuyo_aist, including new UXM-30LX-E.
- Added support for new SCIP 2.2 commands and multi-echo data.
- - Added algorithm to calibrate the laser's clock against system time, providing considerably more accurate time stamps in laser data.
+ - Added algorithm to calibrate the laser's clock against system time (including communications delay), providing considerably more accurate time stamps in laser data.
- Laser model detection and reporting.
- - Significant improvements in data reading efficiency. CPU usage has been cut considerably. Reading a URG-04LX (10Hz refresh rate) has dropped from 2%-3% usage down to somewhere between 0% and 1%. Reading a UTM-30LX (40Hz refresh rate) has dropped from 13% down to 1%. Tests were on an Intel Q6600 with no system load. No statistically significant change in the time to read was observed.
+ - Significant improvements in data reading efficiency. CPU usage has been cut considerably. Reading a URG-04LX (10Hz refresh rate) has dropped from 2%-3% usage down to somewhere between 0% and 1%. Reading a UTM-30LX (40Hz refresh rate) has dropped from 13% down to 1%. Tests were on an Intel Q6600 with no system load. No statistically significant change in the time to read on an unloaded CPU was observed.
@par Retired libraries
Modified: gearbox/trunk/doc/index.dox
===================================================================
--- gearbox/trunk/doc/index.dox 2010-10-29 07:40:33 UTC (rev 524)
+++ gearbox/trunk/doc/index.dox 2010-11-05 02:18:21 UTC (rev 525)
@@ -45,6 +45,7 @@
@section gbx_doc_index_news News
+- 05-Nov-10 Release 10.11. Major revision of the hokuyo_aist library, with a new API and support for new laser scanners. (@ref gbx_doc_history_1011)
- 18-Nov-09 Release 9.11. Several bug fixes in the libraries, build system cleanup to be packaged for Fedora. (@ref gbx_doc_history_911)
- 10-Jul-09 Release 9.07. Several bug fixes in the libraries, and the new ability for the flexiport library's UDP port type to handle broadcast data. (@ref gbx_doc_history_907)
- 18-Feb-09 Release 9.02. One new driver and a few updates in other libraries. (@ref gbx_doc_history_902)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-10-29 07:40:39
|
Revision: 524
http://gearbox.svn.sourceforge.net/gearbox/?rev=524&view=rev
Author: gbiggs
Date: 2010-10-29 07:40:33 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
Major improvements to data reading efficiency.
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2010-10-28 09:12:53 UTC (rev 523)
+++ gearbox/trunk/doc/history.dox 2010-10-29 07:40:33 UTC (rev 524)
@@ -55,6 +55,7 @@
- Added support for new SCIP 2.2 commands and multi-echo data.
- Added algorithm to calibrate the laser's clock against system time, providing considerably more accurate time stamps in laser data.
- Laser model detection and reporting.
+ - Significant improvements in data reading efficiency. CPU usage has been cut considerably. Reading a URG-04LX (10Hz refresh rate) has dropped from 2%-3% usage down to somewhere between 0% and 1%. Reading a UTM-30LX (40Hz refresh rate) has dropped from 13% down to 1%. Tests were on an Intel Q6600 with no system load. No statistically significant change in the time to read was observed.
@par Retired libraries
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2010-10-28 09:12:53 UTC (rev 523)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2010-10-29 07:40:33 UTC (rev 524)
@@ -25,5 +25,11 @@
#include "scan_data.h"
#include "sensor.h"
+// TODO: The line reading code is suffering from age. It is getting bloated and
+// complicated, not to mention slow. Reading the range data has been switched
+// to an improved method. The rest of the reads need to be moved to this new
+// method. Not urgent as only the range data needs to be read really
+// efficiently.
+
#endif // HOKUYO_AIST_H__
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp 2010-10-28 09:12:53 UTC (rev 523)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp 2010-10-29 07:40:33 UTC (rev 524)
@@ -317,6 +317,7 @@
/* 35 */ "SCIP version 1 does not support the semi-reset command.",
/* 36 */ "SCIP version 1 does not support the get ranges and intensities command.",
/* 37 */ "Error configuring IP address.",
+/* 38 */ "Did not receive a full line."
};
return std::string(descriptions[code]);
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-10-28 09:12:53 UTC (rev 523)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-10-29 07:40:33 UTC (rev 524)
@@ -52,6 +52,8 @@
unsigned int const SCIP1_LINE_LENGTH = 66;
// SCIP2: 67 bytes (64 bytes of data + checksum byte + line feed + 0)
unsigned int const SCIP2_LINE_LENGTH = 67;
+// Size of a full data block in range data
+unsigned int const DATA_BLOCK_LENGTH = 64;
///////////////////////////////////////////////////////////////////////////////
// SCIP protocol version 1 notes
@@ -1389,7 +1391,10 @@
// not the 0 (although the buffer still has to include this).
// If expected_length is -1, this function expects buffer to be a certain length
// to allow up to the maximum line length to be read. See SCIP1_LINE_LENGTH and
-// SCIP2_LINE_LENGTH.
+// SCIP2_LINE_LENGTHr
+// If fast is true, Read() will be called instead of ReadLine(), which should
+// result in a faster, less CPU-intensive read. This is used, for example, when
+// reading the range data.
// The line feed that terminates a line will be replaced with a 0.
// The return value is the number of bytes received, not including the 0
// byte or the line feed.
@@ -1436,8 +1441,8 @@
{
err_output_ << "Sensor::" << __func__ << "() Read " << linelength <<
" bytes.\n";
- err_output_ << "Sensor::" << __func__ << "() Line is " << buffer <<
- '\n';
+ err_output_ << "Sensor::" << __func__ << "() Line is '" << buffer <<
+ "'\n";
}
return linelength - 1; // Line feed not included
}
@@ -1488,10 +1493,10 @@
if(bytesToConsider < 1)
throw InsufficientBytesError(bytesToConsider, linelength);
- int checkSum = 0;
+ int checksum = 0;
try
{
- checkSum = confirm_checksum(buffer, bytesToConsider,
+ checksum = confirm_checksum(buffer, bytesToConsider,
static_cast<int>(buffer[checksumIndex]));
}
catch(ProtocolError& e)
@@ -1516,7 +1521,7 @@
linelength);
}
- checkSum = confirm_checksum(buffer, newBytesToConsider,
+ checksum = confirm_checksum(buffer, newBytesToConsider,
static_cast<int>(buffer[checksumIndex]));
}
else
@@ -1535,6 +1540,88 @@
}
+// Data blocks are treated as a special case of lines. This allows us to easily
+// implement a faster read with less condition checks, as the format is more
+// uniform.
+// Returns true if the read data block was not a full data block, and thus is
+// the end of the data.
+bool Sensor::read_data_block(char* buffer, int& block_size)
+{
+ bool is_last(false);
+
+ if(verbose_)
+ {
+ err_output_ << "Sensor::" << __func__ << "() Reading exactly " <<
+ DATA_BLOCK_LENGTH + 2 << " bytes.\n";
+ }
+ // Read up to DATA_BLOCK_SIZE + 1 (checksum) + 1 (line feed) bytes,
+ // stopping as soon as a read puts a new line on the end
+ block_size = 0;
+ int read_goal = DATA_BLOCK_LENGTH + 2;
+ while (block_size < read_goal)
+ {
+ int bytes_read(0);
+ if((bytes_read = port_->Read(&buffer[block_size],
+ read_goal - block_size)) < 0)
+ {
+ throw ReadError(0);
+ }
+ else if(bytes_read == 0)
+ {
+ throw ReadError(1);
+ }
+ block_size += bytes_read;
+ if (buffer[block_size - 1] == '\n')
+ {
+ // New line = end of data line
+ break;
+ }
+ }
+ if(verbose_)
+ {
+ err_output_ << "Sensor::" << __func__ << "() Read " << block_size <<
+ " bytes.\n";
+ err_output_ << "Sensor::" << __func__ << "() Line is '" << buffer <<
+ "'\n";
+ }
+ // The data block should finish with one or two new lines. If it finishes
+ // with two, this is the last data block.
+ if (buffer[block_size - 1] != '\n')
+ {
+ throw ReadError(38);
+ }
+ buffer[block_size - 1] = '\0';
+ block_size -= 1; // Remove the new line
+ if (buffer[block_size - 1] == '\n')
+ {
+ if (verbose_)
+ {
+ err_output_ << "Sensor::" << __func__ << "() Found last block.\n";
+ }
+ is_last = true;
+ buffer[block_size - 1] = '\0';
+ block_size -= 1; // So it doesn't get used in the checksum calculation
+ }
+ // Check the checksum, which is the last byte in the block.
+ int bytes_to_consider = block_size - 1;
+ if(verbose_)
+ {
+ err_output_ << "Sensor::" << __func__ << "() Considering " <<
+ bytes_to_consider << " bytes for checksum from a line length of " <<
+ block_size << " bytes.\n";
+ }
+ if(bytes_to_consider < 1)
+ throw InsufficientBytesError(bytes_to_consider, block_size);
+ confirm_checksum(buffer, bytes_to_consider,
+ static_cast<int>(buffer[bytes_to_consider]));
+ // Nullify the checksum
+ buffer[bytes_to_consider] = '\0';
+ block_size -= 1;
+
+ return is_last;
+}
+
+
// Reads lines until the number specified has passed.
void Sensor::skip_lines(int count)
{
@@ -2149,15 +2236,18 @@
// 2 byte data is easy since it fits neatly in a 64-byte block
char buffer[SCIP2_LINE_LENGTH];
- unsigned int current_step = 0;
- int numBytesInLine = 0;
- while(true)
+ unsigned int current_step(0);
+ int numBytesInLine(0);
+ bool done(false);
+ while(!done)
{
// Read a line of data
- numBytesInLine = read_line_with_check(buffer);
+ done = read_data_block(buffer, numBytesInLine);
// Check if we've reached the end of the data
if(numBytesInLine == 0)
- break;
+ {
+ err_output_ << "numBytesInLine is zero!\n";
+ }
// Process pairs of bytes until we encounter the end of the line
for (int ii = 0; ii < numBytesInLine; ii += 2, current_step++)
{
@@ -2202,36 +2292,20 @@
// 3 byte data is a pain because it crosses the line boundary, it may
// overlap by 0, 1 or 2 bytes
char buffer[SCIP2_LINE_LENGTH];
- unsigned int current_step = 0;
- int numBytesInLine = 0, split_count = 0;
+ unsigned int current_step(0);
+ int numBytesInLine(0), split_count(0);
char split_value[3];
int echo_buffer[3] = {-1, -1, -1};
- int echo_buf_ind = 0;
- while(true)
+ int echo_buf_ind(0);
+ bool done(false);
+ while(!done)
{
// Read a line of data
- numBytesInLine = read_line_with_check(buffer);
+ done = read_data_block(buffer, numBytesInLine);
// Check if we've reached the end of the data
if(numBytesInLine == 0)
{
- if(echo_buffer[0] != -1)
- {
- // Not the first value, so deal with the previous
- data.write_range(current_step,
- process_echo_buffer(echo_buffer, echo_buf_ind + 1));
- if(data.ranges_)
- {
- if(data.ranges_[current_step] > max_range_)
- {
- err_output_ << "WARNING: Sensor::" << __func__ <<
- "() Value at step " << current_step <<
- " beyond maximum range: " <<
- data.ranges_[current_step];
- }
- }
- current_step++;
- }
- break;
+ err_output_ << "numBytesInLine is zero!\n";
}
// Process triplets of bytes until we encounter or overrun the end of
// the line
@@ -2265,7 +2339,7 @@
err_output_ << "WARNING: Sensor::" << __func__ <<
"() Value at step " << current_step <<
" beyond maximum range: " <<
- data.ranges_[current_step];
+ data.ranges_[current_step] << '\n';
}
}
current_step++;
@@ -2314,6 +2388,24 @@
}
// End of this line. Go around again.
}
+ // Last little bit of data
+ if(echo_buffer[0] != -1)
+ {
+ // Not the first value, so deal with the previous
+ data.write_range(current_step,
+ process_echo_buffer(echo_buffer, echo_buf_ind + 1));
+ if(data.ranges_)
+ {
+ if(data.ranges_[current_step] > max_range_)
+ {
+ err_output_ << "WARNING: Sensor::" << __func__ <<
+ "() Value at step " << current_step <<
+ " beyond maximum range: " <<
+ data.ranges_[current_step] << '\n';
+ }
+ }
+ current_step++;
+ }
if(verbose_)
err_output_ << "Sensor::" << __func__ << "() Read " <<
@@ -2346,30 +2438,21 @@
// 3 byte data is a pain because it crosses the line boundary, it may
// overlap by 0, 1 or 2 bytes
char buffer[SCIP2_LINE_LENGTH];
- unsigned int current_range = 0, current_intensity = 0;
- int numBytesInLine = 0, split_count = 0;
+ unsigned int current_range(0), current_intensity(0);
+ int numBytesInLine(0), split_count(0);
char split_value[3];
- bool nextIsIntensity = false;
+ bool nextIsIntensity(false);
int echo_buffer[3] = {-1, -1, -1};
- int echo_buf_ind = 0;
- while(true)
+ int echo_buf_ind(0);
+ bool done(false);
+ while(!done)
{
// Read a line of data
- numBytesInLine = read_line_with_check(buffer);
+ done = read_data_block(buffer, numBytesInLine);
// Check if we've reached the end of the data
if(numBytesInLine == 0)
{
- // The last piece should always be an intensity value (if it isn't
- // then the data count won't add up and an error will be thrown
- // below anyway).
- if(echo_buffer[0] != -1)
- {
- assert(nextIsIntensity == true);
- data.write_intensity(current_intensity,
- process_echo_buffer(echo_buffer, echo_buf_ind + 1));
- current_intensity++;
- }
- break;
+ err_output_ << "numBytesInLine is zero!\n";
}
// Process triplets of bytes until we encounter or overrun the end of
// the line
@@ -2474,6 +2557,16 @@
}
// End of this line. Go around again.
}
+ // The last piece should always be an intensity value (if it isn't
+ // then the data count won't add up and an error will be thrown
+ // below anyway).
+ if(echo_buffer[0] != -1)
+ {
+ assert(nextIsIntensity == true);
+ data.write_intensity(current_intensity,
+ process_echo_buffer(echo_buffer, echo_buf_ind + 1));
+ current_intensity++;
+ }
if(verbose_)
{
Modified: gearbox/trunk/src/hokuyo_aist/sensor.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.h 2010-10-28 09:12:53 UTC (rev 523)
+++ gearbox/trunk/src/hokuyo_aist/sensor.h 2010-10-29 07:40:33 UTC (rev 524)
@@ -514,9 +514,10 @@
float time_skew_alpha_;
void clear_read_buffer();
- int read_line(char* buffer, int expected_length = -1);
- int read_line_with_check(char* buffer, int expected_length = -1,
- bool has_semicolon = false);
+ int read_line(char* buffer, int expected_length=-1);
+ int read_line_with_check(char* buffer, int expected_length=-1,
+ bool has_semicolon=false);
+ bool read_data_block(char* buffer, int& block_size);
void skip_lines(int count);
int send_command(char const* cmd, char const* param, int param_length,
char const* extra_ok);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-10-28 09:12:59
|
Revision: 523
http://gearbox.svn.sourceforge.net/gearbox/?rev=523&view=rev
Author: gbiggs
Date: 2010-10-28 09:12:53 +0000 (Thu, 28 Oct 2010)
Log Message:
-----------
Updated history with changes to hokuyo_aist
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2010-10-28 09:08:54 UTC (rev 522)
+++ gearbox/trunk/doc/history.dox 2010-10-28 09:12:53 UTC (rev 523)
@@ -49,6 +49,12 @@
- libhokuyo_aist:
- Added a useful utility to get a laser's ID and use that to create nodes in /dev. Thanks to Luiz Mirisola.
+ - New version 2.0 API for hokuyo_aist.
+ - New, easier-to-use exceptions hierarchy.
+ - Added support for new lasers to hokuyo_aist, including new UXM-30LX-E.
+ - Added support for new SCIP 2.2 commands and multi-echo data.
+ - Added algorithm to calibrate the laser's clock against system time, providing considerably more accurate time stamps in laser data.
+ - Laser model detection and reporting.
@par Retired libraries
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-10-28 09:09:01
|
Revision: 522
http://gearbox.svn.sourceforge.net/gearbox/?rev=522&view=rev
Author: gbiggs
Date: 2010-10-28 09:08:54 +0000 (Thu, 28 Oct 2010)
Log Message:
-----------
Updated Python bindings to match v2 api
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h
gearbox/trunk/src/hokuyo_aist/python/hokuyo_aist.cpp
gearbox/trunk/src/hokuyo_aist/python/test/hokuyo_aist_example.py
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-09-24 06:17:05 UTC (rev 521)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-10-28 09:08:54 UTC (rev 522)
@@ -52,7 +52,7 @@
add_subdirectory (test)
endif (GBX_BUILD_TESTS)
- option (HOKUYO_AIST_BUILD_BINDINGS "Build the Python bindings for Hokuyo_aist" OFF)
+ option (HOKUYO_AIST_BUILD_BINDINGS "Build the Python bindings for hokuyo_aist" ON)
if (HOKUYO_AIST_BUILD_BINDINGS)
add_subdirectory (python)
endif (HOKUYO_AIST_BUILD_BINDINGS)
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp 2010-09-24 06:17:05 UTC (rev 521)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_errors.cpp 2010-10-28 09:08:54 UTC (rev 522)
@@ -324,23 +324,23 @@
BaseError::BaseError(unsigned int desc_code, char const* error_type)
- : _desc_code(desc_code)
+ : desc_code_(desc_code)
{
- strncpy(_error_type, error_type, 32);
+ strncpy(error_type_, error_type, 32);
}
BaseError::BaseError(BaseError const& rhs)
- : _desc_code(rhs.desc_code())
+ : desc_code_(rhs.desc_code())
{
- strncpy(_error_type, rhs.error_type(), 32);
+ strncpy(error_type_, rhs.error_type(), 32);
}
const char* BaseError::what() throw()
{
- ss << _error_type << " (" << _desc_code << "): " <<
- desc_code_to_string(_desc_code);
+ ss << error_type_ << " (" << desc_code_ << "): " <<
+ desc_code_to_string(desc_code_);
return ss.str().c_str();
}
@@ -348,7 +348,7 @@
const char* BaudrateError::what() throw()
{
RuntimeError::what();
- ss << _baud;
+ ss << baud_;
return ss.str().c_str();
}
@@ -356,7 +356,7 @@
const char* ChecksumError::what() throw()
{
ProtocolError::what();
- ss << "expected " << _expected << ", calculated " << _calculated;
+ ss << "expected " << expected_ << ", calculated " << calculated_;
return ss.str().c_str();
}
@@ -364,21 +364,21 @@
UnknownLineError::UnknownLineError(char const* const line)
: ProtocolError(27, "UnknownLineError")
{
- strncpy(_line, line, 128);
+ strncpy(line_, line, 128);
}
UnknownLineError::UnknownLineError(UnknownLineError const& rhs)
: ProtocolError(rhs)
{
- strncpy(_line, rhs.line(), 128);
+ strncpy(line_, rhs.line(), 128);
}
const char* UnknownLineError::what() throw()
{
ProtocolError::what();
- ss << _line;
+ ss << line_;
return ss.str().c_str();
}
@@ -386,23 +386,23 @@
ParseError::ParseError(char const* const line, char const* const type)
: ProtocolError(28, "ParseError")
{
- strncpy(_line, line, 128);
- strncpy(_type, type, 16);
+ strncpy(line_, line, 128);
+ strncpy(type_, type, 16);
}
ParseError::ParseError(ParseError const& rhs)
: ProtocolError(rhs)
{
- strncpy(_line, rhs.line(), 128);
- strncpy(_type, rhs.type(), 16);
+ strncpy(line_, rhs.line(), 128);
+ strncpy(type_, rhs.type(), 16);
}
const char* ParseError::what() throw()
{
ProtocolError::what();
- ss << "Line type: " << _type << ". Line: " << _line;
+ ss << "Line type: " << type_ << ". Line: " << line_;
return ss.str().c_str();
}
@@ -410,9 +410,9 @@
const char* ResponseError::what() throw()
{
ProtocolError::what();
- ss << " Command: " << _cmd[0] << _cmd[1];
- ss << " Error : (" << _error[0] << _error[1] << ") " <<
- scip2_error_to_string(_error, _cmd);
+ ss << " Command: " << cmd_[0] << cmd_[1];
+ ss << " Error : (" << error_[0] << error_[1] << ") " <<
+ scip2_error_to_string(error_, cmd_);
return ss.str().c_str();
}
@@ -420,8 +420,8 @@
const char* Scip1ResponseError::what() throw()
{
ProtocolError::what();
- ss << " Command: " << _cmd;
- ss << " Error : " << _error;
+ ss << " Command: " << cmd_;
+ ss << " Error : " << error_;
return ss.str().c_str();
}
@@ -429,8 +429,8 @@
const char* CommandEchoError::what() throw()
{
ProtocolError::what();
- ss << " Command: " << _cmd[0] << _cmd[1];
- ss << " Received echo: " << _echo[0] << _echo[1];
+ ss << " Command: " << cmd_[0] << cmd_[1];
+ ss << " Received echo: " << echo_[0] << echo_[1];
return ss.str().c_str();
}
@@ -438,7 +438,7 @@
const char* ParamEchoError::what() throw()
{
ProtocolError::what();
- ss << " Command: " << _cmd[0] << _cmd[1];
+ ss << " Command: " << cmd_[0] << cmd_[1];
return ss.str().c_str();
}
@@ -446,8 +446,8 @@
const char* InsufficientBytesError::what() throw()
{
ProtocolError::what();
- ss << " Number of bytes: " << _num;
- ss << " Line length: " << _line_length;
+ ss << " Number of bytes: " << num_;
+ ss << " Line length: " << line_length_;
return ss.str().c_str();
}
@@ -455,8 +455,8 @@
const char* LineLengthError::what() throw()
{
ProtocolError::what();
- ss << " Received length: " << _length;
- ss << " Expected line length: " << _expected;
+ ss << " Received length: " << length_;
+ ss << " Expected line length: " << expected_;
return ss.str().c_str();
}
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h 2010-09-24 06:17:05 UTC (rev 521)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_errors.h 2010-10-28 09:08:54 UTC (rev 522)
@@ -64,21 +64,21 @@
virtual ~BaseError() throw() {};
virtual unsigned int desc_code() const throw()
- { return _desc_code; }
+ { return desc_code_; }
virtual char const* error_type() const throw()
- { return _error_type; }
+ { return error_type_; }
virtual const char* what() throw();
protected:
/** Description code for use with the error string table. */
- unsigned int _desc_code;
+ unsigned int desc_code_;
/** Formatted description of the error. */
std::stringstream ss;
/** String representation of the error. */
- char _error_type[32];
+ char error_type_[32];
}; //class BaseError
@@ -150,20 +150,20 @@
@param baud The bad baud rate. */
BaudrateError(unsigned int baud)
- : RuntimeError(6, "BaudrateError"), _baud(baud)
+ : RuntimeError(6, "BaudrateError"), baud_(baud)
{}
BaudrateError(BaudrateError const& rhs)
- : RuntimeError(rhs), _baud(rhs.baud())
+ : RuntimeError(rhs), baud_(rhs.baud())
{}
unsigned int baud() const throw()
- { return _baud; }
+ { return baud_; }
const char* what() throw();
protected:
/** Baud rate that caused the error. */
- unsigned int _baud;
+ unsigned int baud_;
}; // class BaudrateError
@@ -343,27 +343,27 @@
@param expected The expected checksum.
@param calculated The calculated checksum. */
ChecksumError(int expected, int calculated)
- : ProtocolError(24, "ChecksumError"), _expected(expected),
- _calculated(calculated)
+ : ProtocolError(24, "ChecksumError"), expected_(expected),
+ calculated_(calculated)
{}
ChecksumError(ChecksumError const& rhs)
- : ProtocolError(rhs), _expected(rhs.expected()),
- _calculated(rhs.calculated())
+ : ProtocolError(rhs), expected_(rhs.expected()),
+ calculated_(rhs.calculated())
{}
virtual int expected() const throw()
- { return _expected; }
+ { return expected_; }
virtual int calculated() const throw()
- { return _calculated; }
+ { return calculated_; }
const char* what() throw();
protected:
/** Expected checksum value. */
- int _expected;
+ int expected_;
/** Calculated checksum value. */
- int _calculated;
+ int calculated_;
}; // class ProtocolError
@@ -398,13 +398,13 @@
UnknownLineError(UnknownLineError const& rhs);
virtual char const* const line() const throw()
- { return _line; }
+ { return line_; }
const char* what() throw();
protected:
/** The mystery line. */
- char _line[128];
+ char line_[128];
}; // class UnknownLineError
@@ -420,18 +420,18 @@
ParseError(ParseError const& rhs);
virtual char const* const line() const throw()
- { return _line; }
+ { return line_; }
virtual char const* const type() const throw()
- { return _type; }
+ { return type_; }
const char* what() throw();
protected:
/** The bad line. */
- char _line[128];
+ char line_[128];
/** The type of line. */
- char _type[16];
+ char type_[16];
}; // class ParseError
@@ -456,33 +456,33 @@
ResponseError(char const* const error, char const* const cmd)
: ProtocolError(30, "ResponseError")
{
- _error[0] = error[0]; _error[1] = error[1];
- _cmd[0] = cmd[0]; _cmd[1] = cmd[1];
+ error_[0] = error[0]; error_[1] = error[1];
+ cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
}
ResponseError(ResponseError const& rhs)
: ProtocolError(rhs)
{
- _error[0] = rhs.error_code()[0];
- _error[1] = rhs.error_code()[1];
- _cmd[0] = rhs.cmd_code()[0];
- _cmd[1] = rhs.cmd_code()[1];
+ error_[0] = rhs.error_code()[0];
+ error_[1] = rhs.error_code()[1];
+ cmd_[0] = rhs.cmd_code()[0];
+ cmd_[1] = rhs.cmd_code()[1];
}
/// Get the two-byte error code as a non-null-terminated array.
virtual char const* const error_code() const throw()
- { return _error; }
+ { return error_; }
/// Get the two-byte command code as a non-null-terminated array.
virtual char const* const cmd_code() const throw()
- { return _cmd; }
+ { return cmd_; }
const char* what() throw();
protected:
/** Error code as defined in SCIP2 (two bytes). */
- char _error[2];
+ char error_[2];
/** Command that triggered the error, from SCIP2 (two bytes). */
- char _cmd[2];
+ char cmd_[2];
}; // class ResponseError
@@ -496,28 +496,28 @@
@param type The command that caused the error. */
Scip1ResponseError(char error, char cmd)
: ProtocolError(30, "Scip1ResponseError"),
- _error(error), _cmd(cmd)
+ error_(error), cmd_(cmd)
{}
Scip1ResponseError(Scip1ResponseError const& rhs)
- : ProtocolError(rhs), _error(rhs.error_code()),
- _cmd(rhs.cmd_code())
+ : ProtocolError(rhs), error_(rhs.error_code()),
+ cmd_(rhs.cmd_code())
{}
/// Get the one-byte error code.
virtual char error_code() const throw()
- { return _error; }
+ { return error_; }
/// Get the one-byte command code.
virtual char cmd_code() const throw()
- { return _cmd; }
+ { return cmd_; }
const char* what() throw();
protected:
/** Error code as defined in SCIP2 (two bytes). */
- char _error;
+ char error_;
/** Command that triggered the error, from SCIP2 (two bytes). */
- char _cmd;
+ char cmd_;
}; // class Scip1ResponseError
@@ -532,33 +532,33 @@
CommandEchoError(char const* const cmd, char const* const echo)
: ProtocolError(31, "CommandEchoError")
{
- _cmd[0] = cmd[0]; _cmd[1] = cmd[1];
- _echo[0] = echo[0]; _echo[1] = echo[1];
+ cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
+ echo_[0] = echo[0]; echo_[1] = echo[1];
}
CommandEchoError(CommandEchoError const& rhs)
: ProtocolError(rhs)
{
- _cmd[0] = rhs.cmd_code()[0];
- _cmd[1] = rhs.cmd_code()[1];
- _echo[0] = rhs.cmd_echo()[0];
- _echo[1] = rhs.cmd_echo()[1];
+ cmd_[0] = rhs.cmd_code()[0];
+ cmd_[1] = rhs.cmd_code()[1];
+ echo_[0] = rhs.cmd_echo()[0];
+ echo_[1] = rhs.cmd_echo()[1];
}
/// Get the two-byte command code as a non-null-terminated array.
virtual char const* const cmd_code() const throw()
- { return _cmd; }
+ { return cmd_; }
/// Get the two-byte command echo as a non-null-terminated array.
virtual char const* const cmd_echo() const throw()
- { return _echo; }
+ { return echo_; }
const char* what() throw();
protected:
/** Command that triggered the error, from SCIP2 (two bytes). */
- char _cmd[2];
+ char cmd_[2];
/** Received echo. */
- char _echo[2];
+ char echo_[2];
}; // class CommandEchoError
@@ -572,24 +572,24 @@
ParamEchoError(char const* const cmd)
: ProtocolError(32, "ParamEchoError")
{
- _cmd[0] = cmd[0]; _cmd[1] = cmd[1];
+ cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
}
ParamEchoError(ParamEchoError const& rhs)
: ProtocolError(rhs)
{
- _cmd[0] = rhs.cmd_code()[0];
- _cmd[1] = rhs.cmd_code()[1];
+ cmd_[0] = rhs.cmd_code()[0];
+ cmd_[1] = rhs.cmd_code()[1];
}
/// Get the two-byte command code as a non-null-terminated array.
virtual char const* const cmd_code() const throw()
- { return _cmd; }
+ { return cmd_; }
const char* what() throw();
protected:
/** Command that triggered the error, from SCIP2 (two bytes). */
- char _cmd[2];
+ char cmd_[2];
}; // class ParamEchoError
@@ -603,26 +603,26 @@
@param line_length The length of the line. */
InsufficientBytesError(int num, int line_length)
: ProtocolError(33, "InsufficientBytesError"),
- _num(num), _line_length(line_length)
+ num_(num), line_length_(line_length)
{}
InsufficientBytesError(InsufficientBytesError const& rhs)
- : ProtocolError(rhs), _num(rhs.num()),
- _line_length(rhs.line_length())
+ : ProtocolError(rhs), num_(rhs.num()),
+ line_length_(rhs.line_length())
{}
virtual int num() const throw()
- { return _num; }
+ { return num_; }
virtual int line_length() const throw()
- { return _line_length; }
+ { return line_length_; }
const char* what() throw();
protected:
/** Number of bytes available. */
- int _num;
+ int num_;
/** Length of the line. */
- int _line_length;
+ int line_length_;
}; // class InsufficientBytesError
@@ -636,26 +636,26 @@
@param line_length The length of the line. */
LineLengthError(int length, int expected)
: ProtocolError(34, "LineLengthError"),
- _length(length), _expected(expected)
+ length_(length), expected_(expected)
{}
LineLengthError(LineLengthError const& rhs)
- : ProtocolError(rhs), _length(rhs.length()),
- _expected(rhs.expected())
+ : ProtocolError(rhs), length_(rhs.length()),
+ expected_(rhs.expected())
{}
virtual int length() const throw()
- { return _length; }
+ { return length_; }
virtual int expected() const throw()
- { return _expected; }
+ { return expected_; }
const char* what() throw();
protected:
/** The received line length. */
- int _length;
+ int length_;
/** The expected line length. */
- int _expected;
+ int expected_;
}; // class LineLengthError
}; // namespace hokuyo_aist
Modified: gearbox/trunk/src/hokuyo_aist/python/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/python/hokuyo_aist.cpp 2010-09-24 06:17:05 UTC (rev 521)
+++ gearbox/trunk/src/hokuyo_aist/python/hokuyo_aist.cpp 2010-10-28 09:08:54 UTC (rev 522)
@@ -6,157 +6,216 @@
#include <iostream>
-class HokuyoErrorWrap : public HokuyoError, public boost::python::wrapper<HokuyoError>
+class BaseErrorWrap
+ : public BaseError, public boost::python::wrapper<BaseError>
{
- public:
- HokuyoErrorWrap (unsigned int code, std::string desc)
- : HokuyoError (code, desc)
- {}
+ public:
+ BaseErrorWrap(unsigned int desc_code, char const* error_type)
+ : BaseError(desc_code, error_type)
+ {}
- unsigned int Code (void) const throw ()
- {
- if (boost::python::override f = get_override ("Code"))
- return f ();
- return HokuyoError::Code ();
- }
- unsigned int DefaultCode (void) const throw ()
- { return HokuyoError::Code (); }
+ BaseErrorWrap(unsigned int desc_code, std::string error_type)
+ : BaseError(desc_code, error_type.c_str())
+ {}
- const char* what (void) const throw ()
- {
- if (boost::python::override f = get_override ("what"))
- return f ();
- return HokuyoError::what ();
- }
- const char* Defaultwhat (void) const throw ()
- { return HokuyoError::what (); }
+ unsigned int desc_code() const throw()
+ {
+ if (boost::python::override f = get_override("desc_code"))
+ {
+ return f();
+ }
+ return BaseError::desc_code();
+ }
+ unsigned int default_desc_code() const throw()
+ {
+ return BaseError::desc_code();
+ }
- std::string AsString (void) const throw ()
- {
- if (boost::python::override f = get_override ("AsString"))
- return f ();
- return HokuyoError::AsString ();
- }
- std::string DefaultAsString (void) const throw ()
- { return HokuyoError::AsString (); }
+ char const* error_type() const throw()
+ {
+ if (boost::python::override f = get_override("error_type"))
+ {
+ return f();
+ }
+ return BaseError::error_type();
+ }
+ char const* default_error_type() const throw()
+ {
+ return BaseError::error_type();
+ }
+
+ const char* what() throw()
+ {
+ if (boost::python::override f = get_override("what"))
+ {
+ return f();
+ }
+ return BaseError::what();
+ }
+ const char* default_what() throw()
+ {
+ return BaseError::what();
+ }
};
-class HokuyoDataWrap : public HokuyoData, public boost::python::wrapper<HokuyoData>
+
+class ScanDataWrap : public ScanData, public boost::python::wrapper<ScanData>
{
- public:
- HokuyoDataWrap (void)
- : HokuyoData ()
- {}
- HokuyoDataWrap (uint32_t *ranges, unsigned int length, bool error, unsigned int time)
- : HokuyoData (ranges, length, error, time)
- {}
- HokuyoDataWrap (uint32_t *ranges, uint32_t *intensities, unsigned int length, bool error,
- unsigned int time)
- : HokuyoData (ranges, intensities, length, error, time)
- {}
+ public:
+ ScanDataWrap(void)
+ : ScanData()
+ {}
+ ScanDataWrap(ScanDataWrap const& rhs)
+ : ScanData(rhs)
+ {}
- uint32_t Range (unsigned int index)
- { return _ranges[index]; }
- uint32_t Intensity (unsigned int index)
- { return _intensities[index]; }
+ uint32_t range(unsigned int index)
+ { return ranges_[index]; }
+ /*unsigned int ranges_length() const
+ {
+ if (boost::python::override f = get_override("ranges_length"))
+ {
+ return f();
+ }
+ return ScanData::ranges_length();
+ }*/
+
+ uint32_t intensity(unsigned int index)
+ { return intensities_[index]; }
+ /*unsigned int intensities_length() const
+ {
+ if (boost::python::override f = get_override("intensities_length"))
+ {
+ return f();
+ }
+ return ScanData::intensities_length();
+ }*/
+
+ /*bool get_error_status() const
+ {
+ if (boost::python::override f = get_override("get_error_status"))
+ {
+ return f();
+ }
+ return ScanData::get_error_status();
+ }
+
+ std::string error_code_to_string(uint32_t error_code)
+ {
+ if (boost::python::override f = get_override("error_code_to_string"))
+ {
+ return f(error_code);
+ }
+ return ScanData::error_code_to_string(error_code);
+ }
+
+ unsigned int laser_time_stamp()
+ {
+ if (boost::python::override f = get_override("laser_time_stamp"))
+ {
+ return f();
+ }
+ return ScanData::laser_time_stamp();
+ }
+
+ unsigned int system_time_stamp()
+ {
+ if (boost::python::override f = get_override("system_time_stamp"))
+ {
+ return f();
+ }
+ return ScanData::system_time_stamp();
+ }*/
};
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (HokuyoLaserOverloads1, GetRanges, 1, 4)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (HokuyoLaserOverloads2, GetRangesByAngle, 3, 4)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (HokuyoLaserOverloads3, GetNewRanges, 1, 4)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (HokuyoLaserOverloads4, GetNewRangesByAngle, 3, 4)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (HokuyoLaserOverloads5, GetNewRangesAndIntensities, 1, 4)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (HokuyoLaserOverloads6, GetNewRangesAndIntensitiesByAngle, 3, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads1,
+ get_ranges, 1, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads2,
+ get_ranges_by_angle, 3, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads3,
+ get_ranges_intensities, 1, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads4,
+ get_ranges_intensities_by_angle, 3, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads5,
+ get_new_ranges, 1, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads6,
+ get_new_ranges_by_angle, 3, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads7,
+ get_new_ranges_intensities, 1, 4)
+BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(sensor_overloads8,
+ get_new_ranges_intensities_by_angle, 3, 4)
-BOOST_PYTHON_MODULE (hokuyo_aist)
+BOOST_PYTHON_MODULE(hokuyo_aist)
{
- using namespace boost::python;
+ using namespace boost::python;
- class_<HokuyoErrorWrap, boost::noncopyable> ("HokuyoError", init<unsigned int, std::string> ())
- .def ("Code", &HokuyoError::Code, &HokuyoErrorWrap::DefaultCode)
- .def ("what", &HokuyoError::what, &HokuyoErrorWrap::Defaultwhat)
- .def ("AsString", &HokuyoError::AsString, &HokuyoErrorWrap::DefaultAsString)
- ;
+ class_<BaseErrorWrap, boost::noncopyable>("BaseError", init<unsigned int, std::string>())
+ .def("desc_code", &BaseError::desc_code, &BaseErrorWrap::default_desc_code)
+ .def("error_type", &BaseError::error_type, &BaseErrorWrap::default_error_type)
+ .def("what", &BaseError::what, &BaseErrorWrap::default_what)
+ ;
- scope ().attr ("HOKUYO_ERR_READ") = HOKUYO_ERR_READ;
- scope ().attr ("HOKUYO_ERR_WRITE") = HOKUYO_ERR_WRITE;
- scope ().attr ("HOKUYO_ERR_PROTOCOL") = HOKUYO_ERR_PROTOCOL;
- scope ().attr ("HOKUYO_ERR_CHANGEBAUD") = HOKUYO_ERR_CHANGEBAUD;
- scope ().attr ("HOKUYO_ERR_CONNECT_FAILED") = HOKUYO_ERR_CONNECT_FAILED;
- scope ().attr ("HOKUYO_ERR_CLOSE_FAILED") = HOKUYO_ERR_CLOSE_FAILED;
- scope ().attr ("HOKUYO_ERR_NODESTINATION") = HOKUYO_ERR_NODESTINATION;
- scope ().attr ("HOKUYO_ERR_BADFIRMWARE") = HOKUYO_ERR_BADFIRMWARE;
- scope ().attr ("HOKUYO_ERR_SCIPVERSION") = HOKUYO_ERR_SCIPVERSION;
- scope ().attr ("HOKUYO_ERR_MEMORY") = HOKUYO_ERR_MEMORY;
- scope ().attr ("HOKUYO_ERR_UNSUPPORTED") = HOKUYO_ERR_UNSUPPORTED;
- scope ().attr ("HOKUYO_ERR_BADARG") = HOKUYO_ERR_BADARG;
- scope ().attr ("HOKUYO_ERR_NODATA") = HOKUYO_ERR_NODATA;
- scope ().attr ("HOKUYO_ERR_NOTSERIAL") = HOKUYO_ERR_NOTSERIAL;
+ class_<ScanDataWrap, boost::noncopyable>("ScanData")
+ // TODO: write a wrapper function to copy the data into a python array, because this doesn't work
+// .def("ranges", &ScanData::ranges, return_value_policy<reference_existing_object> (), with_custodian_and_ward_postcall<1, 0> ())
+// .def("intensities", &ScanData::intensities, return_value_policy<reference_existing_object> (), with_custodian_and_ward_postcall<1, 0> ())
+ .def("range", &ScanDataWrap::range)
+ .def("intensity", &ScanDataWrap::intensity)
+ .def("ranges_length", &ScanData::ranges_length)
+ .def("intensities_length", &ScanData::intensities_length)
+ .def("get_error_status", &ScanData::get_error_status)
+ .def("error_code_to_string", &ScanData::error_code_to_string)
+ .def("laser_time_stamp", &ScanData::laser_time_stamp)
+ .def("system_time_stamp", &ScanData::system_time_stamp)
+ .def("model", &ScanData::model)
+ .def("buffers_provided", &ScanData::buffers_provided)
+ .def("as_string", &ScanData::as_string)
+ .def("clean_up", &ScanData::clean_up)
+ ;
- // TODO: this causes an undefined symbol error when importing into Python
-// class_<HokuyoSensorInfo> ("HokuyoSensorInfo")
-// .def ("AsString", &HokuyoSensorInfo::AsString)
-// .def_readonly ("vendor", &HokuyoSensorInfo::vendor)
-// .def_readonly ("product", &HokuyoSensorInfo::product)
-// .def_readonly ("firmware", &HokuyoSensorInfo::firmware)
-// .def_readonly ("protocol", &HokuyoSensorInfo::protocol)
-// .def_readonly ("serial", &HokuyoSensorInfo::serial)
-// .def_readonly ("model", &HokuyoSensorInfo::model)
-// .def_readonly ("minRange", &HokuyoSensorInfo::minRange)
-// .def_readonly ("maxRange", &HokuyoSensorInfo::maxRange)
-// .def_readonly ("steps", &HokuyoSensorInfo::steps)
-// .def_readonly ("firstStep", &HokuyoSensorInfo::firstStep)
-// .def_readonly ("lastStep", &HokuyoSensorInfo::lastStep)
-// .def_readonly ("frontStep", &HokuyoSensorInfo::frontStep)
-// .def_readonly ("standardSpeed", &HokuyoSensorInfo::standardSpeed)
-// .def_readonly ("power", &HokuyoSensorInfo::power)
-// .def_readonly ("speed", &HokuyoSensorInfo::speed)
-// .def_readonly ("speedLevel", &HokuyoSensorInfo::speedLevel)
-// .def_readonly ("measureState", &HokuyoSensorInfo::measureState)
-// .def_readonly ("baud", &HokuyoSensorInfo::baud)
-// .def_readonly ("time", &HokuyoSensorInfo::time)
-// .def_readonly ("sensorDiagnostic", &HokuyoSensorInfo::sensorDiagnostic)
-// .def_readonly ("minAngle", &HokuyoSensorInfo::minAngle)
-// .def_readonly ("maxAngle", &HokuyoSensorInfo::maxAngle)
-// .def_readonly ("resolution", &HokuyoSensorInfo::resolution)
-// .def_readonly ("scanableSteps", &HokuyoSensorInfo::scanableSteps)
-// ;
-
- class_ <HokuyoDataWrap, boost::noncopyable> ("HokuyoData")
- .def (init<uint32_t*, unsigned int, bool, unsigned int> ())
- .def (init<uint32_t*, uint32_t*, unsigned int, bool, unsigned int> ())
- // TODO: write a wrapper function to copy the data into a python array, because this doesn't work
-// .def ("Ranges", &HokuyoData::Ranges, return_value_policy<reference_existing_object> (), with_custodian_and_ward_postcall<1, 0> ())
- .def ("Range", &HokuyoDataWrap::Range)
- .def ("Intensity", &HokuyoDataWrap::Intensity)
- .def ("Length", &HokuyoData::Length)
- .def ("GetErrorStatus", &HokuyoData::GetErrorStatus)
- .def ("ErrorCodeToString", &HokuyoData::ErrorCodeToString)
- .def ("TimeStamp", &HokuyoData::TimeStamp)
- .def ("AsString", &HokuyoData::AsString)
- .def ("CleanUp", &HokuyoData::CleanUp)
- ;
-
- class_ <HokuyoLaser> ("HokuyoLaser")
- .def ("Open", &HokuyoLaser::Open)
- .def ("Close", &HokuyoLaser::Close)
- .def ("IsOpen", &HokuyoLaser::IsOpen)
- .def ("SetPower", &HokuyoLaser::SetPower)
- .def ("SetBaud", &HokuyoLaser::SetBaud)
- .def ("Reset", &HokuyoLaser::Reset)
- .def ("SetMotorSpeed", &HokuyoLaser::SetMotorSpeed)
- .def ("SetHighSensitivity", &HokuyoLaser::SetHighSensitivity)
- .def ("GetSensorInfo", &HokuyoLaser::GetSensorInfo)
- .def ("GetTime", &HokuyoLaser::GetTime)
- .def ("GetRanges", &HokuyoLaser::GetRanges, HokuyoLaserOverloads1 ())
- .def ("GetRangesByAngle", &HokuyoLaser::GetRangesByAngle, HokuyoLaserOverloads2 ())
- .def ("GetNewRanges", &HokuyoLaser::GetNewRanges, HokuyoLaserOverloads3 ())
- .def ("GetNewRangesByAngle", &HokuyoLaser::GetNewRangesByAngle, HokuyoLaserOverloads4 ())
- .def ("GetNewRangesAndIntensities", &HokuyoLaser::GetNewRangesAndIntensities, HokuyoLaserOverloads5 ())
- .def ("GetNewRangesAndIntensitiesByAngle", &HokuyoLaser::GetNewRangesAndIntensitiesByAngle, HokuyoLaserOverloads6 ())
- .def ("SCIPVersion", &HokuyoLaser::SCIPVersion)
- .def ("SetVerbose", &HokuyoLaser::SetVerbose)
- .def ("StepToAngle", &HokuyoLaser::StepToAngle)
- .def ("AngleToStep", &HokuyoLaser::AngleToStep)
- ;
+ class_<Sensor>("Sensor")
+ .def("open", &Sensor::open)
+ .def("open_with_probing", &Sensor::open_with_probing)
+ .def("close", &Sensor::close)
+ .def("is_open", &Sensor::is_open)
+ .def("set_power", &Sensor::set_power)
+ .def("set_baud", &Sensor::set_baud)
+ .def("set_ip", &Sensor::set_ip)
+ .def("reset", &Sensor::reset)
+ .def("semi_reset", &Sensor::semi_reset)
+ .def("set_motor_speed", &Sensor::set_motor_speed)
+ .def("set_high_sensitivity", &Sensor::set_high_sensitivity)
+ .def("get_sensor_info", &Sensor::get_sensor_info)
+ .def("get_time", &Sensor::get_time)
+ .def("get_raw_time", &Sensor::get_raw_time)
+ .def("calibrate_time", &Sensor::calibrate_time)
+ .def("time_offset", &Sensor::time_offset)
+ .def("set_time_offset", &Sensor::set_time_offset)
+ .def("drift_rate", &Sensor::drift_rate)
+ .def("set_drift_rate", &Sensor::set_drift_rate)
+ .def("skew_alpha", &Sensor::skew_alpha)
+ .def("set_skew_alpha", &Sensor::set_skew_alpha)
+ .def("get_ranges", &Sensor::get_ranges, sensor_overloads1())
+ .def("get_ranges_by_angle",
+ &Sensor::get_ranges_by_angle, sensor_overloads2())
+ .def("get_ranges_intensities",
+ &Sensor::get_ranges_intensities, sensor_overloads3())
+ .def("get_ranges_intensities_by_angle",
+ &Sensor::get_ranges_intensities_by_angle, sensor_overloads4())
+ .def("get_new_ranges",
+ &Sensor::get_new_ranges, sensor_overloads5())
+ .def("get_new_ranges_by_angle",
+ &Sensor::get_new_ranges_by_angle, sensor_overloads6())
+ .def("get_new_ranges_intensities",
+ &Sensor::get_new_ranges_intensities, sensor_overloads7())
+ .def("get_new_ranges_intensities_by_angle",
+ &Sensor::get_new_ranges_intensities_by_angle,
+ sensor_overloads8())
+ .def("scip_version", &Sensor::scip_version)
+ .def("set_verbose", &Sensor::set_verbose)
+ .def("ignore_unknowns", &Sensor::ignore_unknowns)
+ .def("set_multiecho_mode", &Sensor::set_multiecho_mode)
+ .def("step_to_angle", &Sensor::step_to_angle)
+ .def("angle_to_step", &Sensor::angle_to_step)
+ ;
}
Modified: gearbox/trunk/src/hokuyo_aist/python/test/hokuyo_aist_example.py
===================================================================
--- gearbox/trunk/src/hokuyo_aist/python/test/hokuyo_aist_example.py 2010-09-24 06:17:05 UTC (rev 521)
+++ gearbox/trunk/src/hokuyo_aist/python/test/hokuyo_aist_example.py 2010-10-28 09:08:54 UTC (rev 522)
@@ -3,89 +3,89 @@
import hokuyo_aist
from optparse import OptionParser
-def main ():
- parser = OptionParser ()
- parser.add_option ('-b', '--baud', dest = 'baudRate', type = 'int', default = '19200',
- help = 'Baud rate to set the laser to *after* connecting [default: %default]')
- parser.add_option ('-c', '--clustercount', dest = 'clusterCount', type = 'int', default = '1',
- help = 'Cluster count [default: %default]')
- parser.add_option ('-e', '--endangle', dest = 'endAngle', type = 'float', default = '0',
- help = 'End angle to get ranges to [default: %default]')
- parser.add_option ('-f', '--firststep', dest = 'firstStep', type = 'int', default = '-1',
- help = 'First step to get ranges from [default: %default]')
- parser.add_option ('-l', '--laststep', dest = 'lastStep', type = 'int', default = '-1',
- help = 'Last step to get ranges to [default: %default]')
- parser.add_option ('-m', '--motorspeed', dest = 'motorSpeed', type = 'int', default = '0',
- help = 'Motor speed stepping (higher is slower) [default: %default]')
- parser.add_option ('-n', '--new', dest = 'getNew', action = 'store_true', default = 'False',
- help = 'Get new ranges instead of latest ranges [default: %default]')
- parser.add_option ('-o', '--portoptions', dest = 'portOptions', type = 'string', default = 'type=serial,device=/dev/ttyACM0,timeout=1',
- help = 'Port options (see flexiport library) [default: %default]')
- parser.add_option ('-s', '--startangle', dest = 'startAngle', type = 'float', default = '0',
- help = 'Start angle to get ranges from [default: %default]')
- parser.add_option ('-v', '--verbose', dest = 'verbose', action = 'store_true', default = 'False',
- help = 'Put the hokuyo_aist library into verbose mode [default: %default]')
+def main():
+ parser = OptionParser()
+ parser.add_option('-c', '--clustercount', dest='cluster_count',
+ type='int', default='1',
+ help='Cluster count [default: %default]')
+ parser.add_option('-e', '--endangle', dest='end_angle', type='float',
+ default='0',
+ help='End angle to get ranges to [default: %default]')
+ parser.add_option('-f', '--firststep', dest='first_step', type='int',
+ default='-1',
+ help='First step to get ranges from [default: %default]')
+ parser.add_option('-l', '--laststep', dest='last_step', type='int',
+ default='-1',
+ help='Last step to get ranges to [default: %default]')
+ parser.add_option('-n', '--new', dest='get_new', action='store_true',
+ default='False', help='Get new ranges instead of latest \
+ranges [default: %default]')
+ parser.add_option('-o', '--portoptions', dest='port_options', type='string',
+ default='type=serial,device=/dev/ttyACM0,timeout=1',
+ help='Port options (see flexiport library) [default: %default]')
+ parser.add_option('-s', '--startangle', dest='start_angle', type='float',
+ default='0',
+ help='Start angle to get ranges from [default: %default]')
+ parser.add_option('-v', '--verbose', dest='verbose', action='store_true',
+ default='False',
+ help='Put the hokuyo_aist library into verbose mode \
+[Default: %default]')
- # Scan command line arguments
- options, args = parser.parse_args ()
+ # Scan command line arguments
+ options, args = parser.parse_args()
- try:
- # Create an instance of a laser scanner object
- laser = hokuyo_aist.HokuyoLaser ()
- if options.verbose == True:
- # Set verbose mode so we see more information in stderr
- laser.SetVerbose (True)
+ try:
+ # Create an instance of a laser scanner object
+ laser = hokuyo_aist.Sensor()
+ if options.verbose == True:
+ # Set verbose mode so we see more information in stderr
+ laser.set_verbose(True)
- # Open the laser
- laser.Open (options.portOptions)
- # Turn the laser on
- laser.SetPower (True)
- # Set the baud rate
- try:
- laser.SetBaud (options.baudRate)
- except hokuyo_aist.HokuyoError, e:
- print 'Failed to change baud rate: (' + str (e.Code ()) + ') ' + e.what ()
- # Set the motor speed
- laser.SetMotorSpeed (options.motorSpeed)
+ # Open the laser
+ laser.open(options.port_options)
+ # Turn the laser on
+ laser.set_power(True)
- # Get some laser info
- #print 'Laser sensor information:'
- #info = hokuyo_aist.HokuyoSensorInfo info ()
- #laser.GetSensorInfo (info)
- #print info.AsString ()
+ # Get some laser info
+ #print 'Laser sensor information:'
+ #info = hokuyo_aist.SensorInfo info()
+ #laser.get_sensor_info(info)
+ #print info.as_string()
- # Get range data
- data = hokuyo_aist.HokuyoData ()
- if (options.firstStep == -1 and options.lastStep == -1) and \
- (options.startAngle == 0 and options.endAngle == 0):
- # Get all ranges
- if options.getNew == True:
- laser.GetNewRanges (data, -1, -1, options.clusterCount)
- else:
- laser.GetRanges (data, -1, -1, options.clusterCount)
- elif options.firstStep != -1 or options.lastStep != -1:
- # Get by step
- if options.getNew == True:
- laser.GetNewRanges (data, options.firstStep, options.lastStep, options.clusterCount)
- else:
- laser.GetRanges (data, options.firstStep, options.lastStep, options.clusterCount)
- else:
- # Get by angle
- if options.getNew == True:
- laser.GetNewRangesByAngle (data, options.startAngle, options.endAngle, options.clusterCount)
- else:
- laser.GetRangesByAngle (data, options.startAngle, options.endAngle, options.clusterCount)
+ # Get range data
+ data = hokuyo_aist.ScanData()
+ if (options.first_step == -1 and options.last_step == -1) and \
+ (options.start_angle == 0 and options.end_angle == 0):
+ # Get all ranges
+ if options.get_new == True:
+ laser.get_new_ranges(data, -1, -1, options.cluster_count)
+ else:
+ laser.get_ranges(data, -1, -1, options.cluster_count)
+ elif options.first_step != -1 or options.last_step != -1:
+ # Get by step
+ if options.get_new == True:
+ laser.get_new_ranges(data, options.first_step, options.last_step, options.cluster_count)
+ else:
+ laser.get_ranges(data, options.first_step, options.last_step, options.cluster_count)
+ else:
+ # Get by angle
+ if options.get_new == True:
+ laser.get_new_ranges_by_angle(data, options.start_angle, options.end_angle, options.cluster_count)
+ else:
+ laser.get_ranges_by_angle(data, options.start_angle, options.end_angle, options.cluster_count)
- print 'Laser range data:'
- print data.AsString ()
+ print 'Laser range data:'
+ print data.as_string()
- # Close the laser
- laser.Close ()
+ # Close the laser
+ laser.close()
- except hokuyo_aist.HokuyoError, e:
- print 'Caught exception: (' + str (e.Code ()) + ') ' + e.what ()
- sys.exit (1)
+ except hokuyo_aist.BaseError, e:
+ print 'Caught exception: ' + e.what()
+ return 1
+ return 0
if __name__ == '__main__':
- main ()
+ main()
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-09-24 06:17:12
|
Revision: 521
http://gearbox.svn.sourceforge.net/gearbox/?rev=521&view=rev
Author: gbiggs
Date: 2010-09-24 06:17:05 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Added sample logs for the UXM-30LX-E
Added Paths:
-----------
gearbox/trunk/src/hokuyo_aist/test/example_uxm_30lx_e.logr
gearbox/trunk/src/hokuyo_aist/test/example_uxm_30lx_e.logw
Added: gearbox/trunk/src/hokuyo_aist/test/example_uxm_30lx_e.logr
===================================================================
(Binary files differ)
Property changes on: gearbox/trunk/src/hokuyo_aist/test/example_uxm_30lx_e.logr
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: gearbox/trunk/src/hokuyo_aist/test/example_uxm_30lx_e.logw
===================================================================
(Binary files differ)
Property changes on: gearbox/trunk/src/hokuyo_aist/test/example_uxm_30lx_e.logw
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-09-24 06:14:37
|
Revision: 520
http://gearbox.svn.sourceforge.net/gearbox/?rev=520&view=rev
Author: gbiggs
Date: 2010-09-24 06:14:31 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Tested with UXM-30LX-E
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/doc.dox
Modified: gearbox/trunk/src/hokuyo_aist/doc.dox
===================================================================
--- gearbox/trunk/src/hokuyo_aist/doc.dox 2010-09-24 06:13:23 UTC (rev 519)
+++ gearbox/trunk/src/hokuyo_aist/doc.dox 2010-09-24 06:14:31 UTC (rev 520)
@@ -7,9 +7,10 @@
@brief Hokuyo URG laser scanner driver.
This library provides a driver for Hokuyo laser scanner devices using the SCIP protocol version 1 or
-2. It has been tested with the Hokuyo URG-04LX, UBG-04LX, UHG-08LX and UTM-30LX but it should work
-with any scanner that conforms to these protocol versions, including the URG-04LX-F01,
-the URG-04LX-UG01 (Simple-URG), and the UXM-30LX (Tough-URG).
+2. It has been tested with the Hokuyo URG-04LX, UBG-04LX, UHG-08LX, UTM-30LX
+and UXM-30LX-E but it should work
+with any scanner that conforms to these protocol versions, including the URG-04LX-F01
+and the URG-04LX-UG01 (Simple-URG).
For a full list of classes and functions, see @ref hokuyo_aist.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-09-24 06:13:30
|
Revision: 519
http://gearbox.svn.sourceforge.net/gearbox/?rev=519&view=rev
Author: gbiggs
Date: 2010-09-24 06:13:23 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Removed debug output. Fixed missing option in example.
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/test/example.cpp
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-09-14 06:01:43 UTC (rev 518)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-09-24 06:13:23 UTC (rev 519)
@@ -1798,10 +1798,6 @@
/// timestamp must be in milliseconds. The result is in nanoseconds.
unsigned long long Sensor::offset_timestamp(unsigned int timestamp)
{
- std::cerr << "time_offset_ = " << time_offset_ << '\n';
- std::cerr << "timestamp = " << timestamp << '\n';
- std::cerr << "time_drift_rate_ = " << time_drift_rate_ << '\n';
- std::cerr << "time_skew_alpha_ = " << time_skew_alpha_ << '\n';
return ((1 - time_drift_rate_) * timestamp * 1e6 + time_offset_) /
(1 - time_skew_alpha_);
}
@@ -1809,9 +1805,6 @@
unsigned int Sensor::step_to_time_offset(int start_step)
{
- std::cerr << "Converting step to time offset for step " << start_step;
- std::cerr << " and resolution " << time_resolution_ << ": ";
- std::cerr << first_step_ * time_resolution_ << '\n';
if(start_step < 0)
return first_step_ * time_resolution_;
else
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-09-14 06:01:43 UTC (rev 518)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-09-24 06:13:23 UTC (rev 519)
@@ -39,7 +39,7 @@
#else
int opt;
// Get some options from the command line
- while((opt = getopt(argc, argv, "b:c:e:f:il:m:no:s:vh")) != -1)
+ while((opt = getopt(argc, argv, "b:c:e:f:il:m:no:s:u:vh")) != -1)
{
switch(opt)
{
@@ -75,6 +75,7 @@
break;
case 'u':
sscanf(optarg, "%d", &multiecho_mode);
+ break;
case 'v':
verbose = true;
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-09-14 06:01:49
|
Revision: 518
http://gearbox.svn.sourceforge.net/gearbox/?rev=518&view=rev
Author: gbiggs
Date: 2010-09-14 06:01:43 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
Be a little less absolute about the hokuyo_aist python bindings
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-09-14 00:39:54 UTC (rev 517)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-09-14 06:01:43 UTC (rev 518)
@@ -3,9 +3,7 @@
set (libVersion 2.0.0)
GBX_ADD_LICENSE (EPL1.0)
-# AlexB: temporarily turning this off because it doesn't build right now.
-#set (build TRUE)
-set (build FALSE)
+set (build TRUE)
GBX_REQUIRE_OPTION (build LIB ${libName} ON)
set (reqLibs flexiport)
@@ -54,7 +52,7 @@
add_subdirectory (test)
endif (GBX_BUILD_TESTS)
- option (HOKUYO_AIST_BUILD_BINDINGS "Build the Python bindings for Hokuyo_aist" ON)
+ option (HOKUYO_AIST_BUILD_BINDINGS "Build the Python bindings for Hokuyo_aist" OFF)
if (HOKUYO_AIST_BUILD_BINDINGS)
add_subdirectory (python)
endif (HOKUYO_AIST_BUILD_BINDINGS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-09-14 00:40:00
|
Revision: 517
http://gearbox.svn.sourceforge.net/gearbox/?rev=517&view=rev
Author: gbiggs
Date: 2010-09-14 00:39:54 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
Fixed a divide-by-zero error and a bug in timestamp calculation
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/scan_data.cpp
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
gearbox/trunk/src/hokuyo_aist/sensor_info.h
gearbox/trunk/src/hokuyo_aist/test/example.cpp
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-09-07 06:39:17 UTC (rev 516)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-09-14 00:39:54 UTC (rev 517)
@@ -312,8 +312,8 @@
}
else
ss << "No data errors.\n";
- ss << "Laser time stamp: " << laser_time_ << '\n';
- ss << "System time stamp: " << system_time_ << '\n';
+ ss << "Laser time stamp: " << laser_time_ << "ms\n";
+ ss << "System time stamp: " << system_time_ << "ns\n";
return ss.str();
}
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-09-07 06:39:17 UTC (rev 516)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-09-14 00:39:54 UTC (rev 517)
@@ -812,6 +812,7 @@
enable_checksum_workaround_ = false;
info.calculate_values();
+ time_resolution_ = info.time_resolution;
if(verbose_)
{
err_output_ << "Retrieved sensor info:\n";
@@ -858,7 +859,10 @@
unsigned int samples)
{
if(verbose_)
- err_output_ << "Entering timing mode.\n";
+ {
+ err_output_ << "Entering timing mode; start system time is " <<
+ get_computer_time() << "ns.\n";
+ }
enter_timing_mode();
// From A. Carballo, Y. Hara, H. Kawata, T.
@@ -884,6 +888,15 @@
wrap_timestamp(get_timing_mode_time(&end_time)) * 1e6;
offsets.push_back(start_time -
(laser_time - (end_time - start_time) / 2));
+ if(verbose_)
+ {
+ err_output_ << "Offset #" << ii << " start_time = " << start_time;
+ err_output_ << "\tend_time = " << end_time;
+ err_output_ << "\tlaser_time = " << laser_time;
+ err_output_ << "\tCalculated offset = " <<
+ (start_time - (laser_time - (end_time - start_time) / 2)) <<
+ '\n';
+ }
}
// Calculate the median offset
time_offset_ = median(offsets);
@@ -1785,6 +1798,10 @@
/// timestamp must be in milliseconds. The result is in nanoseconds.
unsigned long long Sensor::offset_timestamp(unsigned int timestamp)
{
+ std::cerr << "time_offset_ = " << time_offset_ << '\n';
+ std::cerr << "timestamp = " << timestamp << '\n';
+ std::cerr << "time_drift_rate_ = " << time_drift_rate_ << '\n';
+ std::cerr << "time_skew_alpha_ = " << time_skew_alpha_ << '\n';
return ((1 - time_drift_rate_) * timestamp * 1e6 + time_offset_) /
(1 - time_skew_alpha_);
}
@@ -1792,6 +1809,9 @@
unsigned int Sensor::step_to_time_offset(int start_step)
{
+ std::cerr << "Converting step to time offset for step " << start_step;
+ std::cerr << " and resolution " << time_resolution_ << ": ";
+ std::cerr << first_step_ * time_resolution_ << '\n';
if(start_step < 0)
return first_step_ * time_resolution_;
else
@@ -2050,7 +2070,6 @@
throw ParseError(buffer, "Motor speed");
}
info.speed_level = 0;
- time_resolution_ = info.speed;
}
else
{
@@ -2061,7 +2080,6 @@
{
throw ParseError(buffer, "Motor speed");
}
- time_resolution_ = info.speed;
}
}
else if(strncmp(buffer, "MESM", 4) == 0)
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-09-07 06:39:17 UTC (rev 516)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-09-14 00:39:54 UTC (rev 517)
@@ -113,7 +113,18 @@
max_angle = (static_cast<int>(last_step) - static_cast<int>(front_step)) *
resolution;
scanable_steps = last_step - first_step + 1;
- time_resolution = 60000 / speed;
+ // Calculate the time taken for a single scan.
+ if(speed == 0)
+ {
+ time_resolution = 60000.0 / 600.0;
+ }
+ else
+ {
+ // 60000 = milliseconds in a minute
+ // speed is in RPM
+ time_resolution = 60000.0 / speed;
+ }
+ time_resolution /= static_cast<double>(steps);
}
@@ -146,6 +157,7 @@
ss << "Motor speed: " << speed << "rpm (level " << speed_level <<
")\tBaud rate: " << baud << "bps\n";
ss << "Time stamp: " << time << "ms\n";
+ ss << "Time between scan points: " << time_resolution << "ms\n";
ss << "Sensor diagnostic: " << sensor_diagnostic << '\n';
return ss.str();
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-09-07 06:39:17 UTC (rev 516)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-09-14 00:39:54 UTC (rev 517)
@@ -197,7 +197,7 @@
/// Angle between two scan points (radians).
double resolution;
/// Time between two scan points (milliseconds).
- unsigned int time_resolution;
+ double time_resolution;
/// Total number of steps in a full scan (lastStep - firstStep).
unsigned int scanable_steps;
/// Absolute maximum commandable step.
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-09-07 06:39:17 UTC (rev 516)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-09-14 00:39:54 UTC (rev 517)
@@ -115,6 +115,14 @@
// Open the laser
laser.open(port_options);
+
+ // Calibrate the laser time stamp
+ std::cout << "Calibrating laser time\n";
+ laser.calibrate_time();
+ std::cout << "Calculated offset: " << laser.time_offset() << "ns\n";
+ std::cout << "Calculated drift rate: " << laser.drift_rate() << '\n';
+ std::cout << "Calculated skew alpha: " << laser.skew_alpha() << '\n';
+
// Turn the laser on
laser.set_power(true);
// Set the baud rate
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2010-09-07 06:39:23
|
Revision: 516
http://gearbox.svn.sourceforge.net/gearbox/?rev=516&view=rev
Author: borax00
Date: 2010-09-07 06:39:17 +0000 (Tue, 07 Sep 2010)
Log Message:
-----------
MR Changes: disabled hokuyo python gear temporarilly because it doesn't build.
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-09-05 05:23:13 UTC (rev 515)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-09-07 06:39:17 UTC (rev 516)
@@ -3,7 +3,9 @@
set (libVersion 2.0.0)
GBX_ADD_LICENSE (EPL1.0)
-set (build TRUE)
+# AlexB: temporarily turning this off because it doesn't build right now.
+#set (build TRUE)
+set (build FALSE)
GBX_REQUIRE_OPTION (build LIB ${libName} ON)
set (reqLibs flexiport)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2010-09-05 05:23:22
|
Revision: 515
http://gearbox.svn.sourceforge.net/gearbox/?rev=515&view=rev
Author: borax00
Date: 2010-09-05 05:23:13 +0000 (Sun, 05 Sep 2010)
Log Message:
-----------
MR Changes
Modified Paths:
--------------
gearbox/trunk/cmake/UseBasicRules.cmake
gearbox/trunk/doc/announce.dox
gearbox/trunk/doc/buildsys.dox
gearbox/trunk/doc/contributors.dox
gearbox/trunk/doc/depends.dox
gearbox/trunk/doc/devguide.dox
gearbox/trunk/doc/documentation.dox
gearbox/trunk/doc/getting.dox
gearbox/trunk/doc/history.dox
gearbox/trunk/doc/index.dox
gearbox/trunk/doc/install_debian.dox
gearbox/trunk/doc/install_gentoo.dox
gearbox/trunk/doc/logo.dox
gearbox/trunk/doc/overview.dox
gearbox/trunk/doc/practices.dox
gearbox/trunk/doc/principles.dox
gearbox/trunk/doc/publications.dox
gearbox/trunk/doc/release_instructions.dox
gearbox/trunk/doc/users.dox
gearbox/trunk/doc/version_control.dox
gearbox/trunk/src/basicexample/defs.h
gearbox/trunk/src/basicexample/util.cpp
gearbox/trunk/src/basicexample/util.h
gearbox/trunk/src/gbxadvancedexample/util.cpp
gearbox/trunk/src/gbxadvancedexample/util.h
gearbox/trunk/src/gbxgarminacfr/doc.dox
gearbox/trunk/src/gbxgarminacfr/driver.cpp
gearbox/trunk/src/gbxgarminacfr/driver.h
gearbox/trunk/src/gbxgarminacfr/nmeamessages.h
gearbox/trunk/src/gbxgarminacfr/nmeasentence.cpp
gearbox/trunk/src/gbxgarminacfr/nmeasentence.h
gearbox/trunk/src/gbxgarminacfr/test/test.cpp
gearbox/trunk/src/gbxnovatelacfr/driver.cpp
gearbox/trunk/src/gbxnovatelacfr/driver.h
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.cpp
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.h
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.h
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/novatelmessages.h
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.cpp
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.h
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/crc32test.cpp
gearbox/trunk/src/gbxnovatelacfr/hw_review.dox
gearbox/trunk/src/gbxnovatelacfr/novatel.dox
gearbox/trunk/src/gbxnovatelacfr/test/test.cpp
gearbox/trunk/src/gbxserialacfr/doc.dox
gearbox/trunk/src/gbxserialacfr/gbxserialacfr.h
gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp
gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.h
gearbox/trunk/src/gbxserialacfr/lockfile/test/locktest.cpp
gearbox/trunk/src/gbxserialacfr/serial.cpp
gearbox/trunk/src/gbxserialacfr/serial.h
gearbox/trunk/src/gbxserialacfr/uncopyable.h
gearbox/trunk/src/gbxsickacfr/doc.dox
gearbox/trunk/src/gbxsickacfr/driver.cpp
gearbox/trunk/src/gbxsickacfr/driver.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/notifytest.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/safethreadtest.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/gbxserialdeviceacfr.h
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
gearbox/trunk/src/gbxsickacfr/messages.cpp
gearbox/trunk/src/gbxsickacfr/messages.h
gearbox/trunk/src/gbxsickacfr/serialhandler.cpp
gearbox/trunk/src/gbxsickacfr/serialhandler.h
gearbox/trunk/src/gbxsickacfr/sickdefines.cpp
gearbox/trunk/src/gbxsickacfr/sickdefines.h
gearbox/trunk/src/gbxsickacfr/test/test.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/exceptions.h
gearbox/trunk/src/gbxsmartbatteryacfr/gbxsmartbatteryacfr.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h
gearbox/trunk/src/gbxsmartbatteryacfr/smartbattery.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/smartbattery.h
gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryacfr.dox
gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryparsing.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryparsing.h
gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
gearbox/trunk/src/gbxutilacfr/doc.dox
gearbox/trunk/src/gbxutilacfr/exceptions.cpp
gearbox/trunk/src/gbxutilacfr/exceptions.h
gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h
gearbox/trunk/src/gbxutilacfr/mathdefs.h
gearbox/trunk/src/gbxutilacfr/status.cpp
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/stoppable.h
gearbox/trunk/src/gbxutilacfr/subhealth.h
gearbox/trunk/src/gbxutilacfr/substatus.h
gearbox/trunk/src/gbxutilacfr/test/mathtest.cpp
gearbox/trunk/src/gbxutilacfr/test/trivialstatustest.cpp
gearbox/trunk/src/gbxutilacfr/test/trivialtracertest.cpp
gearbox/trunk/src/gbxutilacfr/tokenise.cpp
gearbox/trunk/src/gbxutilacfr/tokenise.h
gearbox/trunk/src/gbxutilacfr/tracer.cpp
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/gbxsickacfr/gbxserialdeviceacfr/printutil.cpp
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/printutil.h
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/stickinbuffercallback.h
gearbox/trunk/src/gbxutilacfr/substatus.cpp
Modified: gearbox/trunk/cmake/UseBasicRules.cmake
===================================================================
--- gearbox/trunk/cmake/UseBasicRules.cmake 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/cmake/UseBasicRules.cmake 2010-09-05 05:23:13 UTC (rev 515)
@@ -16,9 +16,9 @@
# Platform-specific compiler and linker flags
#
if( NOT GBX_OS_WIN )
- add_definitions( "-Wall" )
+ add_definitions( "-Wall -Wnon-virtual-dtor" )
#
-# AlexB: Using -Wconversion finds some real bugs, but turns up lots of
+# AlexB: Using -Wconversion finds some real bugs, but turns up lots of
# false positives, especially in gcc4.3.
# (see: http://gcc.gnu.org/ml/gcc/2008-05/msg00363.html)
#
Modified: gearbox/trunk/doc/announce.dox
===================================================================
--- gearbox/trunk/doc/announce.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/announce.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/buildsys.dox
===================================================================
--- gearbox/trunk/doc/buildsys.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/buildsys.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/contributors.dox
===================================================================
--- gearbox/trunk/doc/contributors.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/contributors.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/depends.dox
===================================================================
--- gearbox/trunk/doc/depends.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/depends.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/devguide.dox
===================================================================
--- gearbox/trunk/doc/devguide.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/devguide.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/documentation.dox
===================================================================
--- gearbox/trunk/doc/documentation.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/documentation.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Components for robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This copy of GearBox is licensed to you under the terms described in the
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/getting.dox
===================================================================
--- gearbox/trunk/doc/getting.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/getting.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/history.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/index.dox
===================================================================
--- gearbox/trunk/doc/index.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/index.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/install_debian.dox
===================================================================
--- gearbox/trunk/doc/install_debian.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/install_debian.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Components for robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This copy of GearBox is licensed to you under the terms described in the
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/install_gentoo.dox
===================================================================
--- gearbox/trunk/doc/install_gentoo.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/install_gentoo.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Components for robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This copy of GearBox is licensed to you under the terms described in the
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/logo.dox
===================================================================
--- gearbox/trunk/doc/logo.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/logo.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/overview.dox
===================================================================
--- gearbox/trunk/doc/overview.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/overview.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This copy of GearBox is licensed to you under the terms described in the
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/practices.dox
===================================================================
--- gearbox/trunk/doc/practices.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/practices.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/principles.dox
===================================================================
--- gearbox/trunk/doc/principles.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/principles.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/publications.dox
===================================================================
--- gearbox/trunk/doc/publications.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/publications.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This copy of GearBox is licensed to you under the terms described in the
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/release_instructions.dox
===================================================================
--- gearbox/trunk/doc/release_instructions.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/release_instructions.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/users.dox
===================================================================
--- gearbox/trunk/doc/users.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/users.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/doc/version_control.dox
===================================================================
--- gearbox/trunk/doc/version_control.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/doc/version_control.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
+ * Copyright (c) 2008-2010 GearBox Team
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/basicexample/defs.h
===================================================================
--- gearbox/trunk/src/basicexample/defs.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/basicexample/defs.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 Gearbox team
+ * Copyright (c) 2008-2010 Gearbox Team
*
* This copy of Gearbox is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/basicexample/util.cpp
===================================================================
--- gearbox/trunk/src/basicexample/util.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/basicexample/util.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 Gearbox team
+ * Copyright (c) 2008-2010 Gearbox Team
*
* This copy of Gearbox is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/basicexample/util.h
===================================================================
--- gearbox/trunk/src/basicexample/util.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/basicexample/util.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 Gearbox team
+ * Copyright (c) 2008-2010 Gearbox Team
*
* This copy of Gearbox is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxadvancedexample/util.cpp
===================================================================
--- gearbox/trunk/src/gbxadvancedexample/util.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxadvancedexample/util.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 Gearbox team
+ * Copyright (c) 2008-2010 Gearbox Team
*
* This copy of Gearbox is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxadvancedexample/util.h
===================================================================
--- gearbox/trunk/src/gbxadvancedexample/util.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxadvancedexample/util.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2008 Gearbox team
+ * Copyright (c) 2008-2010 Gearbox Team
*
* This copy of Gearbox is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/doc.dox
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/doc.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/doc.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/driver.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2009 Duncan Mercer, Alex Brooks, Alexei Makarenko, Tobias Kaupp, Michael Warren
+ * Copyright (c) 2004-2010 Duncan Mercer, Alex Brooks, Alexei Makarenko, Tobias Kaupp, Michael Warren
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/driver.h
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/driver.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Duncan Mercer, Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ * Copyright (c) 2004-2010 Duncan Mercer, Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/nmeamessages.h
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/nmeamessages.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/nmeamessages.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Duncan Mercer
+ * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Duncan Mercer
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/nmeasentence.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/nmeasentence.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/nmeasentence.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Mathew Ridley, Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ * Copyright (c) 2004-2010 Mathew Ridley, Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/nmeasentence.h
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/nmeasentence.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/nmeasentence.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Duncan Mercer
+ * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Duncan Mercer
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxgarminacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/test/test.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxgarminacfr/test/test.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/driver.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/driver.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Matthew Ridley, Ben Upcroft, Michael Moser
+ * Copyright (c) 2004-2010 Matthew Ridley, Ben Upcroft, Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/driver.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/driver.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/driver.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Matthew Ridley, Ben Upcroft, Michael Moser
+ * Copyright (c) 2004-2010 Matthew Ridley, Ben Upcroft, Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/crc32.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/novatelmessages.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/novatelmessages.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/novatelmessages.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/serialconnectivity.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/crc32test.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/crc32test.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/crc32test.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/hw_review.dox
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/hw_review.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/hw_review.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/novatel.dox
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/novatel.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/novatel.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Matthew Ridley, Ben Upcroft, Michael Moser
+ * Copyright (c) 2004-2010 Matthew Ridley, Ben Upcroft, Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxnovatelacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/test/test.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxnovatelacfr/test/test.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Michael Moser
+ * Copyright (c) 2004-2010 Michael Moser
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/doc.dox
===================================================================
--- gearbox/trunk/src/gbxserialacfr/doc.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/doc.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Mathew Ridley
+ * Copyright (c) 2004-2010 Alex Brooks, Mathew Ridley
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/gbxserialacfr.h
===================================================================
--- gearbox/trunk/src/gbxserialacfr/gbxserialacfr.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/gbxserialacfr.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Mathew Ridley
+ * Copyright (c) 2004-2010 Alex Brooks, Mathew Ridley
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp
===================================================================
--- gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks
+ * Copyright (c) 2004-2010 Alex Brooks
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.h
===================================================================
--- gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks
+ * Copyright (c) 2004-2010 Alex Brooks
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/lockfile/test/locktest.cpp
===================================================================
--- gearbox/trunk/src/gbxserialacfr/lockfile/test/locktest.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/lockfile/test/locktest.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks
+ * Copyright (c) 2004-2010 Alex Brooks
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/serial.cpp
===================================================================
--- gearbox/trunk/src/gbxserialacfr/serial.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/serial.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Mathew Ridley
+ * Copyright (c) 2004-2010 Alex Brooks, Mathew Ridley
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
@@ -64,6 +64,26 @@
namespace {
+ std::string toHexAndAscii( const char *str, int len )
+ {
+ stringstream ss;
+ ss << "'";
+ for ( int i=0; i < len; i++ )
+ {
+ ss << str[i];
+ }
+ ss << "' ( ";
+ // ss << "' ("<<std::hex<<std::setfill('0')<<std::setw(3);
+ for ( int i=0; i < len; i++ )
+ {
+ char buf[3];
+ sprintf(buf,"%02x",((int)((unsigned char)(str[i]))));
+ ss << buf << " ";
+ }
+ ss << ")";
+ return ss.str();
+ }
+
// Converts an integer baud-rate into a c-style '#define'd baudrate
int cBaudrate( int baudRate )
{
@@ -577,10 +597,10 @@
if ( debugLevel_ > 1 )
{
- cout<<"TRACE(serial.cpp): just read: '";
- for ( int i=0; i < count; i++ )
- cout << ((char*)(buf))[i];
- cout << "'" << endl;
+ cout<<"TRACE(serial.cpp): just read: "<<toHexAndAscii((char *)buf,count)<<endl;
+// for ( int i=0; i < count; i++ )
+// cout << ((char*)(buf))[i];
+// cout << "'" << endl;
}
return got;
@@ -737,7 +757,7 @@
Serial::writeString(const char *str)
{
if ( debugLevel_ > 0 )
- cout<<"TRACE(serial.cpp): "<<__func__<<"(): writing '"<<str<<"'" << endl;
+ cout<<"TRACE(serial.cpp): "<<__func__<<"(): writing: "<<toHexAndAscii(str,strlen(str))<<endl;
int put;
put = ::write(portFd_, str, strlen(str) );
@@ -853,9 +873,7 @@
}
if ( debugLevel_ > 1 )
{
- cout<<"TRACE(serial.cpp): wrote " << put << " bytes: '";
- for ( int i=0; i < count; i++ ) cout << ((char*)(buf))[i];
- cout << "'" << endl;
+ cout<<"TRACE(serial.cpp): wrote " << put << " bytes: "<<toHexAndAscii((char *)buf,count)<<endl;
}
return put;
Modified: gearbox/trunk/src/gbxserialacfr/serial.h
===================================================================
--- gearbox/trunk/src/gbxserialacfr/serial.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/serial.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Mathew Ridley
+ * Copyright (c) 2004-2010 Alex Brooks, Mathew Ridley
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxserialacfr/uncopyable.h
===================================================================
--- gearbox/trunk/src/gbxserialacfr/uncopyable.h 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxserialacfr/uncopyable.h 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks
+ * Copyright (c) 2004-2010 Alex Brooks
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxsickacfr/doc.dox
===================================================================
--- gearbox/trunk/src/gbxsickacfr/doc.dox 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxsickacfr/doc.dox 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
Modified: gearbox/trunk/src/gbxsickacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/driver.cpp 2010-08-16 02:22:54 UTC (rev 514)
+++ gearbox/trunk/src/gbxsickacfr/driver.cpp 2010-09-05 05:23:13 UTC (rev 515)
@@ -1,7 +1,7 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
- * Copyright (c) 2004-2008 Alex Brooks
+ * Copyright (c) 2004-2010 Alex Brooks
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
@@ -21,15 +21,15 @@
namespace {
- class NoResponseException : public std::exception
+ class NoRxMsgException : public std::exception
{
std::string message_;
public:
- NoResponseException(const char *message)
+ NoRxMsgException(const char *message)
: message_(message) {}
- NoResponseException(const std::string &message)
+ NoRxMsgException(const std::string &message)
: message_(message) {}
- ~NoResponseException()throw(){}
+ ~NoRxMsgException()throw(){}
virtual const char* what() const throw() { return message_.c_str(); }
};
@@ -45,15 +45,15 @@
virtual const char* what() const throw() { return message_.c_str(); }
};
- class ResponseIsErrorException : public std::exception
+ class RxMsgIsErrorException : public std::exception
{
std::string message_;
public:
- ResponseIsErrorException(const char *message)
+ RxMsgIsErrorException(const char *message)
: message_(message) {}
- ResponseIsErrorException(const std::string &message)
+ RxMsgIsErrorException(const std::string &message)
: message_(message) {}
- ~ResponseIsErrorException()throw(){}
+ ~RxMsgIsErrorException()throw(){}
virtual const char* what() const throw() { return message_.c_str(); }
};
}
@@ -141,13 +141,13 @@
initLaser();
break;
}
- catch ( const ResponseIsErrorException &e )
+ catch ( const RxMsgIsErrorException &e )
{
std::string errorLog = errorConditions();
stringstream ss;
ss << e.what() << endl << "Laser error log: " << errorLog;
if ( i == MAX_TRIES-1 )
- throw ResponseIsErrorException( ss.str() );
+ throw RxMsgIsErrorException( ss.str() );
else
tracer_.warning( tryString.str() + ss.str() );
}
@@ -163,30 +163,30 @@
}
bool
-Driver::waitForResponseType( uChar type, TimedLmsResponse &response, int maxWaitMs )
+Driver::waitForRxMsgType( uChar type, TimedLmsRxMsg &rxMsg, int maxWaitMs )
{
gbxiceutilacfr::Timer waitTimer;
while ( true )
{
- int ret = serialHandler_->getNextResponse( response, maxWaitMs );
+ int ret = serialHandler_->getNextRxMsg( rxMsg, maxWaitMs );
if ( ret == 0 )
{
- // got response
- if ( response.response.type == type )
+ // got rxMsg
+ if ( rxMsg.msg->type == type )
return true;
- // Got a response, but not of the type we were expecting...
+ // Got a rxMsg, but not of the type we were expecting...
//
// In general, print out a warning message.
// However, don't print out a warning if it's an ACK/NACK, because ACK/NACK don't
// have checksums so they're likely to be found inside a failed-checksum message when a bit
// gets flipped during transmission.
- if ( response.response.type != ACK &&
- response.response.type != NACK )
+ if ( rxMsg.msg->type != ACK &&
+ rxMsg.msg->type != NACK )
{
stringstream ss;
- ss << "Driver::waitForResponseType(): While waiting for " << cmdToString(type) << ", received unexpected response: " << toString(response.response);
+ ss << "Driver::waitForRxMsgType(): While waiting for " << cmdToString(type) << ", received unexpected rxMsg: " << toString(*(rxMsg.msg));
tracer_.warning( ss.str() );
}
@@ -218,21 +218,21 @@
while ( true )
{
- TimedLmsResponse timedResponse;
+ TimedLmsRxMsg timedRxMsg;
- int ret = serialHandler_->getNextResponse( timedResponse, maxWaitMs );
+ int ret = serialHandler_->getNextRxMsg( timedRxMsg, maxWaitMs );
if ( ret == 0 )
{
- // got timedResponse
- if ( timedResponse.response.type == ACK || timedResponse.response.type == NACK )
+ // got timedRxMsg
+ if ( timedRxMsg.msg->type == ACK || timedRxMsg.msg->type == NACK )
{
- receivedAck = (timedResponse.response.type == ACK);
+ receivedAck = (timedRxMsg.msg->type == ACK);
return true;
}
else
{
stringstream ss;
- ss << "Driver::waitForAckOrNack(): Received unexpected response: " << toString(timedResponse.response);
+ ss << "Driver::waitForAckOrNack(): Received unexpected rxMsg: " << toString(*(timedRxMsg.msg));
tracer_.warning( ss.str() );
}
@@ -250,34 +250,34 @@
else
{
stringstream ss;
- ss << "Weird return code from serialHandler_->getNextResponse: " << ret;
+ ss << "Weird return code from serialHandler_->getNextRxMsg: " << ret;
throw gbxutilacfr::Exception( ERROR_INFO, ss.str() );
}
}
}
-LmsResponse
+LmsRxMsgPtr
Driver::askLaserForStatusData()
{
constructStatusRequest( commandAndData_ );
- TimedLmsResponse response = sendAndExpectResponse( commandAndData_ );
- return response.response;
+ TimedLmsRxMsg rxMsg = sendAndExpectRxMsg( commandAndData_ );
+ return rxMsg.msg;
}
-LmsResponse
+LmsRxMsgPtr
Driver::askLaserForConfigData()
{
constructConfigurationRequest( commandAndData_ );
try {
- TimedLmsResponse response = sendAndExpectResponse( commandAndData_ );
- return response.response;
+ TimedLmsRxMsg rxMsg = sendAndExpectRxMsg( commandAndData_ );
+ return rxMsg.msg;
}
- catch ( NoResponseException &e )
+ catch ( NoRxMsgException &e )
{
stringstream ss;
ss << "While trying to askLaserForConfigData(): " << e.what();
- throw NoResponseException( ss.str() );
+ throw NoRxMsgException( ss.str() );
}
}
@@ -346,8 +346,8 @@
tracer_.debug( "Driver: Checking error conditions." );
constructRequestErrorMessage( commandAndData_ );
const bool ignoreErrorConditions = true;
- TimedLmsResponse errorResponse = sendAndExpectResponse( commandAndData_, ignoreErrorConditions );
- return toString( errorResponse.response );
+ TimedLmsRxMsg errorRxMsg = sendAndExpectRxMsg( commandAndData_, ignoreErrorConditions );
+ return toString( *(errorRxMsg.msg) );
}
catch ( std::exception &e )
{
@@ -363,7 +363,7 @@
{
// Tell the laser to switch
constructRequestBaudRate( commandAndData_, baudRate );
- sendAndExpectResponse( commandAndData_ );
+ sendAndExpectRxMsg( commandAndData_ );
// And switch myself
serialHandler_->setBaudRate( config_.baudRate );
}
@@ -395,7 +395,7 @@
askLaserForStatusData();
return baudRates[baudRateI];
}
- catch ( const NoResponseException &e )
+ catch ( const NoRxMsgException &e )
{
stringstream ss;
ss << "Driver::guessLaserBaudRate(): failed: " << e.what();
@@ -417,7 +417,7 @@
//
tracer_.debug("Driver: Turning continuous mode off");
constructRequestMeasuredOnRequestMode( commandAndData_ );
- sendAndExpectResponse( commandAndData_ );
+ sendAndExpectRxMsg( commandAndData_ );
//
// Set Desired BaudRate
@@ -442,24 +442,24 @@
//
tracer_.debug("Driver: Checking operating data counters");
constructRequestOperatingDataCounter( commandAndData_ );
- TimedLmsResponse counterResponse = sendAndExpectResponse( commandAndData_ );
- ssInfo << "OperatingDataCounter: " << toString(counterResponse.response) << endl;
+ TimedLmsRxMsg counterRxMsg = sendAndExpectRxMsg( commandAndData_ );
+ ssInfo << "OperatingDataCounter: " << toString(counterRxMsg.msg) << endl;
//
// Get status
//
tracer_.debug("Driver: Checking status");
- LmsResponse statusResponse = askLaserForStatusData();
- LmsStatusResponseData *statusResponseData =
- dynamic_cast<LmsStatusResponseData*>(statusResponse.data);
- assert( statusResponseData != NULL );
- ssInfo << "Status: " << statusResponseData->toString() << endl;
+ LmsRxMsgPtr statusRxMsg = askLaserForStatusData();
+ LmsStatusRxMsgData *statusRxMsgData =
+ dynamic_cast<LmsStatusRxMsgData*>(statusRxMsg->data.get());
+ assert( statusRxMsgData != NULL );
+ ssInfo << "Status: " << statusRxMsgData->toString() << endl;
- LmsResponse configResponse = askLaserForConfigData();
+ LmsRxMsgPtr configRxMsg = askLaserForConfigData();
LmsConfigurationData *lmsConfig =
- dynamic_cast<LmsConfigurationData*>(configResponse.data);
+ dynamic_cast<LmsConfigurationData*>(configRxMsg->data.get());
assert( lmsConfig != NULL );
- ssInfo << "Config: " << configResponse.data->toString() << endl;
+ ssInfo << "Config: " << configRxMsg->data->toString() << endl;
tracer_.info( ssInfo.str() );
@@ -467,7 +467,7 @@
// Enter installation mode
//
constructRequestInstallationMode( commandAndData_ );
- sendAndExpectResponse( commandAndData_ );
+ sendAndExpectRxMsg( commandAndData_ );
//
// Configure the thing if we have to
@@ -478,13 +478,13 @@
constructConfigurationCommand( desiredConfiguration(),
commandAndData_ );
- TimedLmsResponse configCmdResponse = sendAndExpectResponse( commandAndData_ );
- LmsConfigurationResponseData *configCmdResponseData =
- dynamic_cast<LmsConfigurationResponseData*>(configCmdResponse.response.data);
- if ( !isAsDesired( configCmdResponseData->config ) )
+ TimedLmsRxMsg configCmdRxMsg = sendAndExpectRxMsg( commandAndData_ );
+ LmsConfigurationRxMsgData *configCmdRxMsgData =
+ dynamic_cast<LmsConfigurationRxMsgData*>(configCmdRxMsg.msg->data.get());
+ if ( !isAsDesired( configCmdRxMsgData->config ) )
{
stringstream ss;
- ss << "Error configuring SICK: Config after configuration not what we expect. Asked for: " << desiredConfiguration().toString() << endl << "got: " << configCmdResponseData->toString();
+ ss << "Error configuring SICK: Config after configuration not what we expect. Asked for: " << desiredConfiguration().toString() << endl << "got: " << configCmdRxMsgData->toString();
throw gbxutilacfr::Exception( ERROR_INFO, ss.str() );
}
}
@@ -496,15 +496,15 @@
constructSwitchVariant( desiredScanningAngle,
desiredAngularResolution(),
commandAndData_ );
- TimedLmsResponse angResponse = sendAndExpectResponse( commandAndData_ );
- LmsSwitchVariantResponseData *angResponseData =
- dynamic_cast<LmsSwitchVariantResponseData*>(angResponse.response.data);
- assert( angResponseData != NULL );
- if ( !( angResponseData->scanningAngle == desiredScanningAngle &&
- angResponseData->angularResolution == desiredAngularResolution() ) )
+ TimedLmsRxMsg angRxMsg = sendAndExpectRxMsg( commandAndData_ );
+ LmsSwitchVariantRxMsgData *angRxMsgData =
+ dynamic_cast<LmsSwitchVariantRxMsgData*>(angRxMsg.msg->data.get());
+ assert( angRxMsgData != NULL );
+ if ( !( angRxMsgData->scanningAngle == desiredScanningAngle &&
+ angRxMsgData->angularResolution == desiredAngularResolution() ) )
{
stringstream ss;
- ss << "Error configuring SICK variant: Variant after configuration not what we expect: " << angResponseData->toString();
+ ss << "Error configuring SICK variant: Variant after configuration not what we expect: " << angRxMsgData->toString();
throw gbxutilacfr::Exception( ERROR_INFO, ss.str() );
}
@@ -512,13 +512,13 @@
// Start continuous mode
//
constructRequestContinuousMode( commandAndData_ );
- TimedLmsResponse contResponse = sendAndExpectResponse( commandAndData_ );
+ TimedLmsRxMsg contRxMsg = sendAndExpectRxMsg( commandAndData_ );
tracer_.info( "Driver: enabled continuous mode, laser is running." );
}
-TimedLmsResponse
-Driver::sendAndExpectResponse( const std::vector<uChar> &commandAndData, bool ignoreErrorConditions )
+TimedLmsRxMsg
+Driver::sendAndExpectRxMsg( const std::vector<uChar> &commandAndData, bool ignoreErrorConditions )
{
constructTelegram( telegramBuffer_, commandAndData );
@@ -536,7 +536,7 @@
bool receivedAckOrNack = waitForAckOrNack( isAck );
if ( !receivedAckOrNack )
{
- throw NoResponseException( "No ACK/NACK to command "+cmdToString(command) );
+ throw NoRxMsgException( "No ACK/NACK to command "+cmdToString(command) );
}
if ( !isAck )
{
@@ -550,61 +550,61 @@
timeoutMs = 15000;
}
- TimedLmsResponse response;
- bool received = waitForResponseType( ack(command), response, timeoutMs );
+ TimedLmsRxMsg rxMsg;
+ bool received = waitForRxMsgType( ack(command), rxMsg, timeoutMs );
if ( !received )
{
- throw NoResponseException( "No response to command "+cmdToString(command) );
+ throw NoRxMsgException( "No rxMsg to command "+cmdToString(command) );
}
- if ( !ignoreErrorConditions && response.response.isError() )
+ if ( !ignoreErrorConditions && rxMsg.msg->isError() )
{
- throw ResponseIsErrorException( "Response contains an error condition: "+toString(response.response) );
+ throw RxMsgIsErrorException( "RxMsg contains an error condition: "+toString(rxMsg.msg) );
}
- if ( response.response.isWarn() )
+ if ( rxMsg.msg->isWarn() )
{
stringstream ss;
- tracer_.warning( "Response contains warning: "+toString(response.response) );
+ tracer_.warning( "RxMsg contains warning: "+toString(rxMsg.msg) );
}
- return response;
+ return rxMsg;
}
void
Driver::read( Data &data )
{
- TimedLmsResponse response;
+ TimedLmsRxMsg rxMsg;
// This timeout is greater than the scan inter-arrival time for all baudrates.
const int timeoutMs = 1000;
- bool received = waitForResponseType( ACK_REQUEST_MEASURED_VALUES, response, timeoutMs );
+ bool received = waitForRxMsgType( ACK_REQUEST_MEASURED_VALUES, rxMsg, timeoutMs );
if ( !received )
{
throw gbxutilacfr::Exception( ERROR_INFO, "No scan received." );
}
- LmsMeasurementData *measuredData = (LmsMeasurementData*)response.response.data;
+ LmsMeasurementData *measuredData = (LmsMeasurementData*)rxMsg.msg->data.get();
- if ( response.response.isError() )
+ if ( rxMsg.msg->isError() )
{
std::string errorLog = errorConditions();
stringstream ss;
- ss << "Scan data indicates errors: " << toString(response.response) << endl << "Laser error log: " << errorLog;
- throw ResponseIsErrorException( ss.str() );
+ ss << "Scan data indicates errors: " << toString(rxMsg.msg) << endl << "Laser error log: " << errorLog;
+ throw RxMsgIsErrorException( ss.str() );
}
- else if ( response.response.isWarn() )
+ else if ( rxMsg.msg->isWarn() )
{
data.haveWarnings = true;
stringstream ss;
- ss << "Scan data indicates warnings: " << toString(response.response);
+ ss << "Scan data indicates warnings: " << toString(rxMsg.msg);
data.warnings = ss.str();
}
memcpy( &(data.ranges[0]), &(meas...
[truncated message content] |
|
From: <gb...@us...> - 2010-08-16 02:23:00
|
Revision: 514
http://gearbox.svn.sourceforge.net/gearbox/?rev=514&view=rev
Author: gbiggs
Date: 2010-08-16 02:22:54 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
Changed pointer to reference
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/getid/getid.cpp
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
gearbox/trunk/src/hokuyo_aist/test/example.cpp
Modified: gearbox/trunk/src/hokuyo_aist/getid/getid.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/getid/getid.cpp 2010-08-16 02:09:25 UTC (rev 513)
+++ gearbox/trunk/src/hokuyo_aist/getid/getid.cpp 2010-08-16 02:22:54 UTC (rev 514)
@@ -63,24 +63,24 @@
// Set the laser to verbose mode (so we see more information in the
// console)
if(verbose)
- laser.set_verbose (true);
+ laser.set_verbose(true);
// Open the laser
- laser.open (port_options);
+ laser.open(port_options);
// Turn the laser on
- laser.set_power (true);
+ laser.set_power(true);
// Get some laser info
hokuyo_aist::SensorInfo info;
- laser.get_sensor_info (&info);
+ laser.get_sensor_info(info);
std::cout << info.serial << '\n';
// Close the laser
- laser.close ();
+ laser.close();
}
catch(hokuyo_aist::BaseError &e)
{
- std::cerr << "Caught exception: " << e.what () << '\n';
+ std::cerr << "Caught exception: " << e.what() << '\n';
return 1;
}
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-16 02:09:25 UTC (rev 513)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-16 02:22:54 UTC (rev 514)
@@ -664,11 +664,8 @@
}
-void Sensor::get_sensor_info(SensorInfo* info)
+void Sensor::get_sensor_info(SensorInfo& info)
{
- if(info == 0)
- throw NoDestinationError();
-
if(scip_version_ == 1)
{
if(verbose_)
@@ -677,7 +674,7 @@
"() Getting sensor information using SCIP version 1.\n";
}
- info->set_defaults();
+ info.set_defaults();
char buffer[SCIP1_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP1_LINE_LENGTH);
@@ -685,27 +682,27 @@
send_command("V", 0, 0, 0);
// Get the vendor info line
read_line(buffer);
- info->vendor = &buffer[5]; // Chop off the "VEND:" tag
+ info.vendor = &buffer[5]; // Chop off the "VEND:" tag
// Get the product info line
read_line(buffer);
- info->product = &buffer[5];
+ info.product = &buffer[5];
// Only the URG-04LX supports SCIP1
model_ = MODEL_URG04LX;
// Get the firmware line
read_line(buffer);
- info->firmware = &buffer[5];
+ info.firmware = &buffer[5];
// Get the protocol version line
read_line(buffer);
- info->protocol = &buffer[5];
+ info.protocol = &buffer[5];
// Get the serial number
read_line(buffer);
- info->serial = &buffer[5];
+ info.serial = &buffer[5];
// Get either the status line or the end of message
read_line(buffer);
if(buffer[0] != '\0')
{
// Got a status line
- info->sensor_diagnostic = &buffer[5];
+ info.sensor_diagnostic = &buffer[5];
skip_lines(1);
}
@@ -714,60 +711,60 @@
// eg: FIRM:3.1.04,07/08/02(20-4095[mm],240[deg],44-725[step],600[rpm])
// Note that this example is right up against the maximum SCIP v1 line
// length of 64 bytes.
- if(atoi(info->firmware.c_str()) >= 3)
+ if(atoi(info.firmware.c_str()) >= 3)
{
if(verbose_)
err_output_ << "SCIP1 Firmware line for parsing: " <<
- info->firmware << '\n';
+ info.firmware << '\n';
// 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 const* valueStart;
- if((valueStart = strchr(info->firmware.c_str(), '(')) == 0)
+ if((valueStart = strchr(info.firmware.c_str(), '(')) == 0)
{
// No bracket? Crud. Fail and use the hard-coded values from
// the manual.
- info->calculate_values();
+ info.calculate_values();
}
// Now put it through sscanf and hope...
int aperture;
int numFound = sscanf(valueStart,
- "(%d-%d[mm],%d[deg],%d-%d[step],%d[rpm]", &info->min_range,
- &info->max_range, &aperture, &info->first_step,
- &info->last_step, &info->speed);
+ "(%d-%d[mm],%d[deg],%d-%d[step],%d[rpm]", &info.min_range,
+ &info.max_range, &aperture, &info.first_step,
+ &info.last_step, &info.speed);
if(numFound != 6)
{
// Didn't get enough values out, assume unknown format and fall
// back on the defaults
- info->set_defaults();
- info->calculate_values();
+ info.set_defaults();
+ info.calculate_values();
if(verbose_)
{
err_output_ << "Retrieved sensor info (hard-coded, not "
"enough values):\n";
- err_output_ << info->as_string();
+ err_output_ << info.as_string();
}
}
else
{
// Need to calculate stuff differently since it gave us an
// aperture value
- info->resolution = DTOR(static_cast<double>(aperture)) /
- static_cast<double>(info->last_step - info->first_step);
+ info.resolution = DTOR(static_cast<double>(aperture)) /
+ static_cast<double>(info.last_step - info.first_step);
// Assume that the range is evenly spread
- info->scanable_steps = info->last_step - info->first_step + 1;
- info->front_step = info->scanable_steps / 2 +
- info->first_step - 1;
- info->min_angle = (static_cast<int>(info->first_step) -
- static_cast<int>(info->front_step)) * info->resolution;
- info->max_angle = (info->last_step - info->front_step) *
- info->resolution;
+ info.scanable_steps = info.last_step - info.first_step + 1;
+ info.front_step = info.scanable_steps / 2 +
+ info.first_step - 1;
+ info.min_angle = (static_cast<int>(info.first_step) -
+ static_cast<int>(info.front_step)) * info.resolution;
+ info.max_angle = (info.last_step - info.front_step) *
+ info.resolution;
if(verbose_)
{
err_output_ << "Retrieved sensor info (from FIRM line):\n";
- err_output_ << info->as_string();
+ err_output_ << info.as_string();
}
}
}
@@ -775,11 +772,11 @@
{
// We're stuck with hard-coded defaults from the manual (already
// set earlier).
- info->calculate_values();
+ info.calculate_values();
if(verbose_)
{
err_output_ << "Retrieved sensor info (hard-coded):\n";
- err_output_ << info->as_string();
+ err_output_ << info.as_string();
}
}
}
@@ -791,7 +788,7 @@
"() Getting sensor information using SCIP version 2.\n";
}
- info->set_defaults();
+ info.set_defaults();
char buffer[SCIP2_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP2_LINE_LENGTH);
@@ -814,11 +811,11 @@
enable_checksum_workaround_ = false;
- info->calculate_values();
+ info.calculate_values();
if(verbose_)
{
err_output_ << "Retrieved sensor info:\n";
- err_output_ << info->as_string();
+ err_output_ << info.as_string();
}
}
else
@@ -1957,7 +1954,7 @@
// Get the laser's info
SensorInfo info;
- get_sensor_info(&info);
+ get_sensor_info(info);
min_angle_ = info.min_angle;
max_angle_ = info.max_angle;
@@ -1976,62 +1973,62 @@
}
-void Sensor::process_vv_line(char const* buffer, SensorInfo* info)
+void Sensor::process_vv_line(char const* buffer, SensorInfo& info)
{
if(strncmp(buffer, "VEND", 4) == 0)
- info->vendor = &buffer[5]; // Vendor info, minus the "VEND:" tag
+ info.vendor = &buffer[5]; // Vendor info, minus the "VEND:" tag
else if(strncmp(buffer, "PROD", 4) == 0)
{
- info->product = &buffer[5]; // Product info
+ info.product = &buffer[5]; // Product info
// Find the product model
find_model(&buffer[5]);
- info->detected_model = model_;
+ info.detected_model = model_;
}
else if(strncmp(buffer, "FIRM", 4) == 0)
- info->firmware = &buffer[5]; // Firmware version
+ info.firmware = &buffer[5]; // Firmware version
else if(strncmp(buffer, "PROT", 4) == 0)
- info->protocol = &buffer[5]; // Protocol version
+ info.protocol = &buffer[5]; // Protocol version
else if(strncmp(buffer, "SERI", 4) == 0)
- info->serial = &buffer[5]; // Serial number
+ info.serial = &buffer[5]; // Serial number
else if(!ignore_unknowns_)
throw UnknownLineError(buffer);
}
-void Sensor::process_pp_line(char const* buffer, SensorInfo* info)
+void Sensor::process_pp_line(char const* buffer, SensorInfo& info)
{
if(strncmp(buffer, "MODL", 4) == 0)
- info->model = &buffer[5]; // Model
+ info.model = &buffer[5]; // Model
// On to the fun ones that require parsing
else if(strncmp(buffer, "DMIN", 4) == 0)
- info->min_range = atoi(&buffer[5]);
+ info.min_range = atoi(&buffer[5]);
else if(strncmp(buffer, "DMAX", 4) == 0)
- info->max_range = atoi(&buffer[5]);
+ info.max_range = atoi(&buffer[5]);
else if(strncmp(buffer, "ARES", 4) == 0)
- info->steps = atoi(&buffer[5]);
+ info.steps = atoi(&buffer[5]);
else if(strncmp(buffer, "AMIN", 4) == 0)
- info->first_step = atoi(&buffer[5]);
+ info.first_step = atoi(&buffer[5]);
else if(strncmp(buffer, "AMAX", 4) == 0)
- info->last_step = atoi(&buffer[5]);
+ info.last_step = atoi(&buffer[5]);
else if(strncmp(buffer, "AFRT", 4) == 0)
- info->front_step = atoi(&buffer[5]);
+ info.front_step = atoi(&buffer[5]);
else if(strncmp(buffer, "SCAN", 4) == 0)
- info->standard_speed = atoi(&buffer[5]);
+ info.standard_speed = atoi(&buffer[5]);
/* No example in the manual and sensor with support for this has not
* arrived yet, so don't know what to look for.
else if(strncmp(buffer, "", 4) == 0)
{
if(strstr(buffer, "CCW") != 0)
- info->rot_dir = COUNTERCLOCKWISE;
+ info.rot_dir = COUNTERCLOCKWISE;
else
- info->rot_dir = CLOCKWISE;
+ info.rot_dir = CLOCKWISE;
}*/
else if(!ignore_unknowns_)
throw UnknownLineError(buffer);
}
-void Sensor::process_ii_line(char const* buffer, SensorInfo* info)
+void Sensor::process_ii_line(char const* buffer, SensorInfo& info)
{
if(strncmp(buffer, "MODL", 4) == 0)
// Do nothing here - we already know this value from PP
@@ -2039,54 +2036,54 @@
else if(strncmp(buffer, "LASR", 4) == 0)
{
if(strncmp(&buffer[5], "OFF", 3) == 0)
- info->power = false;
+ info.power = false;
else
- info->power = true;
+ info.power = true;
}
else if(strncmp(buffer, "SCSP", 4) == 0)
{
if(strncmp(&buffer[5], "Initial", 7) == 0)
{
// Unchanged motor speed
- if(sscanf(buffer, "SCSP:%*7s(%d[rpm]", &info->speed) != 1)
+ if(sscanf(buffer, "SCSP:%*7s(%d[rpm]", &info.speed) != 1)
{
throw ParseError(buffer, "Motor speed");
}
- info->speed_level = 0;
- time_resolution_ = info->speed;
+ info.speed_level = 0;
+ time_resolution_ = info.speed;
}
else
{
// Changed motor speed, format is:
// <level>%<ignored string>(<speed>[rpm])
- if(sscanf(buffer, "SCSP:%hd%%%*4s(%d[rpm]", &info->speed_level,
- &info->speed) != 2)
+ if(sscanf(buffer, "SCSP:%hd%%%*4s(%d[rpm]", &info.speed_level,
+ &info.speed) != 2)
{
throw ParseError(buffer, "Motor speed");
}
- time_resolution_ = info->speed;
+ time_resolution_ = info.speed;
}
}
else if(strncmp(buffer, "MESM", 4) == 0)
- info->measure_state = &buffer[5];
+ info.measure_state = &buffer[5];
else if(strncmp(buffer, "SBPS", 4) == 0)
{
if(strncmp(&buffer[5], "USB only", 8) == 0 ||
strncmp(&buffer[5], "USB Full Speed", 14) == 0)
{
// No baud rate for USB-only devices such as the UHG-08LX
- info->baud = 0;
+ info.baud = 0;
}
- else if(sscanf(buffer, "SBPS:%d[bps]", &info->baud) != 1)
+ else if(sscanf(buffer, "SBPS:%d[bps]", &info.baud) != 1)
throw ParseError(buffer, "Baud rate");
}
else if(strncmp(buffer, "TIME", 4) == 0)
{
- if(sscanf(buffer, "TIME:%x", &info->time) != 1)
+ if(sscanf(buffer, "TIME:%x", &info.time) != 1)
throw ParseError(buffer, "Timestamp");
}
else if(strncmp(buffer, "STAT", 4) == 0)
- info->sensor_diagnostic = &buffer[5];
+ info.sensor_diagnostic = &buffer[5];
else if(!ignore_unknowns_)
throw UnknownLineError(buffer);
}
Modified: gearbox/trunk/src/hokuyo_aist/sensor.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-16 02:09:25 UTC (rev 513)
+++ gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-16 02:22:54 UTC (rev 514)
@@ -20,7 +20,6 @@
#ifndef SENSOR_H__
#define SENSOR_H__
-#include <flexiport/port.h>
#include <string>
#if defined(WIN32)
@@ -38,6 +37,11 @@
#define HOKUYO_AIST_EXPORT
#endif
+namespace flexiport
+{
+ class Port;
+}
+
/** @ingroup gbx_library_hokuyo_aist
@{
*/
@@ -189,7 +193,7 @@
/** @brief Get various information about the scanner.
Much of the information is not available with the SCIP v1 protocol. */
- void get_sensor_info(SensorInfo* info);
+ void get_sensor_info(SensorInfo& info);
/** @brief Get the value of the scanner's clock in milliseconds.
@@ -535,9 +539,9 @@
void find_model(char const* buffer);
void get_and_set_scip_version();
void get_defaults();
- void process_vv_line(char const* buffer, SensorInfo* info);
- void process_pp_line(char const* buffer, SensorInfo* info);
- void process_ii_line(char const* buffer, SensorInfo* info);
+ void process_vv_line(char const* buffer, SensorInfo& info);
+ void process_pp_line(char const* buffer, SensorInfo& info);
+ void process_ii_line(char const* buffer, SensorInfo& info);
uint32_t process_echo_buffer(int const* buffer, int num_echos);
void read_2_byte_range_data(ScanData& data, unsigned int num_steps);
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-08-16 02:09:25 UTC (rev 513)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-08-16 02:22:54 UTC (rev 514)
@@ -171,7 +171,7 @@
// Get some laser info
std::cout << "Laser sensor information:\n";
hokuyo_aist::SensorInfo info;
- laser.get_sensor_info(&info);
+ laser.get_sensor_info(info);
std::cout << info.as_string();
// Get range data
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-08-16 02:09:33
|
Revision: 513
http://gearbox.svn.sourceforge.net/gearbox/?rev=513&view=rev
Author: gbiggs
Date: 2010-08-16 02:09:25 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
Removed public and private tags
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/scan_data.cpp
gearbox/trunk/src/hokuyo_aist/scan_data.h
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
gearbox/trunk/src/hokuyo_aist/sensor_info.h
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-08-16 01:36:43 UTC (rev 512)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-08-16 02:09:25 UTC (rev 513)
@@ -419,7 +419,7 @@
}
-void ScanData::write_range_(unsigned int index, uint32_t value)
+void ScanData::write_range(unsigned int index, uint32_t value)
{
if(ranges_ != 0)
{
@@ -432,7 +432,7 @@
}
-void ScanData::write_intensity_(unsigned int index, uint32_t value)
+void ScanData::write_intensity(unsigned int index, uint32_t value)
{
if(intensities_ != 0)
{
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-08-16 01:36:43 UTC (rev 512)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-08-16 02:09:25 UTC (rev 513)
@@ -110,7 +110,7 @@
/** @brief Get the system time stamp of the data in milliseconds.
This value is only available using SCIP version 2). */
- unsigned int system_time_stamp() const { return system_time_; }
+ unsigned long long system_time_stamp() const { return system_time_; }
/// Get the model of the laser that produced this scan.
LaserModel model() const { return model_; }
/// Check if the buffers are being provided instead of automatic.
@@ -143,14 +143,14 @@
unsigned int intensities_length_;
bool error_;
unsigned int laser_time_;
- unsigned int system_time_;
+ unsigned long long system_time_;
LaserModel model_;
bool buffers_provided_;
void allocate_data(unsigned int length,
bool include_intensities = false);
- void write_range_(unsigned int index, uint32_t value);
- void write_intensity_(unsigned int index, uint32_t value);
+ void write_range(unsigned int index, uint32_t value);
+ void write_intensity(unsigned int index, uint32_t value);
}; // class ScanData
} // namespace hokuyo_aist
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-16 01:36:43 UTC (rev 512)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-16 02:09:25 UTC (rev 513)
@@ -323,9 +323,9 @@
// Figure out the SCIP version currently in use and switch to a higher one
// if possible
- get_and_set_scip_version_();
+ get_and_set_scip_version();
// Get some values we need for providing default ranges
- get_defaults_();
+ get_defaults();
}
@@ -352,9 +352,9 @@
{
// Figure out the SCIP version currently in use and switch to a higher
// one if possible
- get_and_set_scip_version_();
+ get_and_set_scip_version();
// Get some values we need for providing default ranges
- get_defaults_();
+ get_defaults();
}
catch(BaseError)
{
@@ -375,8 +375,8 @@
reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(bauds[ii]);
try
{
- get_and_set_scip_version_();
- get_defaults_();
+ get_and_set_scip_version();
+ get_defaults();
// If the above two functions succeed, break out of the
// loop and be happy
if(verbose_)
@@ -448,16 +448,16 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser on.\n";
- send_command_("L", "1", 1, 0);
+ send_command("L", "1", 1, 0);
}
else
{
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser off.\n";
- send_command_("L", "0", 1, 0);
+ send_command("L", "0", 1, 0);
}
- skip_lines_(1);
+ skip_lines(1);
}
else if(scip_version_ == 2)
{
@@ -466,16 +466,16 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser on.\n";
- send_command_("BM", 0, 0, "02");
+ send_command("BM", 0, 0, "02");
}
else
{
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser off.\n";
- send_command_("QT", 0, 0, "02");
+ send_command("QT", 0, 0, "02");
}
- skip_lines_(1);
+ skip_lines(1);
}
else
throw UnknownScipVersionError();
@@ -502,16 +502,16 @@
if(scip_version_ == 1)
{
// Send the command to change baud rate
- send_command_("S", newBaud, 13, 0);
- skip_lines_(1);
+ send_command("S", newBaud, 13, 0);
+ skip_lines(1);
// Change the port's baud rate
reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(baud);
}
else if(scip_version_ == 2)
{
// Send the command to change baud rate
- send_command_("SS", newBaud, 6, "03");
- skip_lines_(1);
+ send_command("SS", newBaud, 6, "03");
+ skip_lines(1);
// Change the port's baud rate
reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(baud);
}
@@ -542,9 +542,9 @@
err_output_ << "Sensor::" << __func__ <<
"() Setting IP information to $I" << params.str() << '\n';
}
- int status = send_command_(&command[0], params.str().c_str(), 48, 0);
+ int status = send_command(&command[0], params.str().c_str(), 48, 0);
// Skip the extra line feed
- skip_lines_(1);
+ skip_lines(1);
if(status != 0)
throw SetIPError();
}
@@ -561,8 +561,8 @@
err_output_ << "Sensor::" << __func__ <<
"() Resetting laser.\n";
}
- send_command_("RS", 0, 0, 0);
- skip_lines_(1);
+ send_command("RS", 0, 0, 0);
+ skip_lines(1);
}
else
throw UnknownScipVersionError();
@@ -578,8 +578,8 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Resetting laser.\n";
- send_command_("RS", 0, 0, 0);
- skip_lines_(1);
+ send_command("RS", 0, 0, 0);
+ skip_lines(1);
}
else
throw UnknownScipVersionError();
@@ -627,8 +627,8 @@
}
number_to_string(speed, buffer, 2);
}
- send_command_("CR", buffer, 2, "03");
- skip_lines_(1);
+ send_command("CR", buffer, 2, "03");
+ skip_lines(1);
}
else
throw UnknownScipVersionError();
@@ -646,7 +646,7 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Switching to high sensitivity.\n";
- send_command_("HS", "1", 1, "02");
+ send_command("HS", "1", 1, "02");
}
else
{
@@ -655,9 +655,9 @@
err_output_ << "Sensor::" << __func__ <<
"() Switching to normal sensitivity.\n";
}
- send_command_("HS", "0", 1, "02");
+ send_command("HS", "0", 1, "02");
}
- skip_lines_(1);
+ skip_lines(1);
}
else
throw UnknownScipVersionError();
@@ -677,36 +677,36 @@
"() Getting sensor information using SCIP version 1.\n";
}
- info->set_defaults_();
+ info->set_defaults();
char buffer[SCIP1_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP1_LINE_LENGTH);
- send_command_("V", 0, 0, 0);
+ send_command("V", 0, 0, 0);
// Get the vendor info line
- read_line_(buffer);
+ read_line(buffer);
info->vendor = &buffer[5]; // Chop off the "VEND:" tag
// Get the product info line
- read_line_(buffer);
+ read_line(buffer);
info->product = &buffer[5];
// Only the URG-04LX supports SCIP1
model_ = MODEL_URG04LX;
// Get the firmware line
- read_line_(buffer);
+ read_line(buffer);
info->firmware = &buffer[5];
// Get the protocol version line
- read_line_(buffer);
+ read_line(buffer);
info->protocol = &buffer[5];
// Get the serial number
- read_line_(buffer);
+ read_line(buffer);
info->serial = &buffer[5];
// Get either the status line or the end of message
- read_line_(buffer);
+ read_line(buffer);
if(buffer[0] != '\0')
{
// Got a status line
info->sensor_diagnostic = &buffer[5];
- skip_lines_(1);
+ skip_lines(1);
}
// Check the firmware version major number. If it's >=3 there is
@@ -728,7 +728,7 @@
{
// No bracket? Crud. Fail and use the hard-coded values from
// the manual.
- info->calculate_values_();
+ info->calculate_values();
}
// Now put it through sscanf and hope...
int aperture;
@@ -740,8 +740,8 @@
{
// Didn't get enough values out, assume unknown format and fall
// back on the defaults
- info->set_defaults_();
- info->calculate_values_();
+ info->set_defaults();
+ info->calculate_values();
if(verbose_)
{
err_output_ << "Retrieved sensor info (hard-coded, not "
@@ -775,7 +775,7 @@
{
// We're stuck with hard-coded defaults from the manual (already
// set earlier).
- info->calculate_values_();
+ info->calculate_values();
if(verbose_)
{
err_output_ << "Retrieved sensor info (hard-coded):\n";
@@ -791,30 +791,30 @@
"() Getting sensor information using SCIP version 2.\n";
}
- info->set_defaults_();
+ info->set_defaults();
char buffer[SCIP2_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP2_LINE_LENGTH);
// We need to send three commands to get all the info we want: VV, PP
// and II
- send_command_("VV", 0, 0, 0);
- while(read_line_with_check_(buffer, -1, true) != 0)
- process_vv_line_(buffer, info);
+ send_command("VV", 0, 0, 0);
+ while(read_line_with_check(buffer, -1, true) != 0)
+ process_vv_line(buffer, info);
// Next up, PP
- send_command_("PP", 0, 0, 0);
- while(read_line_with_check_(buffer, -1, true) != 0)
- process_pp_line_(buffer, info);
+ send_command("PP", 0, 0, 0);
+ while(read_line_with_check(buffer, -1, true) != 0)
+ process_pp_line(buffer, info);
// Command II: Revenge of the Commands.
- send_command_("II", 0, 0, 0);
- while(read_line_with_check_(buffer, -1, true) != 0)
- process_ii_line_(buffer, info);
+ send_command("II", 0, 0, 0);
+ while(read_line_with_check(buffer, -1, true) != 0)
+ process_ii_line(buffer, info);
enable_checksum_workaround_ = false;
- info->calculate_values_();
+ info->calculate_values();
if(verbose_)
{
err_output_ << "Retrieved sensor info:\n";
@@ -828,7 +828,7 @@
unsigned int Sensor::get_time()
{
- return offset_timestamp_(wrap_timestamp_(get_raw_time()));
+ return offset_timestamp(wrap_timestamp(get_raw_time()));
}
@@ -841,12 +841,12 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Retrieving time from laser.\n";
- send_command_("TM", "0", 1, 0);
- send_command_("TM", "1", 1, 0);
+ send_command("TM", "0", 1, 0);
+ send_command("TM", "1", 1, 0);
char buffer[7];
- read_line_with_check_(buffer, 6);
- send_command_("TM", "2", 1, 0);
- skip_lines_(1);
+ read_line_with_check(buffer, 6);
+ send_command("TM", "2", 1, 0);
+ skip_lines(1);
// We need to decode the time value that's in the buffer
return decode_4_byte_value(buffer);
}
@@ -862,7 +862,7 @@
{
if(verbose_)
err_output_ << "Entering timing mode.\n";
- enter_timing_mode_();
+ enter_timing_mode();
// From A. Carballo, Y. Hara, H. Kawata, T.
// Yoshida, A. Ohya, S. Yuta, “Time synchronisation
@@ -882,9 +882,9 @@
for(unsigned int ii = 0; ii < samples; ii++)
{
unsigned long long end_time(0);
- unsigned long long start_time = get_computer_time_();
+ unsigned long long start_time = get_computer_time();
unsigned long long laser_time =
- wrap_timestamp_(get_timing_mode_time_(&end_time)) * 1e6;
+ wrap_timestamp(get_timing_mode_time(&end_time)) * 1e6;
offsets.push_back(start_time -
(laser_time - (end_time - start_time) / 2));
}
@@ -908,9 +908,9 @@
for(unsigned int ii = 0; ii < samples; ii++)
{
unsigned long long end_time(0);
- unsigned long long start_time = get_computer_time_();
+ unsigned long long start_time = get_computer_time();
unsigned long long laser_time =
- wrap_timestamp_(get_timing_mode_time_(&end_time)) * 1e6;
+ wrap_timestamp(get_timing_mode_time(&end_time)) * 1e6;
offsets.push_back(start_time -
(laser_time - (end_time - start_time) / 2));
}
@@ -934,7 +934,7 @@
// All done.
if(verbose_)
err_output_ << "Leaving timing mode.\n";
- leave_timing_mode_();
+ leave_timing_mode();
return time_offset_;
}
@@ -966,9 +966,9 @@
number_to_string(start_step, buffer, 3);
number_to_string(end_step, &buffer[3], 3);
number_to_string(cluster_count, &buffer[6], 2);
- send_command_("G", buffer, 8, 0);
+ send_command("G", buffer, 8, 0);
// In SCIP1 mode we're going to get back 2-byte data
- read_2_byte_range_data_(data, num_steps);
+ read_2_byte_range_data(data, num_steps);
}
else if(scip_version_ == 2)
{
@@ -978,20 +978,20 @@
number_to_string(end_step, &buffer[4], 4);
number_to_string(cluster_count, &buffer[8], 2);
if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
- send_command_("HD", buffer, 10, 0);
+ send_command("HD", buffer, 10, 0);
else
- send_command_("GD", buffer, 10, 0);
+ send_command("GD", buffer, 10, 0);
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
- if(read_line_with_check_(buffer) == 0)
+ if(read_line_with_check(buffer) == 0)
throw NoDataError();
data.laser_time_ = decode_4_byte_value(buffer) +
- step_to_time_offset_(start_step);
- data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
+ step_to_time_offset(start_step);
+ data.system_time_ = offset_timestamp(wrap_timestamp(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GD command
- read_3_byte_range_data_(data, num_steps);
+ read_3_byte_range_data(data, num_steps);
}
else
throw UnknownScipVersionError();
@@ -1057,20 +1057,20 @@
number_to_string(end_step, &buffer[4], 4);
number_to_string(cluster_count, &buffer[8], 2);
if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
- send_command_("HE", buffer, 10, 0);
+ send_command("HE", buffer, 10, 0);
else
- send_command_("GE", buffer, 10, 0);
+ send_command("GE", buffer, 10, 0);
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
- if(read_line_with_check_(buffer) == 0)
+ if(read_line_with_check(buffer) == 0)
throw NoDataError();
data.laser_time_ = decode_4_byte_value(buffer) +
- step_to_time_offset_(start_step);
- data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
+ step_to_time_offset(start_step);
+ data.system_time_ = offset_timestamp(wrap_timestamp(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GE command
- read_3_byte_range_data_(data, num_steps);
+ read_3_byte_range_data(data, num_steps);
return data.ranges_length_;
}
@@ -1140,13 +1140,13 @@
command[0] = 'M';
command[1] = 'D';
command[2] = '\0';
- send_command_(command, buffer, 13, 0);
+ send_command(command, buffer, 13, 0);
// Mx commands will perform a scan, then send the data prefixed with
// another command echo.
// Read back the command echo (minimum of 3 bytes, maximum of 16 bytes)
char response[17];
- skip_lines_(1); // End of the command echo message
- read_line_(response, 16); // Size is command(2)+params(13)+new line(1)
+ skip_lines(1); // End of the command echo message
+ read_line(response, 16); // Size is command(2)+params(13)+new line(1)
// Check the echo is correct
if(response[0] != command[0] || response[1] != command[1])
throw CommandEchoError(command, response);
@@ -1155,7 +1155,7 @@
if(memcmp(&response[2], buffer, 13) != 0)
throw ParamEchoError(command);
// The next line should be the status line
- read_line_with_check_(response, 4);
+ read_line_with_check(response, 4);
if(verbose_)
{
err_output_ << "Sensor::" << __func__ <<
@@ -1167,7 +1167,7 @@
{
// There is an extra line feed after an error status (signalling
// end of message)
- skip_lines_(1);
+ skip_lines(1);
throw ResponseError(response, command);
}
@@ -1175,14 +1175,14 @@
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
- if(read_line_with_check_(buffer) == 0)
+ if(read_line_with_check(buffer) == 0)
throw NoDataError();
data.laser_time_ = decode_4_byte_value(buffer) +
- step_to_time_offset_(start_step);
- data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
+ step_to_time_offset(start_step);
+ data.system_time_ = offset_timestamp(wrap_timestamp(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the MD command
- read_3_byte_range_data_(data, num_steps);
+ read_3_byte_range_data(data, num_steps);
return data.ranges_length_;
}
@@ -1256,13 +1256,13 @@
command[0] = 'M';
command[1] = 'E';
command[2] = '\0';
- send_command_(command, buffer, 13, 0);
+ send_command(command, buffer, 13, 0);
// Mx commands will perform a scan, then send the data prefixed with
// another command echo.
// Read back the command echo (minimum of 3 bytes, maximum of 16 bytes)
char response[17];
- skip_lines_(1); // End of the command echo message
- read_line_(response, 16); // Size is command(2)+params(13)+new line(1)
+ skip_lines(1); // End of the command echo message
+ read_line(response, 16); // Size is command(2)+params(13)+new line(1)
// Check the echo is correct
if(response[0] != command[0] || response[1] != command[1])
throw CommandEchoError(command, response);
@@ -1271,7 +1271,7 @@
if(memcmp(&response[2], buffer, 13) != 0)
throw ParamEchoError(command);
// The next line should be the status line
- read_line_with_check_(response, 4);
+ read_line_with_check(response, 4);
if(verbose_)
{
err_output_ << "Sensor::" << __func__ <<
@@ -1283,7 +1283,7 @@
{
// There is an extra line feed after an error status (signalling
// end of message)
- skip_lines_(1);
+ skip_lines(1);
throw ResponseError(response, command);
}
@@ -1291,14 +1291,14 @@
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
- if(read_line_with_check_(buffer) == 0)
+ if(read_line_with_check(buffer) == 0)
throw NoDataError();
data.laser_time_ = decode_4_byte_value(buffer) +
- step_to_time_offset_(start_step);
- data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
+ step_to_time_offset(start_step);
+ data.system_time_ = offset_timestamp(wrap_timestamp(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the ME command
- read_3_byte_range_and_intensity_data_(data, num_steps);
+ read_3_byte_range_and_intensity_data(data, num_steps);
return data.ranges_length_;
}
@@ -1368,7 +1368,7 @@
// keep flushing until the port reports there is no data left after a timeout.
// This shouldn't be called too much, as it introduces a delay as big as the
// timeout (which may be infinite).
-void Sensor::clear_read_buffer_()
+void Sensor::clear_read_buffer()
{
while(port_->BytesAvailableWait() > 0)
port_->Flush();
@@ -1383,7 +1383,7 @@
// The line feed that terminates a line will be replaced with a 0.
// The return value is the number of bytes received, not including the 0
// byte or the line feed.
-int Sensor::read_line_(char* buffer, int expected_length)
+int Sensor::read_line(char* buffer, int expected_length)
{
int linelength = 0;
@@ -1436,7 +1436,7 @@
// This function will read a line and then calculate its checksum, comparing it
// with the checksum at the end of the line. The checksum will be removed
// (along with the semi-colon, if present). buffer and expected_length args are
-// as for read_line_().
+// as for read_line().
// If has_semicolon is true, the byte before the checksum is assumed to be the
// semi-colon separator and so not a part of the checksum. If it's not a
// semi-colon, an exception is thrown.
@@ -1450,10 +1450,10 @@
// model_ is MODEL_UTM30LX. In this case, if the checksum fails normally, it
// scans the line for "<-" and recalculates the checksum on the bytes up to
// that point. This only happens in SCIP v2.
-int Sensor::read_line_with_check_(char* buffer, int expected_length,
+int Sensor::read_line_with_check(char* buffer, int expected_length,
bool has_semicolon)
{
- int linelength = read_line_(buffer, expected_length);
+ int linelength = read_line(buffer, expected_length);
if(scip_version_ == 1)
{
// No checksums in SCIP version 1
@@ -1481,7 +1481,7 @@
int checkSum = 0;
try
{
- checkSum = confirm_checksum_(buffer, bytesToConsider,
+ checkSum = confirm_checksum(buffer, bytesToConsider,
static_cast<int>(buffer[checksumIndex]));
}
catch(ProtocolError& e)
@@ -1506,7 +1506,7 @@
linelength);
}
- checkSum = confirm_checksum_(buffer, newBytesToConsider,
+ checkSum = confirm_checksum(buffer, newBytesToConsider,
static_cast<int>(buffer[checksumIndex]));
}
else
@@ -1526,7 +1526,7 @@
// Reads lines until the number specified has passed.
-void Sensor::skip_lines_(int count)
+void Sensor::skip_lines(int count)
{
if(verbose_)
err_output_ << "Sensor::" << __func__ << "() Skipping " << count <<
@@ -1545,7 +1545,7 @@
// If param_length is 0, no parameters will be sent or expected in the reply.
// extra_ok must be a 1-byte string for SCIP1 and a 2-byte string for SCIP2.
// Return value is the status code returned for the command.
-int Sensor::send_command_(char const* cmd, char const* param,
+int Sensor::send_command(char const* cmd, char const* param,
int param_length, char const* extra_ok)
{
int statusCode = -1;
@@ -1577,8 +1577,8 @@
// 16 including \n's depending on the parameters): cmd[0] params \n
// status \n
int statusIndex = 2 + param_length;
- read_line_(response, 2 + param_length);
- read_line_(&response[statusIndex], 2);
+ read_line(response, 2 + param_length);
+ read_line(&response[statusIndex], 2);
// First make sure that the echoed command matches
if(response[0] != cmd[0])
{
@@ -1616,7 +1616,7 @@
{
// There is an extra line feed after an error status
// (signalling end of message)
- skip_lines_(1);
+ skip_lines(1);
throw Scip1ResponseError(response[statusIndex], cmd[0]);
}
}
@@ -1624,7 +1624,7 @@
{
// There is an extra line feed after an error status
// (signalling end of message)
- skip_lines_(1);
+ skip_lines(1);
throw Scip1ResponseError(response[statusIndex], cmd[0]);
}
}
@@ -1651,7 +1651,7 @@
throw WriteError(21);
// Read back the command echo (minimum of 3 bytes, maximum of 16 bytes)
- read_line_(response, 3 + param_length);
+ read_line(response, 3 + param_length);
// Check the echo is correct
if(response[0] != cmd[0] || response[1] != cmd[1])
throw CommandEchoError(cmd, response);
@@ -1663,7 +1663,7 @@
}
// The next line should be the status line
- read_line_with_check_(response, 4);
+ read_line_with_check(response, 4);
if(verbose_)
{
err_output_ << "Sensor::" << __func__ <<
@@ -1681,7 +1681,7 @@
{
// There is an extra line feed after an error status
// (signalling end of message)
- skip_lines_(1);
+ skip_lines(1);
throw ResponseError(response, cmd);
}
}
@@ -1689,7 +1689,7 @@
{
// There is an extra line feed after an error status
// (signalling end of message)
- skip_lines_(1);
+ skip_lines(1);
throw ResponseError(response, cmd);
}
}
@@ -1704,25 +1704,25 @@
/// Puts the laser into the timing mode.
-void Sensor::enter_timing_mode_()
+void Sensor::enter_timing_mode()
{
- send_command_("TM", "0", 1, 0);
- skip_lines_(1);
+ send_command("TM", "0", 1, 0);
+ skip_lines(1);
}
/// Take the laser out of timing mode.
-void Sensor::leave_timing_mode_()
+void Sensor::leave_timing_mode()
{
- send_command_("TM", "2", 1, 0);
- skip_lines_(1);
+ send_command("TM", "2", 1, 0);
+ skip_lines(1);
}
/// Get the timestamp from the laser.
/// If @ref reception_time is not 0, it will be filled with the time at
/// which data reception was completed.
-unsigned int Sensor::get_timing_mode_time_(unsigned long long* reception_time)
+unsigned int Sensor::get_timing_mode_time(unsigned long long* reception_time)
{
// To get the most accurate result, we cannot do any processing while
// receiving. We want to know the time that reception finished as exactly
@@ -1734,7 +1734,7 @@
throw WriteError(19);
unsigned int line_length = port_->Read(response, 16);
if(reception_time)
- *reception_time = get_computer_time_();
+ *reception_time = get_computer_time();
// Process the response to confirm it is correct
if(line_length < 0)
throw ReadError(0);
@@ -1749,7 +1749,7 @@
if(response[4] != '0' || response[5] != '0' || response[6] != 'P')
throw ResponseError(response, "TM");
// Check the checksum on the time stamp is accurate
- confirm_checksum_(&response[8], 4, response[12]);
+ confirm_checksum(&response[8], 4, response[12]);
// Decode the time stamp
unsigned int timestamp =
decode_4_byte_value(&response[8]);
@@ -1758,7 +1758,7 @@
/// Get the computer's time as accurately as possible.
-unsigned long long Sensor::get_computer_time_()
+unsigned long long Sensor::get_computer_time()
{
#if defined(_POSIX_TIMERS)
struct timespec ts;
@@ -1773,7 +1773,7 @@
/// timestamp must be in milliseconds. The result is in milliseconds.
-unsigned int Sensor::wrap_timestamp_(unsigned int timestamp)
+unsigned int Sensor::wrap_timestamp(unsigned int timestamp)
{
if(timestamp < last_timestamp_)
{
@@ -1786,14 +1786,14 @@
/// timestamp must be in milliseconds. The result is in nanoseconds.
-unsigned long long Sensor::offset_timestamp_(unsigned int timestamp)
+unsigned long long Sensor::offset_timestamp(unsigned int timestamp)
{
return ((1 - time_drift_rate_) * timestamp * 1e6 + time_offset_) /
(1 - time_skew_alpha_);
}
-unsigned int Sensor::step_to_time_offset_(int start_step)
+unsigned int Sensor::step_to_time_offset(int start_step)
{
if(start_step < 0)
return first_step_ * time_resolution_;
@@ -1803,7 +1803,7 @@
/// Search a string for the laser's model.
-void Sensor::find_model_(char const* buffer)
+void Sensor::find_model(char const* buffer)
{
if(strstr(buffer, "URG-04LX") != 0)
model_ = MODEL_URG04LX;
@@ -1825,7 +1825,7 @@
}
-void Sensor::get_and_set_scip_version_()
+void Sensor::get_and_set_scip_version()
{
bool scip2Failed = false;
@@ -1836,7 +1836,7 @@
// Try SCIP version 2 first by sending an info command
try
{
- send_command_("VV", 0, 0, 0);
+ send_command("VV", 0, 0, 0);
}
catch(BaseError)
{
@@ -1856,18 +1856,18 @@
port_->Flush();
try
{
- send_command_("V", 0, 0, 0);
+ send_command("V", 0, 0, 0);
}
catch(BaseError)
{
throw ScipVersionError();
}
// Skip the vendor and product info
- skip_lines_(2);
+ skip_lines(2);
// Get the firmware line
char buffer[SCIP1_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP1_LINE_LENGTH);
- read_line_(buffer);
+ read_line(buffer);
if(strncmp(buffer, "FIRM:", 5) != 0)
throw MissingFirmSpecError();
@@ -1887,7 +1887,7 @@
}
// Dump the rest of the V command result (one of these will be the
// empty last line)
- skip_lines_(3);
+ skip_lines(3);
// If the firmware version is less than 3, we're stuck with SCIP
// version 1.
@@ -1910,7 +1910,7 @@
// first byte as the command and the other 6 as parameters.
try
{
- send_command_("S", "CIP2.0", 6, 0);
+ send_command("S", "CIP2.0", 6, 0);
}
catch(BaseError)
{
@@ -1921,7 +1921,7 @@
return;
}
// There'll be a trailing line on the end
- skip_lines_(1);
+ skip_lines(1);
// Changed to SCIP version 2
if(verbose_)
@@ -1937,7 +1937,7 @@
scip_version_ = 2;
// Dump the rest of the result
- skip_lines_(6);
+ skip_lines(6);
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Using SCIP version 2.\n";
@@ -1949,7 +1949,7 @@
}
-void Sensor::get_defaults_()
+void Sensor::get_defaults()
{
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
@@ -1976,7 +1976,7 @@
}
-void Sensor::process_vv_line_(char const* buffer, SensorInfo* info)
+void Sensor::process_vv_line(char const* buffer, SensorInfo* info)
{
if(strncmp(buffer, "VEND", 4) == 0)
info->vendor = &buffer[5]; // Vendor info, minus the "VEND:" tag
@@ -1984,7 +1984,7 @@
{
info->product = &buffer[5]; // Product info
// Find the product model
- find_model_(&buffer[5]);
+ find_model(&buffer[5]);
info->detected_model = model_;
}
else if(strncmp(buffer, "FIRM", 4) == 0)
@@ -1998,7 +1998,7 @@
}
-void Sensor::process_pp_line_(char const* buffer, SensorInfo* info)
+void Sensor::process_pp_line(char const* buffer, SensorInfo* info)
{
if(strncmp(buffer, "MODL", 4) == 0)
info->model = &buffer[5]; // Model
@@ -2031,7 +2031,7 @@
}
-void Sensor::process_ii_line_(char const* buffer, SensorInfo* info)
+void Sensor::process_ii_line(char const* buffer, SensorInfo* info)
{
if(strncmp(buffer, "MODL", 4) == 0)
// Do nothing here - we already know this value from PP
@@ -2094,7 +2094,7 @@
/// Combines up to three values from an echo buffer into a single value based
/// on the setting of multiecho_mode_.
-uint32_t Sensor::process_echo_buffer_(int const* buffer, int num_echos)
+uint32_t Sensor::process_echo_buffer(int const* buffer, int num_echos)
{
uint32_t sum = 0;
switch(multiecho_mode_)
@@ -2125,7 +2125,7 @@
}
-void Sensor::read_2_byte_range_data_(ScanData& data, unsigned int num_steps)
+void Sensor::read_2_byte_range_data(ScanData& data, unsigned int num_steps)
{
if(verbose_)
{
@@ -2146,7 +2146,7 @@
while(true)
{
// Read a line of data
- numBytesInLine = read_line_with_check_(buffer);
+ numBytesInLine = read_line_with_check(buffer);
// Check if we've reached the end of the data
if(numBytesInLine == 0)
break;
@@ -2158,7 +2158,7 @@
// Line feed in the middle of a data block? Why?
throw MisplacedLineFeedError();
}
- data.write_range_(current_step, decode_2_byte_value(&buffer[ii]));
+ data.write_range(current_step, decode_2_byte_value(&buffer[ii]));
}
// End of this line. Go around again.
}
@@ -2171,7 +2171,7 @@
}
-void Sensor::read_3_byte_range_data_(ScanData& data, unsigned int num_steps)
+void Sensor::read_3_byte_range_data(ScanData& data, unsigned int num_steps)
{
if(verbose_)
{
@@ -2202,15 +2202,15 @@
while(true)
{
// Read a line of data
- numBytesInLine = read_line_with_check_(buffer);
+ numBytesInLine = read_line_with_check(buffer);
// Check if we've reached the end of the data
if(numBytesInLine == 0)
{
if(echo_buffer[0] != -1)
{
// Not the first value, so deal with the previous
- data.write_range_(current_step,
- process_echo_buffer_(echo_buffer, echo_buf_ind + 1));
+ data.write_range(current_step,
+ process_echo_buffer(echo_buffer, echo_buf_ind + 1));
if(data.ranges_)
{
if(data.ranges_[current_step] > max_range_)
@@ -2247,8 +2247,8 @@
else if(echo_buffer[0] != -1)
{
// Not the first value, so deal with the previous
- data.write_range_(current_step,
- process_echo_buffer_(echo_buffer,
+ data.write_range(current_step,
+ process_echo_buffer(echo_buffer,
echo_buf_ind + 1));
if(data.ranges_)
{
@@ -2315,7 +2315,7 @@
}
-void Sensor::read_3_byte_range_and_intensity_data_(ScanData& data,
+void Sensor::read_3_byte_range_and_intensity_data(ScanData& data,
unsigned int num_steps)
{
if(verbose_)
@@ -2347,7 +2347,7 @@
while(true)
{
// Read a line of data
- numBytesInLine = read_line_with_check_(buffer);
+ numBytesInLine = read_line_with_check(buffer);
// Check if we've reached the end of the data
if(numBytesInLine == 0)
{
@@ -2357,8 +2357,8 @@
if(echo_buffer[0] != -1)
{
assert(nextIsIntensity == true);
- data.write_intensity_(current_intensity,
- process_echo_buffer_(echo_buffer, echo_buf_ind + 1));
+ data.write_intensity(current_intensity,
+ process_echo_buffer(echo_buffer, echo_buf_ind + 1));
current_intensity++;
}
break;
@@ -2387,14 +2387,14 @@
// Not the first value, so deal with the previous
if(nextIsIntensity)
{
- data.write_intensity_(current_intensity,
- process_echo_buffer_(echo_buffer,
+ data.write_intensity(current_intensity,
+ process_echo_buffer(echo_buffer,
echo_buf_ind + 1));
}
else
{
- data.write_range_(current_range,
- process_echo_buffer_(echo_buffer,
+ data.write_range(current_range,
+ process_echo_buffer(echo_buffer,
echo_buf_ind + 1));
}
echo_buf_ind = 0;
@@ -2478,7 +2478,7 @@
}
-int Sensor::confirm_checksum_(char const* buffer, int length,
+int Sensor::confirm_checksum(char const* buffer, int length,
int expected_sum)
{
int checksum = 0;
Modified: gearbox/trunk/src/hokuyo_aist/sensor.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-16 01:36:43 UTC (rev 512)
+++ gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-16 02:09:25 UTC (rev 513)
@@ -509,45 +509,43 @@
/// The clock skew alpha value.
float time_skew_alpha_;
- void clear_read_buffer_();
- int read_line_(char* buffer, int expected_length = -1);
- int read_line_with_check_(char* buffer, int expected_length = -1,
+ void clear_read_buffer();
+ int read_line(char* buffer, int expected_length = -1);
+ int read_line_with_check(char* buffer, int expected_length = -1,
bool has_semicolon = false);
- void skip_lines_(int count);
- int send_command_(char const* cmd, char const* param, int param_length,
+ void skip_lines(int count);
+ int send_command(char const* cmd, char const* param, int param_length,
char const* extra_ok);
- public:
- void enter_timing_mode_();
- void leave_timing_mode_();
+ void enter_timing_mode();
+ void leave_timing_mode();
/// Get the laser time in milliseconds.
- unsigned int get_timing_mode_time_(unsigned long long* reception_time=0);
+ unsigned int get_timing_mode_time(unsigned long long* reception_time=0);
/// Get the computer time in nanoseconds.
- unsigned long long get_computer_time_();
+ unsigned long long get_computer_time();
/// Adjust a wrapped laser timestamp, in milliseconds.
- unsigned int wrap_timestamp_(unsigned int timestamp);
+ unsigned int wrap_timestamp(unsigned int timestamp);
/// Offset a laser timestamp, in milliseconds, into computer time, in
/// nanoseconds.
- unsigned long long offset_timestamp_(unsigned int timestamp);
- private:
+ unsigned long long offset_timestamp(unsigned int timestamp);
/// Convert a step value into its time offset from the start of a scan,
/// in milliseconds.
- unsigned int step_to_time_offset_(int start_step);
+ unsigned int step_to_time_offset(int start_step);
- void find_model_(char const* buffer);
- void get_and_set_scip_version_();
- void get_defaults_();
- void process_vv_line_(char const* buffer, SensorInfo* info);
- void process_pp_line_(char const* buffer, SensorInfo* info);
- void process_ii_line_(char const* buffer, SensorInfo* info);
+ void find_model(char const* buffer);
+ void get_and_set_scip_version();
+ void get_defaults();
+ void process_vv_line(char const* buffer, SensorInfo* info);
+ void process_pp_line(char const* buffer, SensorInfo* info);
+ void process_ii_line(char const* buffer, SensorInfo* info);
- uint32_t process_echo_buffer_(int const* buffer, int num_echos);
- void read_2_byte_range_data_(ScanData& data, unsigned int num_steps);
- void read_3_byte_range_data_(ScanData& data, unsigned int num_steps);
- void read_3_byte_range_and_intensity_data_(ScanData& data,
+ uint32_t process_echo_buffer(int const* buffer, int num_echos);
+ void read_2_byte_range_data(ScanData& data, unsigned int num_steps);
+ void read_3_byte_range_data(ScanData& data, unsigned int num_steps);
+ void read_3_byte_range_and_intensity_data(ScanData& data,
unsigned int num_steps);
- int confirm_checksum_(char const* buffer, int length,
+ int confirm_checksum(char const* buffer, int length,
int expected_sum);
}; // class Sensor
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-08-16 01:36:43 UTC (rev 512)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-08-16 02:09:25 UTC (rev 513)
@@ -39,7 +39,7 @@
// Set various known values based on what the manual says
-void SensorInfo::set_defaults_()
+void SensorInfo::set_defaults()
{
switch(detected_model)
{
@@ -103,7 +103,7 @@
}
-void SensorInfo::calculate_values_()
+void SensorInfo::calculate_values()
{
resolution = DTOR(360.0) / steps;
// If any of the steps are beyond INT_MAX, we have problems.
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-08-16 01:36:43 UTC (rev 512)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-08-16 02:09:25 UTC (rev 513)
@@ -206,8 +206,8 @@
LaserModel detected_model;
private:
- void set_defaults_();
- void calculate_values_();
+ void set_defaults();
+ void calculate_values();
}; // class SensorInfo
}; // namespace hokuyo_aist
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-08-16 01:36:50
|
Revision: 512
http://gearbox.svn.sourceforge.net/gearbox/?rev=512&view=rev
Author: gbiggs
Date: 2010-08-16 01:36:43 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
Changed data pointer to reference
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
gearbox/trunk/src/hokuyo_aist/test/example.cpp
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-11 00:49:53 UTC (rev 511)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-16 01:36:43 UTC (rev 512)
@@ -939,12 +939,9 @@
}
-unsigned int Sensor::get_ranges(ScanData* data, int start_step,
+unsigned int Sensor::get_ranges(ScanData& data, int start_step,
int end_step, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDestinationError();
-
char buffer[11];
memset(buffer, 0, sizeof(char) * 11);
@@ -989,9 +986,9 @@
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer) +
+ data.laser_time_ = decode_4_byte_value(buffer) +
step_to_time_offset_(start_step);
- data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
+ data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GD command
read_3_byte_range_data_(data, num_steps);
@@ -999,16 +996,13 @@
else
throw UnknownScipVersionError();
- return data->ranges_length_;
+ return data.ranges_length_;
}
-unsigned int Sensor::get_ranges_by_angle(ScanData* data, double start_angle,
+unsigned int Sensor::get_ranges_by_angle(ScanData& data, double start_angle,
double end_angle, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDataError();
-
// Calculate the given angles in steps, rounding towards front_step_
int start_step, end_step;
start_step = angle_to_step(start_angle);
@@ -1032,12 +1026,9 @@
}
-unsigned int Sensor::get_ranges_intensities(ScanData* data, int start_step,
+unsigned int Sensor::get_ranges_intensities(ScanData& data, int start_step,
int end_step, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDestinationError();
-
char buffer[11];
memset(buffer, 0, sizeof(char) * 11);
@@ -1074,23 +1065,20 @@
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer) +
+ data.laser_time_ = decode_4_byte_value(buffer) +
step_to_time_offset_(start_step);
- data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
+ data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GE command
read_3_byte_range_data_(data, num_steps);
- return data->ranges_length_;
+ return data.ranges_length_;
}
-unsigned int Sensor::get_ranges_intensities_by_angle(ScanData* data,
+unsigned int Sensor::get_ranges_intensities_by_angle(ScanData& data,
double start_angle, double end_angle, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDataError();
-
// Calculate the given angles in steps, rounding towards front_step_
int start_step, end_step;
start_step = angle_to_step(start_angle);
@@ -1114,12 +1102,9 @@
}
-unsigned int Sensor::get_new_ranges(ScanData* data, int start_step,
+unsigned int Sensor::get_new_ranges(ScanData& data, int start_step,
int end_step, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDestinationError();
-
if(scip_version_ == 1)
throw UnsupportedError(16);
else if(scip_version_ != 2)
@@ -1192,22 +1177,20 @@
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer) +
+ data.laser_time_ = decode_4_byte_value(buffer) +
step_to_time_offset_(start_step);
- data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
+ data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the MD command
read_3_byte_range_data_(data, num_steps);
- return data->ranges_length_;
+ return data.ranges_length_;
}
-unsigned int Sensor::get_new_ranges_by_angle(ScanData* data,
+unsigned int Sensor::get_new_ranges_by_angle(ScanData& data,
double start_angle, double end_angle, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDestinationError();
if(scip_version_ == 1)
throw UnsupportedError(16);
@@ -1234,12 +1217,9 @@
}
-unsigned int Sensor::get_new_ranges_intensities(ScanData* data,
+unsigned int Sensor::get_new_ranges_intensities(ScanData& data,
int start_step, int end_step, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDestinationError();
-
if(scip_version_ == 1)
throw UnsupportedError(17);
else if(scip_version_ != 2)
@@ -1313,22 +1293,20 @@
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer) +
+ data.laser_time_ = decode_4_byte_value(buffer) +
step_to_time_offset_(start_step);
- data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
+ data.system_time_ = offset_timestamp_(wrap_timestamp_(data.laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the ME command
read_3_byte_range_and_intensity_data_(data, num_steps);
- return data->ranges_length_;
+ return data.ranges_length_;
}
-unsigned int Sensor::get_new_ranges_intensities_by_angle(ScanData* data,
+unsigned int Sensor::get_new_ranges_intensities_by_angle(ScanData& data,
double start_angle, double end_angle, unsigned int cluster_count)
{
- if(data == 0)
- throw NoDestinationError();
if(scip_version_ == 1)
throw UnsupportedError(17);
@@ -2147,7 +2125,7 @@
}
-void Sensor::read_2_byte_range_data_(ScanData* data, unsigned int num_steps)
+void Sensor::read_2_byte_range_data_(ScanData& data, unsigned int num_steps)
{
if(verbose_)
{
@@ -2157,9 +2135,9 @@
// This will automatically take care of whether it actually needs to
// (re)allocate or not.
- data->allocate_data(num_steps);
- data->model_ = model_;
- data->error_ = false;
+ data.allocate_data(num_steps);
+ data.model_ = model_;
+ data.error_ = false;
// 2 byte data is easy since it fits neatly in a 64-byte block
char buffer[SCIP2_LINE_LENGTH];
@@ -2180,7 +2158,7 @@
// Line feed in the middle of a data block? Why?
throw MisplacedLineFeedError();
}
- data->write_range_(current_step, decode_2_byte_value(&buffer[ii]));
+ data.write_range_(current_step, decode_2_byte_value(&buffer[ii]));
}
// End of this line. Go around again.
}
@@ -2193,7 +2171,7 @@
}
-void Sensor::read_3_byte_range_data_(ScanData* data, unsigned int num_steps)
+void Sensor::read_3_byte_range_data_(ScanData& data, unsigned int num_steps)
{
if(verbose_)
{
@@ -2209,9 +2187,9 @@
// This will automatically take care of whether it actually needs to
// (re)allocate or not.
- data->allocate_data(num_steps);
- data->model_ = model_;
- data->error_ = false;
+ data.allocate_data(num_steps);
+ data.model_ = model_;
+ data.error_ = false;
// 3 byte data is a pain because it crosses the line boundary, it may
// overlap by 0, 1 or 2 bytes
@@ -2231,16 +2209,16 @@
if(echo_buffer[0] != -1)
{
// Not the first value, so deal with the previous
- data->write_range_(current_step,
+ data.write_range_(current_step,
process_echo_buffer_(echo_buffer, echo_buf_ind + 1));
- if(data->ranges_)
+ if(data.ranges_)
{
- if(data->ranges_[current_step] > max_range_)
+ if(data.ranges_[current_step] > max_range_)
{
err_output_ << "WARNING: Sensor::" << __func__ <<
"() Value at step " << current_step <<
" beyond maximum range: " <<
- data->ranges_[current_step];
+ data.ranges_[current_step];
}
}
current_step++;
@@ -2269,17 +2247,17 @@
else if(echo_buffer[0] != -1)
{
// Not the first value, so deal with the previous
- data->write_range_(current_step,
+ data.write_range_(current_step,
process_echo_buffer_(echo_buffer,
echo_buf_ind + 1));
- if(data->ranges_)
+ if(data.ranges_)
{
- if(data->ranges_[current_step] > max_range_)
+ if(data.ranges_[current_step] > max_range_)
{
err_output_ << "WARNING: Sensor::" << __func__ <<
"() Value at step " << current_step <<
" beyond maximum range: " <<
- data->ranges_[current_step];
+ data.ranges_[current_step];
}
}
current_step++;
@@ -2337,7 +2315,7 @@
}
-void Sensor::read_3_byte_range_and_intensity_data_(ScanData* data,
+void Sensor::read_3_byte_range_and_intensity_data_(ScanData& data,
unsigned int num_steps)
{
if(verbose_)
@@ -2354,8 +2332,8 @@
// This will automatically take care of whether it actually needs to
// (re)allocate or not.
- data->allocate_data(num_steps, true);
- data->model_ = model_;
+ data.allocate_data(num_steps, true);
+ data.model_ = model_;
// 3 byte data is a pain because it crosses the line boundary, it may
// overlap by 0, 1 or 2 bytes
@@ -2379,7 +2357,7 @@
if(echo_buffer[0] != -1)
{
assert(nextIsIntensity == true);
- data->write_intensity_(current_intensity,
+ data.write_intensity_(current_intensity,
process_echo_buffer_(echo_buffer, echo_buf_ind + 1));
current_intensity++;
}
@@ -2409,27 +2387,27 @@
// Not the first value, so deal with the previous
if(nextIsIntensity)
{
- data->write_intensity_(current_intensity,
+ data.write_intensity_(current_intensity,
process_echo_buffer_(echo_buffer,
echo_buf_ind + 1));
}
else
{
- data->write_range_(current_range,
+ data.write_range_(current_range,
process_echo_buffer_(echo_buffer,
echo_buf_ind + 1));
}
echo_buf_ind = 0;
echo_buffer[0] = -1;
- if(data->ranges_)
+ if(data.ranges_)
{
- if(data->ranges_[current_range] > max_range_ &&
+ if(data.ranges_[current_range] > max_range_ &&
!nextIsIntensity)
{
err_output_ << "WARNING: Sensor::" << __func__ <<
"() Value at step " << current_range <<
" beyond maximum range: " <<
- data->ranges_[current_range] << " (raw bytes: ";
+ data.ranges_[current_range] << " (raw bytes: ";
if(split_count != 0)
err_output_ << split_value[0] << split_value[1] <<
split_value[2] << ")\n";
Modified: gearbox/trunk/src/hokuyo_aist/sensor.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-11 00:49:53 UTC (rev 511)
+++ gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-16 01:36:43 UTC (rev 512)
@@ -296,7 +296,7 @@
@param end_step The last step to get ranges from. Set to -1 for the last
scannable step.
@return The number of range readings read into @ref data. */
- unsigned int get_ranges(ScanData* data, int start_step = -1,
+ unsigned int get_ranges(ScanData& data, int start_step = -1,
int end_step = -1, unsigned int cluster_count = 1);
/** @brief Get the latest scan data from the scanner.
@@ -313,7 +313,7 @@
single reading. The minimum value from a cluster is returned as the
range for that cluster.
@return The number of range readings read into @ref data. */
- unsigned int get_ranges_by_angle(ScanData* data, double start_angle,
+ unsigned int get_ranges_by_angle(ScanData& data, double start_angle,
double end_angle, unsigned int cluster_count = 1);
/** @brief Get the latest scan data from the scanner with intensities.
@@ -338,7 +338,7 @@
@param end_step The last step to get ranges from. Set to -1 for the last
scannable step.
@return The number of range readings read into @ref data. */
- unsigned int get_ranges_intensities(ScanData* data,
+ unsigned int get_ranges_intensities(ScanData& data,
int start_step = -1, int end_step = -1,
unsigned int cluster_count = 1);
@@ -356,7 +356,7 @@
single reading. The minimum value from a cluster is returned as the
range for that cluster.
@return The number of range readings read into @ref data. */
- unsigned int get_ranges_intensities_by_angle(ScanData* data,
+ unsigned int get_ranges_intensities_by_angle(ScanData& data,
double start_angle, double end_angle,
unsigned int cluster_count = 1);
@@ -388,7 +388,7 @@
@param end_step The last step to get ranges from. Set to -1 for the last
scannable step.
@return The number of range readings read into @ref data. */
- unsigned int get_new_ranges(ScanData* data, int start_step = -1,
+ unsigned int get_new_ranges(ScanData& data, int start_step = -1,
int end_step = -1, unsigned int cluster_count = 1);
/** @brief Get a new scan from the scanner.
@@ -407,7 +407,7 @@
single reading. The minimum value from a cluster is returned as the
range for that cluster.
@return The number of range readings read into @ref data. */
- unsigned int get_new_ranges_by_angle(ScanData* data,
+ unsigned int get_new_ranges_by_angle(ScanData& data,
double start_angle, double end_angle,
unsigned int cluster_count = 1);
@@ -438,7 +438,7 @@
@param end_step The last step to get ranges from. Set to -1 for the last
scannable step.
@return The number of range readings read into @ref data. */
- unsigned int get_new_ranges_intensities(ScanData* data,
+ unsigned int get_new_ranges_intensities(ScanData& data,
int start_step = -1, int end_step = -1,
unsigned int cluster_count = 1);
@@ -458,7 +458,7 @@
single reading. The minimum value from a cluster is returned as the
range for that cluster.
@return The number of range readings read into @ref data. */
- unsigned int get_new_ranges_intensities_by_angle(ScanData* data,
+ unsigned int get_new_ranges_intensities_by_angle(ScanData& data,
double start_angle, double end_angle,
unsigned int cluster_count = 1);
@@ -542,9 +542,9 @@
void process_ii_line_(char const* buffer, SensorInfo* info);
uint32_t process_echo_buffer_(int const* buffer, int num_echos);
- void read_2_byte_range_data_(ScanData* data, unsigned int num_steps);
- void read_3_byte_range_data_(ScanData* data, unsigned int num_steps);
- void read_3_byte_range_and_intensity_data_(ScanData* data,
+ void read_2_byte_range_data_(ScanData& data, unsigned int num_steps);
+ void read_3_byte_range_data_(ScanData& data, unsigned int num_steps);
+ void read_3_byte_range_and_intensity_data_(ScanData& data,
unsigned int num_steps);
int confirm_checksum_(char const* buffer, int length,
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-08-11 00:49:53 UTC (rev 511)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-08-16 01:36:43 UTC (rev 512)
@@ -181,35 +181,35 @@
{
// Get all ranges
if(get_new)
- laser.get_new_ranges(&data, -1, -1, cluster_count);
+ laser.get_new_ranges(data, -1, -1, cluster_count);
else if(get_intensities)
- laser.get_new_ranges_intensities(&data, -1, -1, cluster_count);
+ laser.get_new_ranges_intensities(data, -1, -1, cluster_count);
else
- laser.get_ranges(&data, -1, -1, cluster_count);
+ laser.get_ranges(data, -1, -1, cluster_count);
}
else if(first_step != -1 || last_step != -1)
{
// Get by step
if(get_new)
- laser.get_new_ranges(&data, first_step, last_step,
+ laser.get_new_ranges(data, first_step, last_step,
cluster_count);
else if(get_intensities)
- laser.get_new_ranges_intensities(&data, first_step, last_step,
+ laser.get_new_ranges_intensities(data, first_step, last_step,
cluster_count);
else
- laser.get_ranges(&data, first_step, last_step, cluster_count);
+ laser.get_ranges(data, first_step, last_step, cluster_count);
}
else
{
// Get by angle
if(get_new)
- laser.get_new_ranges_by_angle(&data, start_angle, end_angle,
+ laser.get_new_ranges_by_angle(data, start_angle, end_angle,
cluster_count);
else if(get_intensities)
- laser.get_new_ranges_intensities_by_angle(&data, start_angle,
+ laser.get_new_ranges_intensities_by_angle(data, start_angle,
end_angle, cluster_count);
else
- laser.get_ranges_by_angle(&data, start_angle, end_angle,
+ laser.get_ranges_by_angle(data, start_angle, end_angle,
cluster_count);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-08-11 00:50:01
|
Revision: 511
http://gearbox.svn.sourceforge.net/gearbox/?rev=511&view=rev
Author: gbiggs
Date: 2010-08-11 00:49:53 +0000 (Wed, 11 Aug 2010)
Log Message:
-----------
Better clock calibration, including skew and drift adjustment.
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/scan_data.cpp
gearbox/trunk/src/hokuyo_aist/scan_data.h
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
gearbox/trunk/src/hokuyo_aist/sensor_info.h
gearbox/trunk/src/hokuyo_aist/test/example.cpp
gearbox/trunk/src/hokuyo_aist/utils.h
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-08-11 00:49:53 UTC (rev 511)
@@ -31,7 +31,7 @@
///////////////////////////////////////////////////////////////////////////////
ScanData::ScanData()
- : ranges_(NULL), intensities_(NULL), ranges_length_(0),
+ : ranges_(0), intensities_(0), ranges_length_(0),
intensities_length_(0), error_(false), laser_time_(0), system_time_(0),
model_(MODEL_UNKNOWN), buffers_provided_(false)
{
@@ -54,7 +54,7 @@
ranges_length_ = rhs.ranges_length();
intensities_length_ = rhs.intensities_length();
if(ranges_length_ == 0)
- ranges_ = NULL;
+ ranges_ = 0;
else
{
try
@@ -69,7 +69,7 @@
memcpy(ranges_, rhs.ranges(), sizeof(uint32_t) * ranges_length_);
}
if(intensities_length_ == 0)
- intensities_ = NULL;
+ intensities_ = 0;
else
{
try
@@ -96,15 +96,15 @@
{
if(!buffers_provided_)
{
- if (ranges_ != NULL)
+ if (ranges_ != 0)
{
delete[] ranges_;
- ranges_ = NULL;
+ ranges_ = 0;
}
- if (intensities_ != NULL)
+ if (intensities_ != 0)
{
delete[] intensities_;
- intensities_ = NULL;
+ intensities_ = 0;
}
}
}
@@ -192,14 +192,14 @@
unsigned int rhslength = rhs.ranges_length();
if(rhslength == 0)
{
- ranges_ = NULL;
+ ranges_ = 0;
ranges_length_ = 0;
}
else
{
if(rhslength != ranges_length_)
{
- if(!buffers_provided_ && ranges_ != NULL)
+ if(!buffers_provided_ && ranges_ != 0)
{
// Just copy
memcpy(ranges_, rhs.ranges(), sizeof(uint32_t) * rhslength);
@@ -211,7 +211,7 @@
// self-assignment making a mess).
uint32_t* new_data = new uint32_t[rhslength];
memcpy(new_data, rhs.ranges(), sizeof(uint32_t) * rhslength);
- if(ranges_ != NULL)
+ if(ranges_ != 0)
delete[] ranges_;
ranges_ = new_data;
ranges_length_ = rhs.ranges_length();
@@ -227,14 +227,14 @@
rhslength = rhs.intensities_length();
if(rhslength == 0)
{
- intensities_ = NULL;
+ intensities_ = 0;
intensities_length_ = 0;
}
else
{
if(rhslength != intensities_length_)
{
- if(!buffers_provided_ && intensities_ != NULL)
+ if(!buffers_provided_ && intensities_ != 0)
{
// Just copy
memcpy(intensities_, rhs.intensities(),
@@ -248,7 +248,7 @@
uint32_t* new_data = new uint32_t[rhslength];
memcpy(new_data, rhs.intensities(),
sizeof(uint32_t) * rhslength);
- if(intensities_ != NULL)
+ if(intensities_ != 0)
delete[] intensities_;
intensities_ = new_data;
intensities_length_ = rhs.intensities_length();
@@ -284,7 +284,7 @@
{
std::stringstream ss;
- if(ranges_ != NULL)
+ if(ranges_ != 0)
{
ss << ranges_length_ << " ranges from model ";
ss << model_to_string(model_) << ":\n";
@@ -292,7 +292,7 @@
ss << ranges_[ii] << '\t';
ss << '\n';
}
- if(intensities_ != NULL)
+ if(intensities_ != 0)
{
ss << intensities_length_ << " intensities from model ";
ss << model_to_string(model_) << ":\n";
@@ -323,12 +323,12 @@
{
if(!buffers_provided_)
{
- if(ranges_ != NULL)
+ if(ranges_ != 0)
delete[] ranges_;
- ranges_ = NULL;
- if(intensities_ != NULL)
+ ranges_ = 0;
+ if(intensities_ != 0)
delete[] intensities_;
- intensities_ = NULL;
+ intensities_ = 0;
}
ranges_length_ = 0;
intensities_length_ = 0;
@@ -345,7 +345,7 @@
return;
// If no data yet, allocate new
- if(ranges_ == NULL)
+ if(ranges_ == 0)
{
try
{
@@ -378,7 +378,7 @@
if(include_intensities)
{
// If no data yet, allocate new
- if(intensities_ == NULL)
+ if(intensities_ == 0)
{
try
{
@@ -408,12 +408,12 @@
}
// Else data is already allocated to the right length, so do nothing
}
- else if(intensities_ != NULL)
+ else if(intensities_ != 0)
{
// If not told to allocate space for intensity data and it exists,
// remove it
delete[] intensities_;
- intensities_ = NULL;
+ intensities_ = 0;
intensities_length_ = 0;
}
}
@@ -421,7 +421,7 @@
void ScanData::write_range_(unsigned int index, uint32_t value)
{
- if(ranges_ != NULL)
+ if(ranges_ != 0)
{
if(index >= ranges_length_)
throw IndexError();
@@ -434,7 +434,7 @@
void ScanData::write_intensity_(unsigned int index, uint32_t value)
{
- if(intensities_ != NULL)
+ if(intensities_ != 0)
{
if(index >= intensities_length_)
throw IndexError();
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-08-11 00:49:53 UTC (rev 511)
@@ -60,7 +60,7 @@
/// This constructor uses a provided data buffer rather than allocating
/// automatically.
///
- /// If the intensity pointer is NULL, no data will be provided of that
+ /// If the intensity pointer is 0, no data will be provided of that
/// type.
///
/// @param ranges_buffer A pointer to a data area to store range data
@@ -75,7 +75,7 @@
/// only for copy constructor and similar.
ScanData(uint32_t* const ranges_buffer,
unsigned int ranges_length,
- uint32_t* const intensities_buffer=NULL,
+ uint32_t* const intensities_buffer=0,
unsigned int intensities_length=0);
/// This copy constructor performs a deep copy of present data.
ScanData(ScanData const& rhs);
@@ -122,7 +122,7 @@
/// buffers. Instead, it will copy the data into its own buffers.
/// If the lhs has provided buffers, it is the caller's responsibility
/// to ensure they will be big enough to receive the data from the rhs,
- /// except in the case of NULL buffers (no data will be copied for NULL
+ /// except in the case of 0 buffers (no data will be copied for 0
/// buffers).
ScanData& operator=(ScanData const& rhs);
/** @brief Subscript operator.
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-11 00:49:53 UTC (rev 511)
@@ -48,9 +48,9 @@
namespace hokuyo_aist
{
-// SCIP1: 66 bytes (64 bytes of data + line feed + NULL)
+// SCIP1: 66 bytes (64 bytes of data + line feed + 0)
unsigned int const SCIP1_LINE_LENGTH = 66;
-// SCIP2: 67 bytes (64 bytes of data + checksum byte + line feed + NULL)
+// SCIP2: 67 bytes (64 bytes of data + checksum byte + line feed + 0)
unsigned int const SCIP2_LINE_LENGTH = 67;
///////////////////////////////////////////////////////////////////////////////
@@ -274,28 +274,30 @@
///////////////////////////////////////////////////////////////////////////////
Sensor::Sensor()
- : port_(NULL), err_output_(std::cerr), scip_version_(2), verbose_(false),
+ : port_(0), err_output_(std::cerr), scip_version_(2), verbose_(false),
enable_checksum_workaround_(false), ignore_unknowns_(false),
multiecho_mode_(ME_OFF), min_angle_(0.0), max_angle_(0.0),
resolution_(0.0), first_step_(0), last_step_(0), front_step_(0),
- max_range_(0), time_offset_(0), last_timestamp_(0), wrap_count_(0)
+ max_range_(0), time_resolution_(0), time_offset_(0), last_timestamp_(0),
+ wrap_count_(0), time_drift_rate_(0.0), time_skew_alpha_(0.0)
{
}
Sensor::Sensor(std::ostream& err_output)
- : port_(NULL), err_output_(err_output), scip_version_(2), verbose_(false),
+ : port_(0), err_output_(err_output), scip_version_(2), verbose_(false),
enable_checksum_workaround_(false), ignore_unknowns_(false),
multiecho_mode_(ME_OFF), min_angle_(0.0), max_angle_(0.0),
resolution_(0.0), first_step_(0), last_step_(0), front_step_(0),
- max_range_(0), time_offset_(0), last_timestamp_(0), wrap_count_(0)
+ max_range_(0), time_resolution_(0), time_offset_(0), last_timestamp_(0),
+ wrap_count_(0), time_drift_rate_(0.0), time_skew_alpha_(0.0)
{
}
Sensor::~Sensor()
{
- if(port_ != NULL)
+ if(port_ != 0)
delete port_;
}
@@ -425,13 +427,13 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ << "() Closing connection.\n";
delete port_;
- port_ = NULL;
+ port_ = 0;
}
bool Sensor::is_open() const
{
- if(port_ != NULL)
+ if(port_ != 0)
return port_->IsOpen();
return false;
}
@@ -446,14 +448,14 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser on.\n";
- send_command_("L", "1", 1, NULL);
+ send_command_("L", "1", 1, 0);
}
else
{
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser off.\n";
- send_command_("L", "0", 1, NULL);
+ send_command_("L", "0", 1, 0);
}
skip_lines_(1);
}
@@ -464,14 +466,14 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser on.\n";
- send_command_("BM", NULL, 0, "02");
+ send_command_("BM", 0, 0, "02");
}
else
{
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Turning laser off.\n";
- send_command_("QT", NULL, 0, "02");
+ send_command_("QT", 0, 0, "02");
}
skip_lines_(1);
}
@@ -500,7 +502,7 @@
if(scip_version_ == 1)
{
// Send the command to change baud rate
- send_command_("S", newBaud, 13, NULL);
+ send_command_("S", newBaud, 13, 0);
skip_lines_(1);
// Change the port's baud rate
reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(baud);
@@ -540,7 +542,7 @@
err_output_ << "Sensor::" << __func__ <<
"() Setting IP information to $I" << params.str() << '\n';
}
- int status = send_command_(&command[0], params.str().c_str(), 48, NULL);
+ int status = send_command_(&command[0], params.str().c_str(), 48, 0);
// Skip the extra line feed
skip_lines_(1);
if(status != 0)
@@ -559,7 +561,7 @@
err_output_ << "Sensor::" << __func__ <<
"() Resetting laser.\n";
}
- send_command_("RS", NULL, 0, NULL);
+ send_command_("RS", 0, 0, 0);
skip_lines_(1);
}
else
@@ -576,7 +578,7 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Resetting laser.\n";
- send_command_("RS", NULL, 0, NULL);
+ send_command_("RS", 0, 0, 0);
skip_lines_(1);
}
else
@@ -664,7 +666,7 @@
void Sensor::get_sensor_info(SensorInfo* info)
{
- if(info == NULL)
+ if(info == 0)
throw NoDestinationError();
if(scip_version_ == 1)
@@ -680,7 +682,7 @@
char buffer[SCIP1_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP1_LINE_LENGTH);
- send_command_("V", NULL, 0, NULL);
+ send_command_("V", 0, 0, 0);
// Get the vendor info line
read_line_(buffer);
info->vendor = &buffer[5]; // Chop off the "VEND:" tag
@@ -722,7 +724,7 @@
// POSIX we get to do it the hard way.
// Start by finding the first (
char const* valueStart;
- if((valueStart = strchr(info->firmware.c_str(), '(')) == NULL)
+ if((valueStart = strchr(info->firmware.c_str(), '(')) == 0)
{
// No bracket? Crud. Fail and use the hard-coded values from
// the manual.
@@ -796,17 +798,17 @@
// We need to send three commands to get all the info we want: VV, PP
// and II
- send_command_("VV", NULL, 0, NULL);
+ send_command_("VV", 0, 0, 0);
while(read_line_with_check_(buffer, -1, true) != 0)
process_vv_line_(buffer, info);
// Next up, PP
- send_command_("PP", NULL, 0, NULL);
+ send_command_("PP", 0, 0, 0);
while(read_line_with_check_(buffer, -1, true) != 0)
process_pp_line_(buffer, info);
// Command II: Revenge of the Commands.
- send_command_("II", NULL, 0, NULL);
+ send_command_("II", 0, 0, 0);
while(read_line_with_check_(buffer, -1, true) != 0)
process_ii_line_(buffer, info);
@@ -839,11 +841,11 @@
if(verbose_)
err_output_ << "Sensor::" << __func__ <<
"() Retrieving time from laser.\n";
- send_command_("TM", "0", 1, NULL);
- send_command_("TM", "1", 1, NULL);
+ send_command_("TM", "0", 1, 0);
+ send_command_("TM", "1", 1, 0);
char buffer[7];
read_line_with_check_(buffer, 6);
- send_command_("TM", "2", 1, NULL);
+ send_command_("TM", "2", 1, 0);
skip_lines_(1);
// We need to decode the time value that's in the buffer
return decode_4_byte_value(buffer);
@@ -855,138 +857,92 @@
}
-unsigned int Sensor::calibrate_time(unsigned int samples)
+long long Sensor::calibrate_time(unsigned int skew_sleep_time,
+ unsigned int samples)
{
+ if(verbose_)
+ err_output_ << "Entering timing mode.\n";
enter_timing_mode_();
- std::ofstream df("times.txt", std::ofstream::app);
-
- // Measure the latency with 1000 plain TM commands
- std::vector<unsigned long long> latencies;
+ // From A. Carballo, Y. Hara, H. Kawata, T.
+ // Yoshida, A. Ohya, S. Yuta, “Time synchronisation
+ // between SOKUIKI sensor and host computer using
+ // timestamps”, Proceedings of the JSME Conference on
+ // Robotics and Mechatronics ROBOMEC 2007, Akita,
+ // Japan, 2007, Paper 1P1-K05.
+ //
+ // Calibration is performed by calculating the offset between the laser's
+ // clock and the computer's clock. The algorithm is:
+ // Offset = Comp time before -
+ // (Laser time - (Comp time before - Comp time after) / 2)
+ // This is calculated samples times, and the median taken.
+ if(verbose_)
+ err_output_ << "Gathering " << samples << " offset values.\n";
+ std::vector<long long> offsets;
for(unsigned int ii = 0; ii < samples; ii++)
{
- unsigned long long start_time(get_computer_time_());
- get_timing_mode_time_("");
- unsigned long long end_time(get_computer_time_());
- latencies.push_back(end_time - start_time);
+ unsigned long long end_time(0);
+ unsigned long long start_time = get_computer_time_();
+ unsigned long long laser_time =
+ wrap_timestamp_(get_timing_mode_time_(&end_time)) * 1e6;
+ offsets.push_back(start_time -
+ (laser_time - (end_time - start_time) / 2));
}
- // Calculate the median two-way latency
- unsigned long long two_way_latency = median(latencies);
- df << two_way_latency << '\t';
+ // Calculate the median offset
+ time_offset_ = median(offsets);
+ if(verbose_)
+ err_output_ << "Calculated offset is " << time_offset_ << '\n';
- // Measure the latency with 1000 TM commands + 32 bytes
- std::string bytes = "12345678901234567890123456789012";
- latencies.clear();
- for(unsigned int ii = 0; ii < samples; ii++)
+ if(skew_sleep_time > 0)
{
- unsigned long long start_time(get_computer_time_());
- get_timing_mode_time_(bytes);
- unsigned long long end_time(get_computer_time_());
- latencies.push_back(end_time - start_time);
- }
- // Calculate the median two-way latency
- unsigned long long latency_32bytes = median(latencies);
- df << latency_32bytes << '\t';
- // Subtract the no-data latency to remove the command transmission time
- latency_32bytes -= two_way_latency;
- df << latency_32bytes << '\t';
- // Divide by 32 to get the per-byte transmission time
- unsigned long long one_byte_latency32 = latency_32bytes / 32;
- df << one_byte_latency32 << '\t';
+ // Sleep, then do it again to approximate a skew line
+ struct timespec sleep_time = {0, 0};
+ sleep_time.tv_sec = skew_sleep_time;
+ if(verbose_)
+ err_output_ << "Sleeping for " << skew_sleep_time << "s.\n";
+ nanosleep(&sleep_time, NULL);
- // Measure the latency with 1000 TM commands + 64 bytes
- bytes = "1234567890123456789012345678901234567890123456789012345678901234";
- latencies.clear();
- for(unsigned int ii = 0; ii < samples; ii++)
- {
- unsigned long long start_time(get_computer_time_());
- get_timing_mode_time_(bytes);
- unsigned long long end_time(get_computer_time_());
- latencies.push_back(end_time - start_time);
+ if(verbose_)
+ err_output_ << "Gathering " << samples << " offset values.\n";
+ offsets.clear();
+ for(unsigned int ii = 0; ii < samples; ii++)
+ {
+ unsigned long long end_time(0);
+ unsigned long long start_time = get_computer_time_();
+ unsigned long long laser_time =
+ wrap_timestamp_(get_timing_mode_time_(&end_time)) * 1e6;
+ offsets.push_back(start_time -
+ (laser_time - (end_time - start_time) / 2));
+ }
+ // Calculate the median offset
+ long long offset2 = median(offsets);
+ if(verbose_)
+ {
+ err_output_ << "Calculated second offset is " << offset2 <<
+ '\n';
+ }
+
+ // Approximate the line slope as (offset2 - offset1) / sleep_time
+ time_skew_alpha_ = (offset2 - time_offset_) /
+ static_cast<double>(skew_sleep_time * 1e9);
+ if(verbose_)
+ {
+ err_output_ << "Calculated alpha is " << time_skew_alpha_ << '\n';
+ }
}
- // Calculate the median two-way latency
- unsigned long long latency_64bytes = median(latencies);
- df << latency_64bytes << '\t';
- // Subtract the no-data latency to remove the command transmission time
- latency_64bytes -= two_way_latency;
- df << latency_64bytes << '\t';
- // Divide by 32 to get the per-byte transmission time
- unsigned long long one_byte_latency64 = latency_64bytes / 64;
- df << one_byte_latency64 << '\t';
- // Get the time from the laser
- // To get the most accurate result, we cannot do any processing while
- // receiving. We want to know the time that reception finished as exactly
- // as possible. To achieve this, we do not use send_command_, but instead
- // send the command manually and receive the entire expected reply at once,
- // then check/decode it later.
- char response[17];
- if(port_->Write("TM1\n", 4) < 4)
- throw WriteError(19);
- unsigned int line_length = port_->ReadLine(response, 16);
- unsigned long long end_time(get_computer_time_());
- df << end_time << '\t';
- // Process the response to confirm it is correct
- if(line_length < 0)
- throw ReadError(0);
- else if(line_length == 0)
- throw ReadError(1);
- else if(line_length < 15)
- throw LineLengthError(line_length, 15);
- response[line_length - 1] = '\0';
- if(response[0] != 'T' || response[1] != 'M' || response[2] != '1')
- throw CommandEchoError("TM", response);
- response[7] = '\0';
- if(response[4] != '0' || response[5] != '0' || response[6] != 'P')
- throw ResponseError(response, "TM");
- // Check the checksum on the time stamp is accurate
- confirm_checksum_(&response[8], 4, response[12]);
- // Decode the time stamp
- unsigned int timestamp =
- wrap_timestamp_(decode_4_byte_value(&response[8]));
- df << timestamp << '\t';
- // The laser had to send 15 bytes to send back the time stamp. This means
- // that there was approximately a 15 byte delay between the time stamp's
- // occurance in real time and when we finished receiving the data.
- // The offset from computer time to laser time is:
- // (computer time - comms time) - laser time
- // Not forgetting that the computer times need to be converted to
- // milliseconds.
- time_offset_ = ((end_time - (one_byte_latency64 * 15)) / 1e6) - timestamp;
- df << time_offset_ << '\n';
-
// All done.
+ if(verbose_)
+ err_output_ << "Leaving timing mode.\n";
leave_timing_mode_();
- df.close();
return time_offset_;
}
-unsigned int Sensor::wrap_timestamp_(unsigned int timestamp)
-{
- unsigned int result;
- if(timestamp < last_timestamp_)
- {
- wrap_count_++;
- result = timestamp + wrap_count_ * 0x1000; // 24-bit value + 1
- }
- else
- result = timestamp;
- last_timestamp_ = timestamp;
- return result;
-}
-
-
-unsigned int Sensor::offset_timestamp_(unsigned int timestamp)
-{
- return timestamp + time_offset_;
-}
-
-
unsigned int Sensor::get_ranges(ScanData* data, int start_step,
int end_step, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDestinationError();
char buffer[11];
@@ -1013,7 +969,7 @@
number_to_string(start_step, buffer, 3);
number_to_string(end_step, &buffer[3], 3);
number_to_string(cluster_count, &buffer[6], 2);
- send_command_("G", buffer, 8, NULL);
+ send_command_("G", buffer, 8, 0);
// In SCIP1 mode we're going to get back 2-byte data
read_2_byte_range_data_(data, num_steps);
}
@@ -1025,15 +981,16 @@
number_to_string(end_step, &buffer[4], 4);
number_to_string(cluster_count, &buffer[8], 2);
if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
- send_command_("HD", buffer, 10, NULL);
+ send_command_("HD", buffer, 10, 0);
else
- send_command_("GD", buffer, 10, NULL);
+ send_command_("GD", buffer, 10, 0);
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer);
+ data->laser_time_ = decode_4_byte_value(buffer) +
+ step_to_time_offset_(start_step);
data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GD command
@@ -1049,7 +1006,7 @@
unsigned int Sensor::get_ranges_by_angle(ScanData* data, double start_angle,
double end_angle, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDataError();
// Calculate the given angles in steps, rounding towards front_step_
@@ -1078,7 +1035,7 @@
unsigned int Sensor::get_ranges_intensities(ScanData* data, int start_step,
int end_step, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDestinationError();
char buffer[11];
@@ -1109,15 +1066,16 @@
number_to_string(end_step, &buffer[4], 4);
number_to_string(cluster_count, &buffer[8], 2);
if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
- send_command_("HE", buffer, 10, NULL);
+ send_command_("HE", buffer, 10, 0);
else
- send_command_("GE", buffer, 10, NULL);
+ send_command_("GE", buffer, 10, 0);
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer);
+ data->laser_time_ = decode_4_byte_value(buffer) +
+ step_to_time_offset_(start_step);
data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GE command
@@ -1130,7 +1088,7 @@
unsigned int Sensor::get_ranges_intensities_by_angle(ScanData* data,
double start_angle, double end_angle, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDataError();
// Calculate the given angles in steps, rounding towards front_step_
@@ -1159,7 +1117,7 @@
unsigned int Sensor::get_new_ranges(ScanData* data, int start_step,
int end_step, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDestinationError();
if(scip_version_ == 1)
@@ -1197,7 +1155,7 @@
command[0] = 'M';
command[1] = 'D';
command[2] = '\0';
- send_command_(command, buffer, 13, NULL);
+ send_command_(command, buffer, 13, 0);
// Mx commands will perform a scan, then send the data prefixed with
// another command echo.
// Read back the command echo (minimum of 3 bytes, maximum of 16 bytes)
@@ -1234,7 +1192,8 @@
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer);
+ data->laser_time_ = decode_4_byte_value(buffer) +
+ step_to_time_offset_(start_step);
data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the MD command
@@ -1247,7 +1206,7 @@
unsigned int Sensor::get_new_ranges_by_angle(ScanData* data,
double start_angle, double end_angle, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDestinationError();
if(scip_version_ == 1)
throw UnsupportedError(16);
@@ -1278,7 +1237,7 @@
unsigned int Sensor::get_new_ranges_intensities(ScanData* data,
int start_step, int end_step, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDestinationError();
if(scip_version_ == 1)
@@ -1317,7 +1276,7 @@
command[0] = 'M';
command[1] = 'E';
command[2] = '\0';
- send_command_(command, buffer, 13, NULL);
+ send_command_(command, buffer, 13, 0);
// Mx commands will perform a scan, then send the data prefixed with
// another command echo.
// Read back the command echo (minimum of 3 bytes, maximum of 16 bytes)
@@ -1354,7 +1313,8 @@
// timestamp back if there was no data.
if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->laser_time_ = decode_4_byte_value(buffer);
+ data->laser_time_ = decode_4_byte_value(buffer) +
+ step_to_time_offset_(start_step);
data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the ME command
@@ -1367,7 +1327,7 @@
unsigned int Sensor::get_new_ranges_intensities_by_angle(ScanData* data,
double start_angle, double end_angle, unsigned int cluster_count)
{
- if(data == NULL)
+ if(data == 0)
throw NoDestinationError();
if(scip_version_ == 1)
throw UnsupportedError(17);
@@ -1438,12 +1398,12 @@
// If expected_length is not -1, it should include the terminating line feed but
-// not the NULL (although the buffer still has to include this).
+// not the 0 (although the buffer still has to include this).
// If expected_length is -1, this function expects buffer to be a certain length
// to allow up to the maximum line length to be read. See SCIP1_LINE_LENGTH and
// SCIP2_LINE_LENGTH.
-// The line feed that terminates a line will be replaced with a NULL.
-// The return value is the number of bytes received, not including the NULL
+// The line feed that terminates a line will be replaced with a 0.
+// The return value is the number of bytes received, not including the 0
// byte or the line feed.
int Sensor::read_line_(char* buffer, int expected_length)
{
@@ -1463,7 +1423,7 @@
throw ReadError(0);
else if(linelength == 0)
throw ReadError(1);
- // Replace the line feed with a NULL
+ // Replace the line feed with a 0
buffer[linelength - 1] = '\0';
}
else
@@ -1473,14 +1433,14 @@
err_output_ << "Sensor::" << __func__ <<
"() Reading exactly " << expected_length << " bytes.\n";
}
- // expected_length+1 for the NULL
+ // expected_length+1 for the 0
if((linelength = port_->ReadLine(buffer, expected_length + 1)) < 0)
throw ReadError(0);
else if(linelength == 0)
throw ReadError(1);
else if(linelength < expected_length)
throw LineLengthError(linelength, expected_length);
- // Replace the line feed with a NULL
+ // Replace the line feed with a 0
buffer[linelength - 1] = '\0';
}
@@ -1552,7 +1512,7 @@
{
// Here comes the UTM-30LX workaround
char* hasComment = strstr(buffer, "<-");
- if(hasComment != NULL)
+ if(hasComment != 0)
{
int newBytesToConsider = hasComment - buffer;
if(verbose_)
@@ -1602,7 +1562,7 @@
// command and parameters sent are correct, and that the returned status code
// is 0 or the first byte of extra_ok (for SCIP1), or 00, 99 or the first two
// bytes of extra_ok (for SCIP2).
-// cmd must be a 1 byte string for SCIP1 and a 2-byte NULL-terminated string
+// cmd must be a 1 byte string for SCIP1 and a 2-byte 0-terminated string
// for SCIP2.
// If param_length is 0, no parameters will be sent or expected in the reply.
// extra_ok must be a 1-byte string for SCIP1 and a 2-byte string for SCIP2.
@@ -1672,7 +1632,7 @@
}
if(response[statusIndex] != '0')
{
- if(extra_ok != NULL)
+ if(extra_ok != 0)
{
if(response[statusIndex] != extra_ok[0])
{
@@ -1737,7 +1697,7 @@
if(!(response[0] == '0' && response[1] == '0') &&
!(response[0] == '9' && response[1] == '9'))
{
- if(extra_ok != NULL)
+ if(extra_ok != 0)
{
if(response[0] != extra_ok[0] || response[1] != extra_ok[1])
{
@@ -1768,25 +1728,54 @@
/// Puts the laser into the timing mode.
void Sensor::enter_timing_mode_()
{
- send_command_("TM", "0", 1, NULL);
+ send_command_("TM", "0", 1, 0);
+ skip_lines_(1);
}
+/// Take the laser out of timing mode.
+void Sensor::leave_timing_mode_()
+{
+ send_command_("TM", "2", 1, 0);
+ skip_lines_(1);
+}
+
+
/// Get the timestamp from the laser.
-unsigned int Sensor::get_timing_mode_time_(std::string const& data)
+/// If @ref reception_time is not 0, it will be filled with the time at
+/// which data reception was completed.
+unsigned int Sensor::get_timing_mode_time_(unsigned long long* reception_time)
{
- std::string command = "TM1";
- if(data != "")
- {
- send_command_((command + data).c_str(), NULL,
- command.size() + data.size(), NULL);
- }
- else
- send_command_("TM", "1", 1, NULL);
-
- char buffer[7];
- read_line_with_check_(buffer, 6);
- return decode_4_byte_value(buffer);
+ // To get the most accurate result, we cannot do any processing while
+ // receiving. We want to know the time that reception finished as exactly
+ // as possible. To achieve this, we do not use send_command_, but instead
+ // send the command manually and receive the entire expected reply at once,
+ // then check/decode it later.
+ char response[17];
+ if(port_->Write("TM1\n", 4) < 4)
+ throw WriteError(19);
+ unsigned int line_length = port_->Read(response, 16);
+ if(reception_time)
+ *reception_time = get_computer_time_();
+ // Process the response to confirm it is correct
+ if(line_length < 0)
+ throw ReadError(0);
+ else if(line_length == 0)
+ throw ReadError(1);
+ else if(line_length < 15)
+ throw LineLengthError(line_length, 15);
+ response[line_length - 1] = '\0';
+ if(response[0] != 'T' || response[1] != 'M' || response[2] != '1')
+ throw CommandEchoError("TM", response);
+ response[7] = '\0';
+ if(response[4] != '0' || response[5] != '0' || response[6] != 'P')
+ throw ResponseError(response, "TM");
+ // Check the checksum on the time stamp is accurate
+ confirm_checksum_(&response[8], 4, response[12]);
+ // Decode the time stamp
+ unsigned int timestamp =
+ decode_4_byte_value(&response[8]);
+ return timestamp;
}
@@ -1799,37 +1788,59 @@
return ts.tv_sec * 1e9 + ts.tv_nsec;
#else
struct timeval tv;
- gettimeofday(&tv, NULL);
+ gettimeofday(&tv, 0);
return tv.tv_sec * 1e9 + tv.tv_usec * 1e3;
#endif
}
-/// Take the laser out of timing mode.
-void Sensor::leave_timing_mode_()
+/// timestamp must be in milliseconds. The result is in milliseconds.
+unsigned int Sensor::wrap_timestamp_(unsigned int timestamp)
{
- send_command_("TM", "2", 1, NULL);
- skip_lines_(1);
+ if(timestamp < last_timestamp_)
+ {
+ wrap_count_++;
+ }
+ last_timestamp_ = timestamp;
+
+ return timestamp + wrap_count_ * 0x01000000; // 24-bit value + 1
}
+/// timestamp must be in milliseconds. The result is in nanoseconds.
+unsigned long long Sensor::offset_timestamp_(unsigned int timestamp)
+{
+ return ((1 - time_drift_rate_) * timestamp * 1e6 + time_offset_) /
+ (1 - time_skew_alpha_);
+}
+
+
+unsigned int Sensor::step_to_time_offset_(int start_step)
+{
+ if(start_step < 0)
+ return first_step_ * time_resolution_;
+ else
+ return start_step * time_resolution_;
+}
+
+
/// Search a string for the laser's model.
void Sensor::find_model_(char const* buffer)
{
- if(strstr(buffer, "URG-04LX") != NULL)
+ if(strstr(buffer, "URG-04LX") != 0)
model_ = MODEL_URG04LX;
- else if(strstr(buffer, "UBG-04LX") != NULL)
+ else if(strstr(buffer, "UBG-04LX") != 0)
model_ = MODEL_UBG04LXF01;
- else if(strstr(buffer, "UHG-08LX") != NULL)
+ else if(strstr(buffer, "UHG-08LX") != 0)
model_ = MODEL_UHG08LX;
- else if(strstr(buffer, "UTM-30LX") != NULL)
+ else if(strstr(buffer, "UTM-30LX") != 0)
{
model_ = MODEL_UTM30LX;
// Also enable the work around for a checksum problem in this
// model.
enable_checksum_workaround_ = true;
}
- else if(strstr(buffer, "UXM-30LX") != NULL)
+ else if(strstr(buffer, "UXM-30LX") != 0)
model_ = MODEL_UXM30LXE;
else
model_ = MODEL_UNKNOWN;
@@ -1847,7 +1858,7 @@
// Try SCIP version 2 first by sending an info command
try
{
- send_command_("VV", NULL, 0, NULL);
+ send_command_("VV", 0, 0, 0);
}
catch(BaseError)
{
@@ -1867,7 +1878,7 @@
port_->Flush();
try
{
- send_command_("V", NULL, 0, NULL);
+ send_command_("V", 0, 0, 0);
}
catch(BaseError)
{
@@ -1887,7 +1898,7 @@
// different firmware version format, that doesn't matter because they
// don't support SCIP v1 and so shouldn't get to this point anyway - if
// they do, it's an uncaught error.
- int majorVer = strtol(&buffer[5], NULL, 10);
+ int majorVer = strtol(&buffer[5], 0, 10);
if(errno == ERANGE)
throw FirmwareError();
if(verbose_)
@@ -1921,7 +1932,7 @@
// first byte as the command and the other 6 as parameters.
try
{
- send_command_("S", "CIP2.0", 6, NULL);
+ send_command_("S", "CIP2.0", 6, 0);
}
catch(BaseError)
{
@@ -2032,7 +2043,7 @@
* arrived yet, so don't know what to look for.
else if(strncmp(buffer, "", 4) == 0)
{
- if(strstr(buffer, "CCW") != NULL)
+ if(strstr(buffer, "CCW") != 0)
info->rot_dir = COUNTERCLOCKWISE;
else
info->rot_dir = CLOCKWISE;
@@ -2064,6 +2075,7 @@
throw ParseError(buffer, "Motor speed");
}
info->speed_level = 0;
+ time_resolution_ = info->speed;
}
else
{
@@ -2074,6 +2086,7 @@
{
throw ParseError(buffer, "Motor speed");
}
+ time_resolution_ = info->speed;
}
}
else if(strncmp(buffer, "MESM", 4) == 0)
Modified: gearbox/trunk/src/hokuyo_aist/sensor.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/sensor.h 2010-08-11 00:49:53 UTC (rev 511)
@@ -218,12 +218,62 @@
approximately every 9.5 hours. This class will detect wrapped time
stamps and adjust them accordingly.
+ @param skew_sleep_time Whether to approximate the laser clock skew.
+ This requires sleeping for the specified time, then calibrating again.
+ The results of the two calibrations are used to approximate the clock
+ skew as a straight line between the two points. This is very
+ approximate; in order to overcome noise in the signal you will need to
+ calibrate over a period of up to several minutes. Set this to 0 to not
+ approximate the skew.
@param samples The number of samples to use in calculating latencies.
- @return The calculated offset in milliseconds.
+ @return The calculated offset in nanoseconds.
*/
- unsigned int calibrate_time(unsigned int samples=10);
+ long long calibrate_time(unsigned int skew_sleep_time=0,
+ unsigned int samples=10);
+ /// Retrieve the calculated time offset (0 if not calibrated).
+ long long time_offset() const { return time_offset_; }
+
+ /// Set the time offset (if the calculated value is bad).
+ void set_time_offset(long long time_offset)
+ { time_offset_ = time_offset; }
+ /// Retrieve the current clock drift rate (0 if not set).
+ float drift_rate() const { return time_drift_rate_; }
+ /** Set the current clock drift rate.
+
+ The drift rate is used when correcting laser time stamps to computer
+ time. It is factored into the equation as:
+ Tc = ((1 - drift)Tl + offset + beta) / (1 - alpha)
+ where Tc is the computer time and Tl is the laser time. See @ref
+ set_skew_alpha for the values of alpha and beta.
+
+ If the drift rate is zero, it means the laser's clock does not drift.
+ This is extremely unlikely, but the laser's drift may not matter for
+ your application.
+
+ Drift should usually be provided by the manufacturer. If it is not,
+ you can calculate it by calibrating the laser many times over a long
+ period and looking at the change in the calculated offset. */
+ void set_drift_rate(float drift_rate)
+ { time_drift_rate_ = drift_rate; }
+
+ /// Get the calculated skew line slope (default: 0).
+ float skew_alpha() const { return time_skew_alpha_; }
+ /** Set a skew line slope value.
+
+ The skew is used when correcting laser time stamps to computer time.
+ It is factored into the equation as:
+ Tc = ((1 - drift)Tl + offset + beta) / (1 - alpha)
+ where Tc is the computer time and Tl is the laser time. See @ref
+ drift_rate for the value of the drift. Beta, the line's y crossing, is
+ assumed to be 0 since we always use a two-point line fit instead of
+ something like least squares.
+
+ The effect of this is to cancel out the skew caused by the different
+ frequencies of the computer clock and the laser clock. */
+ void set_skew_alpha(float alpha) { time_skew_alpha_ = alpha; }
+
/** @brief Get the latest scan data from the scanner.
This function requires a pointer to a @ref ScanData object. It will
@@ -444,8 +494,20 @@
double min_angle_, max_angle_, resolution_;
int first_step_, last_step_, front_step_;
unsigned int max_range_;
- unsigned int time_offset_;
- unsigned int last_timestamp_, wrap_count_;
+ /// The time between two points in a scan, in milliseconds.
+ unsigned int time_resolution_;
+ /// The offset from the laser's clock to the computer's clock in
+ /// nanoseconds.
+ long long time_offset_;
+ /// The previous received timestamp from the laser, in laser time and
+ /// in milliseconds.
+ unsigned int last_timestamp_;
+ /// The number of times the laser's clock has wrapped.
+ unsigned int wrap_count_;
+ /// The drift rate of the laser's clock
+ float time_drift_rate_;
+ /// The clock skew alpha value.
+ float time_skew_alpha_;
void clear_read_buffer_();
int read_line_(char* buffer, int expected_length = -1);
@@ -455,12 +517,22 @@
int send_command_(char const* cmd, char const* param, int param_length,
char const* extra_ok);
+ public:
void enter_timing_mode_();
- unsigned int get_timing_mode_time_(std::string const& data);
+ void leave_timing_mode_();
+ /// Get the laser time in milliseconds.
+ unsigned int get_timing_mode_time_(unsigned long long* reception_time=0);
+ /// Get the computer time in nanoseconds.
unsigned long long get_computer_time_();
- void leave_timing_mode_();
+ /// Adjust a wrapped laser timestamp, in milliseconds.
unsigned int wrap_timestamp_(unsigned int timestamp);
- unsigned int offset_timestamp_(unsigned int timestamp);
+ /// Offset a laser timestamp, in milliseconds, into computer time, in
+ /// nanoseconds.
+ unsigned long long offset_timestamp_(unsigned int timestamp);
+ private:
+ /// Convert a step value into its time offset from the start of a scan,
+ /// in milliseconds.
+ unsigned int step_to_time_offset_(int start_step);
void find_model_(char const* buffer);
void get_and_set_scip_version_();
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.cpp 2010-08-11 00:49:53 UTC (rev 511)
@@ -32,7 +32,7 @@
: min_range(0), max_range(0), steps(0), first_step(0), last_step(0),
front_step(0), standard_speed(0), rot_dir(COUNTERCLOCKWISE), power(false),
speed(0), speed_level(0), baud(0), time(0), min_angle(0.0), max_angle(0.0),
- resolution(0.0), scanable_steps(0), max_step(0),
+ resolution(0.0), time_resolution(0), scanable_steps(0), max_step(0),
detected_model(MODEL_UNKNOWN)
{
}
@@ -113,6 +113,7 @@
max_angle = (static_cast<int>(last_step) - static_cast<int>(front_step)) *
resolution;
scanable_steps = last_step - first_step + 1;
+ time_resolution = 60000 / speed;
}
Modified: gearbox/trunk/src/hokuyo_aist/sensor_info.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/sensor_info.h 2010-08-11 00:49:53 UTC (rev 511)
@@ -196,6 +196,8 @@
double max_angle;
/// Angle between two scan points (radians).
double resolution;
+ /// Time between two scan points (milliseconds).
+ unsigned int time_resolution;
/// Total number of steps in a full scan (lastStep - firstStep).
unsigned int scanable_steps;
/// Absolute maximum commandable step.
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2010-08-11 00:49:53 UTC (rev 511)
@@ -130,6 +130,10 @@
{
std::cerr << "Failed to change baud rate: " << e.what() << '\n';
}
+ catch(...)
+ {
+ std::cerr << "Failed to change baud rate\n";
+ }
// Set the motor speed
try
{
Modified: gearbox/trunk/src/hokuyo_aist/utils.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/utils.h 2010-08-08 04:31:17 UTC (rev 510)
+++ gearbox/trunk/src/hokuyo_aist/utils.h 2010-08-11 00:49:53 UTC (rev 511)
@@ -24,7 +24,10 @@
#include <string>
#include <vector>
#include <algorithm>
+#include <cassert>
+#include <iostream>
+
#if defined(WIN32)
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
@@ -65,6 +68,7 @@
}
#endif
+
/// Find the median value of a std::vector.
template<typename T>
inline T median(std::vector<T>& v)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-08-08 04:31:25
|
Revision: 510
http://gearbox.svn.sourceforge.net/gearbox/?rev=510&view=rev
Author: gbiggs
Date: 2010-08-08 04:31:17 +0000 (Sun, 08 Aug 2010)
Log Message:
-----------
Added time calibration
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/scan_data.cpp
gearbox/trunk/src/hokuyo_aist/scan_data.h
gearbox/trunk/src/hokuyo_aist/sensor.cpp
gearbox/trunk/src/hokuyo_aist/sensor.h
gearbox/trunk/src/hokuyo_aist/sensor_info.cpp
gearbox/trunk/src/hokuyo_aist/sensor_info.h
gearbox/trunk/src/hokuyo_aist/utils.h
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-08-05 05:15:27 UTC (rev 509)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-08-08 04:31:17 UTC (rev 510)
@@ -30,8 +30,19 @@
add_definitions (-DHOKUYO_AIST_STATIC -DFLEXIPORT_STATIC)
endif (GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
endif (WIN32)
+
+ include (CheckFunctionExists)
+ set (CMAKE_REQUIRED_INCLUDES time.h)
+ set (CMAKE_REQUIRED_LIBRARIES rt)
+ CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME)
+ set (CMAKE_REQUIRED_INCLUDES)
+ set (CMAKE_REQUIRED_LIBRARIES)
+
GBX_ADD_LIBRARY (${libName} DEFAULT ${libVersion} ${srcs})
target_link_libraries (${libName} ${reqLibs})
+ if (HAVE_CLOCK_GETTIME)
+ target_link_libraries (${libName} rt)
+ endif (HAVE_CLOCK_GETTIME)
GBX_ADD_PKGCONFIG (${libName} ${libDesc} "" reqLibs "" "" ${libVersion})
GBX_ADD_HEADERS (${libName} ${hdrs})
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-08-05 05:15:27 UTC (rev 509)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.cpp 2010-08-08 04:31:17 UTC (rev 510)
@@ -31,111 +31,88 @@
///////////////////////////////////////////////////////////////////////////////
ScanData::ScanData()
- : _ranges(NULL), _intensities(NULL), _length(0),
- _error(false), _time(0), _model(MODEL_UNKNOWN)
+ : ranges_(NULL), intensities_(NULL), ranges_length_(0),
+ intensities_length_(0), error_(false), laser_time_(0), system_time_(0),
+ model_(MODEL_UNKNOWN), buffers_provided_(false)
{
}
-ScanData::ScanData(uint32_t *ranges, unsigned int length, bool error,
- unsigned int time, LaserModel model)
- : _error(error), _time(time), _model(model)
+ScanData::ScanData(uint32_t* const ranges_buffer,
+ unsigned int ranges_length, uint32_t* const intensities_buffer,
+ unsigned int intensities_length)
+ : ranges_(ranges_buffer), intensities_(intensities_buffer),
+ ranges_length_(ranges_length), intensities_length_(intensities_length),
+ error_(false), laser_time_(0), system_time_(0), model_(MODEL_UNKNOWN),
+ buffers_provided_(true)
{
- _length = length;
- if(_length == 0)
- {
- _ranges = NULL;
- _intensities = NULL;
- }
+}
+
+
+ScanData::ScanData(ScanData const& rhs)
+{
+ ranges_length_ = rhs.ranges_length();
+ intensities_length_ = rhs.intensities_length();
+ if(ranges_length_ == 0)
+ ranges_ = NULL;
else
{
try
{
- _ranges = new uint32_t[_length];
+ ranges_ = new uint32_t[ranges_length_];
}
catch(std::bad_alloc& e)
{
- _length = 0;
+ ranges_length_ = 0;
throw;
}
- memcpy(_ranges, ranges, sizeof(uint32_t) * _length);
-
- _intensities = NULL; // No intensity data to copy
+ memcpy(ranges_, rhs.ranges(), sizeof(uint32_t) * ranges_length_);
}
-}
-
-
-ScanData::ScanData(uint32_t* ranges, uint32_t* intensities,
- unsigned int length, bool error, unsigned int time,
- LaserModel model)
- : _error(error), _time(time), _model(model)
-{
- _length = length;
- if(_length == 0)
- {
- _ranges = NULL;
- _intensities = NULL;
- }
+ if(intensities_length_ == 0)
+ intensities_ = NULL;
else
{
try
{
- _ranges = new uint32_t[_length];
+ intensities_ = new uint32_t[intensities_length_];
}
catch(std::bad_alloc& e)
{
- _length = 0;
+ intensities_length_ = 0;
throw;
}
- memcpy(_ranges, ranges, sizeof(uint32_t) * _length);
-
- _intensities = new uint32_t[_length];
- memcpy(_intensities, intensities, sizeof(uint32_t) * _length);
+ memcpy(intensities_, rhs.ranges(),
+ sizeof(uint32_t) * intensities_length_);
}
+ error_ = rhs.get_error_status();
+ laser_time_ = rhs.laser_time_stamp();
+ system_time_ = rhs.system_time_stamp();
+ model_ = rhs.model();
+ buffers_provided_ = rhs.buffers_provided();
}
-ScanData::ScanData(ScanData const& rhs)
+ScanData::~ScanData()
{
- _length = rhs.length();
- if(_length == 0)
- _ranges = NULL;
- else
+ if(!buffers_provided_)
{
- try
+ if (ranges_ != NULL)
{
- _ranges = new uint32_t[_length];
+ delete[] ranges_;
+ ranges_ = NULL;
}
- catch(std::bad_alloc& e)
+ if (intensities_ != NULL)
{
- _length = 0;
- throw;
+ delete[] intensities_;
+ intensities_ = NULL;
}
- memcpy(_ranges, rhs.ranges(), sizeof(uint32_t) * _length);
-
- if(rhs.intensities() != NULL)
- {
- _intensities = new uint32_t[_length];
- memcpy(_intensities, rhs.intensities(),
- sizeof(uint32_t) * _length);
- }
}
- _error = rhs.get_error_status();
- _time = rhs.time_stamp();
- _model = rhs.model();
}
-ScanData::~ScanData()
-{
- if(_ranges != NULL)
- delete[] _ranges;
-}
-
-
std::string ScanData::error_code_to_string(uint32_t error_code)
{
- if(_model == MODEL_UTM30LX)
+ if(model_ == MODEL_UTM30LX)
{
switch(error_code)
{
@@ -212,80 +189,94 @@
ScanData& ScanData::operator=(ScanData const& rhs)
{
- if(rhs.length() == 0)
+ unsigned int rhslength = rhs.ranges_length();
+ if(rhslength == 0)
{
- _length = 0;
- if(_ranges != NULL)
- delete[] _ranges;
- _ranges = NULL;
- if(_intensities != NULL)
- delete[] _intensities;
- _intensities = NULL;
- _error = rhs.get_error_status();
- _time = rhs.time_stamp();
- _model = rhs.model();
+ ranges_ = NULL;
+ ranges_length_ = 0;
}
else
{
- unsigned int rhslength = rhs.length();
- uint32_t* newData;
- if(rhslength != _length)
+ if(rhslength != ranges_length_)
{
- // Copy the data into a temporary variable pointing to new space
- // (prevents dangling pointers on allocation error and prevents
- // self-assignment making a mess).
- newData = new uint32_t[rhslength];
- memcpy(newData, rhs.ranges(), sizeof(uint32_t) * rhslength);
- if(_ranges != NULL)
- delete[] _ranges;
- _ranges = newData;
- _length = rhs.length();
-
- if(rhs.intensities() != NULL)
+ if(!buffers_provided_ && ranges_ != NULL)
{
- try
- {
- newData = new uint32_t[rhslength];
- }
- catch(std::bad_alloc& e)
- {
- // We have to remove any old intensity data or the length
- // won't match
- if(_intensities != NULL)
- delete[] _intensities;
- _intensities = NULL;
- throw;
- }
- memcpy(newData, rhs.intensities(), sizeof(uint32_t) *
- rhslength);
- if(_intensities != NULL)
- delete[] _intensities;
- _intensities = newData;
+ // Just copy
+ memcpy(ranges_, rhs.ranges(), sizeof(uint32_t) * rhslength);
}
+ else
+ {
+ // Copy the data into a temporary variable pointing to new space
+ // (prevents dangling pointers on allocation error and prevents
+ // self-assignment making a mess).
+ uint32_t* new_data = new uint32_t[rhslength];
+ memcpy(new_data, rhs.ranges(), sizeof(uint32_t) * rhslength);
+ if(ranges_ != NULL)
+ delete[] ranges_;
+ ranges_ = new_data;
+ ranges_length_ = rhs.ranges_length();
+ }
}
else
{
// If lengths are the same, no need to reallocate
- memcpy(_ranges, rhs.ranges(), sizeof(uint32_t) * _length);
- if(rhs.intensities() != NULL)
- memcpy(_intensities, rhs.intensities(), sizeof(uint32_t) *
- _length);
+ memcpy(ranges_, rhs.ranges(), sizeof(uint32_t) * rhslength);
}
+ }
- _error = rhs.get_error_status();
- _time = rhs.time_stamp();
- _model = rhs.model();
+ rhslength = rhs.intensities_length();
+ if(rhslength == 0)
+ {
+ intensities_ = NULL;
+ intensities_length_ = 0;
}
+ else
+ {
+ if(rhslength != intensities_length_)
+ {
+ if(!buffers_provided_ && intensities_ != NULL)
+ {
+ // Just copy
+ memcpy(intensities_, rhs.intensities(),
+ sizeof(uint32_t) * rhslength);
+ }
+ else
+ {
+ // Copy the data into a temporary variable pointing to new
+ // space (prevents dangling pointers on allocation error and
+ // prevents self-assignment making a mess).
+ uint32_t* new_data = new uint32_t[rhslength];
+ memcpy(new_data, rhs.intensities(),
+ sizeof(uint32_t) * rhslength);
+ if(intensities_ != NULL)
+ delete[] intensities_;
+ intensities_ = new_data;
+ intensities_length_ = rhs.intensities_length();
+ }
+ }
+ else
+ {
+ // If lengths are the same, no need to reallocate
+ memcpy(intensities_, rhs.intensities(),
+ sizeof(uint32_t) * rhslength);
+ }
+ }
+ error_ = rhs.get_error_status();
+ laser_time_ = rhs.laser_time_stamp();
+ system_time_ = rhs.system_time_stamp();
+ model_ = rhs.model();
+ buffers_provided_ = rhs.buffers_provided();
+
return *this;
}
uint32_t ScanData::operator[](unsigned int index)
{
- if(index >= _length)
+ if(index >= ranges_length_)
throw IndexError();
- return _ranges[index];
+ return ranges_[index];
}
@@ -293,30 +284,36 @@
{
std::stringstream ss;
- ss << _length << " readings from model ";
- ss << model_to_string(_model) << ":\n";
- for (unsigned int ii = 0; ii < _length; ii++)
- ss << _ranges[ii] << "\t";
- if(_intensities != NULL)
+ if(ranges_ != NULL)
{
- ss << std::endl << _length << " intensities:\n";
- for (unsigned int ii = 0; ii < _length; ii++)
- ss << _intensities[ii] << "\t";
+ ss << ranges_length_ << " ranges from model ";
+ ss << model_to_string(model_) << ":\n";
+ for(unsigned int ii(0); ii < ranges_length_; ii++)
+ ss << ranges_[ii] << '\t';
+ ss << '\n';
}
- ss << '\n';
- if(_error)
+ if(intensities_ != NULL)
{
+ ss << intensities_length_ << " intensities from model ";
+ ss << model_to_string(model_) << ":\n";
+ for(unsigned int ii(0); ii < intensities_length_; ii++)
+ ss << intensities_[ii] << '\t';
+ ss << '\n';
+ }
+
+ if(error_)
+ {
ss << "Detected data errors:\n";
- for (unsigned int ii = 0; ii < _length; ii++)
+ for(unsigned int ii = 0; ii < ranges_length_; ii++)
{
- if(_ranges[ii] < 20)
- ss << ii << ": " <<
- error_code_to_string(_ranges[ii]) << '\n';
+ if(ranges_[ii] < 20)
+ ss << ii << ": " << error_code_to_string(ranges_[ii]) << '\n';
}
}
else
ss << "No data errors.\n";
- ss << "Time stamp: " << _time << '\n';
+ ss << "Laser time stamp: " << laser_time_ << '\n';
+ ss << "System time stamp: " << system_time_ << '\n';
return ss.str();
}
@@ -324,72 +321,126 @@
void ScanData::clean_up()
{
- if(_ranges != NULL)
- delete[] _ranges;
- _ranges = NULL;
- if(_intensities != NULL)
- delete[] _intensities;
- _intensities = NULL;
- _length = 0;
- _error = false;
- _time = 0;
+ if(!buffers_provided_)
+ {
+ if(ranges_ != NULL)
+ delete[] ranges_;
+ ranges_ = NULL;
+ if(intensities_ != NULL)
+ delete[] intensities_;
+ intensities_ = NULL;
+ }
+ ranges_length_ = 0;
+ intensities_length_ = 0;
+ error_ = false;
+ laser_time_ = 0;
+ system_time_ = 0;
}
void ScanData::allocate_data(unsigned int length, bool include_intensities)
{
+ // If buffers have been provided, automatic allocation is off.
+ if(buffers_provided_)
+ return;
+
// If no data yet, allocate new
- if(_ranges == NULL)
+ if(ranges_ == NULL)
{
try
{
- _ranges = new uint32_t[length];
+ ranges_ = new uint32_t[length];
}
catch(std::bad_alloc& e)
{
- _length = 0;
+ ranges_length_ = 0;
throw;
}
- _length = length;
+ ranges_length_ = length;
}
// If there is data, reallocate only if the length is different
- else if(length != _length)
+ else if(length != ranges_length_)
{
- delete[] _ranges;
+ delete[] ranges_;
try
{
- _ranges = new uint32_t[length];
+ ranges_ = new uint32_t[length];
}
catch(std::bad_alloc& e)
{
- _length = 0;
+ ranges_length_ = 0;
throw;
}
- _length = length;
+ ranges_length_ = length;
}
// Else data is already allocated to the right length, so do nothing
if(include_intensities)
{
// If no data yet, allocate new
- if(_intensities == NULL)
+ if(intensities_ == NULL)
{
- _intensities = new uint32_t[length];
+ try
+ {
+ intensities_ = new uint32_t[length];
+ }
+ catch(std::bad_alloc& e)
+ {
+ intensities_length_ = 0;
+ throw;
+ }
+ intensities_length_ = length;
}
// If there is data, reallocate only if the length is different
- else if(length != _length)
+ else if(length != intensities_length_)
{
- delete[] _intensities;
- _intensities = new uint32_t[length];
+ delete[] intensities_;
+ try
+ {
+ intensities_ = new uint32_t[length];
+ }
+ catch(std::bad_alloc& e)
+ {
+ intensities_length_ = 0;
+ throw;
+ }
+ intensities_length_ = length;
}
// Else data is already allocated to the right length, so do nothing
}
- else if(_intensities != NULL)
+ else if(intensities_ != NULL)
{
// If not told to allocate space for intensity data and it exists,
// remove it
- delete[] _intensities;
- _intensities = NULL;
+ delete[] intensities_;
+ intensities_ = NULL;
+ intensities_length_ = 0;
}
}
+
+void ScanData::write_range_(unsigned int index, uint32_t value)
+{
+ if(ranges_ != NULL)
+ {
+ if(index >= ranges_length_)
+ throw IndexError();
+ ranges_[index] = value;
+ if(ranges_[index] < 20)
+ error_ = true;
+ }
+}
+
+
+void ScanData::write_intensity_(unsigned int index, uint32_t value)
+{
+ if(intensities_ != NULL)
+ {
+ if(index >= intensities_length_)
+ throw IndexError();
+ intensities_[index] = value;
+ if(intensities_[index] < 20)
+ error_ = true;
+ }
+}
+
Modified: gearbox/trunk/src/hokuyo_aist/scan_data.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-08-05 05:15:27 UTC (rev 509)
+++ gearbox/trunk/src/hokuyo_aist/scan_data.h 2010-08-08 04:31:17 UTC (rev 510)
@@ -57,14 +57,26 @@
/// This constructor creates an empty ScanData with no data currently
/// allocated.
ScanData();
- /// This constructor performs a deep copy of existing range data.
- ScanData(uint32_t* ranges, unsigned int length, bool error,
- unsigned int time, LaserModel model);
- /// This constructor performs a deep copy of existing range and
- /// intensity data.
- ScanData(uint32_t* ranges, uint32_t* intensities,
- unsigned int length, bool error, unsigned int time,
- LaserModel model);
+ /// This constructor uses a provided data buffer rather than allocating
+ /// automatically.
+ ///
+ /// If the intensity pointer is NULL, no data will be provided of that
+ /// type.
+ ///
+ /// @param ranges_buffer A pointer to a data area to store range data
+ /// in. It is the caller's responsibility to ensure that it is big
+ /// enough.
+ /// @param ranges_length The size of the ranges buffer. Used only for
+ /// copy constructor and similar.
+ /// @param intensities_buffer A pointer to a data area to store
+ /// intensity data in. It is the caller's responsibility to ensure that
+ /// it is big enough.
+ /// @param intensities_length The size of the intensities buffer. Used
+ /// only for copy constructor and similar.
+ ScanData(uint32_t* const ranges_buffer,
+ unsigned int ranges_length,
+ uint32_t* const intensities_buffer=NULL,
+ unsigned int intensities_length=0);
/// This copy constructor performs a deep copy of present data.
ScanData(ScanData const& rhs);
~ScanData();
@@ -75,28 +87,43 @@
data to see a probable cause for the error. Most of the time, it will
just be an out-of-range reading. */
const uint32_t* ranges() const
- { return _ranges; }
+ { return ranges_; }
/// @brief Return a pointer to an array of intensity readings.
const uint32_t* intensities() const
- { return _intensities; }
- /// @brief Get the number of samples in the data.
- unsigned int length() const { return _length; }
+ { return intensities_; }
+ /// @brief Get the number of range samples in the data.
+ unsigned int ranges_length() const { return ranges_length_; }
+ /// @brief Get the number of intensity samples in the data.
+ unsigned int intensities_length() const { return intensities_length_; }
/** @brief Indicates if one or more steps had an error.
A step's value will be less than 20 if it had an error. Use @ref
error_code_to_string to get a textual representation of the error. */
- bool get_error_status() const { return _error; }
+ bool get_error_status() const { return error_; }
/// @brief Return a string representing the error for the given error
/// code.
std::string error_code_to_string(uint32_t error_code);
- /** @brief Get the time stamp of the data in milliseconds
+ /** @brief Get the raw time stamp of the data in milliseconds.
This value is only available using SCIP version 2). */
- unsigned int time_stamp() const { return _time; }
+ unsigned int laser_time_stamp() const { return laser_time_; }
+ /** @brief Get the system time stamp of the data in milliseconds.
+
+ This value is only available using SCIP version 2). */
+ unsigned int system_time_stamp() const { return system_time_; }
/// Get the model of the laser that produced this scan.
- LaserModel model() const { return _model; }
+ LaserModel model() const { return model_; }
+ /// Check if the buffers are being provided instead of automatic.
+ bool buffers_provided() const { return buffers_provided_; }
/// @brief Assignment operator.
+ ///
+ /// If the rhs has provided buffers, the lhs will not receive the same
+ /// buffers. Instead, it will copy the data into its own buffers.
+ /// If the lhs has provided buffers, it is the caller's responsibility
+ /// to ensure they will be big enough to receive the data from the rhs,
+ /// except in the case of NULL buffers (no data will be copied for NULL
+ /// buffers).
ScanData& operator=(ScanData const& rhs);
/** @brief Subscript operator.
@@ -110,15 +137,20 @@
void clean_up();
protected:
- uint32_t* _ranges;
- uint32_t* _intensities;
- unsigned int _length;
- bool _error;
- unsigned int _time;
- LaserModel _model;
+ uint32_t* ranges_;
+ uint32_t* intensities_;
+ unsigned int ranges_length_;
+ unsigned int intensities_length_;
+ bool error_;
+ unsigned int laser_time_;
+ unsigned int system_time_;
+ LaserModel model_;
+ bool buffers_provided_;
void allocate_data(unsigned int length,
bool include_intensities = false);
+ void write_range_(unsigned int index, uint32_t value);
+ void write_intensity_(unsigned int index, uint32_t value);
}; // class ScanData
} // namespace hokuyo_aist
Modified: gearbox/trunk/src/hokuyo_aist/sensor.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-05 05:15:27 UTC (rev 509)
+++ gearbox/trunk/src/hokuyo_aist/sensor.cpp 2010-08-08 04:31:17 UTC (rev 510)
@@ -29,14 +29,17 @@
#include <cassert>
#include <cstring>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <math.h>
+#include <cstdarg>
+#include <cstdlib>
+#include <cstdio>
+#include <cerrno>
+#include <cmath>
+#include <unistd.h>
#include <sstream>
#include <iostream>
#include <iomanip>
+#include <ctime>
+#include <fstream>
#if defined(WIN32)
#define __func__ __FUNCTION__
@@ -271,93 +274,94 @@
///////////////////////////////////////////////////////////////////////////////
Sensor::Sensor()
- : _port(NULL), _err_output(std::cerr), _scip_version(2), _verbose(false),
- _enable_checksum_workaround(false), _ignore_unknowns(false),
- _multiecho_mode(ME_OFF), _min_angle(0.0), _max_angle(0.0),
- _resolution(0.0), _first_step(0), _last_step(0), _front_step(0)
+ : port_(NULL), err_output_(std::cerr), scip_version_(2), verbose_(false),
+ enable_checksum_workaround_(false), ignore_unknowns_(false),
+ multiecho_mode_(ME_OFF), min_angle_(0.0), max_angle_(0.0),
+ resolution_(0.0), first_step_(0), last_step_(0), front_step_(0),
+ max_range_(0), time_offset_(0), last_timestamp_(0), wrap_count_(0)
{
}
Sensor::Sensor(std::ostream& err_output)
- : _port(NULL), _err_output(err_output), _scip_version(2),
- _verbose(false), _enable_checksum_workaround(false),
- _ignore_unknowns(false), _multiecho_mode(ME_OFF), _min_angle(0.0),
- _max_angle(0.0), _resolution(0.0), _first_step(0), _last_step(0),
- _front_step(0)
+ : port_(NULL), err_output_(err_output), scip_version_(2), verbose_(false),
+ enable_checksum_workaround_(false), ignore_unknowns_(false),
+ multiecho_mode_(ME_OFF), min_angle_(0.0), max_angle_(0.0),
+ resolution_(0.0), first_step_(0), last_step_(0), front_step_(0),
+ max_range_(0), time_offset_(0), last_timestamp_(0), wrap_count_(0)
{
}
Sensor::~Sensor()
{
- if(_port != NULL)
- delete _port;
+ if(port_ != NULL)
+ delete port_;
}
void Sensor::open(std::string port_options)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Creating and opening port using options: " <<
port_options << '\n';
}
- _port = flexiport::CreatePort(port_options);
- _port->Open();
+ port_ = flexiport::CreatePort(port_options);
+ port_->Open();
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Connected using " <<
- _port->GetPortType() << " connection.\n";
- _err_output << _port->GetStatus();
+ err_output_ << "Sensor::" << __func__ << "() Connected using " <<
+ port_->GetPortType() << " connection.\n";
+ err_output_ << port_->GetStatus();
}
- _port->Flush();
+ port_->Flush();
// Figure out the SCIP version currently in use and switch to a higher one
// if possible
- _get_and_set_scip_version();
+ get_and_set_scip_version_();
// Get some values we need for providing default ranges
- _get_defaults();
+ get_defaults_();
}
unsigned int Sensor::open_with_probing(std::string port_options)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Creating and opening port using options: " << port_options <<
'\n';
}
- _port = flexiport::CreatePort(port_options);
- _port->Open();
+ port_ = flexiport::CreatePort(port_options);
+ port_->Open();
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Connected using " <<
- _port->GetPortType() << " connection.\n";
- _err_output << _port->GetStatus();
+ err_output_ << "Sensor::" << __func__ << "() Connected using " <<
+ port_->GetPortType() << " connection.\n";
+ err_output_ << port_->GetStatus();
}
- _port->Flush();
+ port_->Flush();
try
{
// Figure out the SCIP version currently in use and switch to a higher
// one if possible
- _get_and_set_scip_version();
+ get_and_set_scip_version_();
// Get some values we need for providing default ranges
- _get_defaults();
+ get_defaults_();
}
catch(BaseError)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Failed to connect at the default baud rate.\n";
}
- if(_port->GetPortType() == "serial")
+ if(port_->GetPortType() == "serial")
{
// Failed at the default baud rate, so try again at the other
// rates. Note that a baud rate of 750000 or 250000 doesn't appear
@@ -366,16 +370,16 @@
unsigned int const numBauds(5);
for (unsigned int ii = 0; ii < numBauds; ii++)
{
- reinterpret_cast<flexiport::SerialPort*>(_port)->SetBaudRate(bauds[ii]);
+ reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(bauds[ii]);
try
{
- _get_and_set_scip_version();
- _get_defaults();
+ get_and_set_scip_version_();
+ get_defaults_();
// If the above two functions succeed, break out of the
// loop and be happy
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Connected at " << bauds[ii] << '\n';
}
return bauds[ii];
@@ -385,9 +389,9 @@
if(ii == numBauds - 1)
{
// Last baud rate, give up and rethrow
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Failed to connect at any baud rate.\n";
}
throw;
@@ -398,17 +402,17 @@
}
else
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Port is not serial, cannot probe.\n";
}
throw;
}
}
- if(_port->GetPortType() == "serial")
- return reinterpret_cast<flexiport::SerialPort*>(_port)->GetBaudRate();
+ if(port_->GetPortType() == "serial")
+ return reinterpret_cast<flexiport::SerialPort*>(port_)->GetBaudRate();
else
return 0;
}
@@ -416,60 +420,60 @@
void Sensor::close()
{
- if(!_port)
+ if(!port_)
throw CloseError();
- if(_verbose)
- _err_output << "Sensor::" << __func__ << "() Closing connection.\n";
- delete _port;
- _port = NULL;
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ << "() Closing connection.\n";
+ delete port_;
+ port_ = NULL;
}
bool Sensor::is_open() const
{
- if(_port != NULL)
- return _port->IsOpen();
+ if(port_ != NULL)
+ return port_->IsOpen();
return false;
}
void Sensor::set_power(bool on)
{
- if(_scip_version == 1)
+ if(scip_version_ == 1)
{
if(on)
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Turning laser on.\n";
- _send_command("L", "1", 1, NULL);
+ send_command_("L", "1", 1, NULL);
}
else
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Turning laser off.\n";
- _send_command("L", "0", 1, NULL);
+ send_command_("L", "0", 1, NULL);
}
- _skip_lines(1);
+ skip_lines_(1);
}
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
if(on)
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Turning laser on.\n";
- _send_command("BM", NULL, 0, "02");
+ send_command_("BM", NULL, 0, "02");
}
else
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Turning laser off.\n";
- _send_command("QT", NULL, 0, "02");
+ send_command_("QT", NULL, 0, "02");
}
- _skip_lines(1);
+ skip_lines_(1);
}
else
throw UnknownScipVersionError();
@@ -480,7 +484,7 @@
// set to the same baud.
void Sensor::set_baud(unsigned int baud)
{
- if(_port->GetPortType() != "serial")
+ if(port_->GetPortType() != "serial")
throw NotSerialError();
char newBaud[13];
@@ -493,21 +497,21 @@
}
number_to_string(baud, newBaud, 6);
- if(_scip_version == 1)
+ if(scip_version_ == 1)
{
// Send the command to change baud rate
- _send_command("S", newBaud, 13, NULL);
- _skip_lines(1);
+ send_command_("S", newBaud, 13, NULL);
+ skip_lines_(1);
// Change the port's baud rate
- reinterpret_cast<flexiport::SerialPort*>(_port)->SetBaudRate(baud);
+ reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(baud);
}
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
// Send the command to change baud rate
- _send_command("SS", newBaud, 6, "03");
- _skip_lines(1);
+ send_command_("SS", newBaud, 6, "03");
+ skip_lines_(1);
// Change the port's baud rate
- reinterpret_cast<flexiport::SerialPort*>(_port)->SetBaudRate(baud);
+ reinterpret_cast<flexiport::SerialPort*>(port_)->SetBaudRate(baud);
}
else
throw UnknownScipVersionError();
@@ -519,7 +523,7 @@
{
// Command is "$IP"(3) + IP(15) + ' ' + subnet(15) + ' ' + gateway(15),
// +1 for the null byte, but split two bytes off the front for sending.
- // Hijack the _send_command function, treating the rest of the command as
+ // Hijack the send_command_ function, treating the rest of the command as
// parameters.
char const command[3] = "$I";
std::stringstream params;
@@ -531,14 +535,14 @@
'.' << subnet.fourth << ' ';
params << gateway.first << '.' << gateway.second << '.' << gateway.third <<
'.' << gateway.fourth;
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Setting IP information to $I" << params.str() << '\n';
}
- int status = _send_command(&command[0], params.str().c_str(), 48, NULL);
+ int status = send_command_(&command[0], params.str().c_str(), 48, NULL);
// Skip the extra line feed
- _skip_lines(1);
+ skip_lines_(1);
if(status != 0)
throw SetIPError();
}
@@ -546,17 +550,17 @@
void Sensor::reset()
{
- if(_scip_version == 1)
+ if(scip_version_ == 1)
throw UnsupportedError(7);
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Resetting laser.\n";
}
- _send_command("RS", NULL, 0, NULL);
- _skip_lines(1);
+ send_command_("RS", NULL, 0, NULL);
+ skip_lines_(1);
}
else
throw UnknownScipVersionError();
@@ -565,15 +569,15 @@
void Sensor::semi_reset()
{
- if(_scip_version == 1)
+ if(scip_version_ == 1)
throw UnsupportedError(35);
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Resetting laser.\n";
- _send_command("RS", NULL, 0, NULL);
- _skip_lines(1);
+ send_command_("RS", NULL, 0, NULL);
+ skip_lines_(1);
}
else
throw UnknownScipVersionError();
@@ -582,9 +586,9 @@
void Sensor::set_motor_speed(unsigned int speed)
{
- if(_scip_version == 1)
+ if(scip_version_ == 1)
throw UnsupportedError(8);
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
// Sanity check the value
if(speed > 10 && speed != 99)
@@ -592,9 +596,9 @@
char buffer[3];
if(speed == 0)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Reseting motor speed to default.\n";
}
buffer[0] = '0';
@@ -603,9 +607,9 @@
}
else if(speed == 99)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Reseting motor speed to default.\n";
}
buffer[0] = '9';
@@ -614,15 +618,15 @@
}
else
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Setting motor speed to ratio " << speed << '\n';
}
number_to_string(speed, buffer, 2);
}
- _send_command("CR", buffer, 2, "03");
- _skip_lines(1);
+ send_command_("CR", buffer, 2, "03");
+ skip_lines_(1);
}
else
throw UnknownScipVersionError();
@@ -631,27 +635,27 @@
void Sensor::set_high_sensitivity(bool on)
{
- if(_scip_version == 1)
+ if(scip_version_ == 1)
throw UnsupportedError(10);
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
if(on)
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Switching to high sensitivity.\n";
- _send_command("HS", "1", 1, "02");
+ send_command_("HS", "1", 1, "02");
}
else
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Switching to normal sensitivity.\n";
}
- _send_command("HS", "0", 1, "02");
+ send_command_("HS", "0", 1, "02");
}
- _skip_lines(1);
+ skip_lines_(1);
}
else
throw UnknownScipVersionError();
@@ -663,44 +667,44 @@
if(info == NULL)
throw NoDestinationError();
- if(_scip_version == 1)
+ if(scip_version_ == 1)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Getting sensor information using SCIP version 1.\n";
}
- info->set_defaults();
+ info->set_defaults_();
char buffer[SCIP1_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP1_LINE_LENGTH);
- _send_command("V", NULL, 0, NULL);
+ send_command_("V", NULL, 0, NULL);
// Get the vendor info line
- _read_line(buffer);
+ read_line_(buffer);
info->vendor = &buffer[5]; // Chop off the "VEND:" tag
// Get the product info line
- _read_line(buffer);
+ read_line_(buffer);
info->product = &buffer[5];
// Only the URG-04LX supports SCIP1
- _model = MODEL_URG04LX;
+ model_ = MODEL_URG04LX;
// Get the firmware line
- _read_line(buffer);
+ read_line_(buffer);
info->firmware = &buffer[5];
// Get the protocol version line
- _read_line(buffer);
+ read_line_(buffer);
info->protocol = &buffer[5];
// Get the serial number
- _read_line(buffer);
+ read_line_(buffer);
info->serial = &buffer[5];
// Get either the status line or the end of message
- _read_line(buffer);
+ read_line_(buffer);
if(buffer[0] != '\0')
{
// Got a status line
info->sensor_diagnostic = &buffer[5];
- _skip_lines(1);
+ skip_lines_(1);
}
// Check the firmware version major number. If it's >=3 there is
@@ -710,8 +714,8 @@
// length of 64 bytes.
if(atoi(info->firmware.c_str()) >= 3)
{
- if(_verbose)
- _err_output << "SCIP1 Firmware line for parsing: " <<
+ if(verbose_)
+ err_output_ << "SCIP1 Firmware line for parsing: " <<
info->firmware << '\n';
// 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
@@ -722,7 +726,7 @@
{
// No bracket? Crud. Fail and use the hard-coded values from
// the manual.
- info->calculate_values();
+ info->calculate_values_();
}
// Now put it through sscanf and hope...
int aperture;
@@ -734,13 +738,13 @@
{
// Didn't get enough values out, assume unknown format and fall
// back on the defaults
- info->set_defaults();
- info->calculate_values();
- if(_verbose)
+ info->set_defaults_();
+ info->calculate_values_();
+ if(verbose_)
{
- _err_output << "Retrieved sensor info (hard-coded, not "
+ err_output_ << "Retrieved sensor info (hard-coded, not "
"enough values):\n";
- _err_output << info->as_string();
+ err_output_ << info->as_string();
}
}
else
@@ -758,10 +762,10 @@
info->max_angle = (info->last_step - info->front_step) *
info->resolution;
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Retrieved sensor info (from FIRM line):\n";
- _err_output << info->as_string();
+ err_output_ << "Retrieved sensor info (from FIRM line):\n";
+ err_output_ << info->as_string();
}
}
}
@@ -769,50 +773,50 @@
{
// We're stuck with hard-coded defaults from the manual (already
// set earlier).
- info->calculate_values();
- if(_verbose)
+ info->calculate_values_();
+ if(verbose_)
{
- _err_output << "Retrieved sensor info (hard-coded):\n";
- _err_output << info->as_string();
+ err_output_ << "Retrieved sensor info (hard-coded):\n";
+ err_output_ << info->as_string();
}
}
}
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ <<
+ err_output_ << "Sensor::" << __func__ <<
"() Getting sensor information using SCIP version 2.\n";
}
- info->set_defaults();
+ info->set_defaults_();
char buffer[SCIP2_LINE_LENGTH];
memset(buffer, 0, sizeof(char) * SCIP2_LINE_LENGTH);
// We need to send three commands to get all the info we want: VV, PP
// and II
- _send_command("VV", NULL, 0, NULL);
- while(_read_line_with_check(buffer, -1, true) != 0)
- _process_vv_line(buffer, info);
+ send_command_("VV", NULL, 0, NULL);
+ while(read_line_with_check_(buffer, -1, true) != 0)
+ process_vv_line_(buffer, info);
// Next up, PP
- _send_command("PP", NULL, 0, NULL);
- while(_read_line_with_check(buffer, -1, true) != 0)
- _process_pp_line(buffer, info);
+ send_command_("PP", NULL, 0, NULL);
+ while(read_line_with_check_(buffer, -1, true) != 0)
+ process_pp_line_(buffer, info);
// Command II: Revenge of the Commands.
- _send_command("II", NULL, 0, NULL);
- while(_read_line_with_check(buffer, -1, true) != 0)
- _process_ii_line(buffer, info);
+ send_command_("II", NULL, 0, NULL);
+ while(read_line_with_check_(buffer, -1, true) != 0)
+ process_ii_line_(buffer, info);
- _enable_checksum_workaround = false;
+ enable_checksum_workaround_ = false;
- info->calculate_values();
- if(_verbose)
+ info->calculate_values_();
+ if(verbose_)
{
- _err_output << "Retrieved sensor info:\n";
- _err_output << info->as_string();
+ err_output_ << "Retrieved sensor info:\n";
+ err_output_ << info->as_string();
}
}
else
@@ -822,19 +826,25 @@
unsigned int Sensor::get_time()
{
- if(_scip_version == 1)
+ return offset_timestamp_(wrap_timestamp_(get_raw_time()));
+}
+
+
+unsigned int Sensor::get_raw_time()
+{
+ if(scip_version_ == 1)
throw UnsupportedError(12);
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
- if(_verbose)
- _err_output << "Sensor::" << __func__ <<
+ if(verbose_)
+ err_output_ << "Sensor::" << __func__ <<
"() Retrieving time from laser.\n";
- _send_command("TM", "0", 1, NULL);
- _send_command("TM", "1", 1, NULL);
+ send_command_("TM", "0", 1, NULL);
+ send_command_("TM", "1", 1, NULL);
char buffer[7];
- _read_line_with_check(buffer, 6);
- _send_command("TM", "2", 1, NULL);
- _skip_lines(1);
+ read_line_with_check_(buffer, 6);
+ send_command_("TM", "2", 1, NULL);
+ skip_lines_(1);
// We need to decode the time value that's in the buffer
return decode_4_byte_value(buffer);
}
@@ -845,6 +855,134 @@
}
+unsigned int Sensor::calibrate_time(unsigned int samples)
+{
+ enter_timing_mode_();
+
+ std::ofstream df("times.txt", std::ofstream::app);
+
+ // Measure the latency with 1000 plain TM commands
+ std::vector<unsigned long long> latencies;
+ for(unsigned int ii = 0; ii < samples; ii++)
+ {
+ unsigned long long start_time(get_computer_time_());
+ get_timing_mode_time_("");
+ unsigned long long end_time(get_computer_time_());
+ latencies.push_back(end_time - start_time);
+ }
+ // Calculate the median two-way latency
+ unsigned long long two_way_latency = median(latencies);
+ df << two_way_latency << '\t';
+
+ // Measure the latency with 1000 TM commands + 32 bytes
+ std::string bytes = "12345678901234567890123456789012";
+ latencies.clear();
+ for(unsigned int ii = 0; ii < samples; ii++)
+ {
+ unsigned long long start_time(get_computer_time_());
+ get_timing_mode_time_(bytes);
+ unsigned long long end_time(get_computer_time_());
+ latencies.push_back(end_time - start_time);
+ }
+ // Calculate the median two-way latency
+ unsigned long long latency_32bytes = median(latencies);
+ df << latency_32bytes << '\t';
+ // Subtract the no-data latency to remove the command transmission time
+ latency_32bytes -= two_way_latency;
+ df << latency_32bytes << '\t';
+ // Divide by 32 to get the per-byte transmission time
+ unsigned long long one_byte_latency32 = latency_32bytes / 32;
+ df << one_byte_latency32 << '\t';
+
+ // Measure the latency with 1000 TM commands + 64 bytes
+ bytes = "1234567890123456789012345678901234567890123456789012345678901234";
+ latencies.clear();
+ for(unsigned int ii = 0; ii < samples; ii++)
+ {
+ unsigned long long start_time(get_computer_time_());
+ get_timing_mode_time_(bytes);
+ unsigned long long end_time(get_computer_time_());
+ latencies.push_back(end_time - start_time);
+ }
+ // Calculate the median two-way latency
+ unsigned long long latency_64bytes = median(latencies);
+ df << latency_64bytes << '\t';
+ // Subtract the no-data latency to remove the command transmission time
+ latency_64bytes -= two_way_latency;
+ df << latency_64bytes << '\t';
+ // Divide by 32 to get the per-byte transmission time
+ unsigned long long one_byte_latency64 = latency_64bytes / 64;
+ df << one_byte_latency64 << '\t';
+
+ // Get the time from the laser
+ // To get the most accurate result, we cannot do any processing while
+ // receiving. We want to know the time that reception finished as exactly
+ // as possible. To achieve this, we do not use send_command_, but instead
+ // send the command manually and receive the entire expected reply at once,
+ // then check/decode it later.
+ char response[17];
+ if(port_->Write("TM1\n", 4) < 4)
+ throw WriteError(19);
+ unsigned int line_length = port_->ReadLine(response, 16);
+ unsigned long long end_time(get_computer_time_());
+ df << end_time << '\t';
+ // Process the response to confirm it is correct
+ if(line_length < 0)
+ throw ReadError(0);
+ else if(line_length == 0)
+ throw ReadError(1);
+ else if(line_length < 15)
+ throw LineLengthError(line_length, 15);
+ response[line_length - 1] = '\0';
+ if(response[0] != 'T' || response[1] != 'M' || response[2] != '1')
+ throw CommandEchoError("TM", response);
+ response[7] = '\0';
+ if(response[4] != '0' || response[5] != '0' || response[6] != 'P')
+ throw ResponseError(response, "TM");
+ // Check the checksum on the time stamp is accurate
+ confirm_checksum_(&response[8], 4, response[12]);
+ // Decode the time stamp
+ unsigned int timestamp =
+ wrap_timestamp_(decode_4_byte_value(&response[8]));
+ df << timestamp << '\t';
+ // The laser had to send 15 bytes to send back the time stamp. This means
+ // that there was approximately a 15 byte delay between the time stamp's
+ // occurance in real time and when we finished receiving the data.
+ // The offset from computer time to laser time is:
+ // (computer time - comms time) - laser time
+ // Not forgetting that the computer times need to be converted to
+ // milliseconds.
+ time_offset_ = ((end_time - (one_byte_latency64 * 15)) / 1e6) - timestamp;
+ df << time_offset_ << '\n';
+
+ // All done.
+ leave_timing_mode_();
+ df.close();
+ return time_offset_;
+}
+
+
+unsigned int Sensor::wrap_timestamp_(unsigned int timestamp)
+{
+ unsigned int result;
+ if(timestamp < last_timestamp_)
+ {
+ wrap_count_++;
+ result = timestamp + wrap_count_ * 0x1000; // 24-bit value + 1
+ }
+ else
+ result = timestamp;
+ last_timestamp_ = timestamp;
+ return result;
+}
+
+
+unsigned int Sensor::offset_timestamp_(unsigned int timestamp)
+{
+ return timestamp + time_offset_;
+}
+
+
unsigned int Sensor::get_ranges(ScanData* data, int start_step,
int end_step, unsigned int cluster_count)
{
@@ -855,55 +993,56 @@
memset(buffer, 0, sizeof(char) * 11);
if(start_step < 0)
- start_step = _first_step;
+ start_step = first_step_;
if(end_step < 0)
- end_step = _last_step;
+ end_step = last_step_;
unsigned int num_steps = (end_step - start_step + 1) / cluster_count;
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Reading " <<
+ err_output_ << "Sensor::" << __func__ << "() Reading " <<
num_steps << " ranges between " << start_step << " and " <<
end_step << " with a cluster count of " << cluster_count <<
'\n';
}
- if(_scip_version == 1)
+ if(scip_version_ == 1)
{
// Send the command to ask for the most recent range data from
// start_step to end_step
number_to_string(start_step, buffer, 3);
number_to_string(end_step, &buffer[3], 3);
number_to_string(cluster_count, &buffer[6], 2);
- _send_command("G", buffer, 8, NULL);
+ send_command_("G", buffer, 8, NULL);
// In SCIP1 mode we're going to get back 2-byte data
- _read_2_byte_range_data(data, num_steps);
+ read_2_byte_range_data_(data, num_steps);
}
- else if(_scip_version == 2)
+ else if(scip_version_ == 2)
{
// Send the command to ask for the most recent range data from
// start_step to end_step
number_to_string(start_step, buffer, 4);
number_to_string(end_step, &buffer[4], 4);
number_to_string(cluster_count, &buffer[8], 2);
- if(_model == MODEL_UXM30LXE && _multiecho_mode != ME_OFF)
- _send_command("HD", buffer, 10, NULL);
+ if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
+ send_command_("HD", buffer, 10, NULL);
else
- _send_command("GD", buffer, 10, NULL);
+ send_command_("GD", buffer, 10, NULL);
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
- if(_read_line_with_check(buffer) == 0)
+ if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->_time = decode_4_byte_value(buffer);
+ data->laser_time_ = decode_4_byte_value(buffer);
+ data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GD command
- _read_3_byte_range_data(data, num_steps);
+ read_3_byte_range_data_(data, num_steps);
}
else
throw UnknownScipVersionError();
- return data->_length;
+ return data->ranges_length_;
}
@@ -913,20 +1052,20 @@
if(data == NULL)
throw NoDataError();
- // Calculate the given angles in steps, rounding towards _front_step
+ // Calculate the given angles in steps, rounding towards front_step_
int start_step, end_step;
start_step = angle_to_step(start_angle);
end_step = angle_to_step(end_angle);
// Check the steps are within the allowable range
- if(start_step < _first_step || start_step > _last_step)
+ if(start_step < first_step_ || start_step > last_step_)
throw StartStepError();
- if(end_step < _first_step || end_step > _last_step)
+ if(end_step < first_step_ || end_step > last_step_)
throw EndStepError();
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Start angle " <<
+ err_output_ << "Sensor::" << __func__ << "() Start angle " <<
start_angle << " is step " << start_step << ", end angle " <<
end_angle << " is step " << end_step << '\n';
}
@@ -946,22 +1085,22 @@
memset(buffer, 0, sizeof(char) * 11);
if(start_step < 0)
- start_step = _first_step;
+ start_step = first_step_;
if(end_step < 0)
- end_step = _last_step;
+ end_step = last_step_;
unsigned int num_steps = (end_step - start_step + 1) / cluster_count;
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Reading " <<
+ err_output_ << "Sensor::" << __func__ << "() Reading " <<
num_steps << " ranges between " << start_step << " and " <<
end_step << " with a cluster count of " << cluster_count <<
'\n';
}
- if(_scip_version == 1)
+ if(scip_version_ == 1)
throw UnsupportedError(36);
- else if(_scip_version != 2)
+ else if(scip_version_ != 2)
throw UnknownScipVersionError();
// Send the command to ask for the most recent data from
@@ -969,21 +1108,22 @@
number_to_string(start_step, buffer, 4);
number_to_string(end_step, &buffer[4], 4);
number_to_string(cluster_count, &buffer[8], 2);
- if(_model == MODEL_UXM30LXE && _multiecho_mode != ME_OFF)
- _send_command("HE", buffer, 10, NULL);
+ if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
+ send_command_("HE", buffer, 10, NULL);
else
- _send_command("GE", buffer, 10, NULL);
+ send_command_("GE", buffer, 10, NULL);
// There will be a timestamp before the data (if there is data)
// Normally we would send 6 for the expected length, but we may get no
// timestamp back if there was no data.
- if(_read_line_with_check(buffer) == 0)
+ if(read_line_with_check_(buffer) == 0)
throw NoDataError();
- data->_time = decode_4_byte_value(buffer);
+ data->laser_time_ = decode_4_byte_value(buffer);
+ data->system_time_ = offset_timestamp_(wrap_timestamp_(data->laser_time_));
// In SCIP2 mode we're going to get back 3-byte data because we're
// sending the GE command
- _read_3_byte_range_data(data, num_steps);
+ read_3_byte_range_data_(data, num_steps);
- return data->_length;
+ return data->ranges_length_;
}
@@ -993,20 +1133,20 @@
if(data == NULL)
throw NoDataError();
- // Calculate the given angles in steps, rounding towards _front_step
+ // Calculate the given angles in steps, rounding towards front_step_
int start_step, end_step;
start_step = angle_to_step(start_angle);
end_step = angle_to_step(end_angle);
// Check the steps are within the allowable range
- if(start_step < _first_step || start_step > _last_step)
+ if(start_step < first_step_ || start_step > last_step_)
throw StartStepError();
- if(end_step < _first_step || end_step > _last_step)
+ if(end_step < first_step_ || end_step > last_step_)
throw EndStepError();
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Start angle " <<
+ err_output_ << "Sensor::" << __func__ << "() Start angle " <<
start_angle << " is step " << start_step << ", end angle " <<
end_angle << " is step " << end_step << '\n';
}
@@ -1022,23 +1162,23 @@
if(data == NULL)
throw NoDestinationError();
- if(_scip_version == 1)
+ if(scip_version_ == 1)
throw UnsupportedError(16);
- else if(_scip_version != 2)
+ else if(scip_version_ != 2)
throw UnknownScipVersionError();
char buffer[14];
memset(buffer, 0, sizeof(char) * 14);
if(start_step < 0)
- start_step = _first_step;
+ start_step = first_step_;
if(end_step < 0)
- end_step = _last_step;
+ end_step = last_step_;
unsigned int num_steps = (end_step - start_step + 1) / cluster_count;
- if(_verbose)
+ if(verbose_)
{
- _err_output << "Sensor::" << __func__ << "() Reading " <<
+ err_output_ << "Sensor::" << __func__ << "() Reading " <<
num_steps << " new ranges between " << start_step << " and " <<
end_step << " with a cluster count of " << cluster_count <<
'\n';
@@ -1051,19 +1191,19 @@
number_to_string(1, &buffer[10], 1);
number_to_string(1, &buffer[11], 2);
char command[3];
- if(_model == MODEL_UXM30LXE && _multiecho_mode != ME_OFF)
+ if(model_ == MODEL_UXM30LXE && multiecho_mode_ != ME_OFF)
command[0] = 'N';
else
command[0] = 'M';
command[1] = 'D';
command[2] = '\0';
- _send_command(command, buffer, 13, NULL);
+ send_command_(command, buffer, 13, NULL);
// Mx commands will perform a scan, then send the data prefixed with
// another command echo.
// Read back the command echo (minimum of 3 bytes, maximum of 16 bytes)
char response[17];
- _skip_lines(1); // End of the command echo message
- _read_line(response, 16); // Size is command(2)+params(13)+new line(1)
+ skip_lines_(1); // End of the command echo message
+ read_line_(response, 16); // Size is command(2)+params(13)+new line(1)
// Check the echo is correct
if(response[0] != command[0] || response[1] != command[1])
throw CommandEchoError(command, response);
@@ -1072,10 +1212,10 @@
if(memcmp(&response[2], buffer, 13) != 0)
throw ParamEchoError(command);
// The next line should be the status line
- _read_line_with_check(response, 4);
- if(_verbose)
+ read_line_with_check_(response, 4);
+ if(verbose...
[truncated message content] |
|
From: <gb...@us...> - 2010-08-05 05:15:34
|
Revision: 509
http://gearbox.svn.sourceforge.net/gearbox/?rev=509&view=rev
Author: gbiggs
Date: 2010-08-05 05:15:27 +0000 (Thu, 05 Aug 2010)
Log Message:
-----------
Install new log files
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/test/CMakeLists.txt
Modified: gearbox/trunk/src/hokuyo_aist/test/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/CMakeLists.txt 2010-08-05 01:39:27 UTC (rev 508)
+++ gearbox/trunk/src/hokuyo_aist/test/CMakeLists.txt 2010-08-05 05:15:27 UTC (rev 509)
@@ -4,4 +4,6 @@
TARGET_LINK_LIBRARIES (hokuyo_aist_example hokuyo_aist flexiport)
GBX_ADD_EXAMPLE (hokuyo_aist example.cmake.in example.cmake
- example.cpp example.readme example.logr example.logw)
\ No newline at end of file
+ example.cpp example.readme example_urg_04lx.logr example_urg_04lx.logw
+ example_utm_30lx.logr example_utm_30lx.logw)
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2010-08-05 01:39:38
|
Revision: 508
http://gearbox.svn.sourceforge.net/gearbox/?rev=508&view=rev
Author: gbiggs
Date: 2010-08-05 01:39:27 +0000 (Thu, 05 Aug 2010)
Log Message:
-----------
Version bump
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-08-05 01:26:43 UTC (rev 507)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2010-08-05 01:39:27 UTC (rev 508)
@@ -1,6 +1,6 @@
set (libName hokuyo_aist)
set (libDesc "Hokuyo laser scanner driver")
-set (libVersion 1.0.0)
+set (libVersion 2.0.0)
GBX_ADD_LICENSE (EPL1.0)
set (build TRUE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|