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

VerifaiRange sampling values far beyond range (Fixed with solution mentioned on Slack, posting for the record) #276

Closed
1 of 3 tasks
Kai-X-Org opened this issue Jun 5, 2024 · 0 comments · Fixed by #280
Labels
status: valid Issue is valid and will be worked on type: bug Something isn't working

Comments

@Kai-X-Org
Copy link

System Details

1.Python 3.10.14
2.Scenic 3.0.0rc1, with latest pull of VerifAI
3.Ubuntu 20.04 on x86
4. No simulator. Just Scenic

Detailed Description

  1. When sampling Scenic values using VerifaiRange, certain programs shows sampling far beyond range or just weird sampling behaviors.
  2. For instance, consider the following program
param x1 = VerifaiRange(5, 6.5)
param y1 = VerifaiRange(0, 1.5)
param yaw1 = VerifaiRange(0, 180)

param x2 = VerifaiRange(5, 6.5)
param y2 = VerifaiRange(0, 3)
param yaw2 = VerifaiRange(0, 180)

param x3 = VerifaiRange(5, 6.5)
param y3 = VerifaiRange(0, 3)
param yaw3 = VerifaiRange(0, 180)

param x4 = VerifaiRange(-0.5, 1)
param y4 = VerifaiRange(0, 0.5)


obj1 = new Object at (globalParameters.x1, globalParameters.y1, 0), with yaw globalParameters.yaw1,
                    with shape SpheroidShape(dimensions=(0.5, 0.5, 0.5)), with color[0, 0, 0]
obj1 = new Object at (globalParameters.x2, globalParameters.y2, 0), with yaw globalParameters.yaw2,
                    with shape SpheroidShape(dimensions=(0.5, 0.5, 0.5)), with color[0.25, 0, 0]
obj1 = new Object at (globalParameters.x3, globalParameters.y3, 0), with yaw globalParameters.yaw3,
                    with shape SpheroidShape(dimensions=(0.5, 0.5, 0.5)), with color[0.5, 0, 0]
obj1 = new Object at (globalParameters.x4, globalParameters.y4, 0), with shape SpheroidShape(dimensions=(0.5, 0.5, 0.5)), with color[0.75, 0, 0]

The sampled Scene using the Scenic GUI is shown in the first picture, where some objects are far out of range in position. Each object has radius 0.5m. The solution mentioned on Slack worked with changing the body of scenic.core.external_params.VerifaiSampler.valueFor to return getattr(self.cachedSample, f'param{param.index}')

Screenshot 2024-06-05 at 10 44 54

Steps To Reproduce

  1. Run the Scenic program shown above.

Issue Submission Checklist

  • I am reporting an issue, not asking a question
  • I checked the open and closed issues, forum, etc. and have not found any solution
  • I have provided all necessary code, etc. to reproduce the issue
@Kai-X-Org Kai-X-Org added status: triage Issue needs to be assessed type: bug Something isn't working labels Jun 5, 2024
@Kai-X-Org Kai-X-Org changed the title Odd Behaviors from VerifaiRange (Fixed with solution mentioned on Slack, posting for the record) VerifaiRange sampling values far beyond range (Fixed with solution mentioned on Slack, posting for the record) Jun 5, 2024
@abanuelo abanuelo added status: valid Issue is valid and will be worked on and removed status: triage Issue needs to be assessed labels Jun 13, 2024
@Eric-Vin Eric-Vin linked a pull request Jul 5, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: valid Issue is valid and will be worked on type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants