-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2506 from songxiaocheng/PR/set_traceline
Features: add an api for setting trace line color and thickness
- Loading branch information
Showing
10 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,46 @@ | ||
# Please add "EnableTrace": true to your setting.json as shown below | ||
|
||
# { | ||
# "SettingsVersion": 1.2, | ||
# "SimMode": "Multirotor", | ||
# "Vehicles": { | ||
# "Drone": { | ||
# "VehicleType": "SimpleFlight", | ||
# "EnableTrace": true | ||
# } | ||
# } | ||
# } | ||
|
||
import setup_path | ||
import airsim | ||
import time | ||
|
||
# connect to the AirSim simulator | ||
client = airsim.MultirotorClient() | ||
client.confirmConnection() | ||
client.enableApiControl(True) | ||
client.armDisarm(True) | ||
|
||
client.takeoffAsync().join() | ||
client.hoverAsync().join() | ||
|
||
vehicleControl = client.moveByVelocityAsync(1, 1, 0, 12) | ||
|
||
client.simSetTraceLine([1.0, 0.0, 0.0, 1.0], 5) | ||
time.sleep(2) | ||
client.simSetTraceLine([0.0, 1.0, 0.0, 0.8], 10) | ||
time.sleep(2) | ||
client.simSetTraceLine([0.0, 0.0, 1.0, 0.6], 20) | ||
time.sleep(2) | ||
client.simSetTraceLine([1.0, 1.0, 0.0, 0.4], 30) | ||
time.sleep(2) | ||
client.simSetTraceLine([0.0, 1.0, 1.0, 0.2], 40) | ||
time.sleep(2) | ||
client.simSetTraceLine([1.0, 0.0, 1.0, 0.1], 50) | ||
time.sleep(2) | ||
|
||
vehicleControl.join() | ||
|
||
client.armDisarm(False) | ||
client.takeoffAsync().join() | ||
client.enableApiControl(False) |
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
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