Skip to content

Commit b99bd53

Browse files
committed
Small fixes to rotation actions
1 parent de6dc63 commit b99bd53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vmas/simulator/environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def get_action_space(self, agent: Agent):
210210
dtype=float,
211211
)
212212
else:
213-
if self.world.dim_c == 0 or agent.silent or agent.u_rot_range != 0:
213+
if (self.world.dim_c == 0 or agent.silent) and agent.u_rot_range == 0.0:
214214
return spaces.Discrete(self.world.dim_p * 2 + 1)
215215
else:
216216
actions = (
@@ -247,7 +247,7 @@ def _set_action(self, action, agent):
247247
action_index = 0
248248

249249
if self.continuous_actions:
250-
physical_action = action[:, action_index : self.world.dim_p]
250+
physical_action = action[:, action_index : action_index + self.world.dim_p]
251251
action_index += self.world.dim_p
252252
assert not torch.any(
253253
torch.abs(physical_action) > agent.u_range

0 commit comments

Comments
 (0)