|
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.
|