mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 03:57:46 +08:00
Add enable_scan_to_point param
This commit is contained in:
@@ -171,6 +171,8 @@ class OBLidarNode {
|
|||||||
|
|
||||||
void publishScan(std::shared_ptr<ob::FrameSet> frame_set);
|
void publishScan(std::shared_ptr<ob::FrameSet> frame_set);
|
||||||
|
|
||||||
|
void publishScanToPoint(std::shared_ptr<ob::FrameSet> frame_set);
|
||||||
|
|
||||||
void publishPointCloud(std::shared_ptr<ob::FrameSet> frame_set);
|
void publishPointCloud(std::shared_ptr<ob::FrameSet> frame_set);
|
||||||
|
|
||||||
void publishSpherePointCloud(std::shared_ptr<ob::FrameSet> frame_set);
|
void publishSpherePointCloud(std::shared_ptr<ob::FrameSet> frame_set);
|
||||||
@@ -230,6 +232,7 @@ class OBLidarNode {
|
|||||||
// Only for Gemini2 device
|
// Only for Gemini2 device
|
||||||
|
|
||||||
std::string time_domain_ = "device"; // device, system, global
|
std::string time_domain_ = "device"; // device, system, global
|
||||||
|
bool enable_scan_to_point_ = false;
|
||||||
bool enable_heartbeat_ = false;
|
bool enable_heartbeat_ = false;
|
||||||
bool use_intra_process_ = false;
|
bool use_intra_process_ = false;
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ def generate_launch_description():
|
|||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||||
DeclareLaunchArgument('lidar_format', default_value='ANY'),#LIDAR_POINT, LIDAR_SPHERE_POINT, LIDAR_SCAN
|
DeclareLaunchArgument('lidar_format', default_value='ANY'),#LIDAR_POINT, LIDAR_SPHERE_POINT, LIDAR_SCAN
|
||||||
DeclareLaunchArgument('lidar_rate', default_value='20'),
|
DeclareLaunchArgument('lidar_rate', default_value='20'),
|
||||||
|
DeclareLaunchArgument('enable_scan_to_point', default_value='false'),
|
||||||
DeclareLaunchArgument('repetitive_scan_mode', default_value='-1'),
|
DeclareLaunchArgument('repetitive_scan_mode', default_value='-1'),
|
||||||
DeclareLaunchArgument('filter_level', default_value='-1'),
|
DeclareLaunchArgument('filter_level', default_value='-1'),
|
||||||
DeclareLaunchArgument('vertical_fov', default_value='-1.0'),
|
DeclareLaunchArgument('vertical_fov', default_value='-1.0'),
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ void OBLidarNode::getParameters() {
|
|||||||
param_name = stream_name_[stream_index] + "_optical_frame_id";
|
param_name = stream_name_[stream_index] + "_optical_frame_id";
|
||||||
setAndGetNodeParameter(optical_frame_id_[stream_index], param_name, default_optical_frame_id);
|
setAndGetNodeParameter(optical_frame_id_[stream_index], param_name, default_optical_frame_id);
|
||||||
}
|
}
|
||||||
|
setAndGetNodeParameter<bool>(enable_scan_to_point_, "enable_scan_to_point", false);
|
||||||
setAndGetNodeParameter<bool>(publish_tf_, "publish_tf", true);
|
setAndGetNodeParameter<bool>(publish_tf_, "publish_tf", true);
|
||||||
setAndGetNodeParameter<double>(tf_publish_rate_, "tf_publish_rate", 0.0);
|
setAndGetNodeParameter<double>(tf_publish_rate_, "tf_publish_rate", 0.0);
|
||||||
setAndGetNodeParameter<std::string>(time_domain_, "time_domain", "global");
|
setAndGetNodeParameter<std::string>(time_domain_, "time_domain", "global");
|
||||||
@@ -418,8 +419,10 @@ void OBLidarNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set)
|
|||||||
publishStaticTransforms();
|
publishStaticTransforms();
|
||||||
tf_published_ = true;
|
tf_published_ = true;
|
||||||
}
|
}
|
||||||
if (format_[LIDAR] == OB_FORMAT_LIDAR_SCAN) {
|
if (format_[LIDAR] == OB_FORMAT_LIDAR_SCAN && !enable_scan_to_point_) {
|
||||||
publishScan(frame_set);
|
publishScan(frame_set);
|
||||||
|
} else if (format_[LIDAR] == OB_FORMAT_LIDAR_SCAN && enable_scan_to_point_) {
|
||||||
|
publishScanToPoint(frame_set);
|
||||||
} else if (format_[LIDAR] == OB_FORMAT_LIDAR_POINT) {
|
} else if (format_[LIDAR] == OB_FORMAT_LIDAR_POINT) {
|
||||||
publishPointCloud(frame_set);
|
publishPointCloud(frame_set);
|
||||||
} else if (format_[LIDAR] == OB_FORMAT_LIDAR_SPHERE_POINT) {
|
} else if (format_[LIDAR] == OB_FORMAT_LIDAR_SPHERE_POINT) {
|
||||||
@@ -469,6 +472,13 @@ void OBLidarNode::publishScan(std::shared_ptr<ob::FrameSet> frame_set) {
|
|||||||
scan_pub_->publish(std::move(scan_msg));
|
scan_pub_->publish(std::move(scan_msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OBLidarNode::publishScanToPoint(std::shared_ptr<ob::FrameSet> frame_set) {
|
||||||
|
(void)frame_set;
|
||||||
|
if (frame_set == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void OBLidarNode::publishPointCloud(std::shared_ptr<ob::FrameSet> frame_set) {
|
void OBLidarNode::publishPointCloud(std::shared_ptr<ob::FrameSet> frame_set) {
|
||||||
(void)frame_set;
|
(void)frame_set;
|
||||||
if (frame_set == nullptr) {
|
if (frame_set == nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user