Closed woensug-choi closed 2 years ago
@mabelzhang Long story short, I need to be able to define the number of vertical data to pipe into the sonar calculations.
vertical_fov
for camera
rendering. Given the horizontal FOV, the vertical FOV will be automatically calculated based on the image width
and height
properties.
<sensor type="depth">
<camera>
<horizontal_fov>1.047198</horizontal_fov>
<image>
<width>512</width>
<height>114</height>
<format>R8G8B8</format>
</image>
</camera>
</sensor>
double hfov = this->HFOV().Radian();
double vfov = 2.0 * atan(tan(hfov / 2.0) / ratio);
ignition::math::Angle Camera::HFOV() const
{
return ignition::math::Angle(this->sdf->Get<double>("horizontal_fov"));
}
//////////////////////////////////////////////////
ignition::math::Angle Camera::VFOV() const
{
return ignition::math::Angle(this->camera->getFOVy().valueRadians());
}
I need to be able to edit the vfov
in the same manner as to how the hfov
is defined. Ray/GPU Ray sensor is capable of defining horizontal and vertical FOVs separately. But moving on to the different sensor-based is unknown territory.
It is confusing that which headers and source codes I have to copy and edit to make the modifications I need.
Elevation stripe is visible due to fixed ray-wise input data from the camera sensor (discretizes the rendering scene with pixels). As the source of the sonar signal is a point. The range resolution (the gap between elevation stripes) is dependent on the relative orientation of the sonar and objects in the scene. For seabed looking cases, if the sonar is near the seabed with a view field grazing the bottom, the gaps become visible. If the sonar is away from the bottom looking down, the gaps are neglectable.
Background
The multibeam sonar plugin is currently based on the Gazebo's generic depth camera sensor. Considering issues brought up by our users who have been trying the plugin, I am convinced that migrating to the Ray sensor could resolve the issues. Otherwise, interpolations should be introduced to the plugin, which is not physical.
Related Issues
maxDistance
SDF handle and Ray sensor's generic ray controls to reach a high refresh rate.