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

User allowed to initialize robot positions outside arena #25

Open
jtebert opened this issue Jan 28, 2019 · 3 comments
Open

User allowed to initialize robot positions outside arena #25

jtebert opened this issue Jan 28, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@jtebert
Copy link
Owner

jtebert commented Jan 28, 2019

There is no check whether the coordinates specified by robot_init(x, y, theta) is valid (i.e., within the arena dimensions).

Fix: The code should provide a warning or exit if a position is outside the arena bounds.

This might be easier said than done because when calling robot_init, the Robot does not have access to the World in which it exists.

@jtebert jtebert added the bug Something isn't working label Jan 28, 2019
@r-barnes
Copy link
Collaborator

Maybe do a check in world.add_robot() and throw an exception if it fails?

@jtebert
Copy link
Owner Author

jtebert commented Feb 13, 2019

world.add_robot() is called before robot_init() (because robot_init() calls the Robot's setup() function, which can do things dependent on the world, such as light detection). So there's a bit of a circularity issue here.

@r-barnes
Copy link
Collaborator

r-barnes commented Feb 13, 2019

I see - sorry I missed that the first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants