Revision: 7971
http://playerstage.svn.sourceforge.net/playerstage/?rev=7971&view=rev
Author: rtv
Date: 2009-07-10 02:46:27 +0000 (Fri, 10 Jul 2009)
Log Message:
-----------
added new example, of pioneers flocking in the cave
Modified Paths:
--------------
code/stage/trunk/CMakeLists.txt
code/stage/trunk/examples/ctrl/CMakeLists.txt
code/stage/trunk/examples/ctrl/wander.cc
code/stage/trunk/libstage/model.cc
code/stage/trunk/libstage/region.cc
code/stage/trunk/libstage/region.hh
code/stage/trunk/libstage/world.cc
code/stage/trunk/worlds/SFU.world
code/stage/trunk/worlds/simple.world
Added Paths:
-----------
code/stage/trunk/examples/ctrl/pioneer_flocking.cc
code/stage/trunk/worlds/pioneer_flocking.world
Modified: code/stage/trunk/CMakeLists.txt
===================================================================
--- code/stage/trunk/CMakeLists.txt 2009-07-10 00:47:18 UTC (rev 7970)
+++ code/stage/trunk/CMakeLists.txt 2009-07-10 02:46:27 UTC (rev 7971)
@@ -35,8 +35,10 @@
IF (NOT PROJECT_OS_WIN AND NOT PROJECT_OS_SOLARIS)
# Using -Wall on Windows causes MSVC to produce thousands of warnings in
its
# own standard headers, dramatically slowing down the build.
- SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -g -Wall")
- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g -Wall")
+ #SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -g -Wall")
+ #SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g -Wall")
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
ENDIF (NOT PROJECT_OS_WIN AND NOT PROJECT_OS_SOLARIS)
ENABLE_TESTING()
Modified: code/stage/trunk/examples/ctrl/CMakeLists.txt
===================================================================
--- code/stage/trunk/examples/ctrl/CMakeLists.txt 2009-07-10 00:47:18 UTC
(rev 7970)
+++ code/stage/trunk/examples/ctrl/CMakeLists.txt 2009-07-10 02:46:27 UTC
(rev 7971)
@@ -5,6 +5,7 @@
sink
source
wander
+ pioneer_flocking
# rasterize
)
Added: code/stage/trunk/examples/ctrl/pioneer_flocking.cc
===================================================================
--- code/stage/trunk/examples/ctrl/pioneer_flocking.cc
(rev 0)
+++ code/stage/trunk/examples/ctrl/pioneer_flocking.cc 2009-07-10 02:46:27 UTC
(rev 7971)
@@ -0,0 +1,172 @@
+/////////////////////////////////
+// File: stest.c
+// Desc: Stage library test program
+// Created: 2004.9.15
+// Author: Richard Vaughan <[email protected]>
+// CVS: $Id: stest.cc,v 1.3 2008-02-01 03:11:02 rtv Exp $
+// License: GPL
+/////////////////////////////////
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "stage.hh"
+using namespace Stg;
+
+typedef struct
+{
+ ModelLaser* laser;
+ ModelPosition* position;
+ ModelRanger* ranger;
+ ModelFiducial* fiducial;
+
+ ModelFiducial::Fiducial* closest;
+ stg_radians_t closest_bearing;
+ stg_meters_t closest_range;
+ stg_radians_t closest_heading_error;
+
+} robot_t;
+
+
+const double VSPEED = 0.3; // meters per second
+const double EXPAND_WGAIN = 0.3; // turn speed gain
+const double FLOCK_WGAIN = 0.3; // turn speed gain
+const double SAFE_DIST = 1.0; // meters
+const double SAFE_ANGLE = 0.5; // radians
+
+
+// forward declare
+int RangerUpdate( ModelRanger* mod, robot_t* robot );
+int FiducialUpdate( ModelFiducial* fid, robot_t* robot );
+
+// Stage calls this when the model starts up
+extern "C" int Init( Model* mod )
+{
+ robot_t* robot = new robot_t;
+ robot->position = (ModelPosition*)mod;
+
+ // subscribe to the ranger, which we use for navigating
+ robot->ranger = (ModelRanger*)mod->GetModel( "ranger:0" );
+ assert( robot->ranger );
+ robot->ranger->Subscribe();
+
+ // ask Stage to call into our ranger update function
+ robot->ranger->AddUpdateCallback( (stg_model_callback_t)RangerUpdate, robot
);
+
+ robot->fiducial = (ModelFiducial*)mod->GetModel( "fiducial:0" ) ;
+ assert( robot->fiducial );
+ robot->fiducial->AddUpdateCallback( (stg_model_callback_t)FiducialUpdate,
robot );
+ robot->fiducial->Subscribe();
+
+ // subscribe to the laser, though we don't use it for navigating
+ //robot->laser = (ModelLaser*)mod->GetModel( "laser:0" );
+ //assert( robot->laser );
+ //robot->laser->Subscribe();
+
+ return 0; //ok
+}
+
+int RangerUpdate( ModelRanger* rgr, robot_t* robot )
+{
+ // compute the vector sum of the sonar ranges
+ double dx=0, dy=0;
+
+ // use the front-facing sensors only
+ for( unsigned int i=0; i < 8; i++ )
+ {
+ ModelRanger::Sensor& s = rgr->sensors[i];
+ dx += s.range * cos( s.pose.a );
+ dy += s.range * sin( s.pose.a );
+
+ //printf( "sensor %d angle= %.2f\n", s, rgr->sensors[s].pose.a
);
+ }
+
+ if( (dx == 0) || (dy == 0) )
+ return 0;
+
+ double resultant_angle = atan2( dy, dx );
+ double forward_speed = 0.0;
+ double side_speed = 0.0;
+ double turn_speed = EXPAND_WGAIN * resultant_angle;
+
+ //printf( "resultant %.2f turn_speed %.2f\n", resultant_angle, turn_speed );
+
+ // if the front is clear, drive forwards
+ if( (rgr->sensors[3].range > SAFE_DIST) && // forwards
+ (rgr->sensors[4].range > SAFE_DIST) &&
+ (rgr->sensors[5].range > SAFE_DIST/1.0) && //
+ (rgr->sensors[6].range > SAFE_DIST/2.0) &&
+ (rgr->sensors[2].range > SAFE_DIST/1.0) &&
+ (rgr->sensors[1].range > SAFE_DIST/2.0) &&
+ (fabs( resultant_angle ) < SAFE_ANGLE) )
+ {
+ forward_speed = VSPEED;
+
+ // and steer to match the heading of the nearest robot
+ if( robot->closest )
+ turn_speed += FLOCK_WGAIN * robot->closest_heading_error;
+ }
+
+ robot->position->SetSpeed( forward_speed, side_speed, turn_speed );
+
+ return 0;
+}
+
+
+int FiducialUpdate( ModelFiducial* fid, robot_t* robot )
+{
+ // find the closest teammate
+
+ //puts( "fiducial update" );
+
+ double dist = 1e6; // big
+
+ robot->closest = NULL;
+
+ FOR_EACH( it, fid->GetFiducials() )
+ {
+ ModelFiducial::Fiducial* other = &(*it);
+
+ if( other->range < dist )
+ {
+ dist = other->range;
+ robot->closest = other;
+ }
+ }
+
+ if( robot->closest ) // if we saw someone
+ {
+ //printf( "model %s see closest %s\n", fid->Token(),
robot->closest->mod->Token() );
+
+ robot->closest_bearing = robot->closest->bearing;
+ robot->closest_range = robot->closest->range;
+ robot->closest_heading_error = robot->closest->geom.a;
+ }
+
+// if( (dx == 0) || (dy == 0) )
+// return 0;
+
+// double resultant_angle = atan2( dy, dx );
+// double forward_speed = 0.0;
+// double side_speed = 0.0;
+// double turn_speed = WGAIN * resultant_angle;
+
+// //printf( "resultant %.2f turn_speed %.2f\n", resultant_angle, turn_speed
);
+
+// // if the front is clear, drive forwards
+// if( (rgr->sensors[3].range > SAFE_DIST) && // forwards
+// (rgr->sensors[4].range > SAFE_DIST) &&
+// (rgr->sensors[5].range > SAFE_DIST/2.0) && //
+// (rgr->sensors[6].range > SAFE_DIST/4.0) &&
+// (rgr->sensors[2].range > SAFE_DIST/2.0) &&
+// (rgr->sensors[1].range > SAFE_DIST/4.0) &&
+// (fabs( resultant_angle ) < SAFE_ANGLE) )
+// {
+// forward_speed = VSPEED;
+// }
+
+// robot->position->SetSpeed( forward_speed, side_speed, turn_speed );
+
+ return 0;
+}
Modified: code/stage/trunk/examples/ctrl/wander.cc
===================================================================
--- code/stage/trunk/examples/ctrl/wander.cc 2009-07-10 00:47:18 UTC (rev
7970)
+++ code/stage/trunk/examples/ctrl/wander.cc 2009-07-10 02:46:27 UTC (rev
7971)
@@ -4,7 +4,7 @@
const double cruisespeed = 0.4;
const double avoidspeed = 0.05;
const double avoidturn = 0.5;
-const double minfrontdistance = 0.6;
+const double minfrontdistance = 1.0; // 0.6
const bool verbose = false;
const double stopdist = 0.3;
const int avoidduration = 10;
@@ -121,11 +121,11 @@
robot->pos->SetTurnSpeed( 0 );
}
- if( robot->pos->Stalled() )
- {
- robot->pos->SetSpeed( 0,0,0 );
- robot->pos->SetTurnSpeed( 0 );
- }
+ // if( robot->pos->Stalled() )
+// {
+// robot->pos->SetSpeed( 0,0,0 );
+// robot->pos->SetTurnSpeed( 0 );
+// }
return 0;
}
Modified: code/stage/trunk/libstage/model.cc
===================================================================
--- code/stage/trunk/libstage/model.cc 2009-07-10 00:47:18 UTC (rev 7970)
+++ code/stage/trunk/libstage/model.cc 2009-07-10 02:46:27 UTC (rev 7971)
@@ -910,7 +910,6 @@
// hit another model, that model is returned.
// ConditionalMove() returns a pointer to the model we hit, or
// NULL. We use this as a boolean for SetStall()
- //SetStall( ConditionalMove( pose_sum( pose, p ) ) );
SetStall( ConditionalMove( pose + p ) );
}
Modified: code/stage/trunk/libstage/region.cc
===================================================================
--- code/stage/trunk/libstage/region.cc 2009-07-10 00:47:18 UTC (rev 7970)
+++ code/stage/trunk/libstage/region.cc 2009-07-10 02:46:27 UTC (rev 7971)
@@ -7,21 +7,31 @@
#include "region.hh"
using namespace Stg;
+// static member for accumulating empty regions for occasional garbage
+// collection
+// std::set<Region*> Region::empty_regions;
-Region::Region()
- : cells(NULL), count(0)
+Region::Region() :
+ cells( NULL ),
+ count(0)
{
- //for( int i=0; i<REGIONSIZE; i++ )
- // cells[i].region = this;
}
Region::~Region()
{
+ if( cells )
+ delete[] cells;
}
-SuperRegion::SuperRegion( World* world, stg_point_int_t origin )
- : regions(NULL), origin(origin), world(world), count(0)
+SuperRegion::SuperRegion( World* world, stg_point_int_t origin )
+ : regions( new Region[ SUPERREGIONSIZE ] ),
+ origin(origin),
+ world(world),
+ count(0)
{
+ for( int i=0; i<SUPERREGIONSIZE; i++ )
+ regions[i].superregion = this;
+
//static int srcount=0;
//printf( "created SR number %d\n", ++srcount );
// printf( "superregion at %d %d\n", origin.x, origin.y );
@@ -29,6 +39,9 @@
SuperRegion::~SuperRegion()
{
+ if( regions )
+ delete[] regions;
+
//printf( "deleting SR %p at [%d,%d]\n", this, origin.x, origin.y );
}
Modified: code/stage/trunk/libstage/region.hh
===================================================================
--- code/stage/trunk/libstage/region.hh 2009-07-10 00:47:18 UTC (rev 7970)
+++ code/stage/trunk/libstage/region.hh 2009-07-10 02:46:27 UTC (rev 7971)
@@ -13,77 +13,99 @@
namespace Stg
{
-// a bit of experimenting suggests that these values are fast. YMMV.
- const int32_t RBITS( 5 ); // regions contain (2^RBITS)^2 pixels
- const int32_t SBITS( 5 );// superregions contain (2^SBITS)^2 regions
- const int32_t SRBITS( RBITS+SBITS );
+ // a bit of experimenting suggests that these values are fast. YMMV.
+ const int32_t RBITS( 5 ); // regions contain (2^RBITS)^2 pixels
+ const int32_t SBITS( 5 );// superregions contain (2^SBITS)^2 regions
+ const int32_t SRBITS( RBITS+SBITS );
- const int32_t REGIONWIDTH( 1<<RBITS );
- const int32_t REGIONSIZE( REGIONWIDTH*REGIONWIDTH );
+ const int32_t REGIONWIDTH( 1<<RBITS );
+ const int32_t REGIONSIZE( REGIONWIDTH*REGIONWIDTH );
- const int32_t SUPERREGIONWIDTH( 1<<SBITS );
- const int32_t SUPERREGIONSIZE( SUPERREGIONWIDTH*SUPERREGIONWIDTH );
+ const int32_t SUPERREGIONWIDTH( 1<<SBITS );
+ const int32_t SUPERREGIONSIZE( SUPERREGIONWIDTH*SUPERREGIONWIDTH );
- const int32_t CELLMASK( ~((~0x00)<< RBITS ));
- const int32_t REGIONMASK( ~((~0x00)<< SRBITS ));
+ const int32_t CELLMASK( ~((~0x00)<< RBITS ));
+ const int32_t REGIONMASK( ~((~0x00)<< SRBITS ));
- inline int32_t GETCELL( const int32_t x ) { return( x & CELLMASK); }
- inline int32_t GETREG( const int32_t x ) { return( ( x & REGIONMASK )
>> RBITS); }
- inline int32_t GETSREG( const int32_t x ) { return( x >> SRBITS); }
+ inline int32_t GETCELL( const int32_t x ) { return( x & CELLMASK); }
+ inline int32_t GETREG( const int32_t x ) { return( ( x & REGIONMASK ) >>
RBITS); }
+ inline int32_t GETSREG( const int32_t x ) { return( x >> SRBITS); }
- // this is slightly faster than the inline method above, but not as safe
- //#define GETREG(X) (( (static_cast<int32_t>(X)) & REGIONMASK ) >>
RBITS)
+ // this is slightly faster than the inline method above, but not as safe
+ //#define GETREG(X) (( (static_cast<int32_t>(X)) & REGIONMASK ) >> RBITS)
-class Cell
-{
- friend class Region;
- friend class SuperRegion;
- friend class World;
- friend class Block;
+ class Cell
+ {
+ friend class Region;
+ friend class SuperRegion;
+ friend class World;
+ friend class Block;
-private:
- Region* region;
- std::vector<Block*> blocks;
- bool boundary;
+ private:
+ Region* region;
+ std::vector<Block*> blocks;
+ bool boundary;
-public:
- Cell()
- : region( NULL),
- blocks()
- {
- }
+ public:
+ Cell()
+ : region( NULL),
+ blocks()
+ {
+ }
- inline void RemoveBlock( Block* b );
- inline void AddBlock( Block* b );
- inline void AddBlockNoRecord( Block* b );
-};
+ inline void RemoveBlock( Block* b );
+ inline void AddBlock( Block* b );
+ inline void AddBlockNoRecord( Block* b );
+ };
-class Region
-{
-public:
+ class Region
+ {
+ public:
- Cell* cells;
- SuperRegion* superregion;
- unsigned long count; // number of blocks rendered into this region
+ Cell* cells;
+ SuperRegion* superregion;
+ unsigned long count; // number of blocks rendered into this region
- Region();
- ~Region();
+ Region();
+ ~Region();
+
+ Cell* GetCell( int32_t x, int32_t y )
+ {
+ if( ! cells )
+ {
+ cells = new Cell[REGIONSIZE];
+
+ for( int i=0; i<REGIONSIZE; ++i )
+ cells[i].region = this;
+ }
- // lazy allocation of memory for Cells: wait until someone asks.
- Cell* GetCell( int32_t x, int32_t y )
- {
- if( ! cells )
- {
- cells = new Cell[REGIONSIZE];
- for( int i=0; i<REGIONSIZE; ++i )
- cells[i].region = this;
- }
+ return( (Cell*)&cells[ x + y * REGIONWIDTH ] );
+ }
- return( (Cell*)&cells[ x + y * REGIONWIDTH ] );
- }
-};
-
+
+ /** Returns an initialized region, either from the top of the
+ stack, or if the stack is empty, a newly constructed Region */
+ //static Region* GetRegion( SuperRegion* superregion );
+ // static std::stack<Region*> recycled_regions;
+
+// static std::set<Region*> empty_regions;
+
+// static void GarbageCollect()
+// {
+// FOR_EACH( it, empty_regions )
+// {
+// Region* reg = *it;
+// //delete reg;
+
+// printf( "Garbage collecting region %p\n", reg );
+// }
+
+// empty_regions.clear();
+// }
+
+ };
+
class SuperRegion
{
friend class World;
@@ -100,18 +122,8 @@
SuperRegion( World* world, stg_point_int_t origin );
~SuperRegion();
- // lazy allocation of regions: wait until someone asks
Region* GetRegion( int32_t x, int32_t y )
- {
- if( ! regions )
- {
- regions = new Region[ SUPERREGIONSIZE ];
- for( int i=0; i<SUPERREGIONSIZE; i++ )
- regions[i].superregion = this;
- }
-
- return( ®ions[ x + y * SUPERREGIONWIDTH ] );
- }
+ { return( ®ions[ x + y * SUPERREGIONWIDTH ] ); }
void Draw( bool drawall );
void Floor();
@@ -120,44 +132,47 @@
};
-// inline void printvec( std::vector<Block*>& vec )
-// {
-// printf( "Vec: ");
-// for( size_t i=0; i<vec.size(); i++ )
-// printf( "%p ", vec[i] );
-// puts( "" );
-// }
+ // inline void printvec( std::vector<Block*>& vec )
+ // {
+ // printf( "Vec: ");
+ // for( size_t i=0; i<vec.size(); i++ )
+ // printf( "%p ", vec[i] );
+ // puts( "" );
+ // }
-void Cell::RemoveBlock( Block* b )
-{
- // linear time removal, but these vectors are very short, usually 1
- // or 2 elements. Fast removal - our strategy is to copy the last
- // item in the vector over the item we want to remove, then pop off
- // the tail. This avoids moving the other items in the vector. Saves
- // maybe 1 or 2% run time in my tests.
+ void Cell::RemoveBlock( Block* b )
+ {
+ // linear time removal, but these vectors are very short, usually 1
+ // or 2 elements. Fast removal - our strategy is to copy the last
+ // item in the vector over the item we want to remove, then pop off
+ // the tail. This avoids moving the other items in the vector. Saves
+ // maybe 1 or 2% run time in my tests.
- // find the value in the vector
- // printf( "\nremoving %p\n", b );
- // puts( "before" );
- // printvec( blocks );
+ // find the value in the vector
+ // printf( "\nremoving %p\n", b );
+ // puts( "before" );
+ // printvec( blocks );
- // copy the last item in the vector to overwrite this one
- copy_backward( blocks.end(), blocks.end(), std::find( blocks.begin(),
blocks.end(), b ));
- blocks.pop_back(); // and remove the redundant copy at the end of
- // the vector
+ // copy the last item in the vector to overwrite this one
+ copy_backward( blocks.end(), blocks.end(), std::find( blocks.begin(),
blocks.end(), b ));
+ blocks.pop_back(); // and remove the redundant copy at the end of
+ // the vector
- --region->count;
- --region->superregion->count;
-}
+ --region->count;
+ --region->superregion->count;
+
+// if( region->count == 0 && region->candidate_count == 0 )
+// Region::empty_regions.insert( region );
+ }
-void Cell::AddBlock( Block* b )
-{
- blocks.push_back( b );
- b->RecordRendering( this );
+ void Cell::AddBlock( Block* b )
+ {
+ blocks.push_back( b );
+ b->RecordRendering( this );
- ++region->count;
- ++region->superregion->count;
-}
+ ++region->count;
+ ++region->superregion->count;
+ }
}; // namespace Stg
Modified: code/stage/trunk/libstage/world.cc
===================================================================
--- code/stage/trunk/libstage/world.cc 2009-07-10 00:47:18 UTC (rev 7970)
+++ code/stage/trunk/libstage/world.cc 2009-07-10 02:46:27 UTC (rev 7971)
@@ -160,6 +160,9 @@
if( (*world_it)->Update() == false )
quit = false;
}
+
+ //Region::GarbageCollect();
+
return quit;
}
Modified: code/stage/trunk/worlds/SFU.world
===================================================================
--- code/stage/trunk/worlds/SFU.world 2009-07-10 00:47:18 UTC (rev 7970)
+++ code/stage/trunk/worlds/SFU.world 2009-07-10 02:46:27 UTC (rev 7971)
@@ -13,14 +13,16 @@
paused 0
-resolution 0.02
+resolution 0.1
+threads 0
+
# configure the GUI window
window
(
size [ 1460.000 1080.000 ] # in pixels
- scale 48.240
- center [ -2.827 -2.340 ]
+ scale 47.257
+ center [ -8.453 -1.884 ]
rotate [ 0 0 ]
show_data 1 # 1=on 0=off
)
@@ -29,7 +31,7 @@
floorplan
(
name "cave"
- size [1000.000 600.000 0.800]
+ size [1200.000 800.000 0.800]
pose [0 0 0 0]
bitmap "bitmaps/SFU_800x600.png"
)
@@ -37,61 +39,119 @@
define wanderer pioneer2dx
(
- sicklaser( samples 32 )
- ctrl "wander"
+ # sicklaser( samples 32 )
+ ctrl "pioneer_flocking"
# report error-free position in world coordinates
localization "gps"
localization_origin [ 0 0 0 0 ]
+
+ fiducial_return 1
+
+ fiducial()
)
-wanderer( pose [ 2.022 0.847 0 0 ] )
-wanderer( pose [ -1.986 2.410 0 108.862 ] )
-wanderer( pose [ -1.259 -0.947 0 -91.673 ] )
-wanderer( pose [ 0.572 1.794 0 105.997 ] )
-wanderer( pose [ 0.671 -1.257 0 -80.214 ] )
-wanderer( pose [ 1.765 -0.661 0 -28.648 ] )
-wanderer( pose [ -0.532 1.129 0 97.403 ] )
-wanderer( pose [ -0.178 0.170 0 -37.242 ] )
-wanderer( pose [ -0.331 2.500 0 88.809 ] )
-wanderer( pose [ -0.213 -1.215 0 -57.296 ] )
-wanderer( pose [ 0.850 0.469 0 40.107 ] )
-wanderer( pose [ -1.282 1.875 0 111.727 ] )
-wanderer( pose [ -3.071 0.661 0 171.887 ] )
-wanderer( pose [ -1.763 1.151 0 134.645 ] )
-wanderer( pose [ -1.764 -0.128 0 168.059 ] )
-wanderer( pose [ -7.432 4.684 0 -143.239 ] )
-wanderer( pose [ -10.133 5.662 0 -143.239 ] )
-wanderer( pose [ -9.307 2.231 0 -143.239 ] )
-wanderer( pose [ -7.711 2.832 0 -143.239 ] )
-wanderer( pose [ -2.653 4.491 0 -143.239 ] )
-wanderer( pose [ -3.005 -4.112 0 -143.239 ] )
-wanderer( pose [ -6.550 0.739 0 -143.239 ] )
-wanderer( pose [ -5.203 -4.361 0 -143.239 ] )
-wanderer( pose [ -11.732 0.511 0 -143.239 ] )
-wanderer( pose [ -10.696 -3.511 0 -143.239 ] )
-wanderer( pose [ -8.271 -3.386 0 -143.239 ] )
-wanderer( pose [ -5.182 -1.873 0 -143.239 ] )
-wanderer( pose [ -9.494 0.531 0 -143.239 ] )
-wanderer( pose [ -6.384 3.040 0 -143.239 ] )
-wanderer( pose [ -4.208 -0.132 0 -143.239 ] )
-wanderer( pose [ -10.447 2.397 0 -143.239 ] )
-wanderer( pose [ -9.017 3.910 0 -143.239 ] )
-wanderer( pose [ -6.218 3.931 0 -143.239 ] )
-wanderer( pose [ -5.182 2.750 0 -143.239 ] )
-wanderer( pose [ -7.939 1.029 0 -143.239 ] )
-wanderer( pose [ -6.695 -2.350 0 -143.239 ] )
-wanderer( pose [ -5.513 -0.692 0 -143.239 ] )
-wanderer( pose [ -4.664 1.527 0 -143.239 ] )
-wanderer( pose [ -8.851 5.818 0 -143.239 ] )
-wanderer( pose [ -5.493 5.320 0 -143.239 ] )
-wanderer( pose [ -4.829 4.449 0 -143.239 ] )
-wanderer( pose [ -3.627 3.268 0 -143.239 ] )
-wanderer( pose [ -12.106 4.056 0 -143.239 ] )
+#wanderer( pose [ 2.022 0.847 0 0 ] )
+#wanderer( pose [ -2.029 2.564 0 101.347 ] )
+#wanderer( pose [ -1.260 -1.107 0 -89.324 ] )
+#wanderer( pose [ 0.542 1.951 0 95.795 ] )
+#wanderer( pose [ 0.671 -1.257 0 -80.214 ] )
+#wanderer( pose [ 1.765 -0.661 0 -28.648 ] )
+#wanderer( pose [ -0.540 1.289 0 91.137 ] )
+#wanderer( pose [ -0.049 0.075 0 -37.638 ] )
+#wanderer( pose [ -0.324 2.660 0 85.587 ] )
+
+#wanderer( pose [ -0.138 -1.356 0 -66.311 ] )
+#wanderer( pose [ 0.970 0.575 0 44.546 ] )
+#wanderer( pose [ -1.322 2.029 0 96.175 ] )
+#wanderer( pose [ -3.228 0.692 0 166.404 ] )
+#wanderer( pose [ -1.879 1.261 0 141.300 ] )
+#wanderer( pose [ -1.922 -0.104 0 176.194 ] )
+#wanderer( pose [ -7.563 4.592 0 -146.872 ] )
+#wanderer( pose [ -10.264 5.570 0 -147.413 ] )
+#wanderer( pose [ -9.433 2.132 0 -139.527 ] )
+#wanderer( pose [ -7.841 2.739 0 -145.215 ] )
+
+#wanderer( pose [ -2.778 4.391 0 -140.419 ] )
+#wanderer( pose [ -3.131 -4.211 0 -140.043 ] )
+#wanderer( pose [ -6.677 0.642 0 -141.801 ] )
+#wanderer( pose [ -5.326 -4.463 0 -137.171 ] )
+#wanderer( pose [ -11.732 0.511 0 -143.239 ] )
+#wanderer( pose [ -10.696 -3.511 0 -143.239 ] )
+#wanderer( pose [ -8.397 -3.485 0 -140.344 ] )
+#wanderer( pose [ -5.313 -1.965 0 -146.396 ] )
+#wanderer( pose [ -9.624 0.438 0 -146.026 ] )
+#wanderer( pose [ -6.510 2.942 0 -141.717 ] )
+
+wanderer( pose [ -4.340 -0.222 0 -148.224 ] )
+wanderer( pose [ -10.576 2.302 0 -143.326 ] )
+wanderer( pose [ -9.152 3.825 0 -152.238 ] )
+wanderer( pose [ -6.356 3.850 0 -155.549 ] )
+wanderer( pose [ -5.305 2.648 0 -136.004 ] )
+wanderer( pose [ -8.066 0.931 0 -140.706 ] )
+wanderer( pose [ -6.822 -2.447 0 -142.029 ] )
+wanderer( pose [ -5.641 -0.789 0 -142.822 ] )
+wanderer( pose [ -4.793 1.432 0 -143.669 ] )
+wanderer( pose [ -8.982 5.726 0 -146.570 ] )
+
+wanderer( pose [ -5.623 5.227 0 -145.996 ] )
+wanderer( pose [ -4.959 4.356 0 -148.010 ] )
+wanderer( pose [ -3.749 3.165 0 -135.787 ] )
+wanderer( pose [ -12.237 3.965 0 -147.875 ] )
wanderer( pose [ -12.085 1.796 0 -143.239 ] )
-wanderer( pose [ -10.219 -0.857 0 -143.239 ] )
-wanderer( pose [ -8.934 -1.749 0 -143.239 ] )
-wanderer( pose [ -6.861 -4.527 0 -143.239 ] )
+wanderer( pose [ -10.349 -0.951 0 -146.498 ] )
+wanderer( pose [ -9.060 -1.847 0 -140.903 ] )
+wanderer( pose [ -6.988 -4.625 0 -141.330 ] )
wanderer( pose [ -11.235 -1.832 0 -143.239 ] )
-wanderer( pose [ -4.477 -3.200 0 -143.239 ] )
-wanderer( pose [ -7.027 -0.795 0 -143.239 ] )
+wanderer( pose [ -4.604 -3.297 0 -141.690 ] )
+
+wanderer( pose [ -12.677 1.194 0 -143.239 ] )
+wanderer( pose [ -13.185 2.612 0 -143.239 ] )
+wanderer( pose [ -8.720 -0.541 0 -143.239 ] )
+wanderer( pose [ -8.043 -1.409 0 -143.239 ] )
+wanderer( pose [ -6.625 -1.514 0 -143.239 ] )
+wanderer( pose [ -7.662 -0.393 0 -143.239 ] )
+wanderer( pose [ -6.456 -0.202 0 -143.239 ] )
+wanderer( pose [ -7.217 1.829 0 -143.239 ] )
+wanderer( pose [ -8.487 1.638 0 -143.239 ] )
+
+wanderer( pose [ -9.482 1.236 0 -143.239 ] )
+wanderer( pose [ -7.450 -1.959 0 -143.239 ] )
+wanderer( pose [ -8.445 -2.636 0 -143.239 ] )
+wanderer( pose [ -9.799 -2.234 0 -143.239 ] )
+wanderer( pose [ -9.164 -3.186 0 -143.239 ] )
+wanderer( pose [ -9.312 -4.117 0 -143.239 ] )
+wanderer( pose [ -8.212 -4.287 0 -143.239 ] )
+wanderer( pose [ -7.429 -3.440 0 -143.239 ] )
+wanderer( pose [ -6.159 -3.609 0 -143.239 ] )
+
+wanderer( pose [ -7.302 0.157 0 -143.239 ] )
+wanderer( pose [ -4.530 -1.261 0 -143.239 ] )
+wanderer( pose [ -5.017 0.094 0 -143.239 ] )
+wanderer( pose [ -5.673 0.475 0 -143.239 ] )
+wanderer( pose [ -5.990 1.533 0 -143.239 ] )
+wanderer( pose [ -8.529 2.845 0 -143.239 ] )
+wanderer( pose [ -3.451 -1.641 0 -143.239 ] )
+wanderer( pose [ -10.349 -0.202 0 -143.239 ] )
+wanderer( pose [ -1.716 -3.144 0 -143.239 ] )
+
+wanderer( pose [ -2.562 -2.297 0 -143.239 ] )
+wanderer( pose [ -2.901 -0.583 0 -143.239 ] )
+wanderer( pose [ -4.107 0.813 0 -143.239 ] )
+wanderer( pose [ -6.371 2.146 0 -143.239 ] )
+wanderer( pose [ -7.577 3.755 0 -143.239 ] )
+wanderer( pose [ -11.598 2.929 0 -143.239 ] )
+wanderer( pose [ -8.699 -5.895 0 -143.239 ] )
+wanderer( pose [ -7.154 -6.530 0 -143.239 ] )
+wanderer( pose [ -5.736 -5.768 0 -143.239 ] )
+
+wanderer( pose [ -5.080 -5.239 0 -143.239 ] )
+wanderer( pose [ -4.340 -4.858 0 -143.239 ] )
+wanderer( pose [ -3.705 2.104 0 -143.239 ] )
+wanderer( pose [ -6.858 5.045 0 -143.239 ] )
+wanderer( pose [ -7.577 5.405 0 -143.239 ] )
+wanderer( pose [ -12.381 -0.562 0 -143.239 ] )
+wanderer( pose [ -9.757 3.077 0 -143.239 ] )
+wanderer( pose [ -10.116 4.114 0 -143.239 ] )
+wanderer( pose [ -5.927 -2.424 0 -143.239 ] )
+
Added: code/stage/trunk/worlds/pioneer_flocking.world
===================================================================
--- code/stage/trunk/worlds/pioneer_flocking.world
(rev 0)
+++ code/stage/trunk/worlds/pioneer_flocking.world 2009-07-10 02:46:27 UTC
(rev 7971)
@@ -0,0 +1,116 @@
+# simple.world - basic world file example
+# Authors: Richard Vaughan
+# $Id$
+
+include "pioneer.inc"
+include "map.inc"
+
+interval_sim 100 # simulation timestep in milliseconds
+interval_real 0 # real-time interval between simulation updates in
milliseconds
+
+paused 1
+
+resolution 0.1
+
+threads 0
+
+# configure the GUI window
+window
+(
+ size [ 1460.000 1080.000 ] # in pixels
+ scale 20.739
+ center [ -19.764 -9.624 ]
+ rotate [ 0 0 ]
+ show_data 1 # 1=on 0=off
+)
+
+# load an environment bitmap
+floorplan
+(
+ name "cave"
+ size [100.000 100.000 0.800]
+ pose [0 0 0 0]
+ bitmap "bitmaps/cave.png"
+)
+
+
+define flocker pioneer2dx
+(
+ color "random"
+ ctrl "pioneer_flocking"
+ fiducial_return 1
+ fiducial()
+)
+
+flocker( pose [ -18.646 -12.227 0 -136.345 ] )
+flocker( pose [ -18.397 -5.955 0 -154.426 ] )
+flocker( pose [ -23.906 -3.211 0 -154.678 ] )
+flocker( pose [ -23.827 -5.305 0 -154.646 ] )
+flocker( pose [ -20.134 -9.244 0 -138.746 ] )
+flocker( pose [ -17.917 -9.963 0 -136.113 ] )
+flocker( pose [ -21.435 -15.234 0 -132.914 ] )
+flocker( pose [ -19.855 -12.715 0 -135.463 ] )
+flocker( pose [ -19.469 -10.461 0 -138.243 ] )
+flocker( pose [ -26.846 -3.327 0 -154.674 ] )
+
+flocker( pose [ -22.825 -3.908 0 -154.605 ] )
+flocker( pose [ -22.463 -5.101 0 -154.629 ] )
+flocker( pose [ -18.861 -9.188 0 -139.232 ] )
+flocker( pose [ -20.792 -4.837 0 -154.426 ] )
+flocker( pose [ -19.744 -4.459 0 -154.226 ] )
+flocker( pose [ -22.129 -7.352 0 -154.226 ] )
+flocker( pose [ -17.200 -14.489 0 -132.929 ] )
+flocker( pose [ -21.850 -18.011 0 -131.557 ] )
+flocker( pose [ -17.337 -8.332 0 -155.150 ] )
+flocker( pose [ -19.748 -16.394 0 -132.939 ] )
+
+flocker( pose [ -19.851 -7.926 0 -155.150 ] )
+flocker( pose [ -20.464 -2.005 0 -154.226 ] )
+flocker( pose [ -16.959 -12.029 0 -133.737 ] )
+flocker( pose [ -22.534 -13.689 0 -134.865 ] )
+flocker( pose [ -20.836 -13.700 0 -134.554 ] )
+flocker( pose [ -22.786 -12.838 0 -135.578 ] )
+flocker( pose [ -21.336 -12.912 0 -135.257 ] )
+flocker( pose [ -22.677 -10.354 0 -136.964 ] )
+flocker( pose [ -16.068 -8.815 0 -136.583 ] )
+
+flocker( pose [ -17.060 -6.404 0 -154.672 ] )
+flocker( pose [ -21.984 -14.563 0 -133.736 ] )
+flocker( pose [ -23.005 -15.561 0 -131.990 ] )
+flocker( pose [ -18.483 -16.627 0 -131.557 ] )
+flocker( pose [ -20.194 -17.434 0 -130.896 ] )
+flocker( pose [ -22.073 -18.880 0 -130.234 ] )
+flocker( pose [ -22.955 -17.797 0 -130.896 ] )
+flocker( pose [ -22.193 -16.477 0 -130.999 ] )
+flocker( pose [ -21.201 -16.658 0 -131.981 ] )
+
+flocker( pose [ -22.150 -11.625 0 -136.304 ] )
+flocker( pose [ -19.741 -14.084 0 -134.388 ] )
+flocker( pose [ -19.012 -11.350 0 -137.587 ] )
+flocker( pose [ -20.621 -11.627 0 -136.086 ] )
+flocker( pose [ -21.192 -10.543 0 -136.824 ] )
+flocker( pose [ -19.974 -6.462 0 -154.674 ] )
+flocker( pose [ -18.840 -14.444 0 -135.746 ] )
+flocker( pose [ -21.592 -8.399 0 -154.440 ] )
+flocker( pose [ -17.260 -15.767 0 -136.384 ] )
+
+flocker( pose [ -18.032 -15.005 0 -136.073 ] )
+flocker( pose [ -17.922 -13.236 0 -136.053 ] )
+flocker( pose [ -17.439 -10.890 0 -138.105 ] )
+flocker( pose [ -21.522 -9.479 0 -137.228 ] )
+flocker( pose [ -22.011 -6.227 0 -154.674 ] )
+flocker( pose [ -17.704 -7.628 0 -154.426 ] )
+flocker( pose [ -23.065 -19.673 0 -129.572 ] )
+flocker( pose [ -21.749 -20.197 0 -130.234 ] )
+flocker( pose [ -20.475 -19.283 0 -130.896 ] )
+
+flocker( pose [ -19.304 -18.401 0 -131.531 ] )
+flocker( pose [ -18.125 -17.701 0 -132.118 ] )
+flocker( pose [ -16.510 -9.846 0 -138.239 ] )
+flocker( pose [ -24.567 -4.276 0 -154.660 ] )
+flocker( pose [ -25.200 -3.645 0 -154.674 ] )
+flocker( pose [ -23.179 -8.708 0 -156.108 ] )
+flocker( pose [ -20.921 -3.183 0 -154.678 ] )
+flocker( pose [ -25.495 -2.252 0 -154.629 ] )
+flocker( pose [ -20.682 -15.283 0 -133.299 ] )
+
Modified: code/stage/trunk/worlds/simple.world
===================================================================
--- code/stage/trunk/worlds/simple.world 2009-07-10 00:47:18 UTC (rev
7970)
+++ code/stage/trunk/worlds/simple.world 2009-07-10 02:46:27 UTC (rev
7971)
@@ -46,6 +46,7 @@
# can refer to the robot by this name
name "r0"
pose [ -7 -7 0 45 ]
+
sicklaser()
ctrl "wander"
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit