
feroze
Hello All!
I recently ordered my EZ-B Complete Kit and can't wait to receive it.
One of my main interests is writing various programs for the robot so it can act on it's own (autonomous) without me having to control it's every move.
I just want a clarification on how you do this with EZ-Builder? Is this done with scripts?
Something like this:
http://www.instructables.com/id/My-Autonomous-HomeMade-Wall-E-Robot/
Did DJ Sures do this with ARC or EZ-SDK?
Would I have to use EZ-SDK with Visual Studio to write custom logic? So I would basically follow the visual studio ez-sdk controller tutorial. Then I would have access to all the classes and methods to control EZ-B. That would allow me to write custom program and then run it?
Thanks so much!
This is a pseudo version by there's a list/table and each one of those is an action so on one line I have
Servo(D0,90)
Servo(D1,90)
then in the next one I have something like
CommandControl("Sound Board",track_0)
(or something to that effect)
I originally thought I was going have to write a ton of code to do this but I just made a few scripts and called them in the RPG and my little guy will randomly move around, spout out some sound bytes from sealab 2021, throw it's "arms" in the air and spin around. I had some talk commands for a minute but i pulled them in favor of the sound bytes for now. I did this all in about 45 minutes after I discovered the Random Personality Generator.
Sure you can write you own and get super detailed with it but, if you just want to have something that appears autonomous until you can get more experience with the ezb system the RPG is awesome. That's what I did and that's where I'm at.
As far as reading data I believe that some you can and some you can't. I know you can read the positions and speeds of the standard servos that come with the kit. But (I may be mistaken here) I think that you CAN NOT read the position of DC motors or modified servo positions. I think DC motors do not have a data wire. (I'm still learning alot of this myself)
I hope that helps.
The camera has tracking and recognition options. Color, face, glyph, rqcode, and I think 1 or 2 more. Those can be set to work in various ways. This is where I'm currently playing around. They can be set so that the robot will move to follow and/or avoid? I'm not sure about avoid. But it appears that it tries to move in order to keep an object within its view finder.
Then there's a way to set it to where servos for arm(s) and cameras (probably will be your head) so that the whole robot wont move to follow but just the camera or arm(s). I've only just started playing with these so I don't know much about them.
Now something I know even less about.
You can do avoidance with the UltraSonic sensor that comes with the EZ complete. I have not hooked mine up yet. I'm moving soon and didn't want to get to invested in it here when I'm about to have a fantastic work space. (Close on Wednesday ;-) So while I'll be getting into these things more in a few weeks but I do know they can be done.
As far as storing data. You can create Variables but I'm not sure on the details too much or their "Life Time". I've messed with the keyboard controls a little and set variables to store a couple of servo positions and then I set the positions using the variables with a different key.
And none of it seems too complicated. And if you have doubts, just ask. The EZ peoples, company and customers are all amazing people. I'm just trying to be helpful and more like them ;-)
I think I will start programming my robot with EZ-Scripts to get familiar with the commands then move onto C# to write more complex programs. The methods names are probably the same...
Can you give a specific task example for what you are expecting to need to use the SDK for.
You can store data using data files and the WriteFile (or FileWrite I never remember which way round it is). This will store the data for as long as the file is there. I haven't touched the file methods yet but I'm sure there are ways to "import" data too.
To be honest, you would be better off thinking about what algorithms and functions you are planning for your robot that way we can give specific answers. Until we know what it is you are planning we can only give generic answers and no real help.
Eventually I would like to write more complex programs that uses multiple classes. Even utilize other people frameworks. That is the main reason I would like to use the SDK but if you can program all this within the EZ-scripts then that would be great too!
1) Firstly, when I add a script and click settings, under Script Help it shows me all the EZ-Script Functions. But is there a manual online with all the other syntax needed like conditional statement (if, else) and looping statements? How to declare variables in scripts? All I see is how to list one function after another.
Like I found this forum post: http://www.ez-robot.com/Community/Forum/posts.aspx?threadId=2574
Where he uses loops statements, if, print, seems to be writing methods? Is there a manual for all this syntax? All that is shown is the function in EZ-Builter Script Help
2) Next question is about Script flow? I understand how you can create different scripts and control them with script manager. But what is script flow? Is that just using ControlCommand to call one script from another?
3) Lastly, it seems like with the scripts you mainly just use them to plan a custom order of specific functions? As where with the SDK you can use all the same functions but also be able to create methods, arrays, matrix, conditionals, loops, basically you have a normal programming environment? Is this a correct interpretation?
Thanks so much for the help clearing up my confusion!
Also, take the time to read through my An Introduction To Scripting topic, this covers the IF statements and conditions in quite a lot of detail.
Since you will be scripting in the script dialogue the manual is to the right, where each command has an example and with ARC constantly being updated (excluding the short period where it hasn't due to the upcoming major release) there is no official online manual, however I do keep a PDF version as up to date as possible here
In ARC there are also many examples for all script commands.
Scripts are not "just to plan orders". EZ-Script is a very powerful, fully functioning scripting language. Multiple commands can all be used at the same time. Some functions may require more than one script running at the same time however my Ping Avoidance and Ping Avoidance V1.1.0 (and V1.1.1)scripts tackle having to move a servo, drive a robot, read the ping sensor and act accordingly.
Read through the forums, search for specific commands that you are unsure of, check out the cloud and examples, check the controls and read through the tutorials. Every control has a ? by the X in ARC, clicking on it will take you to the relevant page for that control.
Is your Ping avoidance script basically what DJ Sures did with the Omnibot here: http://youtu.be/LhlC7xOUadU
He says he is using a 2D Autonomous Mapping Code.. Did this require using the SDK?
It would be great if you could use ARC with C# or C++ style programming in the scripts. I noticed there was once a C# scripting tool, but look like DJ Sures took it out. I wonder why because C# scripts have much more tools available to program with.
I checked out your pdf of commands for EZ-Buidler Script and it has conditional statements and goto commands which is awesome but I could not find syntax for loops, 'while' or 'for loops'? Can you do this with ARC Script?
Basically I am looking for an environment like ARC but be able to write scripts for my robot in typical c#, c++, or java programming language.
Code:
Code:
I use loops a lot in my scripts, check some of them out. The ping avoidance one uses a lot of loops, gotos and labels.
I just tried out your Ping Avoidance Script and I have to say it is by far the coolest thing I have done with my robot. Watching is navigate my room all by itself is awesome. I found it best to mount the ping sensor close to the floor right in front of the robot.
Thanks for the awesome script!
It's all commented too and there is a topic where it's been discussed (although I don't know where to look for it) so it should be really easy to adapt to your requirements if you need to.