Skip to content

Pull request for Monte Carlo localisation algorithm - #266

Closed
Ridhwanluthra wants to merge 12 commits into
aimacode:masterfrom
Ridhwanluthra:master
Closed

Pull request for Monte Carlo localisation algorithm#266
Ridhwanluthra wants to merge 12 commits into
aimacode:masterfrom
Ridhwanluthra:master

Conversation

@Ridhwanluthra

Copy link
Copy Markdown

I have created 2 new files, monte_carlo_localisation.py and robot_class.py.
To run the algorithm just run the monte_carlo_localisation.py and assuming the the dependencies are installed, it will first show the initial condition and if you close that plot it will run the algorithm and then show the plot after running the algorithm for 20 timesteps.
I am not sure what kind of a structure would you like me to give.
Let me know and i will fix it.
also i have made a few assumptions from the algorithm, like the speed, motion model, etc and also added a way for measurement. the sensor model that i am using is 4 sensors in 4 directions of the bot.
if you would like me to add or subtract anything just let me know.
as far as the styling goes i am still working on it.
Thank you

maze = list(zip(*maze))


def eval(r, p):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably better not to shadow the builtin function eval

Comment thread robot_class.py
if x >= self.world_size - 1:
break
if maze[x][y] == 1:
y2 = y

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would do
x2, y2 = x, y

Comment thread robot_class.py

prob = 1.0;
for i in range(len(self.sense_orient)):
if (self.sense_orient[i] > 0 and self.sense_orient[i] < pi/2):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand why you need to repeat code for each pi/2 quadrant?

@antmarakis antmarakis mentioned this pull request Aug 3, 2017
@norvig norvig closed this Aug 10, 2017
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