You can subscribe to this list here.
| 2008 |
Jan
|
Feb
(58) |
Mar
(15) |
Apr
(23) |
May
(8) |
Jun
(92) |
Jul
(66) |
Aug
(6) |
Sep
(9) |
Oct
(44) |
Nov
(8) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(10) |
Feb
(8) |
Mar
(2) |
Apr
(8) |
May
(19) |
Jun
(11) |
Jul
(8) |
Aug
(6) |
Sep
(5) |
Oct
(4) |
Nov
(26) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
(16) |
Sep
(7) |
Oct
(3) |
Nov
(7) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <rus...@us...> - 2008-02-10 04:43:52
|
Revision: 57
http://gearbox.svn.sourceforge.net/gearbox/?rev=57&view=rev
Author: russo2503v
Date: 2008-02-09 20:43:57 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
corrected names of OS variables
Modified Paths:
--------------
gearbox/trunk/cmake/UseBasicRules.cmake
gearbox/trunk/cmake/internal/SetupBuildType.cmake
Modified: gearbox/trunk/cmake/UseBasicRules.cmake
===================================================================
--- gearbox/trunk/cmake/UseBasicRules.cmake 2008-02-09 13:14:19 UTC (rev 56)
+++ gearbox/trunk/cmake/UseBasicRules.cmake 2008-02-10 04:43:57 UTC (rev 57)
@@ -15,8 +15,8 @@
#
# Platform-specific compiler and linker flags
#
-IF ( NOT OS_WIN )
+IF ( NOT GBX_OS_WIN )
ADD_DEFINITIONS( "-Wall" )
-ELSE ( NOT OS_WIN )
+ELSE ( NOT GBX_OS_WIN )
ADD_DEFINITIONS( "-Wall -D_CRT_SECURE_NO_DEPRECATE" )
-ENDIF ( NOT OS_WIN )
+ENDIF ( NOT GBX_OS_WIN )
Modified: gearbox/trunk/cmake/internal/SetupBuildType.cmake
===================================================================
--- gearbox/trunk/cmake/internal/SetupBuildType.cmake 2008-02-09 13:14:19 UTC (rev 56)
+++ gearbox/trunk/cmake/internal/SetupBuildType.cmake 2008-02-10 04:43:57 UTC (rev 57)
@@ -1,13 +1,13 @@
IF ( NOT CMAKE_BUILD_TYPE )
- IF ( NOT OS_WIN )
+ IF ( NOT GBX_OS_WIN )
# For gcc, RelWithDebInfo gives '-O2 -g'
SET( CMAKE_BUILD_TYPE RelWithDebInfo )
- ELSE ( NOT OS_WIN )
+ ELSE ( NOT GBX_OS_WIN )
# windows... a temp hack: VCC does not seem to respect the cmake
# setting and always defaults to debug, we have to match it here.
SET( CMAKE_BUILD_TYPE Debug )
- ENDIF ( NOT OS_WIN )
+ ENDIF ( NOT GBX_OS_WIN )
MESSAGE( STATUS "Setting build type to '${CMAKE_BUILD_TYPE}'" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-09 13:14:15
|
Revision: 56
http://gearbox.svn.sourceforge.net/gearbox/?rev=56&view=rev
Author: russo2503v
Date: 2008-02-09 05:14:19 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
Added Paths:
-----------
gearbox/trunk/cmake/FindIceUtil.cmake
gearbox/trunk/cmake/UseIceUtil.cmake
Added: gearbox/trunk/cmake/FindIceUtil.cmake
===================================================================
--- gearbox/trunk/cmake/FindIceUtil.cmake (rev 0)
+++ gearbox/trunk/cmake/FindIceUtil.cmake 2008-02-09 13:14:19 UTC (rev 56)
@@ -0,0 +1,51 @@
+# Locate IceUtil home
+#
+# This module defines the following variables:
+# ICEUTIL_FOUND : 1 if Ice is found, 0 otherwise
+# ICEUTIL_HOME : path where to find include, lib, bin, etc.
+
+# start with 'not found'
+SET( ICEUTIL_FOUND 0 CACHE BOOL "Do we have libIceUtil?" )
+
+FIND_PATH( ICEUTIL_HOME_INCLUDE_ICEUTIL IceUtil.h
+ # rational for this search order:
+ # source install w/env.var -> source install
+ # package -> package
+ # package + source install w/env.var -> source install
+ # package + source install w/out env.var -> package
+ #
+ # installation selected by user
+ $ENV{ICE_HOME}/include/IceUtil
+ $ENV{ICEUTIL_HOME}/include/IceUtil
+ # debian package installs Ice here
+ /usr/include/IceUtil
+ # Test standard installation points: newer versions first
+ /opt/Ice-3.2.1/include/IceUtil
+ /opt/Ice-3.2.0/include/IceUtil
+ # some people may manually choose to install Ice here
+ /usr/local/include/IceUtil
+ # windows
+ C:/Ice-3.2.0-VC80/include/IceUtil
+ C:/Ice-3.2.0/include/IceUtil
+ )
+# MESSAGE( STATUS "DEBUG: Ice.h is apparently found in : ${ICEUTIL_HOME_INCLUDE_ICE}" )
+
+# NOTE: if ICEUTIL_HOME_INCLUDE_ICE is set to *-NOTFOUND it will evaluate to FALSE
+IF ( ICEUTIL_HOME_INCLUDE_ICEUTIL )
+
+ SET( ICEUTIL_FOUND 1 CACHE BOOL "Do we have Ice?" FORCE )
+
+ # strip 'file' twice to get rid off 'include/IceUtil'
+# MESSAGE( STATUS "DEBUG: ICEUTIL_HOME_INCLUDE_ICE=" ${ICEUTIL_HOME_INCLUDE_ICE} )
+ GET_FILENAME_COMPONENT( ICEUTIL_HOME_INCLUDE ${ICEUTIL_HOME_INCLUDE_ICEUTIL} PATH )
+# MESSAGE( STATUS "DEBUG: ICEUTIL_HOME_INCLUDE=" ${ICEUTIL_HOME_INCLUDE} )
+ GET_FILENAME_COMPONENT( ICEUTIL_HOME ${ICEUTIL_HOME_INCLUDE} PATH CACHE )
+# MESSAGE( STATUS "Setting ICEUTIL_HOME to ${ICEUTIL_HOME}" )
+
+ENDIF ( ICEUTIL_HOME_INCLUDE_ICEUTIL )
+
+IF ( ICEUTIL_FOUND )
+ MESSAGE( STATUS "Looking for libIceUtil - found in ${ICEUTIL_HOME}")
+ELSE ( ICEUTIL_FOUND )
+ MESSAGE( STATUS "Looking for libIceUtil - not found")
+ENDIF ( ICEUTIL_FOUND )
Added: gearbox/trunk/cmake/UseIceUtil.cmake
===================================================================
--- gearbox/trunk/cmake/UseIceUtil.cmake (rev 0)
+++ gearbox/trunk/cmake/UseIceUtil.cmake 2008-02-09 13:14:19 UTC (rev 56)
@@ -0,0 +1,4 @@
+INCLUDE_DIRECTORIES( ${ICEUTIL_HOME}/include )
+LINK_DIRECTORIES( ${ICEUTIL_HOME}/lib )
+
+LINK_LIBRARIES( IceUtil )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-09 05:23:46
|
Revision: 55
http://gearbox.svn.sourceforge.net/gearbox/?rev=55&view=rev
Author: russo2503v
Date: 2008-02-08 21:23:52 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
Added Paths:
-----------
gearbox/trunk/cmake/UseGearbox.cmake
Added: gearbox/trunk/cmake/UseGearbox.cmake
===================================================================
--- gearbox/trunk/cmake/UseGearbox.cmake (rev 0)
+++ gearbox/trunk/cmake/UseGearbox.cmake 2008-02-09 05:23:52 UTC (rev 55)
@@ -0,0 +1,3 @@
+# This script is indended for Gearbox users (not for internal use)
+INCLUDE_DIRECTORIES( ${GEARBOX_HOME}/include/gearbox )
+LINK_DIRECTORIES( ${GEARBOX_HOME}/lib/gearbox )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-09 05:23:36
|
Revision: 54
http://gearbox.svn.sourceforge.net/gearbox/?rev=54&view=rev
Author: russo2503v
Date: 2008-02-08 21:23:40 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
including submitted directory when enabled
Modified Paths:
--------------
gearbox/trunk/cmake/UseBasicRules.cmake
Modified: gearbox/trunk/cmake/UseBasicRules.cmake
===================================================================
--- gearbox/trunk/cmake/UseBasicRules.cmake 2008-02-09 02:34:54 UTC (rev 53)
+++ gearbox/trunk/cmake/UseBasicRules.cmake 2008-02-09 05:23:40 UTC (rev 54)
@@ -5,6 +5,14 @@
INCLUDE_DIRECTORIES( ${GBX_PROJECT_SOURCE_DIR}/src )
#
+# Do the same for the submitted directory when its compilation
+# is enabled.
+#
+IF ( GBX_BUILD_SUBMITTED )
+ INCLUDE_DIRECTORIES( ${GBX_PROJECT_SOURCE_DIR}/submitted )
+ENDIF ( GBX_BUILD_SUBMITTED )
+
+#
# Platform-specific compiler and linker flags
#
IF ( NOT OS_WIN )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-09 02:34:49
|
Revision: 53
http://gearbox.svn.sourceforge.net/gearbox/?rev=53&view=rev
Author: russo2503v
Date: 2008-02-08 18:34:54 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
sample script to find gearbox
Added Paths:
-----------
gearbox/trunk/cmake/FindGearbox.cmake
Added: gearbox/trunk/cmake/FindGearbox.cmake
===================================================================
--- gearbox/trunk/cmake/FindGearbox.cmake (rev 0)
+++ gearbox/trunk/cmake/FindGearbox.cmake 2008-02-09 02:34:54 UTC (rev 53)
@@ -0,0 +1,24 @@
+# Locate Gearbox installation
+
+# This module defines
+# GEARBOX_HOME where to find include, lib, bin, etc.
+# GEARBOX_FOUND, If set to 0, don't try to use Gearbox libraries, scripts, etc.
+#
+# We look for the cmake manifest file generated by Gearbox.
+
+# start with 'not found'
+SET( GEARBOX_FOUND 0 CACHE BOOL "Do we have Gearbox?" )
+
+FIND_PATH( GEARBOX_HOME gearbox_manifest.cmake
+ $ENV{GEARBOX_HOME}
+ # Test standard installation points
+ /usr/local
+ /opt/gearbox
+ C:/gearbox
+ )
+# MESSAGE( STATUS "DEBUG: manifest.cmake is apparently found in : ${GEARBOX_HOME}" )
+
+# NOTE: if GEARBOX_HOME is set to *-NOTFOUND it will evaluate to FALSE
+IF ( GEARBOX_HOME )
+ SET( GEARBOX_FOUND 1 CACHE BOOL "Do we have Gearbox?" FORCE )
+ENDIF ( GEARBOX_HOME )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-09 02:11:47
|
Revision: 52
http://gearbox.svn.sourceforge.net/gearbox/?rev=52&view=rev
Author: russo2503v
Date: 2008-02-08 18:11:51 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
added a variable to manifest to let user test whether it was loaded or not
Modified Paths:
--------------
gearbox/trunk/cmake/internal/TargetUtils.cmake
Modified: gearbox/trunk/cmake/internal/TargetUtils.cmake
===================================================================
--- gearbox/trunk/cmake/internal/TargetUtils.cmake 2008-02-08 12:26:01 UTC (rev 51)
+++ gearbox/trunk/cmake/internal/TargetUtils.cmake 2008-02-09 02:11:51 UTC (rev 52)
@@ -205,6 +205,11 @@
WRITE_FILE ( ${manifest_file} "SET( ${UPPERA}_INSTALLED 0)" APPEND )
ENDFOREACH( A ${LIBRARY_NOT_LIST} )
+ WRITE_FILE ( ${manifest_file} " " APPEND )
+
+ STRING ( TOUPPER ${PROJECT_NAME} upper_project_name )
+ WRITE_FILE ( ${manifest_file} "SET( ${upper_project_name}_MANIFEST_LOADED 1)" APPEND )
+
INSTALL( FILES ${manifest_file} DESTINATION . )
ENDMACRO ( GBX_WRITE_MANIFEST )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 12:25:58
|
Revision: 51
http://gearbox.svn.sourceforge.net/gearbox/?rev=51&view=rev
Author: russo2503v
Date: 2008-02-08 04:26:01 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
changes from yesterday
Modified Paths:
--------------
gearbox/trunk/doc/index.dox
gearbox/trunk/doc/update_and_rebuild_docco.sh
Modified: gearbox/trunk/doc/index.dox
===================================================================
--- gearbox/trunk/doc/index.dox 2008-02-08 08:32:05 UTC (rev 50)
+++ gearbox/trunk/doc/index.dox 2008-02-08 12:26:01 UTC (rev 51)
@@ -41,7 +41,7 @@
- Get set up: @ref gbx_doc_getting
- Browse through the <strong><a href="modules.html" style="text-decoration:none">currently available software</a></strong><br>
-Note: The documentation on this web page matches the latest release. A web page is also <a href="http://gearbox.sourceforge.net/head/gearbox">generated every 30 min</a> from the latest SVN version.
+Note: The documentation on this web page matches the latest release. A web page is also <a href="http://gearbox.sourceforge.net/head">generated every 30 min</a> from the latest SVN version.
@section gbx_doc_index_news News
Modified: gearbox/trunk/doc/update_and_rebuild_docco.sh
===================================================================
--- gearbox/trunk/doc/update_and_rebuild_docco.sh 2008-02-08 08:32:05 UTC (rev 50)
+++ gearbox/trunk/doc/update_and_rebuild_docco.sh 2008-02-08 12:26:01 UTC (rev 51)
@@ -5,6 +5,21 @@
#
# Usage: try_rebuild_docco [--force]
+force () {
+ echo "$*"
+ $*
+
+ status=$?
+
+ if [ $status -ne 0 ]; then
+ echo "Problem executing '$*'"
+ exit 1
+ else
+ echo "Executed '$*' OK"
+ fi
+}
+
+
forced=0
if [ $# -eq 1 ]
then
@@ -70,12 +85,9 @@
#
# Copy it to sourceforge
#
-rm -rf $MODULENAME
-mv html $MODULENAME
-tar -zcvf $TARBALL $MODULENAME
-echo "scp $TARBALL shell.sf.net:$HEADDIR/."
-scp $TARBALL shell.sf.net:$HEADDIR/.
-echo "ssh shell.sf.net 'cd $HEADDIR; tar -zxf $TARBALL'"
-ssh shell.sf.net "cd $HEADDIR; tar -zxf $TARBALL"
+force cd html
+force tar --exclude=$TARBALL -zcvf $TARBALL *
+force scp $TARBALL shell.sourceforge.net:$HEADDIR/.
+ssh shell.sourceforge.net "cd $HEADDIR; tar -zxvf $TARBALL"
echo "Finished $0 at: `date`"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2008-02-08 08:32:06
|
Revision: 50
http://gearbox.svn.sourceforge.net/gearbox/?rev=50&view=rev
Author: gbiggs
Date: 2008-02-08 00:32:05 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
Fixed some broken links to documentation.
Modified Paths:
--------------
gearbox/trunk/doc/documentation.dox
Modified: gearbox/trunk/doc/documentation.dox
===================================================================
--- gearbox/trunk/doc/documentation.dox 2008-02-08 06:53:36 UTC (rev 49)
+++ gearbox/trunk/doc/documentation.dox 2008-02-08 08:32:05 UTC (rev 50)
@@ -18,8 +18,8 @@
@par View On-line
-- Latest release: http://gearbox.sf.net/gearbox
-- Up to date from SVN HEAD generated every 30 min: http://gearbox.sf.net/head/gearbox
+- Latest release: http://gearbox.sourceforge.net/
+- Up to date from SVN HEAD generated every 30 min: http://gearbox.sf.net/head/
@par Download Archive
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 06:53:33
|
Revision: 49
http://gearbox.svn.sourceforge.net/gearbox/?rev=49&view=rev
Author: russo2503v
Date: 2008-02-07 22:53:36 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
uppded required cmake version to 2.4.4
Modified Paths:
--------------
gearbox/trunk/doc/getting.dox
gearbox/trunk/doc/install_debian.dox
gearbox/trunk/doc/overview.dox
Modified: gearbox/trunk/doc/getting.dox
===================================================================
--- gearbox/trunk/doc/getting.dox 2008-02-08 06:35:49 UTC (rev 48)
+++ gearbox/trunk/doc/getting.dox 2008-02-08 06:53:36 UTC (rev 49)
@@ -21,14 +21,10 @@
- Option 1. Download <strong><a href="http://sourceforge.net/project/showfiles.php?group_id=216468" style="text-decoration:none">the latest distribution of GearBox</a></strong>
- Option 2. Checkout source from SVN
- - Anonymous checkout:
+ - Anonymous checkout (your username/password will be asked on commit):
@verbatim
$ svn co https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/trunk gearbox
@endverbatim
- - Checkout for registered developers:
-@verbatim
-$ svn co --username [your-sf-username] https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/trunk gearbox
-@endverbatim
- See links @ref gbx_doc_version_control "to get started" with SVN.
- See <strong><a href="http://sourceforge.net/svn/?group_id=216468" style="text-decoration:none">more detailed SourceForge SVN instructions.</a></strong>
@@ -42,7 +38,7 @@
The instructions below are quite general, follow them if your platform/distribution combination is not described above:
-# Download and install <a href="http://www.cmake.org/">CMake: Cross-Platform Make</a> which is used to build the GearBox distribution.
- - Minimum version required 2.4-patch 2 (latest tested: 2.4-patch 7).
+ - Minimum version required 2.4-patch 4 (latest tested: 2.4-patch 7).
- Full instructions are available from the <a href="http://www.cmake.org/HTML/Download.html">download page</a>.
-# Download and install any optional dependencies you'd like. Or just skip this step and do it later.
- You may want to take a look at our notes on @ref gbx_doc_depends.
Modified: gearbox/trunk/doc/install_debian.dox
===================================================================
--- gearbox/trunk/doc/install_debian.dox 2008-02-08 06:35:49 UTC (rev 48)
+++ gearbox/trunk/doc/install_debian.dox 2008-02-08 06:53:36 UTC (rev 49)
@@ -20,15 +20,9 @@
These instructions should also be applicable to Ubuntu/Kubuntu 6.10 (Edgy).
-@section gbx_doc_installdebian_buildessential Build Essential
-
-@verbatim
-# apt-get install build-essential
-@endverbatim
-
@section gbx_doc_installdebian_cmake CMake
-Minimum version required 2.4-patch 2 (latest tested: 2.4-patch 7).
+Minimum version required 2.4-patch 4 (latest tested: 2.4-patch 7).
@verbatim
# apt-get install cmake
@@ -42,10 +36,10 @@
- Download @ref gbx_doc_getting_download "GearBox source" archive and un-tar it.
@verbatim
-$ tar -zxf gearbox-x.x.x.tar.gz
+$ tar -xzf gearbox-x.x.x.tar.gz
$ cd gearbox
@endverbatim
-- Configure (note the dot after cmake). The default installation directory is @c /usr/local. (See below on how to customize it).
+- Configure (note the dot after cmake). The default installation directory is @c /usr/local. (See below on how to customize this).
@verbatim
$ cmake .
@endverbatim
@@ -74,7 +68,7 @@
@par Installation Directory
The default installation directory is @c /usr/local. There are two options for specifying a custom install directory:
-- Option 1. With @c cmake. This variable is stored in CMake cache so you don't have to set this variable every time: only the first time you run cmake and when you want to change it.
+- Option 1. With @c cmake. This variable is stored in CMake cache so you don't have to set this variable every time: only the first time you run cmake and when you want to change it. For example:
@verbatim
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/gearbox .
@endverbatim
@@ -86,7 +80,7 @@
@verbatim
$ ccmake .
@endverbatim
-Scroll down to CMAKE_INSTALL_PREFIX variable, hit ENTER to edit and type in the new installation directory. When finished, hit ENTER again, then type "c" for [c]onfigure and "g" for [g]enerate. From now on, the new installation dir will be used.
+Scroll down to @c CMAKE_INSTALL_PREFIX variable, hit ENTER to edit and type in the new installation directory. When finished, hit ENTER again, then type "c" for [c]onfigure and "g" for [g]enerate. From now on, the new installation dir will be used.
That's it! We are done.
Modified: gearbox/trunk/doc/overview.dox
===================================================================
--- gearbox/trunk/doc/overview.dox 2008-02-08 06:35:49 UTC (rev 48)
+++ gearbox/trunk/doc/overview.dox 2008-02-08 06:53:36 UTC (rev 49)
@@ -28,9 +28,9 @@
Copyright belongs to developers and major contributors. The copyright is recorded in a comment block at the top of every source file.
-@par Complete Description of Rules
+@par Details
-For a complete set of project rules see @ref gbx_doc_principles
+For more details see @ref gbx_doc_principles
@par OS support
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 06:42:23
|
Revision: 48
http://gearbox.svn.sourceforge.net/gearbox/?rev=48&view=rev
Author: russo2503v
Date: 2008-02-07 22:35:49 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
using normal doxygen
Modified Paths:
--------------
gearbox/trunk/doc/rebuild_docco.sh
Modified: gearbox/trunk/doc/rebuild_docco.sh
===================================================================
--- gearbox/trunk/doc/rebuild_docco.sh 2008-02-08 06:24:45 UTC (rev 47)
+++ gearbox/trunk/doc/rebuild_docco.sh 2008-02-08 06:35:49 UTC (rev 48)
@@ -14,10 +14,13 @@
fi
}
+# doxygen
+DOXYGENCMD=/usr/bin/doxygen
+DOXYFILE=doxyfile
TARBALL=gearbox-release-doc.tar.gz
force ls
-force doxyorca doxyfile
+force $DOXYGENCMD $DOXYFILE
force cd html
force tar --exclude=$TARBALL -zcvf $TARBALL *
force scp $TARBALL shell.sourceforge.net:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2008-02-08 06:24:42
|
Revision: 47
http://gearbox.svn.sourceforge.net/gearbox/?rev=47&view=rev
Author: gbiggs
Date: 2008-02-07 22:24:45 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Added and updated Gentoo ebuild, updated Gentoo install guide.
Modified Paths:
--------------
gearbox/trunk/doc/install_gentoo.dox
Added Paths:
-----------
gearbox/trunk/dist/
gearbox/trunk/dist/gearbox-0.0.1.ebuild
Added: gearbox/trunk/dist/gearbox-0.0.1.ebuild
===================================================================
--- gearbox/trunk/dist/gearbox-0.0.1.ebuild (rev 0)
+++ gearbox/trunk/dist/gearbox-0.0.1.ebuild 2008-02-08 06:24:45 UTC (rev 47)
@@ -0,0 +1,38 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit cmake-utils
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~amd64"
+DESCRIPTION="A collection of libraries for robotics, including hardware drivers and algorithms."
+SRC_URI="/${P}.tar.bz2"
+HOMEPAGE="http://gearbox.sourceforge.net"
+IUSE="doc basic gbxadvanced urg_nz"
+DEPEND=">=dev-util/cmake-2.4
+ doc? (app-doc/doxygen)"
+RDEPEND=${DEPEND}
+
+S=${WORKDIR}/${PN}
+
+src_compile()
+{
+ local mycmakeargs="`cmake-utils_use_enable basic LIB_BASIC`\
+ `cmake-utils_use_enable gbxadvanced LIB_GBXADVANCED`\
+ `cmake-utils_use_enable urg_nz LIB_URG_NZ`"
+ cmake-utils_src_compile
+ if use doc;
+ then
+ cd doc
+ doxygen doxyfile || die "Error building documentation"
+ fi
+}
+
+src_install ()
+{
+ cmake-utils_src_install
+ dodoc LICENSE
+ use doc && dohtml -r doc/html/*
+}
\ No newline at end of file
Modified: gearbox/trunk/doc/install_gentoo.dox
===================================================================
--- gearbox/trunk/doc/install_gentoo.dox 2008-02-08 06:18:46 UTC (rev 46)
+++ gearbox/trunk/doc/install_gentoo.dox 2008-02-08 06:24:45 UTC (rev 47)
@@ -25,14 +25,11 @@
-# Create a directory to store the overlay in, for example \b /usr/local/portage
-# Set the \b PORTDIR_OVERLAY variable in \b /etc/make.conf to include this directory.
-[\b TODO I hope that once we get plenty of libraries, I can get gearbox into the main gentoo portage distribution. That would remove
-this step and probably the next two steps, too.]
-
@section gbx_doc_installgentoo_copyebuild Download and copy ebuild
-Download the Gearbox ebuild from the Gearbox download page. [\b TODO need to find a place to put this in the repository.] This ebuild must be copied into
-the local overlay so that portage can find it. Extract the downloaded files into your local overlay directory. This should create a
-subdirectory called \b dev-libs with a subdirectory called \b gearbox inside it.
+Download the Gearbox ebuild from the GearBox download page. This ebuild must be copied into the local overlay so that portage can
+find it. Extract the downloaded files into your local overlay directory. This should create a subdirectory called \b dev-libs with
+a subdirectory called \b gearbox inside it.
@section gbx_doc_installgentoo_keywordebuild Keyword the ebuild
@@ -51,18 +48,18 @@
specifying them on the command line, for example:
@verbatim
-USE="urglaser" emerge gearbox -av
+USE="urg_nz" emerge gearbox -av
@endverbatim
Alternatively, they can be set more permanantly be specifying them in /etc/portage/package.use:
@verbatim
-dev-libs/gearbox urglaser
+dev-libs/gearbox urg_nz
@endverbatim
A full list of available USE flags is given below. For a list of those provided by your current ebuild for Gearbox,
run \b equery \b uses \b gearbox.
-<table><tr><td>urglaser</td><td>Enables the Hokuyo URG laser driver library</td></tr>
+<table><tr><td>urg_nz</td><td>Enables the "urgnz" Hokuyo URG laser driver library</td></tr>
</table>
@section gbx_doc_installgentoo_install Install
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2008-02-08 06:18:41
|
Revision: 46
http://gearbox.svn.sourceforge.net/gearbox/?rev=46&view=rev
Author: gbiggs
Date: 2008-02-07 22:18:46 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Step two of renaming: Move the files and fix all the errors (confirmed working with example).
Modified Paths:
--------------
gearbox/trunk/src/urg_nz/example.cpp
Added Paths:
-----------
gearbox/trunk/src/urg_nz/urg_nz.cpp
gearbox/trunk/src/urg_nz/urg_nz.dox
gearbox/trunk/src/urg_nz/urg_nz.h
Removed Paths:
-------------
gearbox/trunk/src/urg_nz/urg_laser.cpp
gearbox/trunk/src/urg_nz/urg_laser.dox
gearbox/trunk/src/urg_nz/urg_laser.h
Modified: gearbox/trunk/src/urg_nz/example.cpp
===================================================================
--- gearbox/trunk/src/urg_nz/example.cpp 2008-02-08 06:06:57 UTC (rev 45)
+++ gearbox/trunk/src/urg_nz/example.cpp 2008-02-08 06:18:46 UTC (rev 46)
@@ -42,7 +42,7 @@
try
{
- urg_nz::urg_nz laser; // Laser scanner object
+ urg_nz::urg_laser laser; // Laser scanner object
// Set the laser to verbose mode (so we see more information in the console)
laser.SetVerbose (true);
Deleted: gearbox/trunk/src/urg_nz/urg_laser.cpp
===================================================================
--- gearbox/trunk/src/urg_nz/urg_laser.cpp 2008-02-08 06:06:57 UTC (rev 45)
+++ gearbox/trunk/src/urg_nz/urg_laser.cpp 2008-02-08 06:18:46 UTC (rev 46)
@@ -1,991 +0,0 @@
-/*
- * Hokuyo URG laser scanner driver class.
- * Originally written by Toby Collett for the Player project.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <termios.h>
-#include <poll.h>
-#include <sstream>
-
-#include "urg_nz.h"
-
-using namespace urg_nz;
-using namespace std;
-
-#ifndef M_PI
- #define M_PI 3.14159265358979323846
-#endif
-// Convert radians to degrees
-#ifndef RTOD
- #define RTOD(r) ((r) * 180 / M_PI)
-#endif
-// Convert degrees to radians
-#ifndef DTOR
- #define DTOR(d) ((d) * M_PI / 180)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// Constructor
-///////////////////////////////////////////////////////////////////////////////
-urg_nz::urg_nz (void)
-{
- // Defaults to SCIP version 1
- SCIP_Version = 1;
- laser_port = NULL;
- verbose = false;
- poll_timeout = -1;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Destructor
-///////////////////////////////////////////////////////////////////////////////
-urg_nz::~urg_nz (void)
-{
- if (PortOpen ())
- Close ();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Read functions
-///////////////////////////////////////////////////////////////////////////////
-int urg_nz::ReadUntil_nthOccurence (int file, int n, char c)
-{
- int retval = 0, bytes_read = 0;
- unsigned char buffer[2];
- buffer[0] = 0;
- buffer[1] = 0;
- for (int i = 0; i < n; i++)
- {
- do
- {
- retval = ReadUntil (file, &buffer[0], 1, poll_timeout);
- if (retval > 0)
- bytes_read += retval;
- } while (buffer[0] != c && retval > 0);
- }
- return bytes_read;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-int urg_nz::ReadUntil (int fd, unsigned char *buf, int len, int timeout)
-{
- int ret;
- int current=0;
- struct pollfd ufd[1];
- int retval;
-
- ufd[0].fd = fd;
- ufd[0].events = POLLIN;
-
- do
- {
- if(timeout >= 0)
- {
- if ((retval = poll (ufd, 1, timeout)) < 0)
- {
- stringstream error_desc;
- error_desc << "Error in ReadUntil at poll(): " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_READPOLL, error_desc.str ());
- }
- else if (retval == 0)
- {
- stringstream error_desc;
- error_desc << "Timed out on poll in ReadUntil";
- throw urg_nz_exception (URG_ERR_READTIMEOUT, error_desc.str ());
- }
- }
-
- ret = read (fd, &buf[current], len-current);
- if (ret < 0)
- {
- stringstream error_desc;
- error_desc << "Error in ReadUntil at read(): " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_READ, error_desc.str ());
- }
-
- current += ret;
- if (current > 2 && current < len && buf[current-2] == '\n' && buf[current-1] == '\n')
- {
- stringstream error_desc;
- error_desc << "Got an end of command while waiting for more data.";
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
- } while (current < len);
- return current;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Port control functions
-///////////////////////////////////////////////////////////////////////////////
-int urg_nz::ChangeBaud (int curr_baud, int new_baud)
-{
- struct termios newtio;
- int fd;
- fd = fileno (laser_port);
- int new_baud_constant;
-
- switch (curr_baud)
- {
- case 19200:
- curr_baud = B19200;
- break;
- case 57600:
- curr_baud = B57600;
- break;
- case 115200:
- curr_baud = B115200;
- break;
- default:
- stringstream error_desc;
- error_desc << "Unknown current baud rate: " << curr_baud;
- throw urg_nz_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
- }
-
- switch (new_baud)
- {
- case 19200:
- new_baud_constant = B19200;
- break;
- case 57600:
- new_baud_constant = B57600;
- break;
- case 115200:
- new_baud_constant = B115200;
- break;
- default:
- stringstream error_desc;
- error_desc << "Unknown new baud rate: " << new_baud;
- throw urg_nz_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
- }
-
- if (tcgetattr (fd, &newtio) < 0)
- {
- close (fd);
- stringstream error_desc;
- error_desc << "Error in ChangeBaud at tcgetattr: " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
- }
-
- cfmakeraw (&newtio);
- cfsetispeed (&newtio, curr_baud);
- cfsetospeed (&newtio, curr_baud);
-
- if (tcsetattr (fd, TCSAFLUSH, &newtio) < 0 )
- {
- close (fd);
- stringstream error_desc;
- error_desc << "Error in ChangeBaud at tcsetattr: " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
- }
-
- unsigned char buf[17];
- memset (buf,0,sizeof (buf));
-
- // TODO: Check if this works with SCIP2.0
- if (SCIP_Version == 1)
- {
- buf[0] = 'S';
- switch (new_baud_constant)
- {
- case B19200:
- buf[1] = '0';
- buf[2] = '1';
- buf[3] = '9';
- buf[4] = '2';
- buf[5] = '0';
- buf[6] = '0';
- break;
- case B57600:
- buf[1] = '0';
- buf[2] = '5';
- buf[3] = '7';
- buf[4] = '6';
- buf[5] = '0';
- buf[6] = '0';
- break;
- case B115200:
- buf[1] = '1';
- buf[2] = '1';
- buf[3] = '5';
- buf[4] = '2';
- buf[5] = '0';
- buf[6] = '0';
- break;
- default:
- // Already checked above
- break;
- }
- buf[7] = '0';
- buf[8] = '0';
- buf[9] = '0';
- buf[10] = '0';
- buf[11] = '0';
- buf[12] = '0';
- buf[13] = '0';
- buf[14] = '\n';
- }
- else // SCIP 2
- {
- buf[0] = 'S';
- buf[1] = 'S';
- switch (new_baud)
- {
- case B19200:
- buf[2] = '0';
- buf[3] = '1';
- buf[4] = '9';
- buf[5] = '2';
- buf[6] = '0';
- buf[7] = '0';
- break;
- case B57600:
- buf[2] = '0';
- buf[3] = '5';
- buf[4] = '7';
- buf[5] = '6';
- buf[6] = '0';
- buf[7] = '0';
- break;
- case B115200:
- buf[2] = '1';
- buf[3] = '1';
- buf[4] = '5';
- buf[5] = '2';
- buf[6] = '0';
- buf[7] = '0';
- break;
- default:
- // Already checked above
- break;
- }
- buf[8] = '\n';
- }
-
- fprintf (laser_port, "%s", buf);
- memset (buf, 0, sizeof (buf));
- int len;
- // The docs say that the response ends in 'status LF LF', where
- // status is '0' if everything went alright. But it seems that
- // the response actually ends in 'LF status LF'.
- if (((len = ReadUntil (fd, buf, sizeof (buf), poll_timeout)) < 0) ||
- (buf[15] != '0'))
- {
- if (verbose)
- fprintf (stderr, "urg_nz: W: Failed to change baud rate to %d\n", new_baud);
- return -1;
- }
- else
- {
- if (tcgetattr (fd, &newtio) < 0)
- {
- close (fd);
- stringstream error_desc;
- error_desc << "Error in ChangeBaud at tcgetattr: " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
- }
- cfmakeraw (&newtio);
- cfsetispeed (&newtio, new_baud_constant);
- cfsetospeed (&newtio, new_baud_constant);
- if (tcsetattr (fd, TCSAFLUSH, &newtio) < 0 )
- {
- close (fd);
- stringstream error_desc;
- error_desc << "Error in ChangeBaud at tcsetattr: " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
- }
- else
- {
- usleep (200000);
- }
- }
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-void urg_nz::Open (const char *port_name, bool use_serial, int baud)
-{
- if (PortOpen ())
- this->Close ();
-
- laser_port = fopen (port_name, "r+");
- if (laser_port == NULL)
- {
- stringstream error_desc;
- error_desc << "Failed to open port " << port_name << " << with error " << errno << ":" << strerror (errno);
- throw urg_nz_exception (URG_ERR_OPEN_FAILED, error_desc.str ());
- }
-
- int fd = fileno (laser_port);
- if (use_serial)
- {
- if (verbose)
- {
- fprintf (stderr, "urg_nz: I: Connecting using serial connection to %s\n", port_name);
- fprintf (stderr, "urg_nz: I: Trying to connect at 19200\n");
- }
- if (this->ChangeBaud (19200, baud) != 0)
- {
- if (verbose)
- fprintf (stderr, "urg_nz: I: Trying to connect at 57600\n");
- if (this->ChangeBaud (57600, baud) != 0)
- {
- if (verbose)
- fprintf (stderr, "urg_nz: I: Trying to connect at 115200\n");
- if (this->ChangeBaud (115200, baud) != 0)
- {
- close (fd);
- stringstream error_desc;
- error_desc << "Failed to connect at any baud";
- throw urg_nz_exception (URG_ERR_CONNECT_FAILED, error_desc.str ());
- }
- }
- }
- if (verbose)
- fprintf (stderr, "urg_nz: I: Successfully changed baud rate\n");
- }
- else
- {
- if (verbose)
- fprintf (stderr, "urg_nz: I: Connecting using USB connection to %s\n", port_name);
- // set up new settings
- struct termios newtio;
- memset (&newtio, 0, sizeof (newtio));
- newtio.c_cflag = /*(rate & CBAUD) |*/ CS8 | CLOCAL | CREAD;
- newtio.c_iflag = IGNPAR;
- newtio.c_oflag = 0;
- newtio.c_lflag = ICANON;
-
- // activate new settings
- tcflush (fd, TCIFLUSH);
- tcsetattr (fd, TCSANOW, &newtio);
- usleep (200000);
- GetSCIPVersion ();
- tcflush (fd, TCIOFLUSH);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-void urg_nz::Close (void)
-{
- assert (this->laser_port);
-
- if (verbose)
- fprintf (stderr, "urg_nz: I: Closing port\n");
-
- tcflush (fileno (this->laser_port), TCIOFLUSH);
- if (fclose (this->laser_port) != 0)
- {
- stringstream error_desc;
- error_desc << "Error closing port: " << errno << ":" << strerror (errno);
- this->laser_port = NULL;
- throw urg_nz_exception (URG_ERR_CLOSE_FAILED, error_desc.str ());
- }
- this->laser_port = NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-bool urg_nz::PortOpen (void)
-{
- return laser_port != NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Laser sensor access functions
-///////////////////////////////////////////////////////////////////////////////
-unsigned int urg_nz::GetReadings (urg_nz_laser_readings_t *readings, unsigned int min_i, unsigned int max_i)
-{
- unsigned char buffer[16];
- unsigned int num_readings_read = 0;
-
- if (readings == NULL)
- {
- stringstream error_desc;
- error_desc << "NULL destination buffer";
- throw urg_nz_exception (URG_ERR_NODESTINATION, error_desc.str ());
- }
-
- if (!PortOpen ())
- {
- stringstream error_desc;
- error_desc << "Laser port is not open";
- throw urg_nz_exception (URG_ERR_NOPORT, error_desc.str ());
- }
-
- if (SCIP_Version == 1)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- // send the command
- fprintf (laser_port, "G00076801\n");
-
- int file = fileno (laser_port);
-
- // check the returned command
- ReadUntil (file, buffer, 10, poll_timeout);
-
- if (strncmp ((const char *) buffer, "G00076801", 9) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading command result: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- // check the returned status
- ReadUntil (file, buffer, 2, poll_timeout);
-
- if (buffer[0] != '0')
- {
- stringstream error_desc;
- error_desc << "Error reported by laser scanner: " << buffer[0] - '0';
- throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
- }
-
- for (unsigned int i=0; ; ++i)
- {
- ReadUntil (file, buffer, 2, poll_timeout);
-
- if (buffer[0] == '\n' && buffer[1] == '\n')
- break;
- else if (buffer[0] == '\n')
- {
- buffer[0] = buffer[1];
- ReadUntil (file, &buffer[1], 1, poll_timeout);
- }
-
- if (i < MAX_READINGS)
- {
- readings->Readings[i] = ((buffer[0]-0x30) << 6) | (buffer[1]-0x30);
- num_readings_read++;
- }
- else
- {
- stringstream error_desc;
- error_desc << "Got too many readings: " << i;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
- }
-
- // Shift the range readings down by min_i if necessary
- if (min_i > 0)
- {
- memmove (&readings->Readings[0], &readings->Readings[min_i], (max_i - min_i) * sizeof (readings->Readings[0]));
- // Don't forget to adjust the number of readings to account for this
- num_readings_read -= (MAX_READINGS - max_i) + min_i;
- }
- }
- else // SCIP_Version == 2
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- // send the command
- fprintf (laser_port, "GD0000076801\n");
-
- int file = fileno (laser_port);
-
- // check the returned command
- ReadUntil (file, buffer, 13, poll_timeout);
-
- if (strncmp ((const char *) buffer, "GD0000076801", 12) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading command result: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- // check the returned status
- ReadUntil (file, buffer, 3, poll_timeout);
- buffer[2] = 0;
- if (buffer[0] != '0' || buffer[1] != '0')
- {
- stringstream error_desc;
- error_desc << "Error reported by laser scanner: " << (buffer[0] - '0') * 10 + (buffer[1] - '0');
- throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
- }
-
- ReadUntil_nthOccurence (file, 2, (char)0xa);
-
- // NOTE: This only works for 769 requested samples.. (64 data bytes
- // blocks are not the best choice for 3-byte values...)
-
- for (unsigned int i = 0; ; ++i)
- {
- ReadUntil (file, buffer, 3, poll_timeout);
-
- if ((buffer[1] == '\n') && (buffer[2] == '\n'))
- break;
- else if (buffer[2] == '\n')
- ReadUntil (file, &buffer[1], 2, poll_timeout);
- else if (buffer[0] == '\n')
- {
- if (i <= MAX_READINGS)
- {
- readings->Readings[i - 1] = ((readings->Readings[i - 1] & 0xFFC0) | (buffer[1]-0x30));
- buffer [0] = buffer [2];
- ReadUntil (file, &buffer[1], 2, poll_timeout);
- }
- else
- {
- stringstream error_desc;
- error_desc << "Got too many readings: " << i;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
- }
- else if (buffer[1] == '\n')
- {
- buffer[0] = buffer[2];
- ReadUntil (file, &buffer[1], 2, poll_timeout);
- }
-
- if (i < MAX_READINGS)
- {
- readings->Readings[i] = ((buffer[0]-0x30) << 12) | ((buffer[1]-0x30) << 6) | (buffer[2]-0x30);
- num_readings_read++;
- if ((readings->Readings[i] > 5600) && (i >= min_i) && (i <= max_i))
- {
- stringstream error_desc;
- error_desc << "Reading " << i << " value of " << readings->Readings[i] << " is bigger than 5.6 metres.";
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
- }
- else
- {
- stringstream error_desc;
- error_desc << "Got too many readings: " << i;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
- }
-
- // Shift the range readings down by min_i if necessary
- if (min_i > 0)
- {
- memmove (&readings->Readings[0], &readings->Readings[min_i], (max_i - min_i) * sizeof (readings->Readings[0]));
- // Don't forget to adjust the number of readings to account for this
- num_readings_read -= (MAX_READINGS - max_i) + min_i;
- }
- }
-
- return num_readings_read;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-int urg_nz::GetIDInfo (void)
-{
- unsigned char buffer [18];
- memset (buffer, 0, 18);
- int i;
- int id;
-
- if (!PortOpen ())
- {
- stringstream error_desc;
- error_desc << "Laser port is not open";
- throw urg_nz_exception (URG_ERR_NOPORT, error_desc.str ());
- }
-
- tcflush (fileno (laser_port), TCIFLUSH);
-
- if (SCIP_Version == 1)
- {
- // send the command
- fprintf (laser_port, "V\n");
-
- int file = fileno (laser_port);
-
- // check the returned command
- ReadUntil (file, buffer, 2, poll_timeout);
-
- if (strncmp ((const char *) buffer, "V", 1) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading command result: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- // check the returned status
- ReadUntil (file, buffer, 2, poll_timeout);
-
- if (buffer[0] != '0')
- {
- stringstream error_desc;
- error_desc << "Error reported by laser scanner: " << buffer[0] - '0';
- throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
- }
-
- buffer[0] = 0;
- // Read the rest of the values
- for (i = 0; i < 4; i++)
- {
- do
- {
- ReadUntil (file, &buffer[0], 1, poll_timeout);
- } while (buffer[0] != 0xa);
- }
-
- // Read "SERI:H"
- ReadUntil (file, buffer, 6, poll_timeout);
- // Read the serial number value
- for (i = 0; ; i++)
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- if (buffer[i] == 0xa)
- break;
- }
-
- id = atol ((const char*)buffer);
- // Read the last LF
- ReadUntil (file, buffer, 1, poll_timeout);
- }
- else // SCIP_Version == 2
- {
- // send the command
- fprintf (laser_port, "VV\n");
-
- int file = fileno (laser_port);
-
- // check the returned command
- ReadUntil (file, buffer, 7, poll_timeout);
-
- if (strncmp ((const char *) buffer, "VV\n00P\n", 7) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading command result: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- buffer[0] = 0;
- // Read the rest of the values
- for (i = 0; i < 4; i++)
- {
- do
- {
- ReadUntil (file, &buffer[0], 1, poll_timeout);
- } while (buffer[0] != 0xa);
- }
-
- // Read "SERI:H"
- ReadUntil (file, buffer, 6, poll_timeout);
- // Read the serial number value
- for (i = 0; ; i++)
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- if (buffer[i] == ';')
- {
- buffer[i] = 0;
- break;
- }
- }
-
- id = atol ((const char*)buffer);
-
- ReadUntil (file, buffer, 3, poll_timeout);
- }
-
- return id;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-void urg_nz::GetSensorConfig (urg_nz_laser_config_t *cfg)
-{
- memset (cfg, 0, sizeof (urg_nz_laser_config_t));
-
- if (SCIP_Version == 1)
- {
- unsigned char buffer[10];
- memset (buffer, 0, 10);
- tcflush (fileno (laser_port), TCIFLUSH);
- // send the command
- fprintf (laser_port, "V\n");
-
- // Set the default resolution
- cfg->resolution = DTOR (270.0) / static_cast<float> (MAX_READINGS);
-
- int file = fileno (laser_port);
-
- // check the returned command
- ReadUntil (file, buffer, 4, poll_timeout);
-
- if (strncmp ((const char *) buffer, "V\n0\n", 4) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading command result: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- // The following might not work on all versions of the hokuyos
- // since it reads out the Product description returned by 'V'
-
- ReadUntil_nthOccurence (file, 2, (char)0xa);
-
- // Read FIRM:
- ReadUntil (file, buffer, 5, poll_timeout);
-
- if (strncmp ((const char *) buffer, "FIRM:", 5) == 0)
- {
- // Read the firmware version major value
- ReadUntil (file, buffer, 5, poll_timeout);
- buffer[1] = 0;
- int firmware = atol ((const char*)buffer);
- if (verbose)
- fprintf (stderr, "urg_nz: I: Firmware major version is %d\n", firmware);
-
- if (firmware < 3)
- {
- ReadUntil_nthOccurence (file, 4, (char)0xa);
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Bad firmware version: " << firmware;
- throw urg_nz_exception (URG_ERR_BADFIRMWARE, error_desc.str ());
- }
- }
-
- ReadUntil_nthOccurence(file, 1, (char)'(');
- ReadUntil_nthOccurence(file, 1, (char)'-');
-
- int i = 0;
- do
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- } while (buffer[i++] != '[');
-
- buffer[i-1] = 0;
- int max_range = atol((const char*)buffer);
-
- ReadUntil_nthOccurence (file, 2, (char)',');
- i = 0;
- do
- {
- ReadUntil(file, &buffer[i], 1, poll_timeout);
- } while (buffer[i++] != '-');
-
- buffer[i-1] = 0;
- int min_i = atol ((const char*)buffer);
- i = 0;
- do
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- } while (buffer[i++] != '[');
- buffer[i-1] = 0;
-
- int max_i = atol ((const char*)buffer);
-
- ReadUntil (file, buffer, 4, poll_timeout);
- if (strncmp ((const char *) buffer, "step", 4) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading angle_min_idx and angle_max_idx. Check firmware version.";
- throw urg_nz_exception (URG_ERR_READ, error_desc.str ());
- }
- cfg->max_range = max_range;
- cfg->min_angle = (min_i-384)*cfg->resolution;
- cfg->max_angle = (max_i-384)*cfg->resolution;
- if (verbose)
- {
- fprintf (stderr, "urg_nz: I: URG-04 specifications: [min_angle, max_angle, resolution, max_range] = [%f, %f, %f, %f]\n",
- cfg->min_angle, cfg->max_angle, cfg->resolution, cfg->max_range);
- }
- tcflush (fileno(laser_port), TCIFLUSH);
- }
- else // SCIP_Version = 2
- {
- // ask hokuyo: PP
- unsigned char buffer[10];
- memset (buffer, 0, 10);
- tcflush (fileno (laser_port), TCIFLUSH);
-
- // send the command
- fprintf (laser_port, "PP\n");
-
- int file = fileno (laser_port);
-
- // check the returned command
- ReadUntil (file, buffer,7, poll_timeout);
-
- if (strncmp ((const char *) buffer, "PP\n00P\n", 7) != 0)
- {
- tcflush (fileno (laser_port), TCIFLUSH);
- stringstream error_desc;
- error_desc << "Error reading command result: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
- int i = 0;
- ReadUntil_nthOccurence (file, 2, (char)0xa);
- // read DMAX
- ReadUntil_nthOccurence (file, 1, ':');
- do
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- i++;
- } while (buffer[i-1] != ';');
- buffer[i-1] = 0;
- cfg->max_range = atol ((const char*)buffer);
-
- // read angular resolution
- ReadUntil_nthOccurence (file, 1, ':');
- i = 0;
- do
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- i++;
- } while (buffer[i-1] != ';');
- buffer[i-1] = 0;
- cfg->resolution = DTOR (360.0 / atol ((const char*)buffer));
-
- // read AMIN
- ReadUntil_nthOccurence (file, 1, ':');
- i = 0;
- do
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- i++;
- } while (buffer[i-1] != ';');
- buffer[i-1] = 0;
- cfg->min_angle = atol ((const char*)buffer);
- cfg->min_angle -= 384.0;
- cfg->min_angle *= cfg->resolution;
-
- // read AMAX
- ReadUntil_nthOccurence (file, 1, ':');
- i=0;
- do
- {
- ReadUntil (file, &buffer[i], 1, poll_timeout);
- i++;
- } while (buffer[i-1] != ';');
- buffer[i-1] = 0;
- cfg->max_angle = atol ((const char*)buffer);
- cfg->max_angle -= 384.0;
- cfg->max_angle *= cfg->resolution;
-
- ReadUntil_nthOccurence (file, 4, (char)0xa);
-
- if (verbose)
- {
- fprintf (stderr, "urg_nz: I: URG-04 specifications: [min_angle, max_angle, resolution, max_range] = [%f, %f, %f, %f]\n",
- cfg->min_angle, cfg->max_angle, cfg->resolution, cfg->max_range);
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-int urg_nz::GetSCIPVersion (void)
-{
- unsigned char buffer [18];
- memset (buffer, 0, 18);
- int file = fileno (laser_port);
- /////////////////
- // try SCIP1 first:
- /////////////////
- tcflush (fileno (laser_port), TCIFLUSH);
- fprintf (laser_port, "V\n");
-
- // check the returned command
- memset (buffer, 0, 18);
- ReadUntil (file, buffer, 4, poll_timeout);
-
- if (strncmp ((const char *) buffer, "V\n0\n", 4) != 0)
- {
- // SCIP1.0 failed, so we test it with SCIP2.0:
- tcflush (fileno (laser_port), TCIFLUSH);
- fprintf (laser_port, "VV\n");
-
- int file = fileno (laser_port);
-
- // check the returned command
- memset (buffer, 0, 18);
- ReadUntil (file, buffer, 7, poll_timeout);
- tcflush (fileno (laser_port), TCIFLUSH);
-
- if (strncmp ((const char *) buffer, "VV\n00P\n", 7) != 0)
- {
- stringstream error_desc;
- error_desc << "Error reading after VV command. Answer: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- // Set SCIP version 2 and return
- SCIP_Version = 2;
- return SCIP_Version;
- }
-
- // we are currently in SCIP 1.0
- else
- {
- buffer[0] = 0;
- // Read the rest of the values, up till right before firmware version
- ReadUntil_nthOccurence (file, 2, (char)0xa);
- // Read "FIRM:"
- memset (buffer, 0, 18);
- ReadUntil (file, buffer, 5, poll_timeout);
-
- if (strncmp ((const char *) buffer, "FIRM:", 5) != 0)
- {
- stringstream error_desc;
- error_desc << "FIRM: is not where it is supposed to be: " << buffer;
- throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
- }
-
- // Read the firmware version major value
- ReadUntil (file, buffer, 5, poll_timeout);
- buffer[1] = 0;
- int firmware = atol ((const char*)buffer);
- if (verbose)
- fprintf (stderr, "urg_nz: I: Firmware major version is %d\n", firmware);
-
- ReadUntil_nthOccurence (file, 4, (char)0xa);
- if (firmware < 3)
- {
- // Set SCIP version 1 and return
- SCIP_Version = 1;
- return SCIP_Version;
- }
- else
- {
- // try to switch to SCIP2.0
- tcflush (fileno (laser_port), TCIFLUSH);
- fprintf (laser_port, "SCIP2.0\n");
-
- // check the returned command
- memset (buffer, 0, 18);
- ReadUntil (file, buffer, 2, poll_timeout);
- if (strncmp ((const char *) buffer, "SC", 2) != 0)
- {
- // Set SCIP version 1 and return
- SCIP_Version = 1;
- return SCIP_Version;
- }
- else
- {
- memset (&buffer[2], 0, 16);
- ReadUntil (file, &buffer[2], 8, poll_timeout);
- if (strncmp ((const char *) buffer, "SCIP2.0\n0\n", 11) != 0)
- {
- // Set SCIP version 1 and return
- SCIP_Version = 1;
- return SCIP_Version;
- }
- // Set SCIP version 2, turn laser on and return
- SCIP_Version = 2;
- fprintf (laser_port, "BM\n");
- ReadUntil_nthOccurence (file, 3, (char)0xa);
- tcflush (fileno (laser_port), TCIFLUSH);
- return SCIP_Version;
- }
- }
- }
-
- // Shouldn't get here
- stringstream error_desc;
- error_desc << "Unknown SCIP version";
- throw urg_nz_exception (URG_ERR_SCIPVERSION, error_desc.str ());
-}
Deleted: gearbox/trunk/src/urg_nz/urg_laser.dox
===================================================================
--- gearbox/trunk/src/urg_nz/urg_laser.dox 2008-02-08 06:06:57 UTC (rev 45)
+++ gearbox/trunk/src/urg_nz/urg_laser.dox 2008-02-08 06:18:46 UTC (rev 46)
@@ -1,47 +0,0 @@
-/*!
-
-@ingroup gbx_libs
-@ingroup gbx_hardware
-@ingroup gbx_c
-@ingroup gbx_linux
-@defgroup gbx_library_urg_nz liburg_nz
-@brief Hokuyo URG laser scanner driver.
-
-For a full list of functions and classes see @ref urg_nz.
-
-Header file:
-@verbatim
-#include <urglaser/urg_laser.h>
-@endverbatim
-
-@par Responsible Developer
- Geoffrey Biggs
-
-@par Copyright
- Toby Collett, Nico Blodow, Geoffrey Biggs
-
-@par Style guidelines
-
-- Naming conventions:
- - Class methods start with a capital letter.
- - Underscores in member, variable and type names.
- - #define'd values in all capitals.
-- Formatting:
- - 4 space indentation.
- - Function declarations on one line.
- - Space between function name and arguments.
-- C++ API.
- - Functionality provided through classes with utility structures.
-- Units:
- - All internal units are in millimetres and radians.
-
-*/
-
-/*!
-@namespace urg_nz
-@brief URG laser scanner driver name space.
-
-This namespace is part of a library which provides a driver for the URG laser scanner driver.
-
-@see @ref gbx_library_urg_nz
-*/
Deleted: gearbox/trunk/src/urg_nz/urg_laser.h
===================================================================
--- gearbox/trunk/src/urg_nz/urg_laser.h 2008-02-08 06:06:57 UTC (rev 45)
+++ gearbox/trunk/src/urg_nz/urg_laser.h 2008-02-08 06:18:46 UTC (rev 46)
@@ -1,213 +0,0 @@
-/*
- * Hokuyo URG laser scanner driver class.
- * Originally written by Toby Collett for the Player project.
- */
-
-#include <stdio.h>
-#include <inttypes.h>
-
-#include <string>
-
-/** @ingroup gbx_library_urg_nz
-@{
-*/
-
-namespace urg_nz
-{
-
-/** The maximum number of readings the laser is capable of returning. */
-const unsigned int MAX_READINGS = 769;
-/** URG_ERR_READPOLL: Error polling the connection to the laser. */
-const unsigned int URG_ERR_READPOLL = 0;
-/** URG_ERR_READTIMEOUT: Time out while reading from the laser. */
-const unsigned int URG_ERR_READTIMEOUT = 1;
-/** URG_ERR_READ: Read error while reading from the laser. */
-const unsigned int URG_ERR_READ = 2;
-/** URG_ERR_PROTOCOL: Error in the SCIP protocol. */
-const unsigned int URG_ERR_PROTOCOL = 3;
-/** URG_ERR_CHANGEBAUD: Error while changing baud rate. */
-const unsigned int URG_ERR_CHANGEBAUD = 4;
-/** URG_WARN_CHANGEBAUD: Non-fatal error while changing baud rate. */
-const unsigned int URG_WARN_CHANGEBAUD = 5;
-/** URG_ERR_BADBAUDRATE: Bad baud rate. */
-const unsigned int URG_ERR_BADBAUDRATE = 6;
-/** URG_ERR_OPEN_FAILED: Failed to open a port. */
-const unsigned int URG_ERR_OPEN_FAILED = 7;
-/** URG_ERR_CONNECT_FAILED: Failed to connect to the laser. */
-const unsigned int URG_ERR_CONNECT_FAILED = 8;
-/** URG_ERR_CLOSE_FAILED: Failed to close a port. */
-const unsigned int URG_ERR_CLOSE_FAILED = 9;
-/** URG_ERR_NODESTINATION: No destination buffer provided for range readings. */
-const unsigned int URG_ERR_NODESTINATION = 10;
-/** URG_ERR_NOPORT: Port is not open. */
-const unsigned int URG_ERR_NOPORT = 11;
-/** URG_ERR_BADFIRMWARE: Bad firmware version. */
-const unsigned int URG_ERR_BADFIRMWARE = 12;
-/** URG_ERR_SCIPVERSION: Unknown/unsupported SCIP protocol version. */
-const unsigned int URG_ERR_SCIPVERSION = 13;
-/** URG_ERR_LASERERROR: Error reported by laser scanner. */
-const unsigned int URG_ERR_LASERERROR = 14;
-
-/** @brief Range readings from a URG laser scanner. */
-typedef struct urg_nz_laser_readings
-{
- /** Array of range readings in millimetres. Values less than 20 indicate no return in the scan
- (i.e. there was nothing detected within the laser range). */
- unsigned short Readings[MAX_READINGS];
-} urg_laser_readings_t;
-
-/** @brief URG laser scanner configuration information. */
-typedef struct urg_nz_laser_config
-{
- /** Start angle the laser is capable of scanning from (inclusive), in radians.*/
- float min_angle;
- /** End angle the laser is capable of scanning to (inclusive), in radians.*/
- float max_angle;
- /** Scan resolution (angle between two readings) in radians. */
- float resolution;
- /** Maximum range in millimetres. */
- float max_range;
-} urg_laser_config_t;
-
-/** @brief URG error class. */
-class urg_nz_exception
-{
- public:
- /** @brief URG error constructor.
-
- @param code Error code of the error.
- @param desc Description of the error. */
- urg_exception (unsigned int code, std::string desc)
- : error_code (code), error_desc (desc)
- {}
-
- /** Error code. */
- unsigned int error_code;
- /** Error description. */
- std::string error_desc;
-};
-
-/** @brief URG laser scanner class.
-
-Provides an interface for interacting with a Hokuyo URG laser scanner.
-
-To use a serial connection, ensure that you do not also have a USB cable connected, as this will
-force the scanner into USB mode, preventing the serial connection from functioning correctly.
-
-All functions may throw instances of @ref urg_nz_exception. */
-class urg_nz
-{
- public:
- /** @brief Constructor for URG laser scanner class. */
- urg_nz (void);
-
- /** @brief Destructor for URG laser scanner class. */
- ~urg_nz (void);
-
- /** @internal Read from the specified file descriptor until a specified number of bytes is received.
-
- @param fd File descriptor to read from.
- @param buf Pointer to a buffer to store received data in.
- @param len Number of bytes to receive.
- @param timeout Time out for each read performed, in milliseconds.
- @return The number of bytes actually read. */
- int ReadUntil (int fd, unsigned char *buf, int len, int timeout);
-
- /** @internal Read characters (and throw them away) until the nth occurence of character c.
-
- @param file File descriptor to read from.
- @param n Number of occurances to read.
- @param c Character to look for.
- @return The number of bytes actually read. */
- int ReadUntil_nthOccurence (int file, int n, char c);
-
- /** @brief Open a laser scanner on the specified port.
-
- Supported baud rates for RS232 connections are 19200, 57600 and 115200. Baud rate is
- not applicable to USB connections.
-
- @param PortName Fully-qualified path to the port the scanner is connected to.
- @param use_serial Use a serial connection. The alternative is termios.
- @param baud Baud rate for serial connections. */
- void Open (const char *port_name, bool use_serial, int baud);
-
- /** @brief Close the laser scanner connection. */
- void Close (void);
-
- /** @brief Check if the port to the laser scanner is open.
-
- @return true if the port is open, false otherwise. */
- bool PortOpen (void);
-
- /** @brief Change the baud rate of the connection.
-
- Supported baud rates are 19200, 57600 and 115200. Not applicable to USB connections.
-
- Note: Not tested with SCIP protocol version 2.
-
- @param curr_baud The current baud rate of the connection.
- @param new_baud The new baud rate to change the connection to.
- @return 0 on success, non-zero for non-fatal failure. Fatal errors will throw an exception. */
- int ChangeBaud (int curr_baud, int new_baud);
-
- /** @brief Set the time out for reads performed when talking to the laser.
-
- A large number of polls are performed while talking to the laser scanner to look for data,
- for example when getting scan data from it. This sets the timeout, in milliseconds, to use
- for these polls. Set it to a negative value for no timeout.
-
- The default value is -1.
-
- @param timeout The time out for reads, in milliseconds. */
- void SetTimeOut (int timeout) { poll_timeout = timeout; }
-
- /** @brief Retrieve a set of range readings from the scanner. Ranges are returned in millimetres.
-
- The scan is a series of discrete values. They can be indexed, starting at 0 and going up to
- @ref MAX_READINGS. A subset of these values only can be returned using min_i and max_i.
-
- @param readings Pointer to a @ref urg_laser_readings_t structure to store the data in.
- @param min_i The minimum scan index to retrieve. Must be at least 0. Default is 0.
- @param max_i The maximum scan index to retrieve. Must be no greater than @ref MAX_READINGS. Default is @ref MAX_READINGS.
- @return The number of range readings read. */
- unsigned int GetReadings (urg_nz_laser_readings_t *readings, unsigned int min_i = 0, unsigned int max_i = MAX_READINGS);
-
- /** @brief Get the laser scanner identification information.
-
- @return The serial number of the laser scanner. */
- int GetIDInfo (void);
-
- /** @brief Get the laser scanner configuration (resolution, scan angles, etc.)
-
- @param cfg Pointer to a @ref urg_laser_config_t structure to store the configuration in. */
- void GetSensorConfig (urg_nz_laser_config_t *cfg);
-
- /** @brief Get the protocol version used by the connected laser scanner.
-
- Old firmware revisions support protocol SCIP1.0, and a max range of 4 meters.
- Since firmware revision 3.0.00, it's called SCIP2.0, and the max range is 5.6 meters.
-
- @return The protocol version in use. */
- int GetSCIPVersion (void);
-
- /** @brief Turns on and off printing of information to the console. Default is off.
-
- @param verbose_mode Set verbose mode on or off. */
- void SetVerbose (bool verbose_mode) { verbose = verbose_mode; }
- private:
- /** @internal SCIP protocol version in use. */
- int SCIP_Version;
-
- /** @internal File structure of the port connected to the laser scanner. */
- FILE *laser_port;
-
- /** @internal Verbose mode setting. */
- bool verbose;
-
- /** @internal Poll time out time in milliseconds. */
- int poll_timeout;
-};
-
-}; // namespace urg_nz
-
-/** @} */
Copied: gearbox/trunk/src/urg_nz/urg_nz.cpp (from rev 45, gearbox/trunk/src/urg_nz/urg_laser.cpp)
===================================================================
--- gearbox/trunk/src/urg_nz/urg_nz.cpp (rev 0)
+++ gearbox/trunk/src/urg_nz/urg_nz.cpp 2008-02-08 06:18:46 UTC (rev 46)
@@ -0,0 +1,991 @@
+/*
+ * Hokuyo URG laser scanner driver class.
+ * Originally written by Toby Collett for the Player project.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <termios.h>
+#include <poll.h>
+#include <sstream>
+
+#include "urg_nz.h"
+
+using namespace urg_nz;
+using namespace std;
+
+#ifndef M_PI
+ #define M_PI 3.14159265358979323846
+#endif
+// Convert radians to degrees
+#ifndef RTOD
+ #define RTOD(r) ((r) * 180 / M_PI)
+#endif
+// Convert degrees to radians
+#ifndef DTOR
+ #define DTOR(d) ((d) * M_PI / 180)
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Constructor
+///////////////////////////////////////////////////////////////////////////////
+urg_laser::urg_laser (void)
+{
+ // Defaults to SCIP version 1
+ SCIP_Version = 1;
+ laser_port = NULL;
+ verbose = false;
+ poll_timeout = -1;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Destructor
+///////////////////////////////////////////////////////////////////////////////
+urg_laser::~urg_laser (void)
+{
+ if (PortOpen ())
+ Close ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Read functions
+///////////////////////////////////////////////////////////////////////////////
+int urg_laser::ReadUntil_nthOccurence (int file, int n, char c)
+{
+ int retval = 0, bytes_read = 0;
+ unsigned char buffer[2];
+ buffer[0] = 0;
+ buffer[1] = 0;
+ for (int i = 0; i < n; i++)
+ {
+ do
+ {
+ retval = ReadUntil (file, &buffer[0], 1, poll_timeout);
+ if (retval > 0)
+ bytes_read += retval;
+ } while (buffer[0] != c && retval > 0);
+ }
+ return bytes_read;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int urg_laser::ReadUntil (int fd, unsigned char *buf, int len, int timeout)
+{
+ int ret;
+ int current=0;
+ struct pollfd ufd[1];
+ int retval;
+
+ ufd[0].fd = fd;
+ ufd[0].events = POLLIN;
+
+ do
+ {
+ if(timeout >= 0)
+ {
+ if ((retval = poll (ufd, 1, timeout)) < 0)
+ {
+ stringstream error_desc;
+ error_desc << "Error in ReadUntil at poll(): " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_READPOLL, error_desc.str ());
+ }
+ else if (retval == 0)
+ {
+ stringstream error_desc;
+ error_desc << "Timed out on poll in ReadUntil";
+ throw urg_nz_exception (URG_ERR_READTIMEOUT, error_desc.str ());
+ }
+ }
+
+ ret = read (fd, &buf[current], len-current);
+ if (ret < 0)
+ {
+ stringstream error_desc;
+ error_desc << "Error in ReadUntil at read(): " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_READ, error_desc.str ());
+ }
+
+ current += ret;
+ if (current > 2 && current < len && buf[current-2] == '\n' && buf[current-1] == '\n')
+ {
+ stringstream error_desc;
+ error_desc << "Got an end of command while waiting for more data.";
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ }
+ } while (current < len);
+ return current;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Port control functions
+///////////////////////////////////////////////////////////////////////////////
+int urg_laser::ChangeBaud (int curr_baud, int new_baud)
+{
+ struct termios newtio;
+ int fd;
+ fd = fileno (laser_port);
+ int new_baud_constant;
+
+ switch (curr_baud)
+ {
+ case 19200:
+ curr_baud = B19200;
+ break;
+ case 57600:
+ curr_baud = B57600;
+ break;
+ case 115200:
+ curr_baud = B115200;
+ break;
+ default:
+ stringstream error_desc;
+ error_desc << "Unknown current baud rate: " << curr_baud;
+ throw urg_nz_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
+ }
+
+ switch (new_baud)
+ {
+ case 19200:
+ new_baud_constant = B19200;
+ break;
+ case 57600:
+ new_baud_constant = B57600;
+ break;
+ case 115200:
+ new_baud_constant = B115200;
+ break;
+ default:
+ stringstream error_desc;
+ error_desc << "Unknown new baud rate: " << new_baud;
+ throw urg_nz_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
+ }
+
+ if (tcgetattr (fd, &newtio) < 0)
+ {
+ close (fd);
+ stringstream error_desc;
+ error_desc << "Error in ChangeBaud at tcgetattr: " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ }
+
+ cfmakeraw (&newtio);
+ cfsetispeed (&newtio, curr_baud);
+ cfsetospeed (&newtio, curr_baud);
+
+ if (tcsetattr (fd, TCSAFLUSH, &newtio) < 0 )
+ {
+ close (fd);
+ stringstream error_desc;
+ error_desc << "Error in ChangeBaud at tcsetattr: " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ }
+
+ unsigned char buf[17];
+ memset (buf,0,sizeof (buf));
+
+ // TODO: Check if this works with SCIP2.0
+ if (SCIP_Version == 1)
+ {
+ buf[0] = 'S';
+ switch (new_baud_constant)
+ {
+ case B19200:
+ buf[1] = '0';
+ buf[2] = '1';
+ buf[3] = '9';
+ buf[4] = '2';
+ buf[5] = '0';
+ buf[6] = '0';
+ break;
+ case B57600:
+ buf[1] = '0';
+ buf[2] = '5';
+ buf[3] = '7';
+ buf[4] = '6';
+ buf[5] = '0';
+ buf[6] = '0';
+ break;
+ case B115200:
+ buf[1] = '1';
+ buf[2] = '1';
+ buf[3] = '5';
+ buf[4] = '2';
+ buf[5] = '0';
+ buf[6] = '0';
+ break;
+ default:
+ // Already checked above
+ break;
+ }
+ buf[7] = '0';
+ buf[8] = '0';
+ buf[9] = '0';
+ buf[10] = '0';
+ buf[11] = '0';
+ buf[12] = '0';
+ buf[13] = '0';
+ buf[14] = '\n';
+ }
+ else // SCIP 2
+ {
+ buf[0] = 'S';
+ buf[1] = 'S';
+ switch (new_baud)
+ {
+ case B19200:
+ buf[2] = '0';
+ buf[3] = '1';
+ buf[4] = '9';
+ buf[5] = '2';
+ buf[6] = '0';
+ buf[7] = '0';
+ break;
+ case B57600:
+ buf[2] = '0';
+ buf[3] = '5';
+ buf[4] = '7';
+ buf[5] = '6';
+ buf[6] = '0';
+ buf[7] = '0';
+ break;
+ case B115200:
+ buf[2] = '1';
+ buf[3] = '1';
+ buf[4] = '5';
+ buf[5] = '2';
+ buf[6] = '0';
+ buf[7] = '0';
+ break;
+ default:
+ // Already checked above
+ break;
+ }
+ buf[8] = '\n';
+ }
+
+ fprintf (laser_port, "%s", buf);
+ memset (buf, 0, sizeof (buf));
+ int len;
+ // The docs say that the response ends in 'status LF LF', where
+ // status is '0' if everything went alright. But it seems that
+ // the response actually ends in 'LF status LF'.
+ if (((len = ReadUntil (fd, buf, sizeof (buf), poll_timeout)) < 0) ||
+ (buf[15] != '0'))
+ {
+ if (verbose)
+ fprintf (stderr, "urg_nz: W: Failed to change baud rate to %d\n", new_baud);
+ return -1;
+ }
+ else
+ {
+ if (tcgetattr (fd, &newtio) < 0)
+ {
+ close (fd);
+ stringstream error_desc;
+ error_desc << "Error in ChangeBaud at tcgetattr: " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ }
+ cfmakeraw (&newtio);
+ cfsetispeed (&newtio, new_baud_constant);
+ cfsetospeed (&newtio, new_baud_constant);
+ if (tcsetattr (fd, TCSAFLUSH, &newtio) < 0 )
+ {
+ close (fd);
+ stringstream error_desc;
+ error_desc << "Error in ChangeBaud at tcsetattr: " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ }
+ else
+ {
+ usleep (200000);
+ }
+ }
+ return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void urg_laser::Open (const char *port_name, bool use_serial, int baud)
+{
+ if (PortOpen ())
+ this->Close ();
+
+ laser_port = fopen (port_name, "r+");
+ if (laser_port == NULL)
+ {
+ stringstream error_desc;
+ error_desc << "Failed to open port " << port_name << " << with error " << errno << ":" << strerror (errno);
+ throw urg_nz_exception (URG_ERR_OPEN_FAILED, error_desc.str ());
+ }
+
+ int fd = fileno (laser_port);
+ if (use_serial)
+ {
+ if (verbose)
+ {
+ fprintf (stderr, "urg_nz: I: Connecting using serial connection to %s\n", port_name);
+ fprintf (stderr, "urg_nz: I: Trying to connect at 19200\n");
+ }
+ if (this->ChangeBaud (19200, baud) != 0)
+ {
+ if (verbose)
+ fprintf (stderr, "urg_nz: I: Trying to connect at 57600\n");
+ if (this->ChangeBaud (57600, baud) != 0)
+ {
+ if (verbose)
+ fprintf (stderr, "urg_nz: I: Trying to connect at 115200\n");
+ if (this->ChangeBaud (115200, baud) != 0)
+ {
+ close (fd);
+ stringstream error_desc;
+ error_desc << "Failed to connect at any baud";
+ throw urg_nz_exception (URG_ERR_CONNECT_FAILED, error_desc.str ());
+ }
+ }
+ }
+ if (verbose)
+ fprintf (stderr, "urg_nz: I: Successfully changed baud rate\n");
+ }
+ else
+ {
+ if (verbose)
+ fprintf (stderr, "urg_nz: I: Connecting using USB connection to %s\n", port_name);
+ // set up new settings
+ struct termios newtio;
+ memset (&newtio, 0, sizeof (newtio));
+ newtio.c_cflag = /*(rate & CBAUD) |*/ CS8 | CLOCAL | CREAD;
+ newtio.c_iflag = IGNPAR;
+ newtio.c_oflag = 0;
+ newtio.c_lflag = ICANON;
+
+ // activate new settings
+ tcflush (fd, TCIFLUSH);
+ tcsetattr (fd, TCSANOW, &newtio);
+ usleep (200000);
+ GetSCIPVersion ();
+ tcflush (fd, TCIOFLUSH);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void urg_laser::Close (void)
+{
+ assert (this->laser_port);
+
+ if (verbose)
+ fprintf (stderr, "urg_nz: I: Closing port\n");
+
+ tcflush (fileno (this->laser_port), TCIOFLUSH);
+ if (fclose (this->laser_port) != 0)
+ {
+ stringstream error_desc;
+ error_desc << "Error closing port: " << errno << ":" << strerror (errno);
+ this->laser_port = NULL;
+ throw urg_nz_exception (URG_ERR_CLOSE_FAILED, error_desc.str ());
+ }
+ this->laser_port = NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+bool urg_laser::PortOpen (void)
+{
+ return laser_port != NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Laser sensor access functions
+///////////////////////////////////////////////////////////////////////////////
+unsigned int urg_laser::GetReadings (urg_nz_laser_readings_t *readings, unsigned int min_i, unsigned int max_i)
+{
+ unsigned char buffer[16];
+ unsigned int num_readings_read = 0;
+
+ if (readings == NULL)
+ {
+ stringstream error_desc;
+ error_desc << "NULL destination buffer";
+ throw urg_nz_exception (URG_ERR_NODESTINATION, error_desc.str ());
+ }
+
+ if (!PortOpen ())
+ {
+ stringstream error_desc;
+ error_desc << "Laser port is not open";
+ throw urg_nz_exception (URG_ERR_NOPORT, error_desc.str ());
+ }
+
+ if (SCIP_Version == 1)
+ {
+ tcflush (fileno (laser_port), TCIFLUSH);
+ // send the command
+ fprintf (laser_port, "G00076801\n");
+
+ int file = fileno (laser_port);
+
+ // check the returned command
+ ReadUntil (file, buffer, 10, poll_timeout);
+
+ if (strncmp ((const char *) buffer, "G00076801", 9) != 0)
+ {
+ tcflush (fileno (laser_port), TCIFLUSH);
+ stringstream error_desc;
+ error_desc << "Error reading command result: " << buffer;
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ }
+
+ // check the returned status
+ ReadUntil (file, buffer, 2, poll_timeout);
+
+ if (buffer[0] != '0')
+ {
+ stringstream error_desc;
+ error_desc << "Error reported by laser scanner: " << buffer[0] - '0';
+ throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
+ }
+
+ for (unsigned int i=0; ; ++i)
+ {
+ ReadUntil (file, buffer, 2, poll_timeout);
+
+ if (buffer[0] == '\n' && buffer[1] == '\n')
+ break;
+ else if (buffer[0] == '\n')
+ {
+ buffer[0] = buffer[1];
+ ReadUntil (file, &buffer[1], 1, poll_timeout);
+ }
+
+ if (i < MAX_READINGS)
+ {
+ readings->Readings[i] = ((buffer[0]-0x30) << 6) | (buffer[1]-0x30);
+ num_readings_read++;
+ }
+ else
+ {
+ stringstream error_desc;
+ error_desc << "Got too many readings: " << i;
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ }
+ }
+
+ // Shift the range readings down by min_i if necessary
+ if (min_i > 0)
+ {
+ memmove (&readings->Readings[0], &readings->Readings[min_i], (max_i - min_i) * sizeof (readings->Readings[0]));
+ // Don't forget to adjust the number of readings to account for this
+ num_readings_read -= (MAX_READINGS - max_i) + min_i;
+ }
+ }
+ else // SCIP_Version == 2
+ {
+ tcflush (fileno (laser_port), TCIFLUSH);
+ // send the command
+ fprintf (laser_port, "GD0000076801\n");
+
+ int file = fileno (laser_port);
+
+ // check the returned command
+ ReadUntil (file, buffer, 13, poll_timeout);
+
+ if (strncmp ((const char *) buffer, "GD0000076801", 12) != 0)
+ {
+ tcflush (fileno (laser_port), TCIFLUSH);
+ stringstream error_desc;
+ error_desc << "Error reading command result: " << buffer;
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ }
+
+ // check the returned status
+ ReadUntil (file, buffer, 3, poll_timeout);
+ buffer[2] = 0;
+ if (buffer[0] != '0' || buffer[1] != '0')
+ {
+ stringstream error_desc;
+ error_desc << "Error reported by laser scanner: " << (buffer[0] - '0') * 10 + (buffer[1] - '0');
+ throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
+ }
+
+ ReadUntil_nthOccurence (file, 2, (char)0xa);
+
+ // NOTE: This only works for 769 requested samples.. (64 data bytes
+ // blocks are not the best choice for 3-byte values...)
+
+ for (unsigned int i = 0; ; ++i)
+ {
+ ReadUntil (file, buffer, 3, poll_timeout);
+
+ if ((buffer[1] == '\n') && (buffer[2] == '\n'))
+ break;
+ else if (buffer[2] == '\n')
+ ReadUntil (file, &buffer[1], 2, poll_timeout);
+ else if (buffer[0] == '\n')
+ {
+ if (i <= MAX_READINGS)
+ {
+ readings->Readings[i - 1] = ((readings->Readings[i - 1] & 0xFFC0) | (buffer[1]-0x30));
+ ...
[truncated message content] |
|
From: <gb...@us...> - 2008-02-08 06:06:52
|
Revision: 45
http://gearbox.svn.sourceforge.net/gearbox/?rev=45&view=rev
Author: gbiggs
Date: 2008-02-07 22:06:57 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Step one of renaming: Edit the files.
Modified Paths:
--------------
gearbox/trunk/src/urg_nz/CMakeLists.txt
gearbox/trunk/src/urg_nz/example.cmake
gearbox/trunk/src/urg_nz/example.cpp
gearbox/trunk/src/urg_nz/example.readme
gearbox/trunk/src/urg_nz/urg_laser.cpp
gearbox/trunk/src/urg_nz/urg_laser.dox
gearbox/trunk/src/urg_nz/urg_laser.h
Modified: gearbox/trunk/src/urg_nz/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/urg_nz/CMakeLists.txt 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/CMakeLists.txt 2008-02-08 06:06:57 UTC (rev 45)
@@ -1,4 +1,4 @@
-SET ( lib_name urglaser )
+SET ( lib_name urg_nz )
GBX_ADD_LICENSE( GPL )
SET ( build TRUE )
@@ -9,8 +9,8 @@
INCLUDE( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
- SET( hdrs urg_laser.h )
- SET( srcs urg_laser.cpp )
+ SET( hdrs urg_nz.h )
+ SET( srcs urg_nz.cpp )
GBX_ADD_LIBRARY( ${lib_name} SHARED ${srcs} )
Modified: gearbox/trunk/src/urg_nz/example.cmake
===================================================================
--- gearbox/trunk/src/urg_nz/example.cmake 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/example.cmake 2008-02-08 06:06:57 UTC (rev 45)
@@ -1,10 +1,10 @@
-PROJECT( urg_example )
+PROJECT( urg_nz_example )
INCLUDE_DIRECTORIES( @CMAKE_INSTALL_PREFIX@ )
-ADD_EXECUTABLE( urg_example example.cpp )
-TARGET_LINK_LIBRARIES( urg_example urglaser )
-SET_TARGET_PROPERTIES( urg_example PROPERTIES
+ADD_EXECUTABLE( urg_nz_example example.cpp )
+TARGET_LINK_LIBRARIES( urg_nz_example urg_nz )
+SET_TARGET_PROPERTIES( urg_nz_example PROPERTIES
LINK_FLAGS "-L@CMAKE_INSTALL_PREFIX@/lib/gearbox"
INSTALL_RPATH "${INSTALL_RPATH};@CMAKE_INSTALL_PREFIX@/lib/gearbox"
BUILD_WITH_INSTALL_RPATH TRUE )
\ No newline at end of file
Modified: gearbox/trunk/src/urg_nz/example.cpp
===================================================================
--- gearbox/trunk/src/urg_nz/example.cpp 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/example.cpp 2008-02-08 06:06:57 UTC (rev 45)
@@ -4,7 +4,7 @@
#include <string.h>
#include <unistd.h>
-#include <gearbox/urglaser/urg_laser.h>
+#include <gearbox/urg_nz/urg_nz.h>
int main (int argc, char **argv)
{
@@ -42,7 +42,7 @@
try
{
- urglaser::urg_laser laser; // Laser scanner object
+ urg_nz::urg_nz laser; // Laser scanner object
// Set the laser to verbose mode (so we see more information in the console)
laser.SetVerbose (true);
@@ -62,7 +62,7 @@
printf ("Laser serial number:\t%d\n", serial);
// Get the laser configuration
- urglaser::urg_laser_config_t config; // Laser configuration structure
+ urg_nz::urg_nz_laser_config_t config; // Laser configuration structure
laser.GetSensorConfig (&config);
printf ("Laser configuration:\n"
"Min angle: %f\tMax angle: %f\tResolution: %f\tMax range: %f\n",
@@ -71,8 +71,8 @@
// Calculate the minimum and maximum indices to retrieve - this is only necessary if you want
// less than the full scan, otherwise simply don't supply min_i and max_i to urg_laser.GetReadings()
// and the full scan will be returned.
- int minIndex = static_cast<int> (round ((urglaser::MAX_READINGS / 2) + config.min_angle / config.resolution));
- int maxIndex = static_cast<int> (round ((urglaser::MAX_READINGS / 2) + config.max_angle / config.resolution));
+ int minIndex = static_cast<int> (round ((urg_nz::MAX_READINGS / 2) + config.min_angle / config.resolution));
+ int maxIndex = static_cast<int> (round ((urg_nz::MAX_READINGS / 2) + config.max_angle / config.resolution));
if (useSerial && version == 1) // Baud rate changing is not currently supported on SCIP v2 scanners
{
@@ -84,7 +84,7 @@
}
// Get range readings from the laser
- urglaser::urg_laser_readings_t readings; // Laser readings structure
+ urg_nz::urg_nz_laser_readings_t readings; // Laser readings structure
printf ("Getting readings from %d to %d\n", minIndex, maxIndex);
unsigned int numRead = laser.GetReadings (&readings, minIndex, maxIndex);
printf ("Got %d range readings:\n", numRead);
@@ -101,7 +101,7 @@
// Close the laser
laser.Close ();
}
- catch (urglaser::urg_exception e)
+ catch (urg_nz::urg_nz_exception e)
{
printf ("Caught exception: (%d) %s\n", e.error_code, e.error_desc.c_str ());
return -1;
Modified: gearbox/trunk/src/urg_nz/example.readme
===================================================================
--- gearbox/trunk/src/urg_nz/example.readme 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/example.readme 2008-02-08 06:06:57 UTC (rev 45)
@@ -7,9 +7,9 @@
have installed GearBox into /usr/local, you could do the following:
$ cd ~
-$ mkdir urglaser_example
-$ cd urglaser_example
-$ ccmake /usr/local/share/gearbox/urglaser/
+$ mkdir urg_nz_example
+$ cd urg_nz_example
+$ ccmake /usr/local/share/gearbox/urg_nz/
Running
-------
@@ -18,7 +18,7 @@
optionally, a baud rate and whether to use an RS232 connection or not. For
example:
-./urg_example -p /dev/ttyS1 -b 115200 -s
+./urg_nz_example -p /dev/ttyS1 -b 115200 -s
This will start the example, looking for the laser on port /dev/ttyS1 and
using a baud rate of 115200bps in RS232 mode.
Modified: gearbox/trunk/src/urg_nz/urg_laser.cpp
===================================================================
--- gearbox/trunk/src/urg_nz/urg_laser.cpp 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/urg_laser.cpp 2008-02-08 06:06:57 UTC (rev 45)
@@ -14,9 +14,9 @@
#include <poll.h>
#include <sstream>
-#include "urg_laser.h"
+#include "urg_nz.h"
-using namespace urglaser;
+using namespace urg_nz;
using namespace std;
#ifndef M_PI
@@ -34,7 +34,7 @@
///////////////////////////////////////////////////////////////////////////////
// Constructor
///////////////////////////////////////////////////////////////////////////////
-urg_laser::urg_laser (void)
+urg_nz::urg_nz (void)
{
// Defaults to SCIP version 1
SCIP_Version = 1;
@@ -46,7 +46,7 @@
///////////////////////////////////////////////////////////////////////////////
// Destructor
///////////////////////////////////////////////////////////////////////////////
-urg_laser::~urg_laser (void)
+urg_nz::~urg_nz (void)
{
if (PortOpen ())
Close ();
@@ -55,7 +55,7 @@
///////////////////////////////////////////////////////////////////////////////
// Read functions
///////////////////////////////////////////////////////////////////////////////
-int urg_laser::ReadUntil_nthOccurence (int file, int n, char c)
+int urg_nz::ReadUntil_nthOccurence (int file, int n, char c)
{
int retval = 0, bytes_read = 0;
unsigned char buffer[2];
@@ -74,7 +74,7 @@
}
///////////////////////////////////////////////////////////////////////////////
-int urg_laser::ReadUntil (int fd, unsigned char *buf, int len, int timeout)
+int urg_nz::ReadUntil (int fd, unsigned char *buf, int len, int timeout)
{
int ret;
int current=0;
@@ -92,13 +92,13 @@
{
stringstream error_desc;
error_desc << "Error in ReadUntil at poll(): " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_READPOLL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_READPOLL, error_desc.str ());
}
else if (retval == 0)
{
stringstream error_desc;
error_desc << "Timed out on poll in ReadUntil";
- throw urg_exception (URG_ERR_READTIMEOUT, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_READTIMEOUT, error_desc.str ());
}
}
@@ -107,7 +107,7 @@
{
stringstream error_desc;
error_desc << "Error in ReadUntil at read(): " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_READ, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_READ, error_desc.str ());
}
current += ret;
@@ -115,7 +115,7 @@
{
stringstream error_desc;
error_desc << "Got an end of command while waiting for more data.";
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
} while (current < len);
return current;
@@ -124,7 +124,7 @@
///////////////////////////////////////////////////////////////////////////////
// Port control functions
///////////////////////////////////////////////////////////////////////////////
-int urg_laser::ChangeBaud (int curr_baud, int new_baud)
+int urg_nz::ChangeBaud (int curr_baud, int new_baud)
{
struct termios newtio;
int fd;
@@ -145,7 +145,7 @@
default:
stringstream error_desc;
error_desc << "Unknown current baud rate: " << curr_baud;
- throw urg_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
}
switch (new_baud)
@@ -162,7 +162,7 @@
default:
stringstream error_desc;
error_desc << "Unknown new baud rate: " << new_baud;
- throw urg_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_BADBAUDRATE, error_desc.str ());
}
if (tcgetattr (fd, &newtio) < 0)
@@ -170,7 +170,7 @@
close (fd);
stringstream error_desc;
error_desc << "Error in ChangeBaud at tcgetattr: " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
}
cfmakeraw (&newtio);
@@ -182,7 +182,7 @@
close (fd);
stringstream error_desc;
error_desc << "Error in ChangeBaud at tcsetattr: " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
}
unsigned char buf[17];
@@ -278,7 +278,7 @@
(buf[15] != '0'))
{
if (verbose)
- fprintf (stderr, "urg_laser: W: Failed to change baud rate to %d\n", new_baud);
+ fprintf (stderr, "urg_nz: W: Failed to change baud rate to %d\n", new_baud);
return -1;
}
else
@@ -288,7 +288,7 @@
close (fd);
stringstream error_desc;
error_desc << "Error in ChangeBaud at tcgetattr: " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
}
cfmakeraw (&newtio);
cfsetispeed (&newtio, new_baud_constant);
@@ -298,7 +298,7 @@
close (fd);
stringstream error_desc;
error_desc << "Error in ChangeBaud at tcsetattr: " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_CHANGEBAUD, error_desc.str ());
}
else
{
@@ -309,7 +309,7 @@
}
///////////////////////////////////////////////////////////////////////////////
-void urg_laser::Open (const char *port_name, bool use_serial, int baud)
+void urg_nz::Open (const char *port_name, bool use_serial, int baud)
{
if (PortOpen ())
this->Close ();
@@ -319,7 +319,7 @@
{
stringstream error_desc;
error_desc << "Failed to open port " << port_name << " << with error " << errno << ":" << strerror (errno);
- throw urg_exception (URG_ERR_OPEN_FAILED, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_OPEN_FAILED, error_desc.str ());
}
int fd = fileno (laser_port);
@@ -327,33 +327,33 @@
{
if (verbose)
{
- fprintf (stderr, "urg_laser: I: Connecting using serial connection to %s\n", port_name);
- fprintf (stderr, "urg_laser: I: Trying to connect at 19200\n");
+ fprintf (stderr, "urg_nz: I: Connecting using serial connection to %s\n", port_name);
+ fprintf (stderr, "urg_nz: I: Trying to connect at 19200\n");
}
if (this->ChangeBaud (19200, baud) != 0)
{
if (verbose)
- fprintf (stderr, "urg_laser: I: Trying to connect at 57600\n");
+ fprintf (stderr, "urg_nz: I: Trying to connect at 57600\n");
if (this->ChangeBaud (57600, baud) != 0)
{
if (verbose)
- fprintf (stderr, "urg_laser: I: Trying to connect at 115200\n");
+ fprintf (stderr, "urg_nz: I: Trying to connect at 115200\n");
if (this->ChangeBaud (115200, baud) != 0)
{
close (fd);
stringstream error_desc;
error_desc << "Failed to connect at any baud";
- throw urg_exception (URG_ERR_CONNECT_FAILED, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_CONNECT_FAILED, error_desc.str ());
}
}
}
if (verbose)
- fprintf (stderr, "urg_laser: I: Successfully changed baud rate\n");
+ fprintf (stderr, "urg_nz: I: Successfully changed baud rate\n");
}
else
{
if (verbose)
- fprintf (stderr, "urg_laser: I: Connecting using USB connection to %s\n", port_name);
+ fprintf (stderr, "urg_nz: I: Connecting using USB connection to %s\n", port_name);
// set up new settings
struct termios newtio;
memset (&newtio, 0, sizeof (newtio));
@@ -372,12 +372,12 @@
}
///////////////////////////////////////////////////////////////////////////////
-void urg_laser::Close (void)
+void urg_nz::Close (void)
{
assert (this->laser_port);
if (verbose)
- fprintf (stderr, "urg_laser: I: Closing port\n");
+ fprintf (stderr, "urg_nz: I: Closing port\n");
tcflush (fileno (this->laser_port), TCIOFLUSH);
if (fclose (this->laser_port) != 0)
@@ -385,13 +385,13 @@
stringstream error_desc;
error_desc << "Error closing port: " << errno << ":" << strerror (errno);
this->laser_port = NULL;
- throw urg_exception (URG_ERR_CLOSE_FAILED, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_CLOSE_FAILED, error_desc.str ());
}
this->laser_port = NULL;
}
///////////////////////////////////////////////////////////////////////////////
-bool urg_laser::PortOpen (void)
+bool urg_nz::PortOpen (void)
{
return laser_port != NULL;
}
@@ -399,7 +399,7 @@
///////////////////////////////////////////////////////////////////////////////
// Laser sensor access functions
///////////////////////////////////////////////////////////////////////////////
-unsigned int urg_laser::GetReadings (urg_laser_readings_t *readings, unsigned int min_i, unsigned int max_i)
+unsigned int urg_nz::GetReadings (urg_nz_laser_readings_t *readings, unsigned int min_i, unsigned int max_i)
{
unsigned char buffer[16];
unsigned int num_readings_read = 0;
@@ -408,14 +408,14 @@
{
stringstream error_desc;
error_desc << "NULL destination buffer";
- throw urg_exception (URG_ERR_NODESTINATION, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_NODESTINATION, error_desc.str ());
}
if (!PortOpen ())
{
stringstream error_desc;
error_desc << "Laser port is not open";
- throw urg_exception (URG_ERR_NOPORT, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_NOPORT, error_desc.str ());
}
if (SCIP_Version == 1)
@@ -434,7 +434,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading command result: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
// check the returned status
@@ -444,7 +444,7 @@
{
stringstream error_desc;
error_desc << "Error reported by laser scanner: " << buffer[0] - '0';
- throw urg_exception (URG_ERR_LASERERROR, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
}
for (unsigned int i=0; ; ++i)
@@ -468,7 +468,7 @@
{
stringstream error_desc;
error_desc << "Got too many readings: " << i;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
}
@@ -496,7 +496,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading command result: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
// check the returned status
@@ -506,7 +506,7 @@
{
stringstream error_desc;
error_desc << "Error reported by laser scanner: " << (buffer[0] - '0') * 10 + (buffer[1] - '0');
- throw urg_exception (URG_ERR_LASERERROR, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
}
ReadUntil_nthOccurence (file, 2, (char)0xa);
@@ -534,7 +534,7 @@
{
stringstream error_desc;
error_desc << "Got too many readings: " << i;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
}
else if (buffer[1] == '\n')
@@ -551,14 +551,14 @@
{
stringstream error_desc;
error_desc << "Reading " << i << " value of " << readings->Readings[i] << " is bigger than 5.6 metres.";
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
}
else
{
stringstream error_desc;
error_desc << "Got too many readings: " << i;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
}
@@ -575,7 +575,7 @@
}
//////////////////////////////////////////////////////////////////////////////
-int urg_laser::GetIDInfo (void)
+int urg_nz::GetIDInfo (void)
{
unsigned char buffer [18];
memset (buffer, 0, 18);
@@ -586,7 +586,7 @@
{
stringstream error_desc;
error_desc << "Laser port is not open";
- throw urg_exception (URG_ERR_NOPORT, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_NOPORT, error_desc.str ());
}
tcflush (fileno (laser_port), TCIFLUSH);
@@ -606,7 +606,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading command result: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
// check the returned status
@@ -616,7 +616,7 @@
{
stringstream error_desc;
error_desc << "Error reported by laser scanner: " << buffer[0] - '0';
- throw urg_exception (URG_ERR_LASERERROR, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_LASERERROR, error_desc.str ());
}
buffer[0] = 0;
@@ -658,7 +658,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading command result: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
buffer[0] = 0;
@@ -693,9 +693,9 @@
}
///////////////////////////////////////////////////////////////////////////////
-void urg_laser::GetSensorConfig (urg_laser_config_t *cfg)
+void urg_nz::GetSensorConfig (urg_nz_laser_config_t *cfg)
{
- memset (cfg, 0, sizeof (urg_laser_config_t));
+ memset (cfg, 0, sizeof (urg_nz_laser_config_t));
if (SCIP_Version == 1)
{
@@ -718,7 +718,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading command result: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
// The following might not work on all versions of the hokuyos
@@ -736,7 +736,7 @@
buffer[1] = 0;
int firmware = atol ((const char*)buffer);
if (verbose)
- fprintf (stderr, "urg_laser: I: Firmware major version is %d\n", firmware);
+ fprintf (stderr, "urg_nz: I: Firmware major version is %d\n", firmware);
if (firmware < 3)
{
@@ -744,7 +744,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Bad firmware version: " << firmware;
- throw urg_exception (URG_ERR_BADFIRMWARE, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_BADFIRMWARE, error_desc.str ());
}
}
@@ -784,14 +784,14 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading angle_min_idx and angle_max_idx. Check firmware version.";
- throw urg_exception (URG_ERR_READ, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_READ, error_desc.str ());
}
cfg->max_range = max_range;
cfg->min_angle = (min_i-384)*cfg->resolution;
cfg->max_angle = (max_i-384)*cfg->resolution;
if (verbose)
{
- fprintf (stderr, "urg_laser: I: URG-04 specifications: [min_angle, max_angle, resolution, max_range] = [%f, %f, %f, %f]\n",
+ fprintf (stderr, "urg_nz: I: URG-04 specifications: [min_angle, max_angle, resolution, max_range] = [%f, %f, %f, %f]\n",
cfg->min_angle, cfg->max_angle, cfg->resolution, cfg->max_range);
}
tcflush (fileno(laser_port), TCIFLUSH);
@@ -816,7 +816,7 @@
tcflush (fileno (laser_port), TCIFLUSH);
stringstream error_desc;
error_desc << "Error reading command result: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
int i = 0;
ReadUntil_nthOccurence (file, 2, (char)0xa);
@@ -871,14 +871,14 @@
if (verbose)
{
- fprintf (stderr, "urg_laser: I: URG-04 specifications: [min_angle, max_angle, resolution, max_range] = [%f, %f, %f, %f]\n",
+ fprintf (stderr, "urg_nz: I: URG-04 specifications: [min_angle, max_angle, resolution, max_range] = [%f, %f, %f, %f]\n",
cfg->min_angle, cfg->max_angle, cfg->resolution, cfg->max_range);
}
}
}
///////////////////////////////////////////////////////////////////////////////
-int urg_laser::GetSCIPVersion (void)
+int urg_nz::GetSCIPVersion (void)
{
unsigned char buffer [18];
memset (buffer, 0, 18);
@@ -910,7 +910,7 @@
{
stringstream error_desc;
error_desc << "Error reading after VV command. Answer: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
// Set SCIP version 2 and return
@@ -932,7 +932,7 @@
{
stringstream error_desc;
error_desc << "FIRM: is not where it is supposed to be: " << buffer;
- throw urg_exception (URG_ERR_PROTOCOL, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_PROTOCOL, error_desc.str ());
}
// Read the firmware version major value
@@ -940,7 +940,7 @@
buffer[1] = 0;
int firmware = atol ((const char*)buffer);
if (verbose)
- fprintf (stderr, "urg_laser: I: Firmware major version is %d\n", firmware);
+ fprintf (stderr, "urg_nz: I: Firmware major version is %d\n", firmware);
ReadUntil_nthOccurence (file, 4, (char)0xa);
if (firmware < 3)
@@ -987,5 +987,5 @@
// Shouldn't get here
stringstream error_desc;
error_desc << "Unknown SCIP version";
- throw urg_exception (URG_ERR_SCIPVERSION, error_desc.str ());
+ throw urg_nz_exception (URG_ERR_SCIPVERSION, error_desc.str ());
}
Modified: gearbox/trunk/src/urg_nz/urg_laser.dox
===================================================================
--- gearbox/trunk/src/urg_nz/urg_laser.dox 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/urg_laser.dox 2008-02-08 06:06:57 UTC (rev 45)
@@ -4,10 +4,10 @@
@ingroup gbx_hardware
@ingroup gbx_c
@ingroup gbx_linux
-@defgroup gbx_library_urglaser liburglaser
+@defgroup gbx_library_urg_nz liburg_nz
@brief Hokuyo URG laser scanner driver.
-For a full list of functions and classes see @ref urglaser.
+For a full list of functions and classes see @ref urg_nz.
Header file:
@verbatim
@@ -38,10 +38,10 @@
*/
/*!
-@namespace urglaser
+@namespace urg_nz
@brief URG laser scanner driver name space.
This namespace is part of a library which provides a driver for the URG laser scanner driver.
-@see @ref gbx_library_urglaser
+@see @ref gbx_library_urg_nz
*/
Modified: gearbox/trunk/src/urg_nz/urg_laser.h
===================================================================
--- gearbox/trunk/src/urg_nz/urg_laser.h 2008-02-08 05:48:23 UTC (rev 44)
+++ gearbox/trunk/src/urg_nz/urg_laser.h 2008-02-08 06:06:57 UTC (rev 45)
@@ -8,11 +8,11 @@
#include <string>
-/** @ingroup gbx_library_urglaser
+/** @ingroup gbx_library_urg_nz
@{
*/
-namespace urglaser
+namespace urg_nz
{
/** The maximum number of readings the laser is capable of returning. */
@@ -49,7 +49,7 @@
const unsigned int URG_ERR_LASERERROR = 14;
/** @brief Range readings from a URG laser scanner. */
-typedef struct urg_laser_readings
+typedef struct urg_nz_laser_readings
{
/** Array of range readings in millimetres. Values less than 20 indicate no return in the scan
(i.e. there was nothing detected within the laser range). */
@@ -57,7 +57,7 @@
} urg_laser_readings_t;
/** @brief URG laser scanner configuration information. */
-typedef struct urg_laser_config
+typedef struct urg_nz_laser_config
{
/** Start angle the laser is capable of scanning from (inclusive), in radians.*/
float min_angle;
@@ -70,7 +70,7 @@
} urg_laser_config_t;
/** @brief URG error class. */
-class urg_exception
+class urg_nz_exception
{
public:
/** @brief URG error constructor.
@@ -94,15 +94,15 @@
To use a serial connection, ensure that you do not also have a USB cable connected, as this will
force the scanner into USB mode, preventing the serial connection from functioning correctly.
-All functions may throw instances of @ref urg_exception. */
-class urg_laser
+All functions may throw instances of @ref urg_nz_exception. */
+class urg_nz
{
public:
/** @brief Constructor for URG laser scanner class. */
- urg_laser (void);
+ urg_nz (void);
/** @brief Destructor for URG laser scanner class. */
- ~urg_laser (void);
+ ~urg_nz (void);
/** @internal Read from the specified file descriptor until a specified number of bytes is received.
@@ -170,7 +170,7 @@
@param min_i The minimum scan index to retrieve. Must be at least 0. Default is 0.
@param max_i The maximum scan index to retrieve. Must be no greater than @ref MAX_READINGS. Default is @ref MAX_READINGS.
@return The number of range readings read. */
- unsigned int GetReadings (urg_laser_readings_t *readings, unsigned int min_i = 0, unsigned int max_i = MAX_READINGS);
+ unsigned int GetReadings (urg_nz_laser_readings_t *readings, unsigned int min_i = 0, unsigned int max_i = MAX_READINGS);
/** @brief Get the laser scanner identification information.
@@ -180,7 +180,7 @@
/** @brief Get the laser scanner configuration (resolution, scan angles, etc.)
@param cfg Pointer to a @ref urg_laser_config_t structure to store the configuration in. */
- void GetSensorConfig (urg_laser_config_t *cfg);
+ void GetSensorConfig (urg_nz_laser_config_t *cfg);
/** @brief Get the protocol version used by the connected laser scanner.
@@ -208,6 +208,6 @@
int poll_timeout;
};
-}; // namespace urglaser
+}; // namespace urg_nz
/** @} */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:48:20
|
Revision: 44
http://gearbox.svn.sourceforge.net/gearbox/?rev=44&view=rev
Author: russo2503v
Date: 2008-02-07 21:48:23 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
added news item about our first lib
Modified Paths:
--------------
gearbox/trunk/doc/index.dox
Modified: gearbox/trunk/doc/index.dox
===================================================================
--- gearbox/trunk/doc/index.dox 2008-02-08 05:43:38 UTC (rev 43)
+++ gearbox/trunk/doc/index.dox 2008-02-08 05:48:23 UTC (rev 44)
@@ -45,5 +45,6 @@
@section gbx_doc_index_news News
+- 08-Feb-08 Accepted the first library: a driver for the URG laser.
- 01-Feb-08 Project created. @ref gbx_doc_announce "A half-page announcement".
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:43:35
|
Revision: 43
http://gearbox.svn.sourceforge.net/gearbox/?rev=43&view=rev
Author: russo2503v
Date: 2008-02-07 21:43:38 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/submitted/CMakeLists.txt
Modified: gearbox/trunk/submitted/CMakeLists.txt
===================================================================
--- gearbox/trunk/submitted/CMakeLists.txt 2008-02-08 05:43:05 UTC (rev 42)
+++ gearbox/trunk/submitted/CMakeLists.txt 2008-02-08 05:43:38 UTC (rev 43)
@@ -10,5 +10,4 @@
# When adding new directories, please maintain order of inter-dependencies.
# Otherwise, maintain alphabetical order.
- ADD_SUBDIRECTORY ( urglaser )
ENDIF ( GBX_BUILD_SUBMITTED )
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:43:12
|
Revision: 42
http://gearbox.svn.sourceforge.net/gearbox/?rev=42&view=rev
Author: russo2503v
Date: 2008-02-07 21:43:05 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
moved and renamed urg_laser after acceptance
Removed Paths:
-------------
gearbox/trunk/submitted/urglaser/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:42:52
|
Revision: 41
http://gearbox.svn.sourceforge.net/gearbox/?rev=41&view=rev
Author: russo2503v
Date: 2008-02-07 21:42:57 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
moved and renamed urg_laser after acceptance
Modified Paths:
--------------
gearbox/trunk/src/CMakeLists.txt
Added Paths:
-----------
gearbox/trunk/src/urg_nz/
Modified: gearbox/trunk/src/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/CMakeLists.txt 2008-02-08 05:37:19 UTC (rev 40)
+++ gearbox/trunk/src/CMakeLists.txt 2008-02-08 05:42:57 UTC (rev 41)
@@ -6,4 +6,5 @@
# Otherwise, maintain alphabetical order.
ADD_SUBDIRECTORY ( basicexample )
-ADD_SUBDIRECTORY ( gbxadvancedexample )
\ No newline at end of file
+ADD_SUBDIRECTORY ( gbxadvancedexample )
+ADD_SUBDIRECTORY ( urg_nz )
Copied: gearbox/trunk/src/urg_nz (from rev 33, gearbox/trunk/submitted/urglaser)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:37:14
|
Revision: 40
http://gearbox.svn.sourceforge.net/gearbox/?rev=40&view=rev
Author: russo2503v
Date: 2008-02-07 21:37:19 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/doc/devguide.dox
gearbox/trunk/doc/principles.dox
Added Paths:
-----------
gearbox/trunk/doc/practices.dox
Removed Paths:
-------------
gearbox/trunk/doc/lifecycle.dox
Modified: gearbox/trunk/doc/devguide.dox
===================================================================
--- gearbox/trunk/doc/devguide.dox 2008-02-08 05:17:55 UTC (rev 39)
+++ gearbox/trunk/doc/devguide.dox 2008-02-08 05:37:19 UTC (rev 40)
@@ -18,6 +18,7 @@
@section gbx_doc_devguide_process Procedures for Running the Project
-- @ref gbx_doc_lifecycle
+- @ref gbx_doc_principles
+- @ref gbx_doc_practices
*/
Deleted: gearbox/trunk/doc/lifecycle.dox
===================================================================
--- gearbox/trunk/doc/lifecycle.dox 2008-02-08 05:17:55 UTC (rev 39)
+++ gearbox/trunk/doc/lifecycle.dox 2008-02-08 05:37:19 UTC (rev 40)
@@ -1,87 +0,0 @@
-/*
- * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
- * http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
- *
- * This distribution is licensed to you under the terms described in
- * the LICENSE file included in this distribution.
- *
- */
-
-/*!
-
-@page gbx_doc_lifecycle Source Code Life Cycle in GearBox
-
-We hope that this project will attract a diverse group of developers. If this happens we think that a clear set of written down rules would help to avoid misunderstandings.
-
-@section gbx_doc_lifecycle_fsm Life of Code as a State Machine
-
-@image html gbx_src_life_cycle.png
-
-Notes on common 'events':
-- @ref gbx_doc_lifecycle_submit
-- @ref gbx_doc_lifecycle_review
-- @ref gbx_doc_lifecycle_maintain
-- @ref gbx_doc_lifecycle_retire
-
-@section gbx_doc_lifecycle_submit Submission
-
-Send an email to the @e gearbox-devel mailing list describing the code you would like to submit. The more information the better but keep in mind that only 3 criteria will be used to make the acceptance decision at this point. The code must be
-- relevant to robotics (therefore you should describe what the code is supposed to do)
-- choose an open-source license
-- state the copyright owner
-
-Other information you may want to include:
-- A brief history of the code. E.g. was it written for a particular project? has it been used much?
-- Implementation overview. E.g. programming language, OS requirements, main dependencies.
-- Possible hardware requirements.
-
-@par Common Scenarios
-
-- I'd like to submit a mapping algorithm which depends on ACE, Boost,
-Qt, Xerces, and all of Gnome
- - accept for review.
-
-- I'd like to submit a laser driver which is implemented as 167 files in
-23 directories
- - accept for review as a single directory with 23 subdirectories.
-
-- I'd like to submit a tracing library which could be useful in robotics
- - reject because not specific to robotics and other similar ones exist.
-
-- I'd like to submit a sonar driver with a tracing library and a serial
-library which the driver uses
- - accept for review as a single directory with 2 subdirectories on the grounds that the general usefulness of the
-utility libs by themselves is not obvious.
-
-- I'd like to submit a Pioneer driver which uses the same serial library
-as my earlier sonar driver
- - accept for review, if accepted promote the serial library to the top level of 'src' (reward multiple submissions).
-
-- I'd like to submit yet another SICK laser driver which uses the
-tracing library supplied with the sonar driver above
- - accept for review, if accepted work with the sonar driver developer in promoting the tracing library to the top level of 'src'.
-
-- I'd like to submit a patch which swaps ACE threads for boost threads in the sonar driver above
- - as with all other patches, defer the decision to the copyright holder, i.e. the original developer.
-
-- I'd like to submit an ACE-threaded behavior-based architecture
- - Borderline submission due to potentially overly-broad scope and
-framework aspects. Discuss on the mailing list regarding the scope of
-the library and query the submitter for more information on their
-intentions for the library before choosing to accept for submission or
-reject.
-
-@section gbx_doc_lifecycle_review Review and Acceptance
-
-TBD
-
-@section gbx_doc_lifecycle_maintain Maintanence
-
-TBD
-
-@section gbx_doc_lifecycle_retire Retirement
-
-TBD
-
-*/
Added: gearbox/trunk/doc/practices.dox
===================================================================
--- gearbox/trunk/doc/practices.dox (rev 0)
+++ gearbox/trunk/doc/practices.dox 2008-02-08 05:37:19 UTC (rev 40)
@@ -0,0 +1,83 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2008 GearBox Team
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+/*!
+
+@page gbx_doc_practices Guide to Common Practices
+
+Project rules are described in @ref gbx_doc_principles_operation "Principles of Project Operation". Questions may still arise on how to apply these rules in practice. We'll update these notes as the project matures and we figure out what works well and what doesn't.
+
+Notes on common life cycle 'events':
+- @ref gbx_doc_practices_submit
+- @ref gbx_doc_practices_review
+- @ref gbx_doc_practices_maintain
+- @ref gbx_doc_practices_retire
+
+@section gbx_doc_practices_submit Submission
+
+Send an email to the @e gearbox-devel mailing list describing the code you would like to submit. The more information the better but keep in mind that only 3 criteria will be used to make the acceptance decision at this point. The code must be
+- relevant to robotics (therefore you should describe what the code is supposed to do)
+- choose an open-source license
+- state the copyright owner
+
+Other information you may want to include:
+- A brief history of the code. E.g. was it written for a particular project? has it been used much?
+- Implementation overview. E.g. programming language, OS requirements, main dependencies.
+- Possible hardware requirements.
+
+@par Common Scenarios
+
+- I'd like to submit a mapping algorithm which depends on ACE, Boost,
+Qt, Xerces, and all of Gnome
+ - accept for review.
+
+- I'd like to submit a laser driver which is implemented as 167 files in
+23 directories
+ - accept for review as a single directory with 23 subdirectories.
+
+- I'd like to submit a tracing library which could be useful in robotics
+ - reject because not specific to robotics and other similar ones exist.
+
+- I'd like to submit a sonar driver with a tracing library and a serial
+library which the driver uses
+ - accept for review as a single directory with 2 subdirectories on the grounds that the general usefulness of the
+utility libs by themselves is not obvious.
+
+- I'd like to submit a Pioneer driver which uses the same serial library
+as my earlier sonar driver
+ - accept for review, if accepted promote the serial library to the top level of 'src' (reward multiple submissions).
+
+- I'd like to submit yet another SICK laser driver which uses the
+tracing library supplied with the sonar driver above
+ - accept for review, if accepted work with the sonar driver developer in promoting the tracing library to the top level of 'src'.
+
+- I'd like to submit a patch which swaps ACE threads for boost threads in the sonar driver above
+ - as with all other patches, defer the decision to the copyright holder, i.e. the original developer.
+
+- I'd like to submit an ACE-threaded behavior-based architecture
+ - Borderline submission due to potentially overly-broad scope and
+framework aspects. Discuss on the mailing list regarding the scope of
+the library and query the submitter for more information on their
+intentions for the library before choosing to accept for submission or
+reject.
+
+@section gbx_doc_practices_review Review and Acceptance
+
+TBD
+
+@section gbx_doc_practices_maintain Maintanence
+
+TBD
+
+@section gbx_doc_practices_retire Retirement
+
+TBD
+
+*/
Modified: gearbox/trunk/doc/principles.dox
===================================================================
--- gearbox/trunk/doc/principles.dox 2008-02-08 05:17:55 UTC (rev 39)
+++ gearbox/trunk/doc/principles.dox 2008-02-08 05:37:19 UTC (rev 40)
@@ -12,6 +12,10 @@
@page gbx_doc_principles Principles of Project Operation
+We hope that this project will attract a diverse group of developers. If this happens we think that a clear set of written down rules would help to avoid misunderstandings.
+
+The rules on the pages are brief. We also maintain a page with @ref gbx_doc_practices "more practical instructions and a guide to common practices".
+
@section gbx_doc_principles_toc Table of contents
- @ref gbx_doc_principles_tools
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:17:50
|
Revision: 39
http://gearbox.svn.sourceforge.net/gearbox/?rev=39&view=rev
Author: russo2503v
Date: 2008-02-07 21:17:55 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
added marketing slogan to the copyright statement
Modified Paths:
--------------
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
Modified: gearbox/trunk/src/basicexample/defs.h
===================================================================
--- gearbox/trunk/src/basicexample/defs.h 2008-02-08 05:17:21 UTC (rev 38)
+++ gearbox/trunk/src/basicexample/defs.h 2008-02-08 05:17:55 UTC (rev 39)
@@ -1,5 +1,5 @@
/*
- * Gearbox Project
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 Gearbox team
*
Modified: gearbox/trunk/src/basicexample/util.cpp
===================================================================
--- gearbox/trunk/src/basicexample/util.cpp 2008-02-08 05:17:21 UTC (rev 38)
+++ gearbox/trunk/src/basicexample/util.cpp 2008-02-08 05:17:55 UTC (rev 39)
@@ -1,5 +1,5 @@
/*
- * Gearbox Project
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 Gearbox team
*
Modified: gearbox/trunk/src/basicexample/util.h
===================================================================
--- gearbox/trunk/src/basicexample/util.h 2008-02-08 05:17:21 UTC (rev 38)
+++ gearbox/trunk/src/basicexample/util.h 2008-02-08 05:17:55 UTC (rev 39)
@@ -1,5 +1,5 @@
/*
- * Gearbox Project
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 Gearbox team
*
Modified: gearbox/trunk/src/gbxadvancedexample/util.cpp
===================================================================
--- gearbox/trunk/src/gbxadvancedexample/util.cpp 2008-02-08 05:17:21 UTC (rev 38)
+++ gearbox/trunk/src/gbxadvancedexample/util.cpp 2008-02-08 05:17:55 UTC (rev 39)
@@ -1,5 +1,5 @@
/*
- * Gearbox Project
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 Gearbox team
*
Modified: gearbox/trunk/src/gbxadvancedexample/util.h
===================================================================
--- gearbox/trunk/src/gbxadvancedexample/util.h 2008-02-08 05:17:21 UTC (rev 38)
+++ gearbox/trunk/src/gbxadvancedexample/util.h 2008-02-08 05:17:55 UTC (rev 39)
@@ -1,5 +1,5 @@
/*
- * Gearbox Project
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 Gearbox team
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-02-08 05:17:21
|
Revision: 38
http://gearbox.svn.sourceforge.net/gearbox/?rev=38&view=rev
Author: russo2503v
Date: 2008-02-07 21:17:21 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/doc/index.dox
gearbox/trunk/doc/overview.dox
gearbox/trunk/doc/principles.dox
Removed Paths:
-------------
gearbox/trunk/doc/constitution.dox
gearbox/trunk/doc/license.dox
Deleted: gearbox/trunk/doc/constitution.dox
===================================================================
--- gearbox/trunk/doc/constitution.dox 2008-02-08 05:00:18 UTC (rev 37)
+++ gearbox/trunk/doc/constitution.dox 2008-02-08 05:17:21 UTC (rev 38)
@@ -1,104 +0,0 @@
-/*
- * GearBox Project: Components for robotics
- * http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
- *
- * This copy of GearBox is licensed to you under the terms described in the
- * the LICENSE file included in this distribution.
- *
- */
-
-/*!
-
-@page gbx_doc_constitution GearBox Constitution
-
-1. TECHNICAL CHOICES RELATED TO PROJECT SETUP
-- build system: [CMake]
-- revision control system: [svn]
-- unit test system: [CTest]
-- documentation: [Doxygen]
-- hosting service: [SorceForge]
-- bug tracking: [Trac]
-- name [Gearbox]
-
-2. CONSTRAINTS ON PROJECT OPERATION
-
-2.1 Source code life cycle
-@image html gbx_src_life_cycle.png
-
-2.2.1 Criteria for acceptance into sandbox
-- relevance: [Any reusable software related to robotics. Emphasis on
-algorithm and driver implementations. Integration frameworks are
-generally discouraged. Relevance of a particular library is determined
-through mailing list discussion.]
-- license [must specify *an* open source license]
-- copyright [must specify ownership]
-
-2.2.2 Criteria for acceptance into distribution
-- documentation [sufficient to be useful, depends on the complexity of
-software, determined by peer review (at least 1 reviewer) and a public
-discussion on the mailing list.]
-- tests and sample code [sufficient to be useful, depends on software,
-determined by peer review.]
-- programming style [must name a known style, or describe a style (see
-Appendix A), and adhere to it]
-- compilation [must compile without warnings (with -Wall) on all
-supported platforms with all supported compilers.
-- operation [Libraries must operate (within reason) as described by the
-documentation. Reviewers of hardware drivers are encouraged to have
-access to hardware where feasible.]
-
-2.2.3 Criteria for a warning
-- all of 2.2.2 [failure of any in 2.2.2]
-
-2.2.4 Criteria for disabling
-- compilation [fails to compile on any one of the supported
-platforms/complilers (as specified by the library developer) or does not
-gracefully handle one of the platforms/compilers specified as supported
-by Gearbox but not supported by that library - will be disabled
-immediatly in SVN and in any following releases until fixed]
-
-2.2.5 Criteria for retirement from the distribution
-- compilation [fails for 2 months since disabling to compile on any one
-of the supported platforms/complilers (as specified by the library
-developer) or does not gracefully handle one of the platforms/compilers
-specified as supported by Gearbox but not supported by that library -
-will be moved to graveyard at the end of the 2nd month]
-- other in 2.2.2 [failure of any in 2.2.2 for 3 months since warning]
-
-2.3 Release of source code
-[Regular frequent releases every 1.5-3 months.]
-
-2.4 Ownership of source code
-[Copyright belongs to authors and major contributors]
-
-3. FREEDOMS
-[
-Aside from complying with Sec.2, the designer of every module within the
-project is not constrained in any way. We specifically mention several
-important freedoms:
-- OS, compiler, programming language. New contributor's responsibility
-is to make sure that the new addition does not break the existing code.
-- code design, e.g. whether or not to use C++ exceptions.
-- dependencies
-- data types used by libraries
-]
-
-A. Programming Style
-
-In the case of not using a well-known, named style, contributors must
-describe the programming style in sufficient detail for others to be
-able to adhere to it (assuming, of course, that others are also capable
-of looking at the code for details). An example of what is necessary for
-C++ is given below.
-
-- Naming conventions:
- - variables, member variables, classes, structs, namespaces
- - functions, member functions
- - #defines, enums
- - filenames
- - API usage style
-- Units and coordinate systems, if applicable (needless to say that the
-units and CS's of the API must be documented separately, this applies to
-the code itself.)
-*/
Modified: gearbox/trunk/doc/index.dox
===================================================================
--- gearbox/trunk/doc/index.dox 2008-02-08 05:00:18 UTC (rev 37)
+++ gearbox/trunk/doc/index.dox 2008-02-08 05:17:21 UTC (rev 38)
@@ -37,7 +37,7 @@
@section gbx_doc_index_more_info Where to start
- Read general information about the project: @ref gbx_doc_overview
-- Read on how the project operates: @ref gbx_doc_principles
+- See how the project operates: @ref gbx_doc_principles
- Get set up: @ref gbx_doc_getting
- Browse through the <strong><a href="modules.html" style="text-decoration:none">currently available software</a></strong><br>
Deleted: gearbox/trunk/doc/license.dox
===================================================================
--- gearbox/trunk/doc/license.dox 2008-02-08 05:00:18 UTC (rev 37)
+++ gearbox/trunk/doc/license.dox 2008-02-08 05:17:21 UTC (rev 38)
@@ -1,39 +0,0 @@
-/*
- * GearBox Project: Components for robotics
- * http://gearbox.sf.net/
- * Copyright (c) 2008 GearBox Team
- *
- * This copy of GearBox is licensed to you under the terms described in the
- * the LICENSE file included in this distribution.
- *
- */
-
-/*!
-
-@page gbx_doc_license GearBox License and Copyright
-
-@section gbx_doc_license_license License
-
-The GearBox project does not, as a policy, require code to conform to any
-specific license to be included in the distribution. However, the code is required
-to have a license and the license must be Open Source. That is the official policy.
-
-For a complete up-to-date list of licenses see the @b LICENSE file included in your distribution.
-
-Generally speaking, most of the code in the GearBox libraries and components is covered under the <a href="http://www.fsf.org/copyleft/lgpl.html" target="_blank">Library GNU Public License (LGPL)</a> as defined by the Free Software Foundation (FSF). Most of the remaining code is licensed under the <a href="http://www.fsf.org/copyleft/gpl.html" target="_blank">GNU Public License (GPL)</a>, also defined by the FSF.
-
-The LGPL (as opposed to the GPL) is used whenever possible to allow commercial enterprises to build closed-source products using GearBox technology.
-
-@section gbx_doc_license_copyright Copyright
-
-Copyright belongs to developers and major contributors. The copyright is recorded in a comment block at the top of every source file. We would like to leave it up to the current copyright holders to distinguish between "major" and "minor" contributions.
-
-Here's how it works. The creators of newly-added code put their names as copyright holders. Major contributions by other people are acknowledged by the current copyright holders by adding new names.
-
-In other words:
-- if you are not on the list: don't add yourself.
-- if you are on the list: be nice to others.
-
-It seems fair.
-
-*/
Modified: gearbox/trunk/doc/overview.dox
===================================================================
--- gearbox/trunk/doc/overview.dox 2008-02-08 05:00:18 UTC (rev 37)
+++ gearbox/trunk/doc/overview.dox 2008-02-08 05:17:21 UTC (rev 38)
@@ -1,5 +1,5 @@
/*
- * GearBox Project: Components for robotics
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 GearBox Team
*
@@ -14,22 +14,28 @@
@par Goals
-Insert from new documents.
+Provide software tools which could be integrated into complete systems with one of many software integration frameworks.
-@ref gbx_doc_principles
+@par Licence
-@par Licence and Copyright
+The GearBox project does not, as a policy, require code to conform to any
+specific license to be included in the distribution. However, the code is required
+to have a license and the license must be Open Source. That is the official policy.
-- GearBox software is released under open source licenses. For a complete up-to-date list of licenses see the @b LICENSE file included in your distribution.
-- Copyright belongs to developers and major contributors.
-- @ref gbx_doc_license "Read more..."
+For a complete up-to-date list of licenses see the @b LICENSE file included in your distribution.
+@par Copyright
+
+Copyright belongs to developers and major contributors. The copyright is recorded in a comment block at the top of every source file.
+
+@par Complete Description of Rules
+
+For a complete set of project rules see @ref gbx_doc_principles
+
@par OS support
-- full Linux support
+In principle GearBox can be deployed as widely as CMake allows. For a detailed list of OS support see the list of <strong><a href="modules.html" style="text-decoration:none">currently available software</a></strong>.
-In principle GearBox can be deployed as widely as CMake allows.
-
@par History
Insert once history is available.
Modified: gearbox/trunk/doc/principles.dox
===================================================================
--- gearbox/trunk/doc/principles.dox 2008-02-08 05:00:18 UTC (rev 37)
+++ gearbox/trunk/doc/principles.dox 2008-02-08 05:17:21 UTC (rev 38)
@@ -137,7 +137,7 @@
@subsection gbx_doc_principles_operation_ownership 2.3 Ownership of source code
-Copyright belongs to authors and major contributors.
+Copyright belongs to authors and major contributors. The copyright is recorded in a comment block at the top of every source file. It is up to the current copyright holders to distinguish between "major" and "minor" contributions.
@section gbx_doc_principles_freedoms 3. Freedoms
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|