Skip to content

Commit

Permalink
Merge pull request #440 from JdeRobot/issue-439
Browse files Browse the repository at this point in the history
Fixed brain for memory based models with 3-image input and previous V
  • Loading branch information
sergiopaniego authored Jan 3, 2023
2 parents 964870d + d03c507 commit f6c3e25
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,12 @@ def execute(self):
self.image_1 = self.image_2
self.image_2 = self.image_1
self.image_3 = img

velocity_dim = np.full((150, 50), self.previous_speed/30)
self.image_1 = np.dstack((self.image_1, velocity_dim))
self.image_2 = np.dstack((self.image_2, velocity_dim))
self.image_3 = np.dstack((self.image_3, velocity_dim))

img = [self.image_3, self.image_2 , self.image_1]
image_1 = np.dstack((self.image_1, velocity_dim))
image_2 = np.dstack((self.image_2, velocity_dim))
image_3 = np.dstack((self.image_3, velocity_dim))
img = [image_3, image_2 , image_1]

img = np.expand_dims(img, axis=0)
start_time = time.time()
Expand All @@ -179,7 +178,6 @@ def execute(self):
speed = self.vehicle.get_velocity()
vehicle_speed = 3.6 * math.sqrt(speed.x**2 + speed.y**2 + speed.z**2)
self.previous_speed = vehicle_speed

if vehicle_speed > 300:
self.motors.sendThrottle(0)
self.motors.sendSteer(steer)
Expand Down

0 comments on commit f6c3e25

Please sign in to comment.