Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Jun 9, 2017
1 parent d051de9 commit c73cdd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion PythonClient/PythonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def rotateByYawRate(self, yaw_rate, duration):
# image_type uses one of the AirSimImageType members
def getImageForCamera(self, camera_id, image_type):
# because this method returns std::vector<uint8>, msgpack decides to encode it as a string unfortunately.
str = self.client.call('getImageForCamera', camera_id, image_type)
result = self.client.call('getImageForCamera', camera_id, image_type)
if (result == "" or result == "\0"):
return None
return np.fromstring(result, np.int8)
Expand Down
7 changes: 4 additions & 3 deletions PythonClient/point_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ def savePointCloud(image, fileName):
f = open(fileName, "w")
for x in xrange(image.shape[0]):
for y in xrange(image.shape[1]):
x,y,z = image[x,y]
f.write("%f %f %f %s\n" % (x, y, z, rgb))
pt = image[x,y]
print pt
f.write("%f %f %f %s\n" % (pt[0], pt[1], pt[2], rgb))
f.close()

for arg in sys.argv[1:]:
Expand All @@ -32,7 +33,7 @@ def savePointCloud(image, fileName):
sys.exit(0)
else:
png = cv2.imdecode(rawImage, cv2.IMREAD_UNCHANGED)
savePointCloud(pnf, outputFile)
savePointCloud(png, outputFile)
print("saved " + outputFile)
sys.exit(0)

Expand Down

0 comments on commit c73cdd7

Please sign in to comment.