mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 08:40:30 +08:00
fix(simulation): remove unnecessary double-float conversion (#28715)
Co-authored-by: jmackay2 <jmackay2@gmail.com>
This commit is contained in:
1 parent
d1862ac96b
commit
fd1ddbc22e
1 file changed
+1
-1
@@ -98,7 +98,7 @@ bool OpticalFlowSensor::Load(const sdf::Sensor &_sdf)
|
||||
}
|
||||
|
||||
// Assume pinhole camera and 1:1 aspect ratio
|
||||
float focal_length = (image_width / 2.0f) / tan(hfov / 2.0f);
|
||||
const float focal_length = (image_width / 2.0f) / tanf(hfov / 2.0f);
|
||||
_optical_flow = std::make_shared<OpticalFlowOpenCV>(focal_length, focal_length,
|
||||
update_rate, image_width, image_height);
|
||||
|
||||
|
||||
Reference in new issue
Block a user