Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for custom agent positioning and angle initialization, along with enhanced visualization capabilities for multiple agents. The changes enable users to specify custom starting positions and angles for agents instead of relying solely on random or default positioning.
- Custom agent positioning and angle support through new optional parameters
- Enhanced visualization to handle multiple agents with partition visualization
- Configuration updates to simplify curriculum levels for LLM integration
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| terra/viz/main_manual.py | Adds custom position and angle parameters to environment reset |
| terra/viz/game/game.py | Implements multi-agent visualization with partition support and agent configuration handling |
| terra/state.py | Adds custom position and angle parameters to State creation methods |
| terra/env.py | Updates environment reset to support custom positioning parameters |
| terra/config.py | Simplifies curriculum configuration to focus on foundations maps |
| terra/agent.py | Implements comprehensive custom positioning logic with validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| def use_custom_position(k): | ||
| # Create position based on custom args or defaults | ||
| temp_pos = IntMap(jnp.array(custom_pos)) if custom_pos is not None else IntMap(jnp.array([-1, -1])) | ||
| temp_angle = jnp.full((1,), custom_angle, dtype=IntMap) if custom_angle is not None else jnp.full((1,), -1, dtype=IntMap) |
There was a problem hiding this comment.
The sentinel value -1 for unset angle should be defined as a constant to improve code clarity.
| temp_angle = jnp.full((1,), custom_angle, dtype=IntMap) if custom_angle is not None else jnp.full((1,), -1, dtype=IntMap) | |
| temp_angle = jnp.full((1,), custom_angle, dtype=IntMap) if custom_angle is not None else jnp.full((1,), UNSET_ANGLE, dtype=IntMap) |
| return Agent(agent_state=agent_state, width=width, height=height, moving_dumped_dirt=moving_dumped_dirt), key | ||
|
|
||
|
|
||
| def _validate_agent_position( |
There was a problem hiding this comment.
The function docstring should document the expected types and ranges for the parameters, particularly the Array types and what constitutes valid position/angle values.
This PR includes the following:
The executables
and
should work as before