Skip to content

Commit

Permalink
Merge pull request #1470 from bmalhigh/hotfix/linuxbuild
Browse files Browse the repository at this point in the history
Fix for build issues on Ubuntu with UE4.18
  • Loading branch information
sytelus authored Oct 16, 2018
2 parents a28894c + 12b1740 commit c5ed97d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AirLib/include/api/VehicleApiBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class VehicleApiBase : public UpdatableObject {
//get reading from RC bound to vehicle (if unsupported then RCData::is_valid = false)
virtual RCData getRCData() const
{
static const RCData invalid_rc_data;
static const RCData invalid_rc_data {};
return invalid_rc_data;
}
//set external RC data to vehicle (if unsupported then returns false)
Expand Down
12 changes: 9 additions & 3 deletions AirLib/include/common/VectorMath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,15 @@ class VectorMathT {

static QuaternionT rotateQuaternion(const QuaternionT& q, const QuaternionT& ref, bool assume_unit_quat)
{
QuaternionT ref_n = assume_unit_quat ? ref : ref.normalized();
QuaternionT ref_n_i = assume_unit_quat ? ref.conjugate() : ref.inverse();
return ref_n * q * ref_n_i;
if (assume_unit_quat) {
QuaternionT ref_n = ref;
QuaternionT ref_n_i = ref.conjugate();
return ref_n * q * ref_n_i;
} else {
QuaternionT ref_n = ref.normalized();
QuaternionT ref_n_i = ref.inverse();
return ref_n * q * ref_n_i;
}
}

static QuaternionT rotateQuaternionReverse(const QuaternionT& q, const QuaternionT& ref, bool assume_unit_quat)
Expand Down
9 changes: 8 additions & 1 deletion AirLib/include/common/common_utils/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,21 @@ class Utils {
}

template <template<class, class, class...> class TContainer, typename TKey, typename TVal, typename... Args>
static const TVal& findOrDefault(const TContainer<TKey, TVal, Args...>& m, TKey const& key, const TVal& default_val = TVal())
static const TVal& findOrDefault(const TContainer<TKey, TVal, Args...>& m, TKey const& key, const TVal& default_val)
{
typename TContainer<TKey, TVal, Args...>::const_iterator it = m.find(key);
if (it == m.end())
return default_val;
return it->second;
}

template <template<class, class, class...> class TContainer, typename TKey, typename TVal, typename... Args>
static const TVal& findOrDefault(const TContainer<TKey, TVal, Args...>& m, TKey const& key)
{
static TVal default_val;
return findOrDefault(m, key, default_val);
}

static Logger* getSetLogger(Logger* logger = nullptr)
{
static Logger logger_default_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "common/Common.hpp"
#include "GameFramework/Actor.h"
#include "sensors/Lidar/LidarSimple.hpp"
#include "sensors/lidar/LidarSimple.hpp"
#include "NedTransform.h"

// UnrealLidarSensor implementation that uses Ray Tracing in Unreal.
Expand Down

0 comments on commit c5ed97d

Please sign in to comment.