Skip to content

Commit af3fc17

Browse files
committed
Merge branch 'main' into dev
2 parents 86f8d7d + 42752ea commit af3fc17

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lsy_drone_racing/envs/drone_racing_deploy_env.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,8 @@ def close(self):
194194
)
195195
return_pos[2] = RETURN_HEIGHT
196196
self.cf.goTo(goal=return_pos, yaw=0, duration=BREAKING_DURATION)
197-
time.sleep(
198-
BREAKING_DURATION - 1
199-
) # Smoothly transition to next position by setting the next goal earlier
197+
# Smoothly transition to next position by setting the next goal earlier
198+
time.sleep(BREAKING_DURATION - 1)
200199

201200
return_pos[:2] = self.config.env.track.drone.pos[:2]
202201
self.cf.goTo(goal=return_pos, yaw=0, duration=RETURN_DURATION)
@@ -244,8 +243,8 @@ def obs(self) -> dict:
244243
real_gates_rpy = np.array([self.vicon.rpy[g] for g in gate_names])
245244
real_obstacles_pos = np.array([self.vicon.pos[o] for o in obstacle_names])
246245

247-
# Use x-y distance to calucate sensor range, otherwise it would depend on the height of the drone
248-
# and obstacle how early the obstacle is in range.
246+
# Use x-y distance to calucate sensor range, otherwise it would depend on the height of the
247+
# drone and obstacle how early the obstacle is in range.
249248
in_range = np.linalg.norm(real_gates_pos[:, :2] - drone_pos[:2], axis=1) < sensor_range
250249
self.gates_visited = np.logical_or(self.gates_visited, in_range)
251250
gates_pos[self.gates_visited] = real_gates_pos[self.gates_visited]

0 commit comments

Comments
 (0)