lasertransform.h
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2000 Brian Gerkey & Kasper Stoy
* gerkey@usc.edu kaspers@robotics.usc.edu
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
//
// Desc: Base class for laser transformations (i.e. cspace etc)
// Author: Andrew Howard
// Date: 1 Sep 2002
// CVS: $Id: lasertransform.h 8003 2009-07-13 10:34:37Z thjc $
//
// Theory of operation -
//
// Requires - Laser device.
//
#include <errno.h>
#include <string.h>
#include <math.h>
#include <stdlib.h> // for atoi(3)
#if !defined (WIN32)
#include <unistd.h>
#endif
#include <libplayercore/playercore.h>
// Driver for computing the free c-space from a laser scan.
class LaserTransform : public Driver
{
// Constructor
public: LaserTransform( ConfigFile* cf, int section);
// MessageHandler
public: virtual int ProcessMessage(QueuePointer & resp_queue,
player_msghdr * hdr,
void * data);
// Setup/shutdown routines.
public: virtual int Setup();
public: virtual int Shutdown();
protected:
// Process laser data. Returns non-zero if the laser data has been
// updated.
virtual int UpdateLaser(player_laser_data_t * data) = 0;
// Process requests. Returns 1 if the configuration has changed.
int HandleRequests();
// Handle geometry requests.
void HandleGetGeom(void *client, void *req, int reqlen);
// Laser stuff.
Device *laser_device;
player_devaddr_t laser_addr;
struct timeval laser_timestamp;
// Fiducila stuff (the data we generate).
player_laser_data_t data;
struct timeval time;
};
ConfigFile
Class for loading configuration file information.
Definition: configfile.h:196
player_msghdr
Generic message header.
Definition: player.h:157
LaserTransform::ProcessMessage
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: lasertransform.cc:86
player_devaddr
A device address.
Definition: player.h:141
Device
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:74
QueuePointer
An autopointer for the message queue.
Definition: message.h:73
Driver
Base class for all drivers.
Definition: driver.h:108
LaserTransform::Setup
virtual int Setup()
Initialize the driver.
Definition: lasertransform.cc:52
LaserTransform
Definition: lasertransform.h:47
player_laser_data
Data: scan (PLAYER_LASER_DATA_SCAN)
Definition: player_interfaces.h:886
LaserTransform::Shutdown
virtual int Shutdown()
Finalize the driver.
Definition: lasertransform.cc:76

Last updated 12 September 2005 21:38:45