WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Unity/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fi

cd linux-build
if [ "$(uname)" == "Darwin" ]; then
export CC=/usr/local/opt/llvm@8/bin/clang
export CXX=/usr/local/opt/llvm@8/bin/clang++
export CC=/usr/local/opt/llvm@12/bin/clang
export CXX=/usr/local/opt/llvm@12/bin/clang++
else
export CC="clang-8"
export CXX="clang++-8"
Expand Down
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ if [ "$(uname)" == "Darwin" ]; then
export CXX="$(brew --prefix)/opt/llvm/bin/clang++"
else
if $gcc; then
export CC="gcc-8"
export CXX="g++-8"
export CC="gcc-12"
export CXX="g++-12"
else
export CC="clang-8"
export CXX="clang++-8"
export CC="clang-12"
export CXX="clang++-12"
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ macro(CommonSetup)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_CXX_FLAGS "-stdlib=libc++ -Wno-documentation -Wno-unknown-warning-option ${CMAKE_CXX_FLAGS}")
find_package(LLVM REQUIRED CONFIG)
set(CXX_EXP_LIB "-L${LLVM_LIBRARY_DIRS} -lc++fs -ferror-limit=10")
set(CXX_EXP_LIB "-L${LLVM_LIBRARY_DIRS} -ferror-limit=10")
else()
set(CXX_EXP_LIB "-lstdc++fs -fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel")
set(CXX_EXP_LIB "-fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel")
endif ()
endif ()

Expand Down
21 changes: 19 additions & 2 deletions ros2/src/airsim_ros_pkgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ find_package(image_transport REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(mavros_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(mavros_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
Expand All @@ -22,6 +23,8 @@ find_package(rosidl_typesupport_cpp REQUIRED)
find_package(rosidl_default_runtime REQUIRED)
find_package(airsim_interfaces REQUIRED)
find_package(OpenCV REQUIRED)
find_package(std_srvs REQUIRED)
find_package(mavros_msgs REQUIRED)

set(AIRSIM_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../)

Expand All @@ -30,11 +33,13 @@ add_subdirectory("${AIRSIM_ROOT}/cmake/AirLib" AirLib)
add_subdirectory("${AIRSIM_ROOT}/cmake/MavLinkCom" MavLinkCom)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wnoexcept -Wstrict-null-sentinel")
# set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wnoexcept -Wstrict-null-sentinel")
# Added -Wno-deprecated-copy to fix Eigen warnings on newer GCC
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wnoexcept -Wstrict-null-sentinel -Wno-deprecated-copy -Wno-format-security")
set(CXX_EXP_LIB "-nostdinc++ -I/usr/include/c++/8 -I/usr/include/x86_64-linux-gnu/c++/8 -nodefaultlibs
-l/usr/lib/x86_64-linux-gnu/libc++.so -l/usr/lib/x86_64-linux-gnu/libc++abi.so
-lm -lc -lgcc_s -lgcc
-lstdc++fs -fmax-errors=10")
-fmax-errors=10")
set(RPC_LIB_INCLUDES " ${AIRSIM_ROOT}/external/rpclib/rpclib-2.3.0/include")
set(RPC_LIB rpc)
message(STATUS "found RPC_LIB_INCLUDES=${RPC_LIB_INCLUDES}")
Expand All @@ -46,6 +51,8 @@ set(INCLUDE_DIRS include
${AIRSIM_ROOT}/MavLinkCom/include
${AIRSIM_ROOT}/MavLinkCom/common_utils
${OpenCV_INCLUDE_DIRS}
${std_srvs_INCLUDE_DIRS}
${mavros_msgs_INCLUDE_DIRS}
)
include_directories(${INCLUDE_DIRS})

Expand All @@ -59,6 +66,8 @@ ament_target_dependencies(pd_position_controller_simple
nav_msgs
geometry_msgs
airsim_interfaces
tf2
tf2_geometry_msgs
)

add_library(airsim_ros src/airsim_ros_wrapper.cpp)
Expand All @@ -72,12 +81,18 @@ ament_target_dependencies(airsim_ros
tf2_ros
cv_bridge
airsim_interfaces
tf2
tf2_geometry_msgs
mavros_msgs
std_srvs
)

add_executable(airsim_node src/airsim_node.cpp)
target_link_libraries(airsim_node airsim_ros AirLib)
ament_target_dependencies(airsim_node
rclcpp
tf2
tf2_geometry_msgs
)

add_executable(pd_position_controller_simple_node
Expand All @@ -86,6 +101,8 @@ target_link_libraries(pd_position_controller_simple_node
pd_position_controller_simple airsim_ros AirLib)
ament_target_dependencies(pd_position_controller_simple_node
rclcpp
tf2
tf2_geometry_msgs
)

# rosidl_target_interfaces(airsim_node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ STRICT_MODE_OFF //todo what does this do?
#include <rclcpp/rclcpp.hpp>
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <math.h>
#include <airsim_interfaces/msg/vel_cmd.hpp>
Expand Down Expand Up @@ -136,4 +136,4 @@ class PIDPositionController
rclcpp::TimerBase::SharedPtr update_control_cmd_timer_;
};

#endif /* _PID_POSITION_CONTROLLER_SIMPLE_ */
#endif /* _PID_POSITION_CONTROLLER_SIMPLE_ */
4 changes: 2 additions & 2 deletions ros2/src/airsim_ros_pkgs/include/utils.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
namespace utils
{
inline double get_yaw_from_quat_msg(const geometry_msgs::msg::Quaternion& quat_msg)
Expand All @@ -11,4 +11,4 @@ inline double get_yaw_from_quat_msg(const geometry_msgs::msg::Quaternion& quat_m
}

// OdometryEuler get_eigen_odom_from_rosmsg(const nav::msgs &odom_msg);
}
}
1 change: 1 addition & 0 deletions ros2/src/airsim_ros_pkgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<exec_depend>image_transport</exec_depend>
<exec_depend>message_generation</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>mavros_msgs</exec_depend>
<exec_depend>nav_msgs</exec_depend>
<exec_depend>rclcpp</exec_depend>
<exec_depend>rclpy</exec_depend>
Expand Down
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else #linux
software-properties-common \
wget \
libvulkan1 \
vulkan-utils
vulkan-tools

#install clang and build tools
VERSION=$(lsb_release -rs | cut -d. -f1)
Expand All @@ -60,7 +60,7 @@ else #linux
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
fi
sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev
fi

if ! which cmake; then
Expand Down