Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PyFlyt/gym_envs/quadx_envs/quadx_waypoints_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def compute_term_trunc_reward(self) -> None:
if not self.sparse_reward:
self.reward += max(3.0 * self.waypoints.progress_to_next_target, 0.0)
self.reward += 0.1 / self.waypoints.distance_to_next_target
yaw_rate = abs(self.env.state(0)[0][2]) # Assuming z-axis is the last component
yaw_rate_penalty = 0.01 * yaw_rate**2# Add penalty for high yaw rate
self.reward -= yaw_rate_penalty # You can adjust the coefficient (0.01) as needed
Comment on lines +185 to +187
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be placed in the above if not self.sparse_reward conditional.


# target reached
if self.waypoints.target_reached:
Expand Down
Loading