Skip to content

Commit 1cfe5be

Browse files
committed
added ROS client package in python
1 parent 5ad5b98 commit 1cfe5be

34 files changed

+3431
-0
lines changed
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
research/
2+
3+
devel/
4+
logs/
5+
build/
6+
bin/
7+
lib/
8+
msg_gen/
9+
srv_gen/
10+
msg/*Action.msg
11+
msg/*ActionFeedback.msg
12+
msg/*ActionGoal.msg
13+
msg/*ActionResult.msg
14+
msg/*Feedback.msg
15+
msg/*Goal.msg
16+
msg/*Result.msg
17+
msg/_*.py
18+
19+
# Bag files
20+
*.bag
21+
22+
# Generated by dynamic reconfigure
23+
*.cfgc
24+
/cfg/cpp/
25+
/cfg/*.py
26+
27+
# Ignore generated docs
28+
*.dox
29+
*.wikidoc
30+
31+
# eclipse stuff
32+
.project
33+
.cproject
34+
35+
# qcreator stuff
36+
CMakeLists.txt.user
37+
38+
srv/_*.py
39+
*.pcd
40+
*.pyc
41+
qtcreator-*
42+
*.user
43+
44+
/planning/cfg
45+
/planning/docs
46+
/planning/src
47+
48+
*~
49+
50+
# Emacs
51+
.#*
52+
53+
# Catkin custom files
54+
CATKIN_IGNORE
55+
56+
# Prerequisites
57+
*.d
58+
59+
# Compiled Object files
60+
*.slo
61+
*.lo
62+
*.o
63+
*.obj
64+
65+
# Precompiled Headers
66+
*.gch
67+
*.pch
68+
69+
# Compiled Dynamic libraries
70+
*.so
71+
*.dylib
72+
*.dll
73+
74+
# Fortran module files
75+
*.mod
76+
*.smod
77+
78+
# Compiled Static libraries
79+
*.lai
80+
*.la
81+
*.a
82+
*.lib
83+
84+
# Executables
85+
*.exe
86+
*.out
87+
*.app
88+
89+
# Byte-compiled / optimized / DLL files
90+
__pycache__/
91+
*.py[cod]
92+
*$py.class
93+
94+
# C extensions
95+
*.so
96+
97+
# Distribution / packaging
98+
.Python
99+
build/
100+
develop-eggs/
101+
dist/
102+
downloads/
103+
eggs/
104+
.eggs/
105+
lib/
106+
lib64/
107+
parts/
108+
sdist/
109+
var/
110+
wheels/
111+
*.egg-info/
112+
.installed.cfg
113+
*.egg
114+
MANIFEST
115+
116+
# PyInstaller
117+
# Usually these files are written by a python script from a template
118+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
119+
*.manifest
120+
*.spec
121+
122+
# Installer logs
123+
pip-log.txt
124+
pip-delete-this-directory.txt
125+
126+
# Unit test / coverage reports
127+
htmlcov/
128+
.tox/
129+
.coverage
130+
.coverage.*
131+
.cache
132+
nosetests.xml
133+
coverage.xml
134+
*.cover
135+
.hypothesis/
136+
.pytest_cache/
137+
138+
# Translations
139+
*.mo
140+
*.pot
141+
142+
# Django stuff:
143+
*.log
144+
local_settings.py
145+
db.sqlite3
146+
147+
# Flask stuff:
148+
instance/
149+
.webassets-cache
150+
151+
# Scrapy stuff:
152+
.scrapy
153+
154+
# Sphinx documentation
155+
docs/_build/
156+
157+
# PyBuilder
158+
target/
159+
160+
# Jupyter Notebook
161+
.ipynb_checkpoints
162+
163+
# pyenv
164+
.python-version
165+
166+
# celery beat schedule file
167+
celerybeat-schedule
168+
169+
# SageMath parsed files
170+
*.sage.py
171+
172+
# Environments
173+
.env
174+
.venv
175+
env/
176+
venv/
177+
ENV/
178+
env.bak/
179+
venv.bak/
180+
181+
# Spyder project settings
182+
.spyderproject
183+
.spyproject
184+
185+
# Rope project settings
186+
.ropeproject
187+
188+
# mkdocs documentation
189+
/site
190+
191+
# mypy
192+
.mypy_cache/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(airsim_ros_client)
3+
4+
## Find catkin macros and libraries
5+
find_package(catkin REQUIRED COMPONENTS
6+
rospy
7+
sensor_msgs
8+
geometry_msgs
9+
nav_msgs
10+
tf2_ros
11+
)
12+
13+
###################################
14+
## catkin specific configuration ##
15+
###################################
16+
## The catkin_package macro generates cmake config files for your package
17+
catkin_package(
18+
# INCLUDE_DIRS include
19+
# LIBRARIES airsim_python_wrapper
20+
# CATKIN_DEPENDS rospy sensor_msgs geometry_msgs nav_msgs tf2_ros
21+
# DEPENDS system_lib
22+
)
23+
24+
###########
25+
## Build ##
26+
###########
27+
28+
## Specify additional locations of header files
29+
include_directories(
30+
${catkin_INCLUDE_DIRS}
31+
)
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# airsim_ros_client
2+
3+
## Overview
4+
5+
This repository is meant to integrate ROS and AirSim plugin using the python APIs available for the simulator.
6+
7+
The `airsim_ros_client` package has been tested under ROS Kinetic and Ubuntu 16.04LTS. The source code is released under [MIT Licence](LICENSE).
8+
9+
## Installation
10+
11+
#### Dependencies
12+
13+
Install the python depenencies:
14+
```bash
15+
# AirSim APIs
16+
pip install airsim
17+
```
18+
19+
#### Building
20+
* To build from source, clone the latest version from this repository into your catkin workspace
21+
```bash
22+
mkdir -p ~/catkin_ws/src
23+
cd ~/catkin_ws/src
24+
git clone https://github.com/Mayankm96/airsim_ros_wrapper.git
25+
```
26+
* To compile the package:
27+
```bash
28+
cd ~/catkin_ws
29+
catkin_make
30+
source devel/setup.bash
31+
```
32+
33+
#### Running AirSim in Unreal Engine
34+
35+
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).
36+
37+
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.
38+
39+
## Usage
40+
41+
### Running the `tf` publisher of drone model (DJI M100)
42+
43+
To use the [`urdf`](urdf) model of the drone used in AirSim simulator, then run:
44+
```
45+
roslaunch airsim_ros_wrapper publish_tf.launch
46+
```
47+
48+
__NOTE:__ In the modified blueprint of the drone for UE4, all cameras are downward-facing.
49+
50+
### Running image publisher
51+
52+
Change the IP and Port configurations in [`pubImages.launch`](launch/pubImages.launch) to match the settings in which Airsim is running. Then:
53+
```
54+
roslaunch airsim_ros_wrapper pubImages.launch
55+
```
56+
57+
## Nodes
58+
59+
### airsim_img_publisher
60+
61+
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)**.
62+
63+
#### Published Topics
64+
65+
* **`/airsim/rgb/image_raw`** ([sensor_msgs/Image])
66+
67+
The rgb camera images in `rgba8` encoding.
68+
69+
* **`/airsim/depth`** ([sensor_msgs/Image])
70+
71+
The depth camera images in `32FC1` encoding.
72+
73+
* **`/airsim/camera_info`** ([sensor_msgs/CameraInfo])
74+
75+
The rgb camera paramters.
76+
77+
* **`/airsim/depth/camera_info`** ([sensor_msgs/CameraInfo])
78+
79+
The depth camera paramters.
80+
81+
* **`/airsim/pose`** ([geometry_msgs/PoseStamped])
82+
83+
The position/orientation of the quadcoper (`base_link`)
84+
85+
* **`/odom`** ([nav_msgs/Odometry])
86+
87+
The odometry of the quadcoper (`base_link`) in the `world` frame
88+
89+
* **`/tf`**
90+
91+
tf tree with the origin (`world`), the position/orientation of the quadcoper (`base_link`)
92+
93+
94+
#### Parameters
95+
* **Camera parameters:** `Fx`, `Fy`, `cx`, `cz`, `width`, `height`
96+
* **Publishing frequency:** `loop_rate`
97+
98+
### airsim_follow_trajectory
99+
100+
This is a client node at ([`follow_trajectory.py`](scripts/follow_trajectory.py)) interfaces with the AirSim plugin to follow a trajectory.
101+
102+
#### Subscribed Topics
103+
104+
* **`/trajectory/spline_marker_array`** ([visualization_msgs/MarkerArray])
105+
106+
An array of waypoints to follow.
107+
108+
#### Parameters
109+
* **Velocity:** `velocity`
110+
111+
[sensor_msgs/Image]: http://docs.ros.org/api/sensor_msgs/html/msg/Image.html
112+
[sensor_msgs/CameraInfo]: http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html
113+
[geometry_msgs/PoseStamped]: http://docs.ros.org/melodic/api/geometry_msgs/html/msg/PoseStamped.html
114+
[nav_msgs/Odometry]: http://docs.ros.org/melodic/api/nav_msgs/html/msg/Odometry.html
115+
[visualization_msgs/MarkerArray]: http://docs.ros.org/melodic/api/visualization_msgs/html/msg/MarkerArray.html/Odometry.html
38.6 KB
Loading

0 commit comments

Comments
 (0)