Skip to content
Snippets Groups Projects
Commit 8c34a7c8 authored by Iván del Pino's avatar Iván del Pino
Browse files

added heuristic to label points outside the local area analysis as ground or obstacles

parent 152984bb
No related branches found
No related tags found
No related merge requests found
...@@ -126,6 +126,7 @@ namespace kf_based_terrain_analysis_lib ...@@ -126,6 +126,7 @@ namespace kf_based_terrain_analysis_lib
struct FilteringConfiguration struct FilteringConfiguration
{ {
float robot_height; float robot_height;
float ground_threshold_in_not_analyzed_areas;
float ROI_delta_x_and_y; float ROI_delta_x_and_y;
float ROI_shadow_area; float ROI_shadow_area;
......
...@@ -1117,6 +1117,16 @@ void CKf_Based_Terrain_Analysis::labelPointcloudUsingGroundModel( ...@@ -1117,6 +1117,16 @@ void CKf_Based_Terrain_Analysis::labelPointcloudUsingGroundModel(
//std::cout << "obstacle z distance from ground = " << pcl_cloud_ptr->points[*point_iterator].z - point_in_sensor_frame.z << std::endl; //std::cout << "obstacle z distance from ground = " << pcl_cloud_ptr->points[*point_iterator].z - point_in_sensor_frame.z << std::endl;
if ((pcl_cloud_ptr->points[*point_iterator].z - point_in_sensor_frame.z) if ((pcl_cloud_ptr->points[*point_iterator].z - point_in_sensor_frame.z)
< filtering_configuration.ground_threshold_in_not_analyzed_areas)
{
pcl_cloud_ptr->points[*point_iterator].r = R_CLASS_GROUND; // We use instead the r g b channels directly
pcl_cloud_ptr->points[*point_iterator].g = G_CLASS_GROUND;
pcl_cloud_ptr->points[*point_iterator].b = B_CLASS_GROUND;
float score = 0.01; // we don't have too much confidence in these points, because they are not analyzed
pcl_cloud_ptr->points[*point_iterator].data_c[DATA_C_1_ID_CLASS] = (float)CLASS_GROUND + score;
}
else if((pcl_cloud_ptr->points[*point_iterator].z - point_in_sensor_frame.z)
< filtering_configuration.robot_height) < filtering_configuration.robot_height)
{ {
// data_c[0] is reserved to cast the RGB values into a float (PCL convention) so we do not use it // data_c[0] is reserved to cast the RGB values into a float (PCL convention) so we do not use it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment