Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
jfx_kalman_filter_src
Commits
c4836efe
Commit
c4836efe
authored
Apr 28, 2023
by
wangqibing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
track cloud filter
parent
2cbc65cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
TrackingRos.cpp
TrackingRos.cpp
+45
-2
TrackingRos.h
TrackingRos.h
+2
-0
No files found.
TrackingRos.cpp
View file @
c4836efe
...
...
@@ -22,6 +22,27 @@
#endif
#include <GeographicLib/Geodesic.hpp>
// headers in PCL
#include <pcl/io/pcd_io.h>
#include <pcl/registration/ndt.h>
#include <pcl/filters/approximate_voxel_grid.h>
#include <pcl/registration/gicp.h>
#include <pcl/registration/ia_ransac.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/features/normal_3d.h>
#include <pcl/features/fpfh.h>
#include <pcl/search/kdtree.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/filter.h>
#include <pcl/registration/icp.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/filters/conditional_removal.h>
#include <pcl/filters/radius_outlier_removal.h>
#include <pcl/filters/impl/conditional_removal.hpp>
#include <pcl/impl/pcl_base.hpp>
#include <pcl_conversions/pcl_conversions.h>
using
namespace
GeographicLib
;
float
to360
(
float
rot_y
,
float
lidar_x_angle
)
...
...
@@ -398,6 +419,10 @@ void TrackingRos::Init(ros::NodeHandle& nh)
m_cross_center_lat
=
config
[
"CROSS_CENTER_LAT"
].
as
<
double
>
();
if
(
config
[
"CLEAR_DISTANCE"
])
m_clear_distance
=
config
[
"CLEAR_DISTANCE"
].
as
<
double
>
();
if
(
config
[
"cloud_filter"
])
m_cloud_filter
=
config
[
"cloud_filter"
].
as
<
int
>
();
if
(
config
[
"cloud_leafsize"
])
m_cloud_leafsize
=
config
[
"cloud_leafsize"
].
as
<
double
>
();
m_objsQueue
.
set_max_num_items
(
2
);
...
...
@@ -732,6 +757,7 @@ void TrackingRos::ThreadTrackingProcess()
}
if
(
is_need_send
==
1
)
{
/* for test
if(m_cross_center_lon != 0 && m_clear_distance != 0)
{
double s12, azi1, azi2;
...
...
@@ -739,6 +765,7 @@ void TrackingRos::ThreadTrackingProcess()
if(s12 > m_clear_distance)
continue;
}
*/
//暂存rot_y
float
rot_y_angle_temp
=
obj
.
rot_y
;
...
...
@@ -939,7 +966,24 @@ void TrackingRos::ThreadTrackingProcess()
m_pubBoundingBoxes
.
publish
(
sendBoxes
);
m_pubMarkerArray
.
publish
(
sendMarkers
);
m_pubMarkerArrow
.
publish
(
sendArrows
);
m_pubCloud
.
publish
(
objsPtr
->
cloud
);
if
(
m_cloud_filter
==
1
)
{
pcl
::
PCLPointCloud2
*
cloud
=
new
pcl
::
PCLPointCloud2
;
pcl
::
PCLPointCloud2ConstPtr
cloudPtr
(
cloud
);
pcl
::
PCLPointCloud2
msg_filtered
;
pcl_conversions
::
toPCL
(
objsPtr
->
cloud
,
*
cloud
);
pcl
::
VoxelGrid
<
pcl
::
PCLPointCloud2
>
sor
;
sor
.
setInputCloud
(
cloudPtr
);
//设置需要过滤的点云给滤波对象
sor
.
setLeafSize
(
m_cloud_leafsize
,
m_cloud_leafsize
,
m_cloud_leafsize
);
//设置滤波时创建的体素大小为20cm立方体,通过设置该值可以直接改变滤波结果,值越大结果越稀疏
sor
.
filter
(
msg_filtered
);
//执行滤波处理,存储输出msg_filtered
sensor_msgs
::
PointCloud2
point_output
;
pcl_conversions
::
fromPCL
(
msg_filtered
,
point_output
);
m_pubCloud
.
publish
(
point_output
);
}
else
{
m_pubCloud
.
publish
(
objsPtr
->
cloud
);
}
#ifdef _SEND_ABUZHABI_
static
int
sendNum
=
0
;
sendNum
++
;
...
...
@@ -962,6 +1006,5 @@ void TrackingRos::ThreadTrackingProcess()
nvtxRangePop
();
#endif
}
}
}
TrackingRos.h
View file @
c4836efe
...
...
@@ -72,4 +72,6 @@ public:
double
m_cross_center_lon
=
0
;
double
m_cross_center_lat
=
0
;
double
m_clear_distance
=
0
;
int
m_cloud_filter
=
0
;
double
m_cloud_leafsize
=
0
.
2
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment