Linking Mathematica (computational Software System) To Ez-builder

 
#1

Hi there. It has been a while since I have put anything out on the forum. My last visit was to show the modifications that I had carried out on a Mecanno G15 KS. With this goal achieved my next goal was to link a very powerful software system to EZ-Builder. This has now been achieved and I feel it is about time to introduce the basics to the forum.

I have three robots, a Revolution JD, a modified Revolution Roli and my G15 KS.

User-inserted image


User-inserted image



User-inserted image

I wanted to give these robots many abilities. For example the G15 KS can obtain location data from a mobile phone by reading the screen. As a programmer I could achieve this using C++/C# and the ezrobot SDK. However in my professional and personal life I use a software system from Wolfram Research called Mathematica. As EZ-Builder allows execution of external programs I knew I could request from a script that Mathematica starts up and carries out some computation and saves the result of the computation in a file that the EZ-Builder script can make use of. This as you will see later has been achieved.

Mathematica gives seamless access to a very large database with I believe over 12 trillion items in it and growing. This knowledge database can be found on the internet as WolframAlpha. Using this setup you will see that my robots can look at an image of say text on a computer screen or paper and interpret it and read it back. Having the ability to read text opens up a door to many more features. For example all my robots can read text and interpret its meaning. As you will see when prompted with the words "The capital of Scotland" the robots when asked to read the text simply repeat what they see. When asked to evaluate the text they reply "Edinburgh". Which as it happens is the capital city of Scotland. When asked to evaluate the Sin[Pi] the reply is 0. Now it gets even better all my robots can identify over 10000+ objects from an image. They can read letters off the screen that correspond to musical notes and in turn play a tune. The G15 KS can look at a series of dots on the screen that could relate to points on a map. Mathematica will link these points finding the shortest route passing through each point once and then plan a route for the G15 KS. In practice using the shortest route saves battery life. On returning to EZ-Builder the G15 KS moves relating to the points.

The code used to create some of these abilities using Mathematica is in general only a few lines of code. For example to identify objects in an image is simply one line of Mathematica code and some file input/output. Powerful neural networks can be created and trained in a very short space of time. Mathematica contains 1000's of industry strength algorithms. These algorithms allow for some really clever experiments with robots like ours at the lower end of the budget scale. As users we are not likley to exceed it capabilities. Mathematica contains functions for audio and video analysis, computer vision, machine learning, neural nets and a massive array of math tools. Not to mention seemless access to WolframAlpha. Also if by some chance I were to stumble upon an idea that required a lot of processing power Mathematica gives access to the GPU in a computer for parallel processing. Better than that you can also link copies of Mathematica to perform even faster on a network cluster. However I probably won't be worrying to much about these features yet.

To carry out computation Mathematica is executed from EZ-Builder any data required by Mathematica can be placed in a file called input.txt. Mathematica reads the input.txt file and carries out its computations and places any result in a file called output.txt. This is then picked up by EZ-Builder and the script continues to execute making use of the data found in output.txt. This allows me to experiment with ideas that might normally take days or weeks to program using C# and the SDK. After successful testing of an idea and knowing that it works writing C# code would now be worth while.

However there is a downside. Mathematica has quite a steep learning curve, actually a very steep learning curve. It is industry standard computational software system. Also Wolfram Research does not give there software away. A full commercial license is over £2000 sterling. That's out of my reach financially. Or so my wife tells me. Do not despair because the good people at Wolfram Research do a Home Edition that can be subscribed to. This is the version I use. In the UK it is priced at around £120 pounds anually. By the way I have no links with Wolfram Research I just like their product. I would talk and do talk in the same way about ezrobot. The Home Edition is heavily licensed for non-comercial use and I asked their permission to put what I have done out on this forum. They said yes. But I can under no circumstance be seen to make money from this. I do not want to get into legal battles with a billion dollar software company.

What follows is a video showing what linking Mathematica to EZ-Builder can accomplish and this is only the beginning. Creating complex systems to support EZ-Builder can be done very easily using Mathematica. I will make the code available quite soon. If anyone is interested. For me linking Mathematica to EZ-Builder and the Robots means I now have a fantastic robot platform to carry out some serious experimentation.







#2

Finally thanks to DJ and the team at ezrobot for giving me brilliant robots to link Mathematica to.

#3

Sounds interesting. I can't view your videos, they come up as "private".

#4

I can not view either video.
Don't know if it's me or what?

#5

Sorry about that. Forgot to make them public.

#6

Well, you impressed me!
Very nice work.

#7

Thanks very much. I plan to do much more when time allows.

#8

@tezsmith We're not worthy, we're not worthy.... Brilliant man! Smile Any chance you could convert this to an ez builder plugin so others could use this?

#9

Yes I probably will at some point. Thanks for your comments. I will at some point make the EZ-Builder project and mathematica code available as well

#10

@tezsmith... that would be phenomenal. Like I said, what you have done is just brilliant. I would absolutely love to incorporate this into my inMoov project.... Please keep us posted... Smile