Update of /cvsroot/playerstage/code/player/client_libs/libplayerc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6671
Modified Files:
Makefile.am playerc.h
Added Files:
dev_pointcloud3d.c
Log Message:
Added support for PointCloud3D for libplayerc.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/Makefile.am,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -d -r1.92 -r1.93
*** Makefile.am 7 Aug 2006 14:17:59 -0000 1.92
--- Makefile.am 6 Sep 2006 16:54:51 -0000 1.93
***************
*** 45,48 ****
--- 45,49 ----
dev_opaque.c \
dev_planner.c \
+ dev_pointcloud3d.c \
dev_position1d.c \
dev_position2d.c \
Index: playerc.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/playerc.h,v
retrieving revision 1.205
retrieving revision 1.206
diff -C2 -d -r1.205 -r1.206
*** playerc.h 24 Aug 2006 00:24:15 -0000 1.205
--- playerc.h 6 Sep 2006 16:54:51 -0000 1.206
***************
*** 103,106 ****
--- 103,107 ----
#define PLAYERC_RFID_MAX_TAGS PLAYER_RFID_MAX_TAGS
#define PLAYERC_RFID_MAX_GUID PLAYER_RFID_MAX_GUID
+ #define PLAYERC_POINTCLOUD3D_MAX_POINTS PLAYER_POINTCLOUD3D_MAX_POINTS
/** @} */
***************
*** 2879,2882 ****
--- 2880,2924 ----
/**************************************************************************/
/** @ingroup playerc_proxies
+ @defgroup playerc_proxy_pointcloud3d pointcloud3d
+
+ The pointcloud3d proxy provides an interface to a pointcloud3d device.
+
+ @{
+ */
+
+ /** @brief Structure describing a single 3D pointcloud element. */
+ typedef player_pointcloud3d_element_t playerc_pointcloud3d_element_t;
+
+ /** @brief pointcloud3d proxy data. */
+ typedef struct
+ {
+ /** Device info; must be at the start of all device structures. */
+ playerc_device_t info;
+
+ /** The number of 3D pointcloud elementS found. */
+ uint16_t points_count;
+
+ /** The list of 3D pointcloud elements. */
+ playerc_pointcloud3d_element_t points[PLAYERC_POINTCLOUD3D_MAX_POINTS];
+ } playerc_pointcloud3d_t;
+
+
+ /** @brief Create a pointcloud3d proxy. */
+ playerc_pointcloud3d_t *playerc_pointcloud3d_create (playerc_client_t
*client, int index);
+
+ /** @brief Destroy a pointcloud3d proxy. */
+ void playerc_pointcloud3d_destroy (playerc_pointcloud3d_t *device);
+
+ /** @brief Subscribe to the pointcloud3d device. */
+ int playerc_pointcloud3d_subscribe (playerc_pointcloud3d_t *device, int
access);
+
+ /** @brief Un-subscribe from the pointcloud3d device. */
+ int playerc_pointcloud3d_unsubscribe (playerc_pointcloud3d_t *device);
+
+ /** @} */
+ /***************************************************************************/
+
+ /**************************************************************************/
+ /** @ingroup playerc_proxies
@defgroup playerc_proxy_wsn wsn
--- NEW FILE: dev_pointcloud3d.c ---
/*
* libplayerc : a Player client library
* Copyright (C) Andrew Howard 2002-2003
* *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/***************************************************************************
* Desc: PointCloud3D device proxy
* Author: Radu Bogdan Rusu
* Date: 6 September 2006
**************************************************************************/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "playerc.h"
#include "error.h"
// Process incoming data
void playerc_pointcloud3d_putmsg (playerc_pointcloud3d_t *device,
player_msghdr_t *header,
void *data);
// Create a new pointcloud3d proxy
playerc_pointcloud3d_t *playerc_pointcloud3d_create (playerc_client_t *client,
int index)
{
playerc_pointcloud3d_t *device;
device = malloc (sizeof (playerc_pointcloud3d_t));
memset (device, 0, sizeof (playerc_pointcloud3d_t));
playerc_device_init (&device->info, client, PLAYER_POINTCLOUD3D_CODE, index,
(playerc_putmsg_fn_t) playerc_pointcloud3d_putmsg);
return device;
}
// Destroy a pointcloud3d proxy
void playerc_pointcloud3d_destroy (playerc_pointcloud3d_t *device)
{
playerc_device_term (&device->info);
free (device);
return;
}
// Subscribe to the pointcloud3d device
int playerc_pointcloud3d_subscribe (playerc_pointcloud3d_t *device, int access)
{
return playerc_device_subscribe (&device->info, access);
}
// Un-subscribe from the pointcloud3d device
int playerc_pointcloud3d_unsubscribe (playerc_pointcloud3d_t *device)
{
return playerc_device_unsubscribe (&device->info);
}
// Process incoming data
void playerc_pointcloud3d_putmsg (playerc_pointcloud3d_t *device,
player_msghdr_t *header,
void *data)
{
if((header->type == PLAYER_MSGTYPE_DATA) &&
(header->subtype == PLAYER_POINTCLOUD3D_DATA_STATE))
{
player_pointcloud3d_data_t* pc3_data =
(player_pointcloud3d_data_t*)data;
device->points_count = MIN (pc3_data->points_count,
PLAYERC_POINTCLOUD3D_MAX_POINTS);
memcpy (device->points, pc3_data->points,
sizeof (player_pointcloud3d_element_t)*device->points_count);
}
else
PLAYERC_WARN2("skipping pointcloud3d message with unknown type/subtype:
%d/%d\n",
header->type, header->subtype);
}
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit