Skip to content

Commit

Permalink
Merge branch 'mescarra-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Mar 29, 2018
2 parents 50b3d0a + 20f3be5 commit 417ebe5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
6 changes: 3 additions & 3 deletions MavLinkCom/MavLinkTest/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,11 +1607,11 @@ void GotoCommand::HandleMessage(const MavLinkMessage& message)
channel->moveToLocalPosition(tx, ty, tz, is_yaw, static_cast<float>(theading * M_PI / 180));

if (this->hasLocalPosition) {
if (!targetReached && std::fabsf(x - tx) < nearDelta && std::fabsf(y - ty) < nearDelta)
if (!targetReached && fabsf(x - tx) < nearDelta && fabsf(y - ty) < nearDelta)
{
targetReached = true;
}
if (targetReached && !settled && (fabs(this->vx) + std::fabsf(this->vy) + std::fabsf(this->vz) < almostStationery)) {
if (targetReached && !settled && (fabs(this->vx) + fabsf(this->vy) + fabsf(this->vz) < almostStationery)) {
settled = true;
// ok, now we can safely switch to loiter.
TargetReached();
Expand Down Expand Up @@ -2081,7 +2081,7 @@ void SquareCommand::UpdateTarget()
float dy = ty - y;
float dist = sqrtf((dx*dx) + (dy*dy));

if (std::fabsf(dx) < near && std::fabsf(dy) < near)
if (fabsf(dx) < near && fabsf(dy) < near)
{
leg_++;
if (leg_ == 4) leg_ = 0;
Expand Down
23 changes: 14 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ if [ ! -d "./cmake_build" ]; then
fi


# set up paths of clang compiler
if [ "$(uname)" == "Darwin" ]; then
CMAKE="$(greadlink -f cmake_build/bin/cmake)"

export CC=/usr/local/opt/llvm\@3.9/bin/clang
export CXX=/usr/local/opt/llvm\@3.9/bin/clang++
# set up paths of cc and cxx compiler
if [ "$1" == "gcc" ]; then
export CC="gcc"
export CXX="g++"
else
CMAKE="$(readlink -f cmake_build/bin/cmake)"
if [ "$(uname)" == "Darwin" ]; then
CMAKE="$(greadlink -f cmake_build/bin/cmake)"

export CC=/usr/local/opt/llvm\@3.9/bin/clang
export CXX=/usr/local/opt/llvm\@3.9/bin/clang++
else
CMAKE="$(readlink -f cmake_build/bin/cmake)"

export CC="clang-3.9"
export CXX="clang++-3.9"
export CC="clang-3.9"
export CXX="clang++-3.9"
fi
fi

#install EIGEN library
Expand Down
2 changes: 1 addition & 1 deletion cmake/MavLinkCom/MavLinkTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ include_directories(
file(GLOB_RECURSE PROJECT_CPP "${AIRSIM_ROOT}/MavLinkCom/${PROJECT_NAME}/*.cpp")
add_executable(${PROJECT_NAME} ${PROJECT_CPP})

target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} MavLinkCom c++abi ${CXX_EXP_LIB})
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} MavLinkCom ${CXX_EXP_LIB})
6 changes: 3 additions & 3 deletions cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ macro(CommonSetup)
-std=c++14 -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy \
-Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default \
-Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef \
-Wno-variadic-macros -Wno-parentheses -Wno-unused-function -Wno-unused -Wno-documentation -fdiagnostics-show-option -ferror-limit=10 \
-Wno-variadic-macros -Wno-parentheses -Wno-unused-function -Wno-unused -Wno-documentation -fdiagnostics-show-option \
-pthread \
${RPC_LIB_DEFINES} ${CMAKE_CXX_FLAGS}")

if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
# make sure to match the compiler flags with which the Unreal
# Engine is built with
set(CMAKE_CXX_FLAGS "\
-nostdinc++ -isystem ${LIBCXX_INC_PATH} \
-nostdinc++ -ferror-limit=10 -isystem ${LIBCXX_INC_PATH} \
-D__CLANG__ ${CMAKE_CXX_FLAGS}")

# removed -lsupc++ from below (Git issue # 678)
Expand All @@ -89,7 +89,7 @@ macro(CommonSetup)
endif()

else()
set(CXX_EXP_LIB "-lstdc++fs -fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel ")
set(CXX_EXP_LIB "-lstdc++fs -fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel")
endif ()
endif ()

Expand Down

0 comments on commit 417ebe5

Please sign in to comment.