Skip to content

Commit

Permalink
fixed buggy getMinZ for latlon
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Oct 17, 2023
1 parent 53e3784 commit f329673
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/control_manager/control_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7055,11 +7055,15 @@ double ControlManager::getMinZ(const std::string& frame_id) {
return std::numeric_limits<double>::lowest();
}

auto uav_state = mrs_lib::get_mutexed(mutex_uav_state_, uav_state_);

geometry_msgs::PointStamped point;

point.header.frame_id = _safety_area_frame_;
std::string from_frame = _safety_area_frame_;

if (_safety_area_frame_ == "latlon_origin") {
from_frame = "world_origin";
}

point.header.frame_id = from_frame;
point.point.x = 0;
point.point.y = 0;
point.point.z = safety_area_min_z_;
Expand All @@ -7071,11 +7075,10 @@ double ControlManager::getMinZ(const std::string& frame_id) {
return std::numeric_limits<double>::lowest();
}

geometry_msgs::PointStamped point_transformed = ret.value();

return mrs_lib::get_mutexed(mutex_safety_area_min_z_, point_transformed.point.z);
return ret->point.z;
}


//}

// | --------------------- obstacle bumper -------------------- |
Expand Down

0 comments on commit f329673

Please sign in to comment.