Skip to content

Commit

Permalink
Position + Pose Correct. Bugs with rel. position solved. Camera goes …
Browse files Browse the repository at this point in the history
…takes images ubove cieling, not all files are being saved in folder
  • Loading branch information
MichaelLee0 committed Apr 2, 2021
1 parent 2788009 commit ed869c6
Show file tree
Hide file tree
Showing 7 changed files with 748 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Data_Collection/grid_search_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

segmentation = True
file_name = "pos.txt"
unreal_object = [1.2, 1.4, 0] # Hardcoded Package Details

# corner points distance [meters] relative to spawn location
TOP_LEFT = (-0.9, -0.9)
Expand Down Expand Up @@ -59,7 +60,7 @@ def load_points(x_increment, y_increment, z_increment):
pts_L = []
x_coords = np.linspace(TOP_LEFT[0], TOP_RIGHT[0], num=x_increment)
y_coords = np.linspace(TOP_LEFT[1], BOT_LEFT[1], num=y_increment)
z_coords = np.linspace(0, MAX_HEIGHT, num=z_increment)
z_coords = np.linspace(0, -MAX_HEIGHT, num=z_increment)

for x in x_coords:
for y in y_coords:
Expand All @@ -83,12 +84,12 @@ def collect_data(x_increment, y_increment, z_increment, rot_increment):
for [x, y, z] in pts:
for yaw in rot_coords:
# TODO: figure out what second param does
client.simSetVehiclePost(airsim.Pos(airsim.Vector3r(x, y, z), airsim.to_quaternion(0, 0, yaw)), True) # PRY in radians
client.simSetVehiclePose(airsim.Pose(airsim.Vector3r(x, y, z), airsim.to_quaternion(0, 0, yaw)), True) # PRY in radians
time.sleep(0.2)

# save data with desired channel
if segmentation:
success = client.simSetSegmentationObjectID(object_name, 20)
# success = client.simSetSegmentationObjectID(object_name, 20)
responses = client.simGetImages([
airsim.ImageRequest("0", airsim.ImageType.Scene), # REGULAR PICTURE
airsim.ImageRequest("0", airsim.ImageType.Segmentation, False, False)])
Expand Down
Binary file added data/GridSearch/Normal/-0.9_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/GridSearch/Normal/0.0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/GridSearch/Segmentation/-0.9_1.pfm
Binary file not shown.
Binary file added data/GridSearch/Segmentation/0.0_1.pfm
Binary file not shown.
743 changes: 743 additions & 0 deletions data/GridSearch/pos.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion unreal_envs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
**/Blocks
**/indoor_cloud
**/indoor_complex
**/PAGENT1
**/PAGENT1_Full
**/PAGENT1
**/Backup
*.zip
*.7Z
Expand Down

0 comments on commit ed869c6

Please sign in to comment.