Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add param for cloud_in and scan topic, and yaml configuration #97

Open
wants to merge 1 commit into
base: lunar-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions config/pointcloud2_to_laserscan_param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
target_frame: hokuyo3d # Leave disabled to output scan in pointcloud frame
cloud_in: /hokuyo3d/hokuyo_cloud2 # input point_cloud2 topic name
scan: /hokuyo3d/scan # output scan topic name
transform_tolerance: 0.01
min_height: 0.0
max_height: 1.0

angle_min: -1.5708 # -M_PI/2
angle_max: 1.5708 # M_PI/2
angle_increment: 0.0087 # M_PI/360.0
scan_time: 0.3333
range_min: 0.45
range_max: 4.0
use_inf: true
inf_epsilon: 1.0

# Concurrency level, affects number of pointclouds queued for processing and number of threads used
# 0 : Detect number of cores
# 1 : Single threaded
# 2->inf : Parallelism level
concurrency_level: 1
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class PointCloudToLaserScanNodelet : public nodelet::Nodelet
// ROS Parameters
unsigned int input_queue_size_;
std::string target_frame_;
std::string cloud_in_;
std::string scan_;
double tolerance_;
double min_height_, max_height_, angle_min_, angle_max_, angle_increment_, scan_time_, range_min_, range_max_;
bool use_inf_;
Expand Down
6 changes: 6 additions & 0 deletions launch/sample_node_with_yaml.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- run pointcloud_to_laserscan node -->
<node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
<rosparam command="load" file="$(find pointcloud_to_laserscan)/config/pointcloud2_to_laserscan_param.yaml"/>
<!-- <remap from="cloud_in" to="$(arg basename)/hokuyo_cloud2"/>
<remap from="scan" to="$(arg basename)/scan"/> -->
</node>
2 changes: 2 additions & 0 deletions src/pointcloud_to_laserscan_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ void PointCloudToLaserScanNodelet::onInit()
private_nh_.param<double>("range_min", range_min_, 0.0);
private_nh_.param<double>("range_max", range_max_, std::numeric_limits<double>::max());
private_nh_.param<double>("inf_epsilon", inf_epsilon_, 1.0);
private_nh_.param<std::string>("cloud_in", cloud_in_, "/hokuyo3d/hokuyo_cloud2");
private_nh_.param<std::string>("scan", scan_, "/hokuyo3d/scan");
s-takahashijp marked this conversation as resolved.
Show resolved Hide resolved

int concurrency_level;
private_nh_.param<int>("concurrency_level", concurrency_level, 1);
Expand Down