SITL: fixup offset calls

This commit is contained in:
Andrew Tridgell 2021-06-25 09:30:05 +10:00
parent e7afa628d1
commit d698987070
4 changed files with 7 additions and 7 deletions

View File

@ -192,7 +192,7 @@ void ADSB::send_report(void)
ADSB_Vehicle &vehicle = vehicles[i];
Location loc = home;
loc.offset(vehicle.position.x, vehicle.position.y);
loc.offset_double(vehicle.position.x, vehicle.position.y);
// re-init when exceeding radius range
if (home.get_distance(loc) > _sitl->adsb_radius_m) {

View File

@ -782,7 +782,7 @@ void Aircraft::smooth_sensors(void)
smoothing.position += (smoothing.velocity_ef * delta_time).todouble();
smoothing.location = home;
smoothing.location.offset(smoothing.position.x, smoothing.position.y);
smoothing.location.offset_double(smoothing.position.x, smoothing.position.y);
smoothing.location.alt = static_cast<int32_t>(home.alt - smoothing.position.z * 100.0f);
smoothing.last_update_us = now;

View File

@ -97,7 +97,7 @@ float SerialProximitySensor::measure_distance_at_angle_bf(const Location &locati
for (int8_t x=-num_post_offset; x<num_post_offset; x++) {
for (int8_t y=-num_post_offset; y<num_post_offset; y++) {
Location post_location = post_origin;
post_location.offset(x*10+3, y*10+2);
post_location.offset_double(x*10+3, y*10+2);
if (postfile != nullptr) {
::fprintf(postfile, "map circle %f %f %f blue\n", post_location.lat*1e-7, post_location.lng*1e-7, radius_cm/100.0);
}
@ -111,8 +111,8 @@ float SerialProximitySensor::measure_distance_at_angle_bf(const Location &locati
float dist_cm = (intersection_point_cm-vehicle_pos_cm).length();
if (intersectionsfile != nullptr) {
Location intersection_point = location;
intersection_point.offset(intersection_point_cm.x/100.0f,
intersection_point_cm.y/100.0f);
intersection_point.offset_double(intersection_point_cm.x/100.0,
intersection_point_cm.y/100.0);
::fprintf(intersectionsfile,
"map icon %f %f barrell\n",
intersection_point.lat*1e-7,

View File

@ -85,7 +85,7 @@ Vector2f ShipSim::get_ground_speed_adjustment(const Location &loc, float &yaw_ra
return Vector2f(0,0);
}
Location shiploc = home;
shiploc.offset(ship.position.x, ship.position.y);
shiploc.offset_double(ship.position.x, ship.position.y);
if (loc.get_distance(shiploc) > deck_size) {
yaw_rate = 0;
return Vector2f(0,0);
@ -172,7 +172,7 @@ void ShipSim::send_report(void)
send a GLOBAL_POSITION_INT messages
*/
Location loc = home;
loc.offset(ship.position.x, ship.position.y);
loc.offset_double(ship.position.x, ship.position.y);
int32_t alt;
bool have_alt = false;