Skip to content

Commit

Permalink
Updated PyPi package, changed move in build (#1403)
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus authored and Mayankm96 committed Oct 19, 2018
1 parent c5ed97d commit 7d82674
Show file tree
Hide file tree
Showing 37 changed files with 3,435 additions and 2 deletions.
192 changes: 192 additions & 0 deletions PythonClient/ros/airsim_ros_client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
research/

devel/
logs/
build/
bin/
lib/
msg_gen/
srv_gen/
msg/*Action.msg
msg/*ActionFeedback.msg
msg/*ActionGoal.msg
msg/*ActionResult.msg
msg/*Feedback.msg
msg/*Goal.msg
msg/*Result.msg
msg/_*.py

# Bag files
*.bag

# Generated by dynamic reconfigure
*.cfgc
/cfg/cpp/
/cfg/*.py

# Ignore generated docs
*.dox
*.wikidoc

# eclipse stuff
.project
.cproject

# qcreator stuff
CMakeLists.txt.user

srv/_*.py
*.pcd
*.pyc
qtcreator-*
*.user

/planning/cfg
/planning/docs
/planning/src

*~

# Emacs
.#*

# Catkin custom files
CATKIN_IGNORE

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
31 changes: 31 additions & 0 deletions PythonClient/ros/airsim_ros_client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 2.8.3)
project(airsim_ros_client)

## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
rospy
sensor_msgs
geometry_msgs
nav_msgs
tf2_ros
)

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES airsim_python_wrapper
# CATKIN_DEPENDS rospy sensor_msgs geometry_msgs nav_msgs tf2_ros
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
include_directories(
${catkin_INCLUDE_DIRS}
)
115 changes: 115 additions & 0 deletions PythonClient/ros/airsim_ros_client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# airsim_ros_client

## Overview

This repository is meant to integrate ROS and AirSim plugin using the python APIs available for the simulator.

The `airsim_ros_client` package has been tested under ROS Kinetic and Ubuntu 16.04LTS. The source code is released under [MIT Licence](LICENSE).

## Installation

#### Dependencies

Install the python depenencies:
```bash
# AirSim APIs
pip install airsim
```

#### Building
* To build from source, clone the latest version from this repository into your catkin workspace
```bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/Mayankm96/airsim_ros_wrapper.git
```
* To compile the package:
```bash
cd ~/catkin_ws
catkin_make
source devel/setup.bash
```

#### Running AirSim in Unreal Engine

Before running the nodes in the package, you need to run Airsim plugin in the Unreal Engine. In case you are unfamiliar on how to do so, refer to the tutorials available [here](https://github.com/Microsoft/AirSim#tutorials).

A sample `settings.json` file used to run the simulator with the ROS package is available [here](docs/settings.json). Copy it to the `~/Documents/AirSim` directory to use the package without any further modifications.

## Usage

### Running the `tf` publisher of drone model (DJI M100)

To use the [`urdf`](urdf) model of the drone used in AirSim simulator, then run:
```
roslaunch airsim_ros_wrapper publish_tf.launch
```

__NOTE:__ In the modified blueprint of the drone for UE4, all cameras are downward-facing.

### Running image publisher

Change the IP and Port configurations in [`pubImages.launch`](launch/pubImages.launch) to match the settings in which Airsim is running. Then:
```
roslaunch airsim_ros_wrapper pubImages.launch
```

## Nodes

### airsim_img_publisher

This is a client node at ([`img_publisher.py`](scripts/img_publisher.py)) interfaces with the AirSim plugin to retrieve the drone's pose and camera images **(rgb, depth)**.

#### Published Topics

* **`/airsim/rgb/image_raw`** ([sensor_msgs/Image])

The rgb camera images in `rgba8` encoding.

* **`/airsim/depth`** ([sensor_msgs/Image])

The depth camera images in `32FC1` encoding.

* **`/airsim/camera_info`** ([sensor_msgs/CameraInfo])

The rgb camera paramters.

* **`/airsim/depth/camera_info`** ([sensor_msgs/CameraInfo])

The depth camera paramters.

* **`/airsim/pose`** ([geometry_msgs/PoseStamped])

The position/orientation of the quadcoper (`base_link`)

* **`/odom`** ([nav_msgs/Odometry])

The odometry of the quadcoper (`base_link`) in the `world` frame

* **`/tf`**

tf tree with the origin (`world`), the position/orientation of the quadcoper (`base_link`)


#### Parameters
* **Camera parameters:** `Fx`, `Fy`, `cx`, `cz`, `width`, `height`
* **Publishing frequency:** `loop_rate`

### airsim_follow_trajectory

This is a client node at ([`follow_trajectory.py`](scripts/follow_trajectory.py)) interfaces with the AirSim plugin to follow a trajectory.

#### Subscribed Topics

* **`/trajectory/spline_marker_array`** ([visualization_msgs/MarkerArray])

An array of waypoints to follow.

#### Parameters
* **Velocity:** `velocity`

[sensor_msgs/Image]: http://docs.ros.org/api/sensor_msgs/html/msg/Image.html
[sensor_msgs/CameraInfo]: http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html
[geometry_msgs/PoseStamped]: http://docs.ros.org/melodic/api/geometry_msgs/html/msg/PoseStamped.html
[nav_msgs/Odometry]: http://docs.ros.org/melodic/api/nav_msgs/html/msg/Odometry.html
[visualization_msgs/MarkerArray]: http://docs.ros.org/melodic/api/visualization_msgs/html/msg/MarkerArray.html/Odometry.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7d82674

Please sign in to comment.