Example #1
0
 def getObservation(self):
     """
     Receive the observation image using a socket
     :return: (numpy ndarray) observation
     """
     # Receive a camera image from the server
     self.observation = recvMatrix(self.socket)
     # Resize it:
     self.observation = cv2.resize(self.observation,
                                   (self.img_shape[2], self.img_shape[1]),
                                   interpolation=cv2.INTER_AREA)
     return self.observation
Example #2
0
 def getObservation(self):
     """
     Receive the observation image using a socket (required method by gazebo)
     :return: np.ndarray (tensor) observation
     """
     # Receive a camera image from the server
     self.observation = recvMatrix(self.socket)
     # Resize it:
     self.observation = cv2.resize(self.observation,
                                   (self.img_shape[2], self.img_shape[1]),
                                   interpolation=cv2.INTER_AREA)
     return self.observation