Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Add design doc for actual_arrel_segmentationn issue #569 #602

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

FZ2000
Copy link
Contributor

@FZ2000 FZ2000 commented Nov 21, 2019

Add design doc for actual_arrel_segmentationn issue #569

Link to design document

Copy link
Contributor

@oswinso oswinso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like a bit more detail with regards to how the clustering algorithms would work.

Comment on lines 14 to 16
- Use the clustering algorithm inside PCL.
- (If necessary)Program a clustering algorithm that take in a pointcloud and returns a clustered pointcloud.
- Both clustering algorithm is based on the same general idea. You pick a point in a pointcloud and get all the point within a certain radius. Repeat the last process recursively with all the points inside the radius are processed. This finish the segmentation of a cluster. After this, you pick another point and repeat this process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should describe the actual clustering algorithm(s) that you are thinking of using a bit more.

Copy link
Contributor

@oswinso oswinso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops meant to say request changes

Copy link
Contributor

@oswinso oswinso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more small thing. Check the github render to see the formatting issues.

Comment on lines 17 to 27
'''
1. create a Kd-tree representation for the input point cloud dataset P;
2. set up an empty list of clusters C, and a queue of the points that need to be checked Q;
3. then for every point pi in P, perform the following steps:
- add pi to the current queue Q;
- for every point pi in Q do:
- search for the set P^i_k of point neighbors of pi in a sphere with radius r < dth;
- for every neighbor pki in P^k_i, check if the point has already been processed, and if not add it to Q;
when the list of all points in Q has been processed, add Q to the list of clusters C, and reset Q to an empty list
4. the algorithm terminates when all points \boldsymbol{p}_i \in P have been processed and are now part of the list of point clusters C
'''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is displaying properly in markdown.

@FZ2000 FZ2000 added the New members 👍🏻 Issues that are meant for new members label Nov 22, 2019
Copy link
Contributor

@oswinso oswinso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

Copy link
Contributor

@oswinso oswinso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant to put these changes on a different branch.

Comment on lines 1 to 44
#include <ros/ros.h>
#include <pcl/PointIndices.h>
#include <pcl/segmentation/extract_clusters.h>

ros::Publisher pub;
std::string pub_topic = "";
std::string sub_topic = "";

double clusterTolerance;
int minClusterSize;
int maxClusterSize;

void clusteringCallBack(pcl::PointCloud<pcl::PointXYZ>::Ptr pointcloud) {
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>);
tree->setInputCloud (pointcloud);

std::vector<pcl::PointIndices> cluster_indices;
pcl::EuclideanClusterExtraction<pcl::PointXYZ> ec;
ec.setClusterTolerance (clusterTolerance);
ec.setMinClusterSize (minClusterSize);
ec.setMaxClusterSize (maxClusterSize);
ec.setSearchMethod (tree);
ec.setInputCloud (pointcloud);
ec.extract (cluster_indices);

pub.publish(cluster_indices);
}

int main(int argc, char** argv)
{
ros::init(argc, argv, "week5");

ros::NodeHandle nh;

ros::NodeHandle pnh{"~"};
pnh.getParam("clusterTolerance", clusterTolerance);
pnh.getParam("minClusterSize", minClusterSize);
pnh.getParam("maxClusterSize", maxClusterSize);

pub = nh.advertise<std::vector<pcl::PointIndices>>(pub_topic, 1);
ros::Subscriber pointcloud_sub = nh.subscribe(sub_topic, 1, clusteringCallBack);

ros::spin();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes should be put in a separate branch, not this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
New members 👍🏻 Issues that are meant for new members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants