Revision: 8450
http://playerstage.svn.sourceforge.net/playerstage/?rev=8450&view=rev
Author: gbiggs
Date: 2009-12-05 15:31:59 +0000 (Sat, 05 Dec 2009)
Log Message:
-----------
Fixes for compiling on Windows, part 1
Modified Paths:
--------------
code/player/trunk/server/drivers/dio/blobtodio/blobtodio.cc
code/player/trunk/server/drivers/localization/amcl/map/map.h
code/player/trunk/server/drivers/map/gridmap.cc
code/player/trunk/server/drivers/map/gridmap.h
code/player/trunk/server/drivers/shell/cmdsplitter.cc
code/player/trunk/server/drivers/shell/readlog.cc
Modified: code/player/trunk/server/drivers/dio/blobtodio/blobtodio.cc
===================================================================
--- code/player/trunk/server/drivers/dio/blobtodio/blobtodio.cc 2009-12-05
11:06:08 UTC (rev 8449)
+++ code/player/trunk/server/drivers/dio/blobtodio/blobtodio.cc 2009-12-05
15:31:59 UTC (rev 8450)
@@ -86,6 +86,10 @@
#include <assert.h>
#include <libplayercore/playercore.h>
+#if defined (WIN32)
+ #define snprintf _snprintf
+#endif
+
class BlobToDio : public Driver
{
public: BlobToDio(ConfigFile * cf, int section);
Modified: code/player/trunk/server/drivers/localization/amcl/map/map.h
===================================================================
--- code/player/trunk/server/drivers/localization/amcl/map/map.h
2009-12-05 11:06:08 UTC (rev 8449)
+++ code/player/trunk/server/drivers/localization/amcl/map/map.h
2009-12-05 15:31:59 UTC (rev 8450)
@@ -77,7 +77,7 @@
// Map dimensions (number of cells)
int size_x, size_y;
- int8_t data_range;
+ unsigned char data_range;
// The map data, stored as a grid
map_cell_t *cells;
Modified: code/player/trunk/server/drivers/map/gridmap.cc
===================================================================
--- code/player/trunk/server/drivers/map/gridmap.cc 2009-12-05 11:06:08 UTC
(rev 8449)
+++ code/player/trunk/server/drivers/map/gridmap.cc 2009-12-05 15:31:59 UTC
(rev 8450)
@@ -246,7 +246,7 @@
// fill the map data with free space
// reasons for this are some good obstacle avoidance always there
// can't bear to say all the world is unknown
- for(uint i=0;i<this->map.width*this->map.height;i++)
+ for(unsigned int i=0;i<this->map.width*this->map.height;i++)
this->published_map.data[i]=-1;
// Open the position interface
@@ -326,7 +326,7 @@
this->sonar_geom = *(player_sonar_geom_t*) msg->GetPayload();
// calculate the distance from the sonar to the center of the robot (in
pixels).
sonar_dist=(int *)malloc(sonar_geom.poses_count*sizeof(int));
- for(uint s;s<this->sonar_geom.poses_count;s++)
+ for(unsigned int s=0;s<this->sonar_geom.poses_count;s++)
this->sonar_dist[s]=(int)(sqrt(pow(this->sonar_geom.poses[s].px,2) +
pow(this->sonar_geom.poses[s].py,2)) /
this->map_info.scale);
@@ -387,8 +387,8 @@
published_map.col = 0;
published_map.row = 0;
published_map.data_count = this->map.data_count;
- for(uint i=0;i<this->map.width;i++) {
- for (uint j=0;j<this->map.height;j++){
+ for(unsigned int i=0;i<this->map.width;i++) {
+ for (unsigned int j=0;j<this->map.height;j++){
MAP_POINT x(i,j);
if(this->map_data.find(x) != this->map_data.end()){
if (map_data[x].P > this->map_treshold)
published_map.data[i+this->map.width*j]=1;
@@ -421,7 +421,7 @@
/// don't overwrite the map if the robot stands still
if (odom->vel.px == 0 && odom->vel.py == 0 && odom->vel.pa == 0) return(0);
- uint s,x,y;
+ unsigned int s,x,y;
int px,py,r,o;
float th_sonar;
// compute r * tan(alfa/2), where alfa is the sonar angular aperture
Modified: code/player/trunk/server/drivers/map/gridmap.h
===================================================================
--- code/player/trunk/server/drivers/map/gridmap.h 2009-12-05 11:06:08 UTC
(rev 8449)
+++ code/player/trunk/server/drivers/map/gridmap.h 2009-12-05 15:31:59 UTC
(rev 8450)
@@ -1,7 +1,9 @@
// objects definitions
-#include <unistd.h>
+#if !defined(WIN32)
+ #include <unistd.h>
+ #include <netinet/in.h>
+#endif
#include <string.h>
-#include <netinet/in.h>
#include <math.h>
#include <libplayercore/playercore.h>
#include <iostream>
@@ -136,7 +138,7 @@
height=800;
startx=0;
starty=0;
-scale=0.028;
+scale=0.028f;
sonar_treshold=4.5;
}
Modified: code/player/trunk/server/drivers/shell/cmdsplitter.cc
===================================================================
--- code/player/trunk/server/drivers/shell/cmdsplitter.cc 2009-12-05
11:06:08 UTC (rev 8449)
+++ code/player/trunk/server/drivers/shell/cmdsplitter.cc 2009-12-05
15:31:59 UTC (rev 8450)
@@ -82,6 +82,10 @@
#define RQ_QUEUE_LEN 10
#define MAX_DEVICES 16
+#if defined (WIN32)
+ #define snprintf _snprintf
+#endif
+
class CmdSplitter : public Driver
{
public: CmdSplitter(ConfigFile * cf, int section);
Modified: code/player/trunk/server/drivers/shell/readlog.cc
===================================================================
--- code/player/trunk/server/drivers/shell/readlog.cc 2009-12-05 11:06:08 UTC
(rev 8449)
+++ code/player/trunk/server/drivers/shell/readlog.cc 2009-12-05 15:31:59 UTC
(rev 8450)
@@ -1477,7 +1477,7 @@
PLAYER_ERROR2("incomplete line at %s:%d", this->filename, linenum);
return -1;
}
- player_blobfinder_blob_t blob[blob_count];
+ player_blobfinder_blob_t *blob = new player_blobfinder_blob_t[blob_count];
for (i = 0; i < blob_count; i++)
{
@@ -1496,6 +1496,7 @@
size = sizeof(data) - sizeof(data.blobs) + blob_count *
sizeof(data.blobs[0]);
this->Publish(id,type,subtype, (void*) &data, size, &time);
+ delete[] blob;
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit