Update of /cvsroot/playerstage/code/player/server/drivers/planner/wavefront
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27174/server/drivers/planner/wavefront
Modified Files:
Tag: release-2-0-patches
Makefile.am plan.c
Log Message:
merged driver changes from HEAD
Index: plan.c
===================================================================
RCS file:
/cvsroot/playerstage/code/player/server/drivers/planner/wavefront/plan.c,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -C2 -d -r1.21 -r1.21.2.1
*** plan.c 28 Mar 2006 19:00:15 -0000 1.21
--- plan.c 24 Apr 2007 22:20:20 -0000 1.21.2.1
***************
*** 37,40 ****
--- 37,44 ----
#endif
+ #if 0
+ void draw_cspace(plan_t* plan, const char* fname);
+ #endif
+
// Create a planner
plan_t *plan_alloc(double abs_min_radius, double des_min_radius,
***************
*** 246,249 ****
--- 250,309 ----
#if 0
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+
+ void
+ draw_cspace(plan_t* plan, const char* fname)
+ {
+ GdkPixbuf* pixbuf;
+ GError* error = NULL;
+ guchar* pixels;
+ int p;
+ int paddr;
+ int i, j;
+
+ pixels = (guchar*)malloc(sizeof(guchar)*plan->size_x*plan->size_y*3);
+
+ p=0;
+ for(j=plan->size_y-1;j>=0;j--)
+ {
+ for(i=0;i<plan->size_x;i++,p++)
+ {
+ paddr = p * 3;
+ if(plan->cells[PLAN_INDEX(plan,i,j)].occ_state == 1)
+ {
+ pixels[paddr] = 255;
+ pixels[paddr+1] = 0;
+ pixels[paddr+2] = 0;
+ }
+ else if(plan->cells[PLAN_INDEX(plan,i,j)].occ_dist < plan->max_radius)
+ {
+ pixels[paddr] = 0;
+ pixels[paddr+1] = 0;
+ pixels[paddr+2] = 255;
+ }
+ else
+ {
+ pixels[paddr] = 255;
+ pixels[paddr+1] = 255;
+ pixels[paddr+2] = 255;
+ }
+ }
+ }
+
+ pixbuf = gdk_pixbuf_new_from_data(pixels,
+ GDK_COLORSPACE_RGB,
+ 0,8,
+ plan->size_x,
+ plan->size_y,
+ plan->size_x * 3,
+ NULL, NULL);
+
+ gdk_pixbuf_save(pixbuf,fname,"png",&error,NULL);
+ gdk_pixbuf_unref(pixbuf);
+ free(pixels);
+ }
+ #endif
+
+ #if 0
void
plan_update_cspace_dp(plan_t* plan)
***************
*** 377,380 ****
--- 437,443 ----
// Reading from the cache file worked; we're done here.
PLAYER_MSG1(2,"Successfully read c-space from file %s", cachefile);
+ #if 0
+ draw_cspace(plan,"plan_cspace.png");
+ #endif
return;
}
***************
*** 392,395 ****
--- 455,462 ----
PLAYER_MSG0(2,"Done.");
+
+ #if 0
+ draw_cspace(plan,"plan_cspace.png");
+ #endif
}
Index: Makefile.am
===================================================================
RCS file:
/cvsroot/playerstage/code/player/server/drivers/planner/wavefront/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -d -r1.9 -r1.9.2.1
*** Makefile.am 20 Jan 2006 21:26:31 -0000 1.9
--- Makefile.am 24 Apr 2007 22:20:20 -0000 1.9.2.1
***************
*** 4,8 ****
endif
! AM_CPPFLAGS = -Wall -g -I$(top_srcdir)
libwavefront_la_SOURCES = plan.c plan_plan.c plan_waypoint.c plan.h \
--- 4,8 ----
endif
! AM_CPPFLAGS = -Wall -g -I$(top_srcdir) `pkg-config --cflags gdk-pixbuf-2.0`
libwavefront_la_SOURCES = plan.c plan_plan.c plan_waypoint.c plan.h \
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit