Comments (6)
Yes, as suspected the problem is that somehow ss_img is getting one dimension of length zero. Based on the 0's in push's y-components, I think I know exactly why this is happening. Will fix soon.
from lqrrt.
My current hypothesis is that one of the dimensions of ss_img is going to zero length, but based on the way things were when this happened, I'm not sure why that'd be the case. I am going to surround that block with a try-except so we can get a look at ss_img (and every argument of that floodFill) if this ever happens again.
test_flood = np.copy(ss_img)
try:
area, rect = cv2.floodFill(test_flood, np.zeros((test_flood.shape[0]+2, test_flood.shape[1]+2), np.uint8), ss_goal, 69)
if test_flood[ss_seed[1], ss_seed[0]] == 69:
gs[:2] = (np.add([col, row], [last_offsets[0], last_offsets[1]]).astype(np.float64) / self.ogrid_cpm) + self.ogrid_origin
found_entry = True
break
except:
print("\nA sample space image during select_exploration may have become degenerate. How odd.")
print("type(ss_img): {}".format(type(ss_img)))
print("np.shape(ss_img): {}".format(np.shape(ss_img)))
print("current push: {}".format(push))
print("ss_goal: {}".format(ss_goal))
print("\nTerminating.")
self.failure_reason = "glitch"
self.set_goal(self.state)
return(1, escape.gen_ss(self.next_seed, self.goal), np.copy(self.goal))
from lqrrt.
There I was minding my own business driving around and all of a sudden this happened to me!
Preparing: drive
Rotating towards goal (duration: 1.36)
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /home/matt/Downloads/opencv-2.4.9/modules/core/src/array.cpp, line 2482
A sample space image during select_exploration may have become degenerate. How odd.
type(ss_img): <type 'numpy.ndarray'>
np.shape(ss_img): (601, 0)
current push: [80, 40, 0, 0]
ss_goal: (120, 40)
Terminating.
np.shape(ss_img): (601, 0)
<< Could this be an issue?
I set the waypoint towards the bottom left corner of this grid. It had started rotating then after a second or two it gave the error and terminated the move.
from lqrrt.
Also, in boundary_analysis
I'm encountering the same issue (with it's floodFill)
from lqrrt.
The current fix just picks some basic sample space (unadvised by the ogrid geometry, like the old days) when we get into the special (and rare) degenerate case. I haven't been able to recreate the degenerate case since implementing this fix, so it may not work as intended, and thus this issue will not close yet. Please report here if the print statement tells you to.
from lqrrt.
It seems that there are multiple causes of the degenerate case. One we know for sure is being too close to the edge of the ogrid. Regardless, the resulting failure is the same in every case, so we have protected against it by catching the degenerate ss_img and reverting to the old style ogrid analysis as needed.
from lqrrt.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lqrrt.