Rubiks Cube State

I need some ideas on how I can get the current state of a rubik’s cube. I could compare original vs current rotation of each piece to check for the solved state but I need more than that. For example, I need to know what the current stage towards completion the cube is in so I need to know if the user has a red-x, or the orange corners but incorrectly oriented. Currently I have nothing tracking the pieces but I thought about the good old fashion 6x9 array. Does anyone know a simpler way to store the state of the cube in a format that can used to find out what to do next.

I apologize for not providing more information but I am unsure as to what to give you guys so please let me know if you need something specific. Thanks in advance.

I wouldn’t try to figure it out from the objects in the world. Instead, I’d keep a representation of it in variables, and then adjust both at the same time.