ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I fixed the calculation of the field_of_view in gazebo_ros_sonar.cpp. Thanks for reporting. Unfortunatly this is not the source of your problem.
The start and end points of each ray are calculated in gazebo's MultiRayShape.cc. I did a quick test with debug outputs to verify that the calculated directional vectors for each ray are as expected.
The gazebo_ros_sonar plugin uses Gazebo's ray sensor and gives you the minimum distance out of all rays. With the default parameters from hector_quadrotor three samples are used for both the horizontal and the vertical axis equally spaces from min_angle to max_angle. So the simulated ultrasound cone is more like a pyramid than a geometric cone. Small obstacles at larger distances might be missed. You can increase the sample count if you need higher accuracy. The calculated field_of_view for the sensor_msgs/Range message is only a very coarse approximation and the visualization in rviz might lead to the impression that the distance readings are faulty.
Although this is not really a solution to your problem, it might help to solve it.
2 | No.2 Revision |
I fixed the calculation of the field_of_view in gazebo_ros_sonar.cpp. Thanks for reporting. Unfortunatly this is not the source of your problem.
The start and end points of each ray are calculated in gazebo's MultiRayShape.cc. I did a quick test with debug outputs to verify that the calculated directional vectors for each ray are as expected.
The gazebo_ros_sonar plugin uses Gazebo's ray sensor and gives you the minimum distance out of all rays. With the default parameters from hector_quadrotor three samples are used for both the horizontal and the vertical axis equally spaces distributed from min_angle to max_angle. So the simulated ultrasound cone is more like a pyramid than a geometric cone. Small obstacles at larger distances might be missed. You can increase the sample count if you need higher accuracy. The calculated field_of_view for the sensor_msgs/Range message is only a very coarse approximation and the visualization in rviz might lead to the impression that the distance readings are faulty.
Although this is these explanations are not really a solution to your problem, it they might help to solve it.
3 | No.3 Revision |
I fixed the calculation of the field_of_view in gazebo_ros_sonar.cpp. Thanks for reporting. Unfortunatly this is not the source of your problem.
The start and end points of each ray are calculated in gazebo's MultiRayShape.cc. I did a quick test with debug outputs to verify that the calculated directional vectors for each ray are as expected.
The gazebo_ros_sonar plugin uses Gazebo's ray sensor and gives you the minimum distance out of all rays. With the default parameters from hector_quadrotor three samples are used for both the horizontal and the vertical axis equally distributed from min_angle to max_angle. So the simulated ultrasound cone is more like a pyramid than a geometric cone. Small obstacles at larger distances might be missed. You can increase the sample count if you need higher accuracy. The calculated field_of_view for the sensor_msgs/Range message is only a very coarse approximation and the visualization in rviz might lead to the impression that the distance readings are faulty.
Although these explanations are not really a solution to your problem, they might help to solve it.
UPDATE: Thanks to the video you have posted I could reproduce the problem and traced it down to the wrong usage of gazebo's RaySensor::getRangeCount() method. Seems that it only returns the number of horizontal samples and therefore only the first three rays out of nine are considered for the calculation of the minimal distance. Thanks for your efforts to point that out! The problem should be fixed now in r631 of tu-darmstadt-ros-pkg and in the upcoming 0.1.2 release of the hector_gazebo stack.