Skip to content

Commit a42b204

Browse files
committed
fixed up merge and changed version to 5.0
1 parent 6bb47ee commit a42b204

File tree

9 files changed

+2758
-2935
lines changed

9 files changed

+2758
-2935
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required( VERSION 2.8.7 FATAL_ERROR )
22
PROJECT(Stage)
33

4-
SET( V_MAJOR 4 )
5-
SET( V_MINOR 2 )
4+
SET( V_MAJOR 5 )
5+
SET( V_MINOR 1 )
66
SET( V_BUGFIX 1 )
77

88
SET( VERSION ${V_MAJOR}.${V_MINOR}.${V_BUGFIX} )

config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define PROJECT "@PROJECT_NAME@"
55
#define VERSION "@VERSION@"
6-
#define FULL_VERSION @V_MAJOR@@V_MINOR@@V_BUGFIX@
6+
#define FULL_VERSION @V_MAJOR@-@V_MINOR@-@V_BUGFIX@
77
#define APIVERSION "@APIVERSION@"
88
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
99
#define PLUGIN_PATH "@CMAKE_INSTALL_PREFIX@/@PROJECT_PLUGIN_DIR@"

libstage/blockgroup.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,22 @@ void BlockGroup::CalcSize()
113113

114114
void BlockGroup::Map(unsigned int layer)
115115
{
116+
static size_t count = 0;
117+
printf( "BlockGroup::Map %lu (%lu)\n", ++count, blocks.size() );
118+
116119
FOR_EACH (it, blocks)
117-
it->Map(layer);
120+
it->Map(layer);
118121
}
119122

120123
void BlockGroup::UnMap(unsigned int layer)
121124
{
125+
static size_t count = 0;
126+
printf( "BlockGroup::UnMap %lu (%lu)\n", ++count, blocks.size() );
127+
122128
FOR_EACH (it, blocks)
123129
it->UnMap(layer);
130+
131+
124132
}
125133

126134
void BlockGroup::DrawSolid(const Geom &geom)

libstage/model.cc

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ Model::Model(World *world, Model *parent, const std::string &type, const std::st
288288
gui.move = true;
289289
}
290290

291+
//static size_t count=0;
292+
//printf( "basic %lu\n", ++count );
293+
291294
// now we can add the basic square shape
292295
AddBlockRect(-0.5, -0.5, 1.0, 1.0, 1.0);
293296

@@ -376,8 +379,13 @@ void Model::LoadBlock(Worldfile *wf, int entity)
376379

377380
void Model::AddBlockRect(meters_t x, meters_t y, meters_t dx, meters_t dy, meters_t dz)
378381
{
379-
UnMap();
382+
static size_t count=0;
383+
printf( "abr %lu\n", ++count );
380384

385+
puts( "unmap start" );
386+
UnMap();
387+
puts( "unmap done" );
388+
381389
std::vector<point_t> pts(4);
382390
pts[0].x = x;
383391
pts[0].y = y;
@@ -390,7 +398,9 @@ void Model::AddBlockRect(meters_t x, meters_t y, meters_t dx, meters_t dy, meter
390398

391399
blockgroup.AppendBlock(Block(&blockgroup, pts, Bounds(0, dz)));
392400

401+
puts( "map start" );
393402
Map();
403+
puts( "map done\n" );
394404
}
395405

396406
// convert a global pose into the model's local coordinate system
@@ -639,22 +649,19 @@ void Model::AddToPose(const Pose &pose)
639649
AddToPose(pose.x, pose.y, pose.z, pose.a);
640650
}
641651

642-
bool Model::PlaceInFreeSpace(meters_t xmin, meters_t xmax, meters_t ymin, meters_t ymax,
643-
size_t max_iter)
652+
653+
bool Model::RandomPoseInFreeSpace(meters_t xmin, meters_t xmax,
654+
meters_t ymin, meters_t ymax,
655+
size_t max_iter)
644656
{
657+
SetPose(Pose::Random(xmin, xmax, ymin, ymax));
658+
645659
size_t i = 0;
646660
while (TestCollision() && (max_iter <= 0 || i++ < max_iter))
647661
SetPose(Pose::Random(xmin, xmax, ymin, ymax));
648662
return i <= max_iter; // return true if a free pose was found within max iterations
649663
}
650664

651-
bool Model::RandomPoseInFreeSpace(meters_t xmin, meters_t xmax, meters_t ymin, meters_t ymax,
652-
size_t max_iter)
653-
{
654-
SetPose(Pose::Random(xmin, xmax, ymin, ymax));
655-
return PlaceInFreeSpace(xmin, xmax, ymin, ymax, max_iter);
656-
}
657-
658665
void Model::AppendTouchingModels(std::set<Model *> &touchers)
659666
{
660667
blockgroup.AppendTouchingModels(touchers);
@@ -1363,6 +1370,8 @@ void Model::Load()
13631370

13641371
const Size size(b.x.max - b.x.min, b.y.max - b.y.min, b.z.max - b.z.min);
13651372

1373+
//static size_t count=0;
1374+
//printf( "boundaries %lu\n", ++count );
13661375
AddBlockRect(b.x.min, b.y.min, epsilon, size.y, size.z);
13671376
AddBlockRect(b.x.min, b.y.min, size.x, epsilon, size.z);
13681377
AddBlockRect(b.x.min, b.y.max - epsilon, size.x, epsilon, size.z);

libstage/model_blobfinder.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ static const unsigned int DEFAULT_BLOBFINDERSCANHEIGHT = 60;
8484
*/
8585

8686
ModelBlobfinder::ModelBlobfinder(World *world, Model *parent, const std::string &type)
87-
: Model(world, parent, type), blob_vis(world), blobs(), colors(), fov(DEFAULT_BLOBFINDERFOV),
87+
: Model(world, parent, type), vis(world), blobs(), colors(), fov(DEFAULT_BLOBFINDERFOV),
8888
pan(DEFAULT_BLOBFINDERPAN), range(DEFAULT_BLOBFINDERRANGE),
8989
scan_height(DEFAULT_BLOBFINDERSCANHEIGHT), scan_width(DEFAULT_BLOBFINDERSCANWIDTH)
9090
{
9191
PRINT_DEBUG2("Constructing ModelBlobfinder %u (%s)\n", id, type.c_str());
9292

9393
ClearBlocks();
9494

95-
AddVisualizer(&this->blob_vis, true);
95+
AddVisualizer(&this->vis, true);
9696
}
9797

9898
ModelBlobfinder::~ModelBlobfinder(void)

libstage/model_ranger.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Option ModelRanger::Vis::showFov("Ranger FOV", "show_ranger_fov", "", false, NUL
100100
// false, NULL );
101101

102102
ModelRanger::ModelRanger(World *world, Model *parent, const std::string &type)
103-
: Model(world, parent, type), ranger_vis(world)
103+
: Model(world, parent, type), vis(world)
104104
{
105105
PRINT_DEBUG2("Constructing ModelRanger %u (%s)\n", id, type.c_str());
106106

@@ -114,7 +114,7 @@ ModelRanger::ModelRanger(World *world, Model *parent, const std::string &type)
114114

115115
this->SetGeom(Geom(Pose(), RANGER_SIZE));
116116

117-
AddVisualizer(&ranger_vis, true);
117+
AddVisualizer(&vis, true);
118118
}
119119

120120
ModelRanger::~ModelRanger()

libstage/stage.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ const char *Stg::Version()
1414
return VERSION;
1515
}
1616

17-
unsigned int Stg::FullVersion()
18-
{
19-
return FULL_VERSION;
20-
}
21-
2217
void Stg::Init(int *argc, char **argv[])
2318
{
2419
PRINT_DEBUG("Stg::Init()");

0 commit comments

Comments
 (0)