2D-Grid-SLAM icon indicating copy to clipboard operation
2D-Grid-SLAM copied to clipboard

Crash

Open cavour22710 opened this issue 5 years ago • 3 comments

I've simply dowloaded the code and tried to run it but i don't understand what it should do, as soon as the two images appear and i press w,a,s,d or i,j,k,l the program closes itself with this error: C:....\2D-Grid-SLAM-master\ParticleFilter.py:130: RuntimeWarning: invalid value encountered in true_divide self.weights = field / np.sum(field) Traceback (most recent call last): File "test.py", line 123, in pf.Resampling(sensor_data) File "C:...\2D-Grid-SLAM-master\ParticleFilter.py", line 113, in Resampling re_id = np.random.choice(self.size, self.size, p=list(self.weights)) File "mtrand.pyx", line 1144, in mtrand.RandomState.choice ValueError: probabilities contain NaN

cavour22710 avatar May 31 '19 11:05 cavour22710

Can you describe your environment in detail ?

jerrywiston avatar Jun 14 '19 16:06 jerrywiston

in ParticleFilter.py modify as follow: if np.sum(field)!= 0: self.weights = field / np.sum(field)

horo2016 avatar May 15 '20 07:05 horo2016

ParticleFilter.py , line 113 self.weights[np.isnan(self.weights)] = 1 / len(self.weights) re_id = np.random.choice(self.size, self.size, p=list(self.weights))

DuQingChen avatar Mar 09 '22 09:03 DuQingChen