forked from Cosys-Lab/Cosys-AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated matlab toolbox to 3.1. Updated example to use vehicleName arg…
…ument. Added example for two drones. Added async launch options for drone functions with join argument. Ref Cosys-Lab#32
- Loading branch information
1 parent
c8edc4b
commit a930b71
Showing
15 changed files
with
419 additions
and
296 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
%% Example two drones | ||
% | ||
% This works well with the settings below: | ||
% | ||
% { | ||
% "SeeDocsAt": "https://cosys-lab.github.io/settings/", | ||
% "SettingsVersion": 2, | ||
% "ClockSpeed": 1, | ||
% "LocalHostIp": "127.0.0.1", | ||
% "ApiServerPort": 41451, | ||
% "RpcEnabled": true, | ||
% "SimMode": "Multirotor", | ||
% "Vehicles": { | ||
% "Drone1": { | ||
% "VehicleType": "SimpleFlight", | ||
% "AllowAPIAlways": true, | ||
% "X": 0, | ||
% "Y": 0, | ||
% "Z": 0, | ||
% "Yaw": 0 | ||
% }, | ||
% "Drone2": { | ||
% "VehicleType": "SimpleFlight", | ||
% "AllowAPIAlways": true, | ||
% "X": 5, | ||
% "Y": 0, | ||
% "Z": 0, | ||
% "Yaw": 0 | ||
% } | ||
% } | ||
% } | ||
|
||
airSimClient = AirSimClient(IsDrone=true, IP="127.0.0.1", port=41451); | ||
|
||
airSimClient.setEnableApiControl("Drone1"); | ||
airSimClient.setEnableApiControl("Drone2"); | ||
|
||
airSimClient.setEnableDroneArm("Drone1"); | ||
airSimClient.setEnableDroneArm("Drone2"); | ||
|
||
airSimClient.takeoffAsync("Drone1", 20, true); | ||
airSimClient.takeoffAsync("Drone2", 20, false); | ||
|
||
airSimClient.moveToPositionAsync(10, 10, -5, 5, 3e+38, AirSimDrivetrainTypes.MaxDegreeOfFreedom, true, 0, -1, 1, "Drone1", true); | ||
airSimClient.moveToPositionAsync(10, 14, -5, 5, 3e+38, AirSimDrivetrainTypes.MaxDegreeOfFreedom, true, 0, -1, 1, "Drone2", true); | ||
|
||
airSimClient.landAsync("Drone1", 60, true); | ||
airSimClient.landAsync("Drone2", 60, false); | ||
|
||
airSimClient.setDisableDroneArm("Drone1"); | ||
airSimClient.setDisableDroneArm("Drone2"); | ||
|
||
airSimClient.setDisableApiControl("Drone1"); | ||
airSimClient.setDisableApiControl("Drone2"); |
Oops, something went wrong.