Skip to content

Commit 38f1776

Browse files
committed
remove merge fault
1 parent faf1105 commit 38f1776

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

crazyflow/gymnasium_envs/crazyflow.py

+1-23
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,6 @@ def _obs(self) -> dict[str, Array]:
357357
obs = super()._obs()
358358
obs["difference_to_target_vel"] = [self.target_vel - self.sim.states.vel]
359359
return obs
360-
<<<<<<< Updated upstream
361-
=======
362-
<<<<<<< Updated upstream
363-
=======
364-
>>>>>>> Stashed changes
365-
366360

367361
class CrazyflowEnvLanding(CrazyflowBaseEnv):
368362
"""JAX Gymnasium environment for Crazyflie simulation."""
@@ -382,17 +376,6 @@ def __init__(self, **kwargs: dict):
382376

383377
@property
384378
def reward(self) -> Array:
385-
<<<<<<< Updated upstream
386-
return self._reward(self.terminated, self.sim.states, self.goal)
387-
388-
@staticmethod
389-
@jax.jit
390-
def _reward(terminated: Array, states: SimState, goal: Array) -> Array:
391-
norm_distance = jnp.linalg.norm(states.pos - goal, axis=2)
392-
speed = jnp.linalg.norm(states.vel, axis=2)
393-
reward = jnp.exp(-2.0 * norm_distance) * jnp.exp(-2.0 * speed)
394-
return jnp.where(terminated, -1.0, reward)
395-
=======
396379
return self._reward(self.prev_done, self.terminated, self.sim.states, self.goal)
397380

398381
@staticmethod
@@ -404,16 +387,11 @@ def _reward(prev_done: Array, terminated: Array, states: SimState, goal: Array)
404387
reward = jnp.where(terminated, -1.0, reward)
405388
reward = jnp.where(prev_done, 0.0, reward)
406389
return reward
407-
>>>>>>> Stashed changes
408390

409391
def reset(self, mask: Array) -> None:
410392
super().reset(mask)
411393

412394
def _get_obs(self) -> dict[str, Array]:
413395
obs = super()._get_obs()
414396
obs["difference_to_goal"] = [self.goal - self.sim.states.pos]
415-
return obs
416-
<<<<<<< Updated upstream
417-
=======
418-
>>>>>>> Stashed changes
419-
>>>>>>> Stashed changes
397+
return obs

0 commit comments

Comments
 (0)