-
Notifications
You must be signed in to change notification settings - Fork 188
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
[jsk_pcl_ros_utils] add PolygonArrayLikelihoodFilter #2054
[jsk_pcl_ros_utils] add PolygonArrayLikelihoodFilter #2054
Conversation
|
ce465d4
to
1340bf4
Compare
|
||
Threshold for filtering polygons. | ||
|
||
* ``~negate`` (Bool, default: ``false``) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~negative
is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
|
||
If ``true``, polygons and coefficients are subscribed and published synchronously. | ||
|
||
* ``~min_likelihood`` (Double, default: ``0.5``) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~threshold
is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
pub_polygons_ = advertise<jsk_recognition_msgs::PolygonArray>( | ||
*pnh_, "output_polygons", 1); | ||
|
||
pnh_->param<bool>(std::string("use_coefficients"), use_coefficients_, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string is not necessary, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! I forgot to remove that. Fixed.
this, _1, _2)); | ||
} else { | ||
sub_polygons_alone_ = pnh_->subscribe( | ||
"input_polygons", 1, &PolygonArrayLikelihoodFilter::filter, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sub_polygons_.registerCallback(&PolygonArrayLIkelihoodFilter::fileter, this);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wkentaro Why this is not allowed? sub_polygons_alone
is just a ros::Suscriber
not a message_filters::Subscriber
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean just it seems better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wkentaro
Sorry, I didn't know about that. What is difference between two calls? Is there any performance improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is the necessity of definition of sub_polygons_alone_
, and with my method, you don't need to define it, leading less number of member varaibles.
Is there any perfo..
I'm not sure about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is not usual way of message_filers, I think...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a stereotype:
http://wiki.ros.org/message_filters#Example_.28C.2B-.2B-.29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this method by my own necessity in https://github.com/jsk-ros-pkg/jsk_recognition/pull/2062/files#diff-0305e61af9efa1e83947d88c19e4ec73R81.
boost::mutex::scoped_lock lock(mutex_); | ||
min_likelihood_ = config.min_likelihood; | ||
negate_ = config.negate; | ||
if (queue_size_ != config.queue_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wkentaro But I found that the code below is super bad... Fixed anyway, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have example launch file for this node?
[jsk_pcl_ros_utils] add docs for polygon_array_likelihood_filter
d3bdc3a
to
ac1345d
Compare
Sorry for late, I updated this PR: added test code and sample launch file. |
@k-okada Thank you for merging! |
Nodelet to filter polygons by likelihood.