{"id":16110283,"url":"https://github.com/manuelmeraz/particlefilter","last_synced_at":"2025-10-11T09:04:11.968Z","repository":{"id":67032035,"uuid":"109661111","full_name":"ManuelMeraz/ParticleFilter","owner":"ManuelMeraz","description":"Implementation of a particle filtering algorithm to localize a mobile robot","archived":false,"fork":false,"pushed_at":"2021-02-17T17:12:40.000Z","size":45556,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T05:32:56.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ManuelMeraz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-06T07:22:25.000Z","updated_at":"2021-02-17T17:12:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6ab05e6-cbf9-44be-8bfe-a19b2f3d6e1d","html_url":"https://github.com/ManuelMeraz/ParticleFilter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ManuelMeraz/ParticleFilter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelMeraz%2FParticleFilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelMeraz%2FParticleFilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelMeraz%2FParticleFilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelMeraz%2FParticleFilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManuelMeraz","download_url":"https://codeload.github.com/ManuelMeraz/ParticleFilter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelMeraz%2FParticleFilter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006754,"owners_count":26084176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T19:36:43.410Z","updated_at":"2025-10-11T09:04:11.934Z","avatar_url":"https://github.com/ManuelMeraz.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Constant Readings](https://github.com/ManuelMeraz/ParticleFilter/blob/master/particle_filter_contant_readings.gif)\n\nrun main_constant.m for constant sensor readings\nrun main_sporadic.m for sporadic sensor readings\n\nThis program dynamically calculates the minimum number of particles \nto use based off of their fitness. \n\nAs I was playing around with resampling, I experimented with\n2 types if resampling. \n\n1) Given a set of fit particles, sample from the set \n   using a uniform random probability to generate a new particle\n\n2) Given a set of fit particles, sample from the set\n   using a weighted random probability to generate a new particle\n\nI realize that the particle filter algorithm prefers\nweighted sampling, but after playing around with both uniform \nand weighted, I prefer uniform because you have a more diverse\nset of particles preventing the robot from getting lost.\n\nDuring this process I thought of a cool idea, because the sensor\nis so accurate, and the motion model might not be the best\nthe partices might eventually diverge. Hence, in the case\nof resampling a certain percentage of them, relative to\nthe total particles are exploratory particles.\n\nEssentially, yes, we keep most of the important particles, but\nto prevent diverging, we throw some particles all over the\nstate space uniformly to see if they survive through the next\ngeneration. If they do and the robots motion model diverges, then\nwe can jump to those exploratory particles to relocalize. \n\nIn case the robot gets completely lost, I keep track of the previous \nweighted mean of the robot and I check particles all over the position\nscaled up by the time since the last sensor reading. Both in terms \nof number of particles and in terms of distance outwards from the robot.\n\nHow the program works\n\nThe minimum number of particles we can start with is 64, just due\nto the way i programmed my initialization function.\n\nAs time goes on, the number of particles keeps doubling until \na fit particle is found (i.e. the weight is \u003e 0) and we keep\ntrack of this number of particles.\n\nThe next generation of particles are created based off of these\nnew fit particles. For every particle in the next iteration,\nwe apply the dynamics model and the ones that survive move forward.\n\nSince my program is dynamic, the number of fit particles is the new M\nand therefore the optimal M for any given situation. If the robot gets lost,\nthen M becomes the initial M based off the initial state scaled by time since\nthe last sensor reading.\n\nFor example, if we had to generate 1000 particles in the beginning to \nfind a fit particle, and the last sensor reading was 3 seconds ago.\n\nThen we generate 3 * 1000 = 3000 particles around the current weighted mean\nscaled by a square area of 3 * 2 m^2. So if it has been a long time\nsince the sensor reading has come in, then it would use more particles further\nout to find itself.\n\nI did not account for the case where it is possible that a sensor reading will \nnever come again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelmeraz%2Fparticlefilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelmeraz%2Fparticlefilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelmeraz%2Fparticlefilter/lists"}