Skip to content

Commit

Permalink
remove DebugBreak calls which might generate crash in bin release
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Sep 3, 2017
1 parent 2cb48dc commit d4b5eed
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion AirLib/include/common/common_utils/WorkerThread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class WorkerThread {
pending->execute();
}
catch (std::exception& e) {
Utils::DebugBreak();
//Utils::DebugBreak();
Utils::log(Utils::stringf("WorkerThread caught unhandled exception: %s", e.what()), Utils::kLogLevelError);
}

Expand Down
6 changes: 4 additions & 2 deletions AirLib/include/controllers/MavLinkDroneController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,10 @@ struct MavLinkDroneController::impl {
hil_node_->sendMessage(hil_gps);
}

if (hil_gps.lat < 0.1f && hil_gps.lat > -0.1f)
Utils::DebugBreak();
if (hil_gps.lat < 0.1f && hil_gps.lat > -0.1f) {
//Utils::DebugBreak();
Utils::log("hil_gps.lat was too close to 0", Utils::kLogLevelError);
}

std::lock_guard<std::mutex> guard(last_message_mutex_);
last_gps_message_ = hil_gps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class AirSimSimpleFlightCommLink : public simple_flight::ICommLink {

virtual void log(const std::string& message, int32_t log_level = ICommLink::kLogLevelInfo)
{
if (log_level > 0)
Utils::DebugBreak();
//if (log_level > 0)
// Utils::DebugBreak();
messages_.push_back(std::string(message));
}

Expand Down
6 changes: 4 additions & 2 deletions AirLib/include/physics/FastPhysicsEngine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,10 @@ class FastPhysicsEngine : public PhysicsEngineBase {
Thus new attitude is q0q1
*/
next.pose.orientation = current_pose.orientation * angle_dt_q;
if (VectorMath::hasNan(next.pose.orientation))
Utils::DebugBreak();
if (VectorMath::hasNan(next.pose.orientation)) {
//Utils::DebugBreak();
Utils::log("orientation had NaN!", Utils::kLogLevelError);
}

//re-normalize quaternion to avoid accumulating error
next.pose.orientation.normalize();
Expand Down
6 changes: 4 additions & 2 deletions AirLib/include/physics/PhysicsBody.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ class PhysicsBody : public UpdatableObject {
}
void setKinematics(const Kinematics::State& state)
{
if (VectorMath::hasNan(state.twist.linear))
Utils::DebugBreak();
if (VectorMath::hasNan(state.twist.linear)) {
//Utils::DebugBreak();
Utils::log("Linear velocity had NaN!", Utils::kLogLevelError);
}

kinematics_.setState(state);
}
Expand Down
4 changes: 2 additions & 2 deletions AirLib/include/physics/World.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ class World : public UpdatableContainer<UpdatableObject*> {
update();
}
catch(const std::exception& ex) {
Utils::DebugBreak();
//Utils::DebugBreak();
Utils::log(Utils::stringf("Exception occurred while updating world: %s", ex.what()), Utils::kLogLevelError);
}
catch(...) {
Utils::DebugBreak();
//Utils::DebugBreak();
Utils::log("Exception occurred while updating world", Utils::kLogLevelError);
}

Expand Down

0 comments on commit d4b5eed

Please sign in to comment.