From a793ae0dcc0a316c414cbb54e06c49ed1701df15 Mon Sep 17 00:00:00 2001 From: TritonSailor Date: Fri, 21 Sep 2018 09:30:30 -0500 Subject: [PATCH 1/3] Adds airsim_ros package supporting Redtail simulations in AirSim --- ros/packages/airsim_ros/CMakeLists.txt | 203 ++++++++++++++++++ .../launch/airsim_apm_rover_sitl.launch | 89 ++++++++ .../airsim_ros/launch/apm_sitl.launch | 25 +++ .../launch/trailnet_debug_airsim.launch | 47 ++++ ros/packages/airsim_ros/package.xml | 38 ++++ .../airsim_ros/scripts/car_image_raw_rgb.py | 59 +++++ ros/packages/airsim_ros/scripts/car_pose.py | 58 +++++ ros/packages/airsim_ros/scripts/car_rc.py | 67 ++++++ .../airsim_ros/scripts/drone_image_raw_rgb.py | 55 +++++ .../airsim_ros/scripts/reset_test_car.py | 18 ++ ros/packages/airsim_ros/scripts/setup_path.py | 52 +++++ .../airsim_ros/scripts/setup_path.pyc | Bin 0 -> 2154 bytes 12 files changed, 711 insertions(+) create mode 100644 ros/packages/airsim_ros/CMakeLists.txt create mode 100644 ros/packages/airsim_ros/launch/airsim_apm_rover_sitl.launch create mode 100644 ros/packages/airsim_ros/launch/apm_sitl.launch create mode 100644 ros/packages/airsim_ros/launch/trailnet_debug_airsim.launch create mode 100644 ros/packages/airsim_ros/package.xml create mode 100755 ros/packages/airsim_ros/scripts/car_image_raw_rgb.py create mode 100755 ros/packages/airsim_ros/scripts/car_pose.py create mode 100755 ros/packages/airsim_ros/scripts/car_rc.py create mode 100755 ros/packages/airsim_ros/scripts/drone_image_raw_rgb.py create mode 100755 ros/packages/airsim_ros/scripts/reset_test_car.py create mode 100644 ros/packages/airsim_ros/scripts/setup_path.py create mode 100644 ros/packages/airsim_ros/scripts/setup_path.pyc diff --git a/ros/packages/airsim_ros/CMakeLists.txt b/ros/packages/airsim_ros/CMakeLists.txt new file mode 100644 index 0000000..8b8b698 --- /dev/null +++ b/ros/packages/airsim_ros/CMakeLists.txt @@ -0,0 +1,203 @@ +cmake_minimum_required(VERSION 2.8.3) +project(airsim_ros) + +## Compile as C++11, supported in ROS Kinetic and newer +# add_compile_options(-std=c++11) + +## Find catkin macros and libraries +## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) +## is used, also find other catkin packages +find_package(catkin REQUIRED COMPONENTS + roscpp + rospy + std_msgs + geometry_msgs + sensor_msgs + ros_numpy + mavros_msgs +) + +## System dependencies are found with CMake's conventions +# find_package(Boost REQUIRED COMPONENTS system) + + +## Uncomment this if the package has a setup.py. This macro ensures +## modules and global scripts declared therein get installed +## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html +# catkin_python_setup() + +################################################ +## Declare ROS messages, services and actions ## +################################################ + +## To declare and build messages, services or actions from within this +## package, follow these steps: +## * Let MSG_DEP_SET be the set of packages whose message types you use in +## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). +## * In the file package.xml: +## * add a build_depend tag for "message_generation" +## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET +## * If MSG_DEP_SET isn't empty the following dependency has been pulled in +## but can be declared for certainty nonetheless: +## * add a exec_depend tag for "message_runtime" +## * In this file (CMakeLists.txt): +## * add "message_generation" and every package in MSG_DEP_SET to +## find_package(catkin REQUIRED COMPONENTS ...) +## * add "message_runtime" and every package in MSG_DEP_SET to +## catkin_package(CATKIN_DEPENDS ...) +## * uncomment the add_*_files sections below as needed +## and list every .msg/.srv/.action file to be processed +## * uncomment the generate_messages entry below +## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) + +## Generate messages in the 'msg' folder +# add_message_files( +# FILES +# Message1.msg +# Message2.msg +# ) + +## Generate services in the 'srv' folder +# add_service_files( +# FILES +# Service1.srv +# Service2.srv +# ) + +## Generate actions in the 'action' folder +# add_action_files( +# FILES +# Action1.action +# Action2.action +# ) + +## Generate added messages and services with any dependencies listed here +# generate_messages( +# DEPENDENCIES +# std_msgs +# ) + +################################################ +## Declare ROS dynamic reconfigure parameters ## +################################################ + +## To declare and build dynamic reconfigure parameters within this +## package, follow these steps: +## * In the file package.xml: +## * add a build_depend and a exec_depend tag for "dynamic_reconfigure" +## * In this file (CMakeLists.txt): +## * add "dynamic_reconfigure" to +## find_package(catkin REQUIRED COMPONENTS ...) +## * uncomment the "generate_dynamic_reconfigure_options" section below +## and list every .cfg file to be processed + +## Generate dynamic reconfigure parameters in the 'cfg' folder +# generate_dynamic_reconfigure_options( +# cfg/DynReconf1.cfg +# cfg/DynReconf2.cfg +# ) + +################################### +## catkin specific configuration ## +################################### +## The catkin_package macro generates cmake config files for your package +## Declare things to be passed to dependent projects +## INCLUDE_DIRS: uncomment this if your package contains header files +## LIBRARIES: libraries you create in this project that dependent projects also need +## CATKIN_DEPENDS: catkin_packages dependent projects also need +## DEPENDS: system dependencies of this project that dependent projects also need +catkin_package( +# INCLUDE_DIRS include +# LIBRARIES redsim +# CATKIN_DEPENDS roscpp rospy std_msgs +# DEPENDS system_lib +) + +########### +## Build ## +########### + +## Specify additional locations of header files +## Your package locations should be listed before other locations +include_directories( +# include + ${catkin_INCLUDE_DIRS} +) + +## Declare a C++ library +# add_library(${PROJECT_NAME} +# src/${PROJECT_NAME}/redsim.cpp +# ) + +## Add cmake target dependencies of the library +## as an example, code may need to be generated before libraries +## either from message generation or dynamic reconfigure +# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) + +## Declare a C++ executable +## With catkin_make all packages are built within a single CMake context +## The recommended prefix ensures that target names across packages don't collide +# add_executable(${PROJECT_NAME}_node src/redsim_node.cpp) + +## Rename C++ executable without prefix +## The above recommended prefix causes long target names, the following renames the +## target back to the shorter version for ease of user use +## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" +# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") + +## Add cmake target dependencies of the executable +## same as for the library above +# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) + +## Specify libraries to link a library or executable target against +# target_link_libraries(${PROJECT_NAME}_node +# ${catkin_LIBRARIES} +# ) + +############# +## Install ## +############# + +# all install targets should use catkin DESTINATION variables +# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html + +## Mark executable scripts (Python etc.) for installation +## in contrast to setup.py, you can choose the destination +# install(PROGRAMS +# scripts/my_python_script +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark executables and/or libraries for installation +# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark cpp header files for installation +# install(DIRECTORY include/${PROJECT_NAME}/ +# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +# FILES_MATCHING PATTERN "*.h" +# PATTERN ".svn" EXCLUDE +# ) + +## Mark other files for installation (e.g. launch and bag files, etc.) +# install(FILES +# # myfile1 +# # myfile2 +# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +# ) + +############# +## Testing ## +############# + +## Add gtest based cpp test target and link libraries +# catkin_add_gtest(${PROJECT_NAME}-test test/test_redsim.cpp) +# if(TARGET ${PROJECT_NAME}-test) +# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) +# endif() + +## Add folders to be run by python nosetests +# catkin_add_nosetests(test) diff --git a/ros/packages/airsim_ros/launch/airsim_apm_rover_sitl.launch b/ros/packages/airsim_ros/launch/airsim_apm_rover_sitl.launch new file mode 100644 index 0000000..8e6e08a --- /dev/null +++ b/ros/packages/airsim_ros/launch/airsim_apm_rover_sitl.launch @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ros/packages/airsim_ros/launch/apm_sitl.launch b/ros/packages/airsim_ros/launch/apm_sitl.launch new file mode 100644 index 0000000..9fb4533 --- /dev/null +++ b/ros/packages/airsim_ros/launch/apm_sitl.launch @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ros/packages/airsim_ros/launch/trailnet_debug_airsim.launch b/ros/packages/airsim_ros/launch/trailnet_debug_airsim.launch new file mode 100644 index 0000000..98f7e8b --- /dev/null +++ b/ros/packages/airsim_ros/launch/trailnet_debug_airsim.launch @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ros/packages/airsim_ros/package.xml b/ros/packages/airsim_ros/package.xml new file mode 100644 index 0000000..da72922 --- /dev/null +++ b/ros/packages/airsim_ros/package.xml @@ -0,0 +1,38 @@ + + + airsim_ros + 0.1.0 + ROS nodes for using Redtail with AirSim. + + Chris Gaddis + Chris Gaddis + BSD + + + catkin + roscpp + rospy + std_msgs + geometry_msgs + sensor_msgs + mavros_msgs + ros_numpy + roscpp + rospy + std_msgs + geometry_msgs + sensor_msgs + mavros_msgs + ros_numpy + roscpp + rospy + std_msgs + geometry_msgs + sensor_msgs + mavros_msgs + ros_numpy + + + + + diff --git a/ros/packages/airsim_ros/scripts/car_image_raw_rgb.py b/ros/packages/airsim_ros/scripts/car_image_raw_rgb.py new file mode 100755 index 0000000..8f3bf34 --- /dev/null +++ b/ros/packages/airsim_ros/scripts/car_image_raw_rgb.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +# Example ROS node for publishing AirSim images. + +from __future__ import print_function + +import setup_path +import airsim +import sys +import rospy + +# ROS Image message +from sensor_msgs.msg import Image + +def airpub(): + pub = rospy.Publisher("airsim_ros/image_raw", Image, queue_size=1) + rospy.init_node('image_raw', anonymous=True) + rate = rospy.Rate(30) # 30hz + + # connect to the AirSim simulator + + client = airsim.CarClient(ip = rospy.get_param('~airsim_ip', '127.0.0.1')) + + client.confirmConnection() + + while not rospy.is_shutdown(): + # get front center camera image from the car + responses = client.simGetImages([ + airsim.ImageRequest(1, airsim.ImageType.Scene, False, False)]) #scene vision image in uncompressed RGBA array + + for response in responses: + img_rgba_string = response.image_data_uint8 + img_rgb_string = ''.join("" if i % 4 == 0 else char for i, char in enumerate(img_rgba_string, 1)) + + + # Populate image message + msg=Image() + msg.header.stamp = rospy.Time.now() + msg.header.frame_id = "frameId" + msg.encoding = "rgb8" + msg.height = 360 # resolution should match values in settings.json + msg.width = 640 + msg.data = img_rgb_string + msg.is_bigendian = 0 + msg.step = msg.width * 3 + + # log time and size of published image + rospy.loginfo(len(response.image_data_uint8)) + # publish image message + pub.publish(msg) + # sleep until next cycle + rate.sleep() + + +if __name__ == '__main__': + try: + airpub() + except rospy.ROSInterruptException: + pass diff --git a/ros/packages/airsim_ros/scripts/car_pose.py b/ros/packages/airsim_ros/scripts/car_pose.py new file mode 100755 index 0000000..a81ed94 --- /dev/null +++ b/ros/packages/airsim_ros/scripts/car_pose.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +import setup_path +import airsim + +import rospy +import tf +from std_msgs.msg import String +from geometry_msgs.msg import PoseStamped + +import time + + +def airpub(): + pub = rospy.Publisher("airsimPose", PoseStamped, queue_size=1) + rospy.init_node('airpub', anonymous=True) + rate = rospy.Rate(30) # 30hz + + # connect to the AirSim simulator + client = airsim.CarClient(ip = rospy.get_param('~airsim_ip', '127.0.0.1')) + client.confirmConnection() + + + + while not rospy.is_shutdown(): + + # get state of the car + car_state = client.getCarState() + pos = car_state.kinematics_estimated.position + orientation = car_state.kinematics_estimated.orientation + + + # populate PoseStamped ros message + simPose = PoseStamped() + simPose.pose.position.x = pos.x_val + simPose.pose.position.y = pos.y_val + simPose.pose.position.z = pos.z_val + simPose.pose.orientation.w = orientation.w_val + simPose.pose.orientation.x = orientation.x_val + simPose.pose.orientation.y = orientation.y_val + simPose.pose.orientation.z = orientation.z_val + simPose.header.stamp = rospy.Time.now() + simPose.header.seq = 1 + simPose.header.frame_id = "simFrame" + + # log PoseStamped message + rospy.loginfo(simPose) + #publish PoseStamped message + pub.publish(simPose) + # sleeps until next cycle + rate.sleep() + + +if __name__ == '__main__': + try: + airpub() + except rospy.ROSInterruptException: + pass diff --git a/ros/packages/airsim_ros/scripts/car_rc.py b/ros/packages/airsim_ros/scripts/car_rc.py new file mode 100755 index 0000000..132ea6d --- /dev/null +++ b/ros/packages/airsim_ros/scripts/car_rc.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +from __future__ import print_function + +import setup_path +import airsim + +import rospy +import tf +import numpy as np +#import ros_numpy +from std_msgs.msg import String +from mavros_msgs.msg import OverrideRCIn + +# ROS Image message +from sensor_msgs.msg import Image + +class Car_RC(): + + def __init__(self): + airsim_ip = rospy.get_param('~airsim_ip', '127.0.0.1') + + print(airsim_ip) + self.client = airsim.CarClient(ip = airsim_ip) + self.client.confirmConnection() + + #Enable api control of car + self.client.enableApiControl(True) + self.car_controls = airsim.CarControls() + + self.listener() + + + def callback(self, data): #Get RC commands from Redtail + + rospy.loginfo(rospy.get_caller_id() + 'Throttle pwm %d Steering pwm %d', data.channels[2], data.channels[0]) + + throttle = data.channels[2] + throttle = (throttle - 1500.0)/500.0 + steering = np.float32(data.channels[0]) + + #Send RC commands to AirSim + self.car_controls.throttle = throttle + steering = (steering - 1500)/500 + self.car_controls.steering = steering + + self.client.setCarControls(self.car_controls) + + rospy.loginfo(rospy.get_caller_id() + 'Throttle %f Steering %f', throttle, steering) + + + def listener(self): #Listen for messages from Redtail + + rospy.Subscriber('/mavros/rc/override', OverrideRCIn, self.callback) + rospy.loginfo(rospy.get_caller_id() + 'Listening to /mavros/rc/override') + + rospy.spin() + +if __name__ == '__main__': + + rospy.init_node('car_rc', anonymous=True) + + try: + carRC = Car_RC() + + except rospy.ROSInterruptException: + pass diff --git a/ros/packages/airsim_ros/scripts/drone_image_raw_rgb.py b/ros/packages/airsim_ros/scripts/drone_image_raw_rgb.py new file mode 100755 index 0000000..d115e05 --- /dev/null +++ b/ros/packages/airsim_ros/scripts/drone_image_raw_rgb.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +# Example ROS node for publishing AirSim images. + +import setup_path +import airsim + +import rospy + +# ROS Image message +from sensor_msgs.msg import Image + +def airpub(): + pub = rospy.Publisher("airsim_ros/image_raw", Image, queue_size=1) + rospy.init_node('image_raw', anonymous=True) + rate = rospy.Rate(30) # 30hz + + # connect to the AirSim simulator + client = airsim.MultirotorClient(ip = rospy.get_param('~airsim_ip', '127.0.0.1')) + client.confirmConnection() + + while not rospy.is_shutdown(): + # get front center camera image from the car + responses = client.simGetImages([ + airsim.ImageRequest(1, airsim.ImageType.Scene, False, False)]) #scene vision image in uncompressed RGBA array + + for response in responses: + img_rgba_string = response.image_data_uint8 + img_rgb_string = ''.join("" if i % 4 == 0 else char for i, char in enumerate(img_rgba_string, 1)) + + + # Populate image message + msg=Image() + msg.header.stamp = rospy.Time.now() + msg.header.frame_id = "frameId" + msg.encoding = "rgb8" + msg.height = 360 # resolution should match values in settings.json + msg.width = 640 + msg.data = img_rgb_string + msg.is_bigendian = 0 + msg.step = msg.width * 3 + + # log time and size of published image + rospy.loginfo(len(response.image_data_uint8)) + # publish image message + pub.publish(msg) + # sleep until next cycle + rate.sleep() + + +if __name__ == '__main__': + try: + airpub() + except rospy.ROSInterruptException: + pass diff --git a/ros/packages/airsim_ros/scripts/reset_test_car.py b/ros/packages/airsim_ros/scripts/reset_test_car.py new file mode 100755 index 0000000..c989175 --- /dev/null +++ b/ros/packages/airsim_ros/scripts/reset_test_car.py @@ -0,0 +1,18 @@ +import setup_path +import airsim + +# connect to the AirSim simulator +client = airsim.CarClient(ip = "192.168.2.1") +client.confirmConnection() +client.enableApiControl(True) +client.armDisarm(True) +car_controls = airsim.CarControls() + +client.setCarControls(car_controls) + +print("reset") +client.reset() + +client.setCarControls(car_controls) + + diff --git a/ros/packages/airsim_ros/scripts/setup_path.py b/ros/packages/airsim_ros/scripts/setup_path.py new file mode 100644 index 0000000..362113f --- /dev/null +++ b/ros/packages/airsim_ros/scripts/setup_path.py @@ -0,0 +1,52 @@ +# Import this module to automatically setup path to local airsim module +# This module first tries to see if airsim module is installed via pip +# If it does then we don't do anything else +# Else we look up grand-parent folder to see if it has airsim folder +# and if it does then we add that in sys.path + +import os,sys,inspect,logging + +#this class simply tries to see if airsim +class SetupPath: + @staticmethod + def getDirLevels(path): + path_norm = os.path.normpath(path) + return len(path_norm.split(os.sep)) + + @staticmethod + def getCurrentPath(): + cur_filepath = os.path.abspath(inspect.getfile(inspect.currentframe())) + return os.path.dirname(cur_filepath) + + @staticmethod + def getGrandParentDir(): + cur_path = SetupPath.getCurrentPath() + if SetupPath.getDirLevels(cur_path) >= 2: + return os.path.dirname(os.path.dirname(cur_path)) + return '' + + @staticmethod + def getParentDir(): + cur_path = SetupPath.getCurrentPath() + if SetupPath.getDirLevels(cur_path) >= 1: + return os.path.dirname(cur_path) + return '' + + @staticmethod + def addAirSimModulePath(): + # if airsim module is installed then don't do anything else + #import pkgutil + #airsim_loader = pkgutil.find_loader('airsim') + #if airsim_loader is not None: + # return + + parent = SetupPath.getParentDir() + if parent != '': + airsim_path = os.path.join(parent, 'airsim') + client_path = os.path.join(airsim_path, 'client.py') + if os.path.exists(client_path): + sys.path.insert(0, parent) + else: + logging.warning("airsim module not found in parent folder. Using installed package (pip install airsim).") + +SetupPath.addAirSimModulePath() diff --git a/ros/packages/airsim_ros/scripts/setup_path.pyc b/ros/packages/airsim_ros/scripts/setup_path.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40f5056f771c76175c3f6070781ced3b6ba7152a GIT binary patch literal 2154 zcmb_cOK%iM5U!rt2M{|3TNXk>(MGvUa`3`|3nEd7k#ZrHGpi`dau`i!+Us7=&J5k{ z5F_AX{s%vVpOp(Y_^Ntm*M~?!%C6l#Rn^_~`05e=vwh>k`*+U@TK-~uf5dXXVk_~l zs3MxKXhl=i$s?LZ9Uap&rV?zA%9!2~T@w8r$b7E2Ze%iw#3mM zVz~sHCz>moNAyZey;kI7dId>Oju3_7|4G8HkCFjDVI__8J$zb(;je+H8@mvOwO6|K z9JFgI#rB@A7Spr+6IWWN`*q|yU;KrR#! z*9*#Xk}%XqMp6!nqf`~4|G?t@8jAqI)%c}M81K)GKV?rh7x%I)Rw3Vo_A4RZ3?Xx_ zcuB}_KwJ$OL2=e&vI}nixikw4Bf5-;hsH{XK^coM>Vzl@TvKFUk{`(1Ax}&ODkAm# zCDq%688W|4rHmU@Vnzy9M=8UGN9ZnTe#i5(s0?z4hBsiy{k}RKEt>MY(xbZZqm$;m zE=Q&wwUTM@RjKX4=r?ET8RX9ARi#TD7ialQkCN83op= Date: Tue, 25 Sep 2018 11:44:45 -0500 Subject: [PATCH 2/3] add settings file for AirSim settings.json.example --- ros/packages/airsim_ros/settings.json.example | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ros/packages/airsim_ros/settings.json.example diff --git a/ros/packages/airsim_ros/settings.json.example b/ros/packages/airsim_ros/settings.json.example new file mode 100644 index 0000000..55ed190 --- /dev/null +++ b/ros/packages/airsim_ros/settings.json.example @@ -0,0 +1,33 @@ +{ + "SettingsVersion": 1.2, + "SimMode": "", + "ClockType": "", + "ClockSpeed": 1, + "LocalHostIp": "", + "RecordUIVisible": true, + "LogMessagesVisible": true, + "ViewMode": "", + "RpcEnabled": true, + "EngineSound": false, + "PhysicsEngineName": "", + "SpeedUnitFactor": 1.0, + + "CameraDefaults": { + "CaptureSettings": [ + { + "ImageType": 0, + "Width": 640, + "Height": 360, + "FOV_Degrees": 90, + "AutoExposureSpeed": 100, + "AutoExposureBias": 0, + "AutoExposureMaxBrightness": 0.64, + "AutoExposureMinBrightness": 0.03, + "MotionBlurAmount": 0, + "TargetGamma": 1.0, + "ProjectionMode": "", + "OrthoWidth": 5.12 + } + ] + } +} From f7cc3df6e00c94b19a834c06f4d3f55bd80987d5 Mon Sep 17 00:00:00 2001 From: TritonSailor Date: Thu, 27 Sep 2018 15:45:29 -0500 Subject: [PATCH 3/3] adds AirSim settings.json examples for win64 and linux --- .../airsim_ros/settings.json.linuxexample | 33 ++++++ .../airsim_ros/settings.json.win64example | 102 ++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 ros/packages/airsim_ros/settings.json.linuxexample create mode 100644 ros/packages/airsim_ros/settings.json.win64example diff --git a/ros/packages/airsim_ros/settings.json.linuxexample b/ros/packages/airsim_ros/settings.json.linuxexample new file mode 100644 index 0000000..55ed190 --- /dev/null +++ b/ros/packages/airsim_ros/settings.json.linuxexample @@ -0,0 +1,33 @@ +{ + "SettingsVersion": 1.2, + "SimMode": "", + "ClockType": "", + "ClockSpeed": 1, + "LocalHostIp": "", + "RecordUIVisible": true, + "LogMessagesVisible": true, + "ViewMode": "", + "RpcEnabled": true, + "EngineSound": false, + "PhysicsEngineName": "", + "SpeedUnitFactor": 1.0, + + "CameraDefaults": { + "CaptureSettings": [ + { + "ImageType": 0, + "Width": 640, + "Height": 360, + "FOV_Degrees": 90, + "AutoExposureSpeed": 100, + "AutoExposureBias": 0, + "AutoExposureMaxBrightness": 0.64, + "AutoExposureMinBrightness": 0.03, + "MotionBlurAmount": 0, + "TargetGamma": 1.0, + "ProjectionMode": "", + "OrthoWidth": 5.12 + } + ] + } +} diff --git a/ros/packages/airsim_ros/settings.json.win64example b/ros/packages/airsim_ros/settings.json.win64example new file mode 100644 index 0000000..367153b --- /dev/null +++ b/ros/packages/airsim_ros/settings.json.win64example @@ -0,0 +1,102 @@ +{ + "SettingsVersion": 1.2, + "SimMode": "", + "ClockType": "", + "ClockSpeed": 1, + "LocalHostIp": "192.168.2.1", + "RecordUIVisible": true, + "LogMessagesVisible": true, + "ViewMode": "", + "RpcEnabled": true, + "EngineSound": false, + "PhysicsEngineName": "", + "SpeedUnitFactor": 1.0, + + "CameraDefaults": { + "CaptureSettings": [ + { + "ImageType": 0, + "Width": 640, + "Height": 360, + "FOV_Degrees": 90, + "AutoExposureSpeed": 100, + "AutoExposureBias": 0, + "AutoExposureMaxBrightness": 0.64, + "AutoExposureMinBrightness": 0.03, + "MotionBlurAmount": 0, + "TargetGamma": 1.0, + "ProjectionMode": "", + "OrthoWidth": 5.12 + } + ] + }, + + + + "PawnPaths": { + "DefaultCar": {"PawnBP": "Class'/AirSim/VehicleAdv/SUV/SuvCarPawn.SuvCarPaw$ + "Buggy": {"PawnBP": "Class'/AirSim/VehicleAdv/Buggy/Buggy.Buggy_C'"}, + "DefaultQuadrotor": {"PawnBP": "Class'/AirSim/Blueprints/BP_FlyingPawn.BP_F$ + "DefaultComputerVision": {"PawnBP": "Class'/AirSim/Blueprints/BP_ComputerVi$ + "AirSimQuadrotor": {"PawnBP": "Class'/AirSim/Blueprints/BP_FlyingPawn.BP_Fl$ + "GoldenEagle": {"PawnBP": "Class'/AirSim/Blueprints/GoldenEagle.GoldenEagle$ + }, + + "Vehicles": { + "Suv": { + "VehicleType": "PhysXCar", + "DefaultVehicleState": "Armed", + "AutoCreate": true, + "PawnPath": "Buggy", + "EnableCollisionPassthrogh": false, + "EnableCollisions": true, + "IsFpvVehicle": true, + "AllowAPIAlways": true, + "RC": { + "RemoteControlID": 0, + "AllowAPIWhenDisconnected": false + } + }, + "Buggy": { + "VehicleType": "PhysXCar", + "DefaultVehicleState": "Armed", + "AutoCreate": false, + "PawnPath": "Buggy", + "EnableCollisionPassthrogh": false, + "EnableCollisions": true, + "IsFpvVehicle": false, + "AllowAPIAlways": true, + "RC": { + "RemoteControlID": 0, + "AllowAPIWhenDisconnected": false + } + }, + "Multirotor": { + "VehicleType": "SimpleFlight", + "DefaultVehicleState": "Armed", + "AutoCreate": true, + "PawnPath": "", + "IsFpvVehicle": true, + "AllowAPIAlways": true, + "RC": { + "RemoteControlID": -1 + } + }, + + "Eagle": { + "VehicleType": "SimpleFlight", + "DefaultVehicleState": "Armed", + "AutoCreate": false, + "PawnPath": "GoldenEagle", + "EnableCollisionPassthrogh": false, + "EnableCollisions": true, + "IsFpvVehicle": false, + "AllowAPIAlways": true, + "RC": { + "RemoteControlID": -1 + } + } + } +} + +