Skip to content

Commit a5f162b

Browse files
committed
docs update complete
1 parent 3e51cf5 commit a5f162b

26 files changed

+506
-329
lines changed

AirLib/include/common/AirSimSettings.hpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ struct AirSimSettings {
566566
//these settings_json are expected in same section, not in another child
567567
auto vehicle_setting = std::unique_ptr<PX4VehicleSetting>(new PX4VehicleSetting());
568568

569+
//TODO: we should be selecting remote if available else keyboard
570+
//currently keyboard is not supported so use rc as default
571+
vehicle_setting->rc.remote_control_id = 0;
572+
569573
MavLinkConnectionInfo &connection_info = vehicle_setting->connection_info;
570574
connection_info.sim_sysid = static_cast<uint8_t>(settings_json.getInt("SimSysID", connection_info.sim_sysid));
571575
connection_info.sim_compid = settings_json.getInt("SimCompID", connection_info.sim_compid);
@@ -620,8 +624,15 @@ struct AirSimSettings {
620624
std::unique_ptr<VehicleSetting> vehicle_setting;
621625
if (vehicle_type == kVehicleTypePX4)
622626
vehicle_setting = createPX4VehicleSetting(settings_json);
623-
else //for everything else we don't need derived class yet
627+
//for everything else we don't need derived class yet
628+
else {
624629
vehicle_setting = std::unique_ptr<VehicleSetting>(new VehicleSetting());
630+
if (vehicle_type == kVehicleTypeSimpleFlight) {
631+
//TODO: we should be selecting remote if available else keyboard
632+
//currently keyboard is not supported so use rc as default
633+
vehicle_setting->rc.remote_control_id = 0;
634+
}
635+
}
625636
vehicle_setting->vehicle_name = vehicle_name;
626637

627638
//required settings_json
@@ -660,6 +671,9 @@ struct AirSimSettings {
660671
{
661672
vehicles.clear();
662673

674+
//NOTE: Do not set defaults for vehicle type here. If you do then make sure
675+
//to sync code in createVehicleSetting() as well.
676+
663677
//create simple flight as default multirotor
664678
auto simple_flight_setting = std::unique_ptr<VehicleSetting>(new VehicleSetting());
665679
simple_flight_setting->vehicle_name = "SimpleFlight";
@@ -692,6 +706,10 @@ struct AirSimSettings {
692706
std::vector<std::string> keys;
693707
vehicles_child.getChildNames(keys);
694708

709+
//remove default vehicles, if values are specified in settings
710+
if (keys.size())
711+
vehicles.clear();
712+
695713
for (const auto& key : keys) {
696714
msr::airlib::Settings child;
697715
vehicles_child.getChild(key, child);

PythonClient/README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
# Python API Examples for AirSim
1+
# Python API for AirSim
22

3-
This folder contains Python package and examples for [AirSim](https://github.com/microsoft/airsim).
3+
This package contains Python APIs for [AirSim](https://github.com/microsoft/airsim).
44

5-
## Pre-requisites
6-
Please make sure you have installed Python package for msgpack (this needs administrator/sudo prompt):
5+
## How to Use
6+
See examples at [car/hello_car.py](https://github.com/Microsoft/AirSim/blob/master/PythonClient/car/hello_car.py) or [multirotor\hello_drone.py](https://github.com/Microsoft/AirSim/blob/master/PythonClient/hello_drone.py).
7+
8+
## Dependencies
9+
This package depends on `msgpack` and would automatically install `msgpack-rpc-python` (this may need administrator/sudo prompt):
710
```
811
pip install msgpack-rpc-python
912
```
1013

11-
Some examples requires opencv. You can install required packages by running `install_packages.bat`.
12-
13-
Note: Do not run `setup.py`. It is meant for creating python package.
14-
15-
## How to Run
16-
Try out `car/hello_car.py` or `multirotor\hello_drone.py`.
17-
You can run them either from Visual Studio solution or from command line like usual Python scripts.
18-
Also explore other examples.
19-
20-
## Folder Structure
21-
22-
The `airsim` folder contains wrapper over msgpack APIs to expose AirSim APIs in friendly Pythonic way.
23-
Other folders contains example code for how to use APIs.
14+
Some examples also requires opencv.
2415

2516
## More Info
2617

PythonClient/airsim.egg-info/PKG-INFO

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Metadata-Version: 2.1
2+
Name: airsim
3+
Version: 1.2.0
4+
Summary: Open source simulator based on Unreal Engine for autonomous vehicles from Microsoft AI & Research
5+
Home-page: https://github.com/microsoft/airsim
6+
Author: Shital Shah
7+
Author-email: sytelus@gmail.com
8+
License: UNKNOWN
9+
Description: # Python API Examples for AirSim
10+
11+
This folder contains Python package and examples for [AirSim](https://github.com/microsoft/airsim).
12+
13+
## Pre-requisites
14+
Please make sure you have installed Python package for msgpack (this needs administrator/sudo prompt):
15+
```
16+
pip install msgpack-rpc-python
17+
```
18+
19+
Some examples requires opencv. You can install required packages by running `install_packages.bat`.
20+
21+
Note: Do not run `setup.py`. It is meant for creating python package.
22+
23+
## How to Run
24+
Try out `car/hello_car.py` or `multirotor\hello_drone.py`.
25+
You can run them either from Visual Studio solution or from command line like usual Python scripts.
26+
Also explore other examples.
27+
28+
## Folder Structure
29+
30+
The `airsim` folder contains wrapper over msgpack APIs to expose AirSim APIs in friendly Pythonic way.
31+
Other folders contains example code for how to use APIs.
32+
33+
## More Info
34+
35+
More information on AirSim Python APIs can be found at:
36+
https://github.com/Microsoft/AirSim/blob/master/docs/python.md
37+
38+
39+
Platform: UNKNOWN
40+
Classifier: Programming Language :: Python :: 3
41+
Classifier: License :: OSI Approved :: MIT License
42+
Classifier: Operating System :: OS Independent
43+
Description-Content-Type: text/markdown
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
README.md
2+
setup.py
3+
airsim/__init__.py
4+
airsim/client.py
5+
airsim/pfm.py
6+
airsim/types.py
7+
airsim/utils.py
8+
airsim.egg-info/PKG-INFO
9+
airsim.egg-info/SOURCES.txt
10+
airsim.egg-info/dependency_links.txt
11+
airsim.egg-info/top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
airsim

PythonClient/car/setup_path.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ def getParentDir():
3535
@staticmethod
3636
def addAirSimModulePath():
3737
# if airsim module is installed then don't do anything else
38-
import pkgutil
39-
airsim_loader = pkgutil.find_loader('airsim')
40-
if airsim_loader is not None:
41-
return
42-
43-
grand_parent = SetupPath.getParentDir()
44-
if grand_parent != '':
45-
airsim_path = os.path.join(grand_parent, 'airsim')
38+
#import pkgutil
39+
#airsim_loader = pkgutil.find_loader('airsim')
40+
#if airsim_loader is not None:
41+
# return
42+
43+
parent = SetupPath.getParentDir()
44+
if parent != '':
45+
airsim_path = os.path.join(parent, 'airsim')
4646
client_path = os.path.join(airsim_path, 'client.py')
4747
if os.path.exists(client_path):
48-
sys.path.insert(0, grand_parent)
48+
sys.path.insert(0, parent)
4949
else:
50-
logging.warning("airsim module not found in grand parent folder. Using default installed module (if any).")
50+
logging.warning("airsim module not found in parent folder. Using installed package (pip install airsim).")
5151

5252
SetupPath.addAirSimModulePath()
10.2 KB
Binary file not shown.

PythonClient/dist/airsim-1.2.0.tar.gz

8.39 KB
Binary file not shown.

PythonClient/setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
"License :: OSI Approved :: MIT License",
1919
"Operating System :: OS Independent",
2020
),
21+
install_requires=[
22+
'msgpack-rpc-python', 'numpy'
23+
]
2124
)

0 commit comments

Comments
 (0)