Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
e3924a2
create laser subscriber (example, does not work)
PetervDooren Oct 29, 2021
ed2d937
Create table_modeler.cpp
PetervDooren Oct 29, 2021
f1c62a1
Update CMakeLists.txt
PetervDooren Oct 29, 2021
0abc6a1
Start work on loading files, library not working yet
ThijsBeurskensTUE Nov 1, 2021
c6be97f
Fix target linking to pcl
PetervDooren Nov 5, 2021
d2c3d1b
Implement registration algorithm
ThijsBeurskensTUE Nov 15, 2021
d17ffa1
implement transformation matrix, json file not loaded
ThijsBeurskensTUE Nov 18, 2021
c32c1a1
Read out json start
PetervDooren Nov 18, 2021
feb29c7
apply rotation matrix WIP
ThijsBeurskensTUE Nov 19, 2021
9164ad8
Finish rotation matrix
ThijsBeurskensTUE Nov 20, 2021
84ce079
Implement temporary fix rotation matrix, start on segmentation
ThijsBeurskensTUE Nov 22, 2021
af77594
transform from geolib camera pose to ros camera pose
PetervDooren Nov 22, 2021
447f15c
Finish segmentation
ThijsBeurskensTUE Nov 26, 2021
caa3168
Merge remote-tracking branch 'origin/thijs' into thijs
ThijsBeurskensTUE Nov 26, 2021
4491ba1
Remove temporary fix
ThijsBeurskensTUE Nov 26, 2021
5fd99bc
Implement concave hull & table height
ThijsBeurskensTUE Dec 6, 2021
061a443
Implement rectangle sac model
ThijsBeurskensTUE Dec 17, 2021
4d05c2e
rectangle fix
ThijsBeurskensTUE Dec 20, 2021
0879a04
implement double line sac model
ThijsBeurskensTUE Dec 20, 2021
f63aca0
fix distance function in rectangle
ThijsBeurskensTUE Dec 20, 2021
3979409
Implement circle sac model
ThijsBeurskensTUE Dec 23, 2021
0605825
Rewrite height estimation
ThijsBeurskensTUE Dec 30, 2021
0345518
Add options to disable parts of the program
ThijsBeurskensTUE Jan 17, 2022
5a20ea1
initial_commit
Pepijn-Hundepool Apr 28, 2022
5b80acc
hoi
Pepijn-Hundepool Apr 28, 2022
012dba2
horiontal plane attempt
Pepijn-Hundepool May 3, 2022
0dc643b
Nieuwste versie
Pepijn-Hundepool May 17, 2022
618831c
Filter update
Pepijn-Hundepool May 23, 2022
52ef4df
Code before costmap
Pepijn-Hundepool Jun 10, 2022
e08696f
added empty_spot_designator files
PetervDooren Jun 10, 2022
6792251
add dilation
PetervDooren Jun 10, 2022
af5a212
add docstrings for some functions
PetervDooren Aug 15, 2022
042bcac
add remaining contracts
PetervDooren Aug 15, 2022
0cae812
indent tab to spaces
PetervDooren Aug 15, 2022
9c3cd45
comments and formatting
PetervDooren Aug 15, 2022
9e66acd
remove unused rectangle model
PetervDooren Aug 16, 2022
a2be25d
Merge branch 'master' into thijs
PetervDooren Aug 16, 2022
950e8d9
small cleanup of sac model
PetervDooren Aug 16, 2022
a388058
fix indents
PetervDooren Aug 16, 2022
50eb12a
updat docstring of sac models
PetervDooren Aug 16, 2022
81aaf5c
cleanup commented code
PetervDooren Aug 16, 2022
ce99405
fix semicolon
PetervDooren Aug 16, 2022
e6bf91d
cleanup sac models
PetervDooren Aug 16, 2022
019c27e
Merge branch 'BEP_Pepijn' into thijs
PetervDooren Aug 18, 2022
a5e9c3f
made empty_spot_visualizer live
PetervDooren Aug 18, 2022
4ee5226
added segmentation
PetervDooren Aug 20, 2022
68732a5
add_saving of costmap
PetervDooren Aug 22, 2022
ad9e901
fix coordinate system of costmap creation
PetervDooren Aug 22, 2022
22413af
optimise cluster selection
PetervDooren Aug 22, 2022
3ed3ad4
move esd to tools
PetervDooren Sep 12, 2022
905237e
fix world to map y
PetervDooren Sep 12, 2022
9ca1cf2
add pure plane segmentation
PetervDooren Sep 12, 2022
58a24cd
remove deprecated code
PetervDooren Oct 3, 2022
deb1cf5
fix pointer bug
PetervDooren Oct 7, 2022
419bb7e
test
MaxVroonhoven Nov 14, 2022
6a5fcac
test2
MaxVroonhoven Nov 15, 2022
6a97cd6
reverting tests
MaxVroonhoven Nov 15, 2022
2d7b3b4
local test
MaxVroonhoven Nov 15, 2022
dc69636
remove table modeler
MaxVroonhoven Nov 15, 2022
8a248b2
Added objects to bitmap
MaxVroonhoven Nov 17, 2022
4700bca
Occluded space added to bitmap
MaxVroonhoven Nov 18, 2022
21c2033
Added FOV and not table to bitmap
MaxVroonhoven Nov 24, 2022
39d81f9
Added preferred distance + Point extraction
MaxVroonhoven Dec 5, 2022
8d1f004
Placement point costmap
MaxVroonhoven Dec 7, 2022
ce480ad
Initial test on HERO
MaxVroonhoven Dec 8, 2022
e510f15
refactor segmentplane
PetervDooren Dec 9, 2022
c46b68d
Fixed Bug + Added placement radius
MaxVroonhoven Dec 15, 2022
c13e09b
Placement costmap improved
MaxVroonhoven Jan 12, 2023
89792a0
Experiment
MaxVroonhoven Jan 12, 2023
8b538df
Latest Experiment
MaxVroonhoven Jan 17, 2023
87bce74
Improved object filtering
MaxVroonhoven Mar 7, 2023
1f34b82
Use morphological operations instead of PCL data
MaxVroonhoven Mar 21, 2023
2c6e4d3
add service PlaceArea
PetervDooren Apr 1, 2023
a448fd6
Re-introducing additional PCL data
MaxVroonhoven Apr 1, 2023
03ec4b8
add place area class
PetervDooren Apr 1, 2023
3ae3ea2
move implementation to new class
PetervDooren Apr 1, 2023
d88b1f0
remove global variable
PetervDooren Apr 1, 2023
74c81b9
get placement pose
PetervDooren Apr 1, 2023
6e6696e
return from findarea
PetervDooren Apr 1, 2023
9adbd34
implement service
PetervDooren Apr 1, 2023
1f046b1
expand emptyspotdesignator tool
PetervDooren Apr 1, 2023
1d19b63
fill result of service
PetervDooren Apr 1, 2023
bfeac69
add fov test
PetervDooren Apr 1, 2023
94e71c9
DRY
PetervDooren Apr 1, 2023
2b0ecea
fix focal lenght
PetervDooren Apr 1, 2023
f4a4496
add comments and output
PetervDooren Apr 1, 2023
4562a0e
debugging
PetervDooren Apr 1, 2023
16cef6a
Merge branch 'master' into thijs
PetervDooren Apr 7, 2023
9c5500e
fix image buffer import
PetervDooren Apr 7, 2023
5e38ce1
fix unused parameter warnings
PetervDooren Apr 7, 2023
3c52d99
fixed sign comparison warning
PetervDooren Apr 7, 2023
17ef6e5
mark req as unused parameter for now
PetervDooren Apr 7, 2023
e310862
add docstring
PetervDooren Apr 7, 2023
ce69312
newline at eof
PetervDooren Apr 7, 2023
633d15e
Dilating per colour basis (not finished)
MaxVroonhoven Apr 27, 2023
6b58a00
fix faulty merge
MaxVroonhoven Apr 27, 2023
fbb6fe1
Remove morphological implementation + fix comments
MaxVroonhoven Apr 30, 2023
d93ef33
Add dilated/placement canvas for introspection
MaxVroonhoven May 16, 2023
8718828
spacing
PetervDooren Jul 17, 2023
305acab
cleanup functions
PetervDooren Jul 19, 2023
6ca8038
add annotated image functionality (still need to draw the right things)
PetervDooren Jul 19, 2023
b44fd37
annotate plane, objects and not table
PetervDooren Jul 20, 2023
c2fe8c6
fix segfault (i think)
PetervDooren Jul 20, 2023
e9ff555
Merge branch 'master' into thijs
PetervDooren Jul 20, 2023
2b80af5
add marker publishers
PetervDooren Jul 20, 2023
90f2cb1
draw place pose on canvas
PetervDooren Jul 20, 2023
f948868
toggle visualization
PetervDooren Jul 20, 2023
269d14e
Yolov8 for image segmentation
Dyan367 Oct 19, 2023
f115703
add yolo to listener
PetervDooren Oct 19, 2023
ff08f4d
move model into class
PetervDooren Oct 19, 2023
ca39649
changed model from XL to M
PetervDooren Oct 19, 2023
6dc0ca9
converts image to correct colour channel
PetervDooren Oct 19, 2023
256ba86
changed model from M to N
PetervDooren Oct 19, 2023
2ac18d9
added filter for noise onto image
PetervDooren Oct 19, 2023
8a9ead8
removed colour channel change
PetervDooren Oct 19, 2023
817ae80
renamed python script and added cpp script for mapping mask onto image
Dyan367 Dec 7, 2023
6414516
renamed segmentor to segmentation
Dyan367 Dec 7, 2023
7f3050a
added queue size to publisher function
Dyan367 Dec 7, 2023
5ab5970
added queue size to publisher function to listener.py
Dyan367 Dec 7, 2023
1b312e7
changed queue_size =10
Dyan367 Dec 7, 2023
1382032
renamed listener to yolo_table_segmentor, changed from cpu to gpu
Dyan367 Dec 7, 2023
e17fe83
mistake made, assign model to 'cuda' not 'gpu'
Dyan367 Dec 7, 2023
7dd6eee
converted colour channel from BGR to RGB
Dyan367 Dec 7, 2023
86a0ff4
export only mask as binary image
Dyan367 Dec 7, 2023
d78fc5f
export only mask using passthrough instead of mono8
Dyan367 Dec 7, 2023
fae31d3
changed from nano model to large model of yolo
Dyan367 Dec 7, 2023
53e76fa
edited cmakelists for mask_mapper.cpp
Dyan367 Dec 7, 2023
922c0c0
reverted changes to cmakelists
Dyan367 Dec 7, 2023
46452be
swap from rgb image topic to rgbd image topic
Dyan367 Dec 7, 2023
0f1eab4
reverted topic change
Dyan367 Dec 7, 2023
348cb31
empty_sport_visualizer node now subs to hero/segmented_image and can …
Dyan367 Dec 11, 2023
84db852
Merge remote-tracking branch 'origin/master' into thijs
MatthijsBurgh Dec 11, 2023
ae8fb39
find common z depth
Dyan367 Dec 17, 2023
9862a02
paint contour of depth data
Dyan367 Dec 18, 2023
eb18b48
filtered annotated image using segmentation mask
Dyan367 Dec 23, 2023
37b37de
successfully mapped mask into rgbd image using setRGBImage(mask)
Dyan367 Dec 24, 2023
5068594
successfully filtered point cloud using segmentation mask from yolo
Dyan367 Dec 24, 2023
8b0e8fd
perform planar segmentation then filter cloud afterwards so correct h…
Dyan367 Dec 24, 2023
3a1e3d7
Cleaned up code, removed unused functions, added extra arguement to s…
Dyan367 Dec 26, 2023
2013883
final changes, extractMaskFilter needed to be inverted
Dyan367 Jan 8, 2024
4d03dad
using nano model for yolo
Dyan367 Jan 16, 2024
5ef89fd
using XL model for yolo
Dyan367 Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class PlaceAreaFinder

//--------------------------------------------------------------------------------------------------------------------------------------
cv::Point2d canvasToWorld2(double u, double v);
void drawContourAndTransformToWorld(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud, cv::Scalar color,float height);
void CreateAndVisConvexHull(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud,float height,pcl::PointCloud<pcl::PointXYZRGB>::Ptr& world_points);
void extractMaskPoints(pcl::PointCloud<pcl::PointXYZRGB>::Ptr inputCloud);
//--------------------------------------------------------------------------------------------------------------------------------------

Expand Down
34 changes: 19 additions & 15 deletions ed_sensor_integration/src/kinect/place_area_finder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <pcl/filters/filter.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/conditional_removal.h>
#include <pcl/filters/statistical_outlier_removal.h>

#include <pcl/features/normal_3d.h>

Expand Down Expand Up @@ -101,7 +102,7 @@ double imageToMaskFilteredCloud(const rgbd::Image &image, pcl::PointCloud<pcl::P
for (uint j = 0; j < cloud->width; ++j)
{
cv::Vec3b bgr = image.getRGBImage().at<cv::Vec3b>(i, j);
if (bgr[0]==255 || bgr[1]==255 || bgr[2]==225)
if (bgr[0]==255 && bgr[2]==225)
{
double d = image.getDepthImage().at<float>(i, j);

Expand Down Expand Up @@ -381,7 +382,6 @@ pcl::Indices multiplyIndex(pcl::Indices indexBA, pcl::Indices indexCB)
}



PlaceAreaFinder::PlaceAreaFinder()
{
}
Expand All @@ -396,9 +396,11 @@ bool PlaceAreaFinder::findArea(const rgbd::ImageConstPtr &image, geo::Pose3D sen
// std::cout << "converting image to cloud" << std::endl;
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
imageToCloud(*image, cloud);

// convert image to cloud and filter using cnn segmentation mask
//imageToMaskFilteredCloud(*image,cloud)

// if(donal){
// imageToMaskFilteredCloud(*image,cloud);
// }

// transform to base link frame
Eigen::Matrix4f transform = geolibToEigen(sensor_pose);
Expand Down Expand Up @@ -458,7 +460,7 @@ bool PlaceAreaFinder::findArea(const rgbd::ImageConstPtr &image, geo::Pose3D sen
cv::Scalar point_color(255, 0, 0);

// Object placement margins #TODO hardcoded parameters
float object_diameter = 0.10;
float object_diameter = 0.10;// removeOutliers(plane_cloud,filtered_plane_cloud);
float error_margin = 0.02;
float length = object_diameter + error_margin;
float placement_margin = 2 * 0.02 + length;
Expand Down Expand Up @@ -488,9 +490,12 @@ bool PlaceAreaFinder::findArea(const rgbd::ImageConstPtr &image, geo::Pose3D sen
cv::Scalar cyan(255, 255, 0);
cv::Scalar white(255, 255, 255);
cv::Scalar yellow(0, 255, 255);
drawContourAndTransformToWorld(plane_cloud,cyan,height);
cv::Scalar purple(255, 0, 255);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr filtered_plane_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr convex_hull_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
extractMaskPoints(plane_cloud);
createCostmap(plane_cloud,yellow);
CreateAndVisConvexHull(plane_cloud,height,convex_hull_cloud);
}
// donal changes--------------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -539,7 +544,7 @@ geo::Vec2d PlaceAreaFinder::canvasToWorld(cv::Point2d point)
return geo::Vec2d(x, y);
}
// donal changes-------------------------------------------------------------------------------------------------------------------
void PlaceAreaFinder::drawContourAndTransformToWorld(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud, cv::Scalar color,float height)
void PlaceAreaFinder::CreateAndVisConvexHull(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud,float height,pcl::PointCloud<pcl::PointXYZRGB>::Ptr& world_points)
{
canvas_center = cv::Point2d(canvas.rows / 2, canvas.cols);

Expand All @@ -557,7 +562,6 @@ void PlaceAreaFinder::drawContourAndTransformToWorld(pcl::PointCloud<pcl::PointX

if (p.x >= 0 && p.y >= 0 && p.x < canvas.cols && p.y < canvas.rows)
{
canvas.at<cv::Vec3b>(p) = cv::Vec3b(color[0], color[1], color[2]);
mask.at<uchar>(p) = 255;
points.push_back(p);
}
Expand All @@ -572,7 +576,6 @@ void PlaceAreaFinder::drawContourAndTransformToWorld(pcl::PointCloud<pcl::PointX
cv::fillConvexPoly(mask, hull, cv::Scalar(255, 255, 255));

// Transform the hull points to the world frame
std::vector<pcl::PointXYZRGB> worldPoints;
for (const auto& point : hull)
{
cv::Point2d worldPoint = canvasToWorld2(point.x, point.y);
Expand All @@ -584,15 +587,15 @@ void PlaceAreaFinder::drawContourAndTransformToWorld(pcl::PointCloud<pcl::PointX

// Set the RGB color for visualization
pclPoint.r = 0;
pclPoint.g = 225;
pclPoint.b = 0;
pclPoint.g = 0;
pclPoint.b = 255;

worldPoints.push_back(pclPoint);
world_points->push_back(pclPoint);
}

// Draw the convex hull on the canvas
std::vector<std::vector<cv::Point>> contours = { hull };
cv::drawContours(canvas, contours, -1, color, cv::FILLED); // Use CV_FILLED to fill the contour
cv::drawContours(canvas, contours, -1, cv::Scalar(255, 255, 0), cv::FILLED); // Use CV_FILLED to fill the contour
cv::drawContours(canvas, contours, -1, cv::Scalar(255, 255, 255), 2);// Draws white border contour
}
else
Expand All @@ -607,15 +610,16 @@ void PlaceAreaFinder::extractMaskPoints(pcl::PointCloud<pcl::PointXYZRGB>::Ptr i
for (size_t i = 0; i < inputCloud->points.size(); ++i) {
// Check for mask color (this case mask is blue)
uint8_t b = inputCloud->points[i].b;
if (b == 255) {
uint8_t r = inputCloud->points[i].r;
if (b == 255 && r == 255) {
FilteredByMaskIndices->indices.push_back(static_cast<int>(i));
}
}

pcl::ExtractIndices<pcl::PointXYZRGB> extract;
extract.setInputCloud(inputCloud);
extract.setIndices(FilteredByMaskIndices);
extract.setNegative(true); // Keep points not in the indices list
extract.setNegative(false); // Keep points not in the indices list
Copy link
Member

Choose a reason for hiding this comment

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

Should we update the comment, when changing the value...

extract.filter(*inputCloud);
}

Expand Down
3 changes: 2 additions & 1 deletion ed_sensor_integration/yolo_python/yolo_table_segmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def detect(model, frame):

def extract_table_segment(self, image, class_ids, segmentations):
table_mask = np.zeros_like(image, dtype=np.uint8)
purple_colour = (255, 0, 255)
for class_id, seg in zip(class_ids, segmentations):
if class_id == self.table_class:
cv2.fillPoly(table_mask, [seg], 255)
cv2.fillPoly(table_mask, [seg], purple_colour)
return table_mask

def callback(self, data):
Expand Down