Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
laser_scan_utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
algorithms
laser_scan_utils
Commits
b5db0dbd
Commit
b5db0dbd
authored
9 years ago
by
andreucm
Browse files
Options
Downloads
Patches
Plain Diff
GridCluster class added but not yet tested
parent
71caf803
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/grid_cluster.cpp
+37
-0
37 additions, 0 deletions
src/grid_cluster.cpp
src/grid_cluster.h
+39
-0
39 additions, 0 deletions
src/grid_cluster.h
with
76 additions
and
0 deletions
src/grid_cluster.cpp
0 → 100644
+
37
−
0
View file @
b5db0dbd
#include
"grid_cluster.h"
namespace
laserscanutils
{
//init static cluster counter
unsigned
int
GridCluster
::
cluster_id_count_
=
0
;
GridCluster
::
GridCluster
()
:
PointSet
()
{
//
}
GridCluster
::~
GridCluster
()
{
//
}
void
GridCluster
::
print
()
const
{
//print cluster params
std
::
cout
<<
"
\t
cluster_id_: "
<<
cluster_id_
<<
std
::
endl
<<
"
\t
centroid_x_: "
<<
centroid_
(
0
)
<<
std
::
endl
<<
"
\t
centroid_y_: "
<<
centroid_
(
1
)
<<
std
::
endl
;
//print cluster cell index pairs
std
::
cout
<<
"
\t
cells_: "
;
for
(
unsigned
int
jj
=
0
;
jj
<
cells_
.
size
();
jj
++
)
{
std
::
cout
<<
cells_
.
at
(
jj
).
first
<<
","
<<
cells_
.
at
(
jj
).
second
<<
" - "
;
}
std
::
cout
<<
std
::
endl
;
}
}
//close namespace
This diff is collapsed.
Click to expand it.
src/grid_cluster.h
0 → 100644
+
39
−
0
View file @
b5db0dbd
#ifndef GRID_CLUSTER_H_
#define GRID_CLUSTER_H_
//laserscanutils
#include
"laser_scan_utils.h"
#include
"point_set.h"
//std
#include
<iostream>
//open namespace
namespace
laserscanutils
{
/** \brief Cluster class
*
* Cluster of connected occupied cells in a grid
*
**/
class
GridCluster
:
public
PointSet
{
protected:
unsigned
int
cluster_id_
;
//Cluster id.
static
unsigned
int
cluster_id_count_
;
//cluster counter (acts as simple ID factory)
public:
std
::
vector
<
std
::
pair
<
unsigned
int
,
unsigned
int
>
>
cells_
;
//i,j index of the grid cells of this cluster
public:
//constructor
GridCluster
();
//Destructor
~
GridCluster
();
//print
virtual
void
print
()
const
;
};
}
//namespace
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment