aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-02-01 11:58:34 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-02-01 11:58:34 +0100
commite8dd70e815033ec1a291ac5190dacfeb7d728dba (patch)
tree105e06706d272ce497356313bf82cf3cc7be6e09 /src
parent0be7bd3166969294bdd56b853b65248442219b80 (diff)
downloadpx4-firmware-e8dd70e815033ec1a291ac5190dacfeb7d728dba.tar.gz
px4-firmware-e8dd70e815033ec1a291ac5190dacfeb7d728dba.tar.bz2
px4-firmware-e8dd70e815033ec1a291ac5190dacfeb7d728dba.zip
fw: fix global position lat/lon read-in (lat/lon have changed to double lately)
Diffstat (limited to 'src')
-rw-r--r--src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
index a62b53221..3ef1871a8 100644
--- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
+++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
@@ -785,26 +785,26 @@ FixedwingPositionControl::control_position(const math::Vector<2> &current_positi
_tecs.set_speed_weight(_parameters.speed_weight);
/* current waypoint (the one currently heading for) */
- math::Vector<2> next_wp(pos_sp_triplet.current.lat, pos_sp_triplet.current.lon);
+ math::Vector<2> next_wp((float)pos_sp_triplet.current.lat, (float)pos_sp_triplet.current.lon);
/* current waypoint (the one currently heading for) */
- math::Vector<2> curr_wp(pos_sp_triplet.current.lat, pos_sp_triplet.current.lon);
+ math::Vector<2> curr_wp((float)pos_sp_triplet.current.lat, (float)pos_sp_triplet.current.lon);
/* previous waypoint */
math::Vector<2> prev_wp;
if (pos_sp_triplet.previous.valid) {
- prev_wp(0) = pos_sp_triplet.previous.lat;
- prev_wp(1) = pos_sp_triplet.previous.lon;
+ prev_wp(0) = (float)pos_sp_triplet.previous.lat;
+ prev_wp(1) = (float)pos_sp_triplet.previous.lon;
} else {
/*
* No valid previous waypoint, go for the current wp.
* This is automatically handled by the L1 library.
*/
- prev_wp(0) = pos_sp_triplet.current.lat;
- prev_wp(1) = pos_sp_triplet.current.lon;
+ prev_wp(0) = (float)pos_sp_triplet.current.lat;
+ prev_wp(1) = (float)pos_sp_triplet.current.lon;
}
@@ -1263,7 +1263,7 @@ FixedwingPositionControl::task_main()
// vehicle_baro_poll();
math::Vector<2> ground_speed(_global_pos.vel_n, _global_pos.vel_e);
- math::Vector<2> current_position(_global_pos.lat / 1e7f, _global_pos.lon / 1e7f);
+ math::Vector<2> current_position((float)_global_pos.lat, (float)_global_pos.lon);
/*
* Attempt to control position, on success (= sensors present and not in manual mode),