Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed partial observation sensing dynamics. #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

piercehowell
Copy link
Collaborator

I noticed that the partial observation sensing was buggy. I was using too simple of a rule to determine if the box was in the agents sensing distance, this happen to cause some agents to not see the box (if the agent radius was larger than the sensing radius). Additionally, the rule for sensing wasn't completely accurate.

To fix this, I did the following:

  • Made the sensing of the agent a landmark that is place at the agents position. It is non-collidable. This allows us to use the is_overlapping() function to accurately determine if the box is in the sensing radius
  • I made the parameter for the sensing radius be the distance from the agents outer surface rather than the agents center. This means the sensing radius is uniform for all agents.

@piercehowell piercehowell requested review from kfu02 and shalin-jain May 22, 2024 15:00
Copy link

@kfu02 kfu02 left a comment

Choose a reason for hiding this comment

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

Changes seem logical. Can you attach a GIF / run validating that this works? Thanks

vmas/scenarios/transport.py Outdated Show resolved Hide resolved
vmas/scenarios/transport.py Outdated Show resolved Hide resolved
@@ -444,12 +465,17 @@ def partial_observation(self, agent: Agent):
# get positions of all entities in this agent's reference frame
package_obs = []
out_of_obs_val = -0.0001 # default value used for out-of-observation data in the observation vector

# spawn the sensor radius for each agent
Copy link

Choose a reason for hiding this comment

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

is the sensor always attached to the agents?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is reset in the observation function for partial observability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants