Home→Forums→MonoBrick EV3 Firmware→Rubik's cube solver
Tagged: Rub1k3ks, Rubik's cube
- This topic has 20 replies, 6 voices, and was last updated 9 years, 2 months ago by Helmut Wunder.
-
AuthorPosts
-
November 27, 2014 at 10:04 #5018
Jacek SParticipantHi,
This is my implementation of the Cube Solver robot using MonoBrick.
Based on the construction plan from http://mindcuber.com/ and Herbert Kociemba Two Phase solving algorithm.
https://onedrive.live.com/redir?resid=D80891353BE56D44!3341&authkey=!ANthpij1gpwP7Xk&ithint=video%2cmovJacek
- This topic was modified 10 years ago by Jacek S.
November 29, 2014 at 11:40 #5020
Anders SøborgKeymasterHi Jacek
Very nice work… maybe you would be interested in sharing the code as part of our Git repository. Also is there a youtube video that I can embed on the firmware page?
/Anders
November 29, 2014 at 14:58 #5021
Jacek SParticipantHi Anders,
Sure, but is not ready yet. It needs some modifications and code cleaning. Also there are still problems with motor movement waithandle in the base repo. Now this working only with my modified firmware lib.
Yes, I will prepare a better video to youtube.Jacek
November 29, 2014 at 20:20 #5022
Anders SøborgKeymasterGreat
Please let me know how it goes…
/Anders
December 25, 2014 at 09:48 #5108
Jacek SParticipantHi,
Here is a video https://www.youtube.com/watch?v=iy25bg4idwM
And source code: https://bitbucket.org/stepienj/ev3cubesolverJacek
December 26, 2014 at 19:58 #5113
Anders SøborgKeymasterHi Jacek
Merry christmas. This is awesome. I will post it right away. Could I maybe steel the code and place in our Git repository – just as an example?
/Anders
December 26, 2014 at 23:56 #5133
Anders SøborgKeymasterHi Again
Your video was shared on MindCubers Facebook page, MonoBrick’s twitter and Facebook page as well as the EV3 Fan Group Facebook page. Let’s see how it goes…
/Anders
December 29, 2014 at 18:19 #5149
Jacek SParticipantHi,
Thank you. Feel free to put the sources in the monobrick github.
Jacek
December 30, 2014 at 11:27 #5153
Anders SøborgKeymasterHi Jacek
Did you AOT compile your program? If not I think you will see a big improvement in speed if you do. Also I noticed that in your main loop you are using a button listener. This will poll for button changes every 50 ms which will load the CPU unnecessary. In the next release it will be possible to set this interval when creating the button listener so you might consider adding this.
/Anders
December 30, 2014 at 11:46 #5154
Jacek SParticipantHi,
I didn’t try AOT. Poll for button is not a part of the main loop, is only when the sensor is moved to the start position.
The most performance issue is the binaryformatter and deserializing 4mb file (data for algorithm) that takes about 2-3 minutes then algorithm calculates solution within 3 seconds. Maybe the low class sd card is the problem?Jacek
December 30, 2014 at 12:15 #5157
Anders SøborgKeymasterHi Again
Sorry if I was not clear enough on the poll thing. In your main program which looks like this:
static class Program { static void Main(string[] args) { var terminateProgram = new ManualResetEvent(false); var cubeSolver = new CubeSolver(); var buts = new ButtonEvents(); buts.EscapePressed += () => terminateProgram.Set(); Task.Factory.StartNew(cubeSolver.Run); terminateProgram.WaitOne(); cubeSolver.Stop(); //var solution = Search.solution(Tools.randomCube(), 26, false); } }
you create a ButtonEvents() so you can terminate the program. This will create a thread that polls for changes very 50 ms – so if your program uses a lot of threads your program might end up spending time switching threads instead of doing actual calculations. Anyway you can have a look at what the ButtonEvent class does here, but when you described what you program is actually doing it does not sound like this is really an issue -:)
/Anders
December 30, 2014 at 12:54 #5161
Jacek SParticipantHi Again,
Oh, sorry for misunderstanding and thank you for info. I didn’t know that button is pooled every 50ms. (I never looked at this source code)
Jacek
August 23, 2015 at 23:12 #5456
Eduardo Konishi de SouzaParticipantHi guys,
This is my first post here. I decided to post it after playing with Monobrick around for a while, it’s a great initiative and it made my life so much easier to program for it. @Anders, for that I thank you.
@Jacek, I was inspired by your design and of other Lego robots that I’ve seen on youtube and decided to build my own implementation using only the components of the Education Core set and this is the result:
Also, thanks for converting Kociemba’s algorithm to C#, it saved me a lot of time :).
I’ve decided to share my whole experience, as well as the blueprints and code, if anyone is interested:
http://edusrandomstuff.blogspot.nl/Cheers,
EduSeptember 12, 2015 at 07:16 #5482
Anders SøborgKeymasterNice job… I will share it on facebook. Keep up the good work…
/Anders
September 25, 2015 at 13:32 #5487
Helmut WunderParticipantI’m actually curious if there is already Cubesolver code running on the EV3 which performs Kociemba’s algorithm autonomously, without using lookup tables etc?
E.g., is this what Jacek S’ code is doing?- This reply was modified 9 years, 3 months ago by Helmut Wunder.
-
AuthorPosts
You must be logged in to reply to this topic.
Follow