mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-18 00:08:22 +08:00
camera_trigger replace math::Vector with matrix::Vector
This commit is contained in:
committed by
Kabir Mohammed
parent
5b6fda2e4b
commit
21ea27f7f6
@@ -169,7 +169,7 @@ private:
|
||||
bool _one_shot;
|
||||
bool _test_shot;
|
||||
bool _turning_on;
|
||||
math::Vector<2> _last_shoot_position;
|
||||
matrix::Vector2f _last_shoot_position;
|
||||
bool _valid_position;
|
||||
|
||||
int _command_sub;
|
||||
@@ -366,7 +366,7 @@ CameraTrigger::update_distance()
|
||||
if (local.xy_valid) {
|
||||
|
||||
// Initialize position if not done yet
|
||||
math::Vector<2> current_position(local.x, local.y);
|
||||
matrix::Vector2f current_position(local.x, local.y);
|
||||
|
||||
if (!_valid_position) {
|
||||
// First time valid position, take first shot
|
||||
@@ -376,7 +376,7 @@ CameraTrigger::update_distance()
|
||||
}
|
||||
|
||||
// Check that distance threshold is exceeded
|
||||
if ((_last_shoot_position - current_position).length() >= _distance) {
|
||||
if (matrix::Vector2f(_last_shoot_position - current_position).length() >= _distance) {
|
||||
shoot_once();
|
||||
_last_shoot_position = current_position;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user