Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
As I’m sure you know, the hector_gazebo_sonar plugin is implemented using Gazebo’s ray sensor, which is essentially a laser scan. As a result, if the sensor’s beam hits the ground, it’s reflected back. I think sensors on the rover models were configured to scan horizontally for that reason, so the beams don’t hit the ground (there is no
vertical
tag in thescan
configuration). I tried adding a vertical component to the scan myself and the results were sad.It isn’t ideal to limit the sonar scans to a single horizontal plane, since the real world sensors have much larger fields of view. A block reflects the sonar if it’s held high enough in the claw, and a pile of blocks also reflects the sonar as the rover drives toward them. Neither of those things happen in the simulation.
It turns out that Gazebo actually has a sonar sensor, but until recently no one had written a ROS plugin to use it. However, there’s an open PR ros-simulation/gazebo_ros_pkgs#697 that adds this functionality. Since it’s still open, has been for a few months, and seems to have lost traction in getting merged to the main branch, I suggest pulling the source to be built alongside our other Gazebo plugins.
This pull request brings in the sonar plugin and updates the rover models to use it.
radius
andfov
are currently set to0.5
, which represents the sonar cone’s radius at it’s maximum range. 50cm leaves some space between each of the three cones, which I think is reasonable, but hasn’t been measured experimentally. You can setvisualize
to true and regenerate the model files to see the cones in Gazebo client. The field of view could be measured on the physical rover by blocking two of the three sensors with tape and moving an object in front of the sensor at 3m away.gaussianNoise
is0.15
which looked good visually, but could also be measured on the physical rover for comparison.Let me know what you think!