-
Notifications
You must be signed in to change notification settings - Fork 136
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
range_sensor_layer don’t use clear_threshold to clear master grid #51
Comments
Hi, |
I think I can understand where your problem is.
If in your Hardware interface program you publish in range_message.range values < range_message.min_range or > range_message.max_range you don’t be able to clear (processVariableRangeMsg return without clean). You need to control your SRFmeasurementResult, if it is between range_message.min_range and range_message.max_range. If not you have to make it equal to range_max limit:
Only then you are able to clear and only if also clear_on_max_reading_ = true , because only then (range_message.range == range_message.max_range && clear_on_max_reading_) is true and that makes also clear_sensor_cone = true. |
A) A PR that implemented clearing would be welcome |
@PSotiriadis
` |
Hi @ju-mingyue, To be able to control this, there are mark_threshold and clear_threshold parameters. These are defined in ROS wiki as following:
As you see, these parameters are probabilities and that means they can take values between 0 and 1. I think is better to use the default values and make your experiment again. As i see in RViz your srf topics are published correctly I hope this will hekp you |
I use ROS kinetic in order to be able to drive my differential drive robot and I also use range_sensor_layer package (Branch Indigo V0.4.0) in order to be able to use SRF sensors. Recently I noticed that range_sensor_layer, in function RangeSensorLayer::updateCosts() in lines 434-437, updates master grid cells for clearing, only if old_cost is NO_INFORMATION (if current=FREE_SPACE=0 then old_cost can never be smaller than current, because old_cost is an unsighned char and cannot be negative)
But what happened if master grid old_cost is not NO_INFORMATION(255) and current=FREE_SPACE (0)?? Is that not possible?? Because if it’s possible, we ignore completely this case and that may cause errors. In this case maybe a possible solution is something like this (but it is not tested):
In addition, I want to highlight another two points of range_sensor_layer source code.
First, in function RangeSensorLayer::processVariableRangeMsg() in line 231, it is critical programming to compare if two float values are equal.
A better way to do that (considering float A and float B) is:
if ( fabs( A - B ) < limit_value )
where limit_value indicates the desired decimal position, in which we want if-statement to compare A and B equality .
And second, I want to ask if it is possible to define a parameter, in order to be able to configure how long we want to wait for transform in line 245 (now is used a fix value of 0.1(100msec))
Thanks in advance
The text was updated successfully, but these errors were encountered: