
dodi
Some nice actions have been added to the latest update :-)
But with the differences a couple of programming questions arise. First one: how to play music and dance together?
In the old program the Dance action started together with the music, in both music editor and interface. Now the action is not started together with the music, neither in the music editor nor in the interface. I only could find a solution for the interface, where the old button script started both the music and action. But where was the action started when playing in the music editor?
Second: how to stop an action in music and script editor? There exists a Run button in the script editor, that seems to do nothing? In the music editor, Play started both the music and the action, but Stop only stops the music! For stopping the action I have to close the editor, then locate the AutoPosition window with the Stop button for the action. The new version requires to add actions in the music editor, but it also only allows to Play and Stop the music, not stopping the current script?
Now I'm missing some instructions in the tutorials, how to handle above issues. And I'm missing Stop buttons in the editors, that stop both the music and the related actions.
The Panic Release button also is unavailable as long as an editor window is open, increasing the panic when something goes wrong :-( And how to restore normal operation after pressing the Panic button?
And another one: how to put or edit text in the Notepad?
Again, try to understand the chicken analogy. With the H-Bridge, if you look at how a H-Bridge works you will understand why stopping a script wont stop the motors spinning.
To stop the motors spinning you need to change the state of the H-Bridge's ports to tell the motors to stop. By just stopping giving instructions will not stop the motors. Much like the tap analogy I mentioned, just stopping instructions wont stop water flowing.
All commands can work in parallel. However, due to the way the Auto Position works (i.e. it sets positions of all servos) by requesting a new action it will conflict with what's previously been asked for and therefore servos will move to the new requested positions. If a servo, motor, sensor, LED or other accessory is not part of the Auto Position control it will remain unchanged until something tells it otherwise.
To make a stop action stop the H-Bridge from moving the Roli you would need to add in script commands to tell the H-Bridge to stop the motors moving. The H-Bridge will do what you asked of it until told to do something else.
Your mistake is by looking at starting a new action in the Auto Position as stopping the old action, this is not the case, you are merely asking it to do something else. If that something else doesn't include other accessories, in your example the H-Bridge (however it's not limited to that, it can be any item connected to the robot) then the accessory will continue to do what you asked of it until told otherwise.
Another analogy. Follow these steps;
Open your front door Walk in your house Close your front door Turn on the light Walk to the chair Sit down Turn on the TV Watch TV for 2 hours Turn off the TV Stand up Turn off the light Walk to bed Get in bed Go to sleep
Now imagine I asked you to stop what you were doing during the "Watch TV for 2 hours" and asked you to carry out instructions to make a cup of coffee. Stand up Walk to the kitchen Pick up the kettle Move it to the tap Turn the tap on Wait until the kettle is full Turn off the tap Boil the kettle
you get the idea.
Now, throughout all of that the light is still on as is the TV because it wasn't instructed that they need to be turned off.
Take it one further. Imagine you were asked to go to bed while making a cup of coffee. Let's say at the "wait until the kettle is full" point. You would wake up to a flooded house as the tap would still be on and the kettle would be under it, overflowing since it wasn't instructed to turn the tap off.
EZ-Script is the same. Unless something is told otherwise it will continue doing (or not doing) whatever it is currently doing.
Actions are the same. They are, in effect, generated script commands. If stopped, they stop in their tracks. They don't know to return to position 90 if you don't tell them, they don't know the H-Bridge needs it's logic pins reconfigured to stop the motors turning. Nobody and nothing has told them that.
As for the on released question. Where is the button? What is the button? The answer is yes but the solution will vary dependant on what you are using.
EZ-Script has the IF command, anything can determine IF a script or command will run or not, you just need to determine what statement would be true for the commands to run and wrap them in a simple IF with that statement.
For instance, IF I wanted my robot to only work from 1pm until 2pm...
Or if the button is on port D0 and needs to be held down to allow the commands to run
Most probably the controls should be seen as managing one or more resources together. Is it possible to create or configure a control to contain all actuators, so that these can be safely stopped with a single command? Or how else can a program be extended, when more components are added which should be stoppable by a single general command (like Emergency Stop)?
Yes. You can write a script which carries out all actions to bring every action to a halt. I have an example emergency stop script in the cloud which sets all digital ports low amongst other things, you can add in whatever is needed to put the robot in it's "stop" state.
I built an emergency stoo based on Rich's that also stios any scripts and actions which might over-ride the release of all the digital ports.
I alsi have one that just stops the scripts but doesn't release all the servos.
It is part of the Myroli-mkII project in the cloud if you want to see some examples how to do it.
Alan
Thanks for the scripts :-)
Now I know how to program the Stop button handler in the interface. The Stop buttons in the editors are not programmable by the user, I assume, so I consider their implementation as flawed.
I'll dig into scripting later, ATM I have another (firmware?) problem with camera servo tracking.
There are no flaws - the development system is designed and explained as such. The tutorials will be able to assist with your questions - the tutorials for your robot can be found by pressing the LEARN button from the top menu of this website.
The lessons will explain what controls are. Controls are individual processes. The stop button stops scripts but does not stop other processes. The stop button for a script stops the script. If the script starts other control processes, those have to be stopped on their own.
To be specific: the stop buttons of each control stops that control. The stop button of each control does not stop other controls. Just like the brake pedal on your car only stops your car. The brake pedal of your car does not stop your friends car.
The lessons explains how programming controls works. Each control is a proccess. In computers, or real life, all processes are seperate items that start and stop. For example, if you open the front door of your home, closing the back door does not close the front door because they are seperate objects.
The tutorials explain ARC and how process control works. In the world of Plc programming wih robotics, you work with processes. For example each control is a process. The tutorials will help explain this. There is a tutorial on the ARC software that introduces controls.
I understand now that controls represent processes, this could be explained in an Realtime Expert tutorial. Scripts can start multiple processes, that's why I think that Stop buttons in the editors should stop all processes. Consider what happend when I added moves to the Dance music, and pressing Stop in the editor did not stop the Roli from rolling :-( And note that stopping other processes is currently impossible while an editor (modal window!) is open.
Suggestion: add an StopAll button to all editors, which stops all processes. Or, perhaps better, make the Stop button in every editor stop all processes; keeping parallel processes running after pressing Stop does not make much sense while editing.
It also should be noted that servos/ports are not locked by their steering processes, that's the responsibility of the coder. When e.g. two controls address the same servo, the results are somewhat unpredictable.
I don't understand yet what's a script (process or subroutine?), and where it executes - on PC or robot? Is it possible to let an robot work autonomously (offline), without a connection to an PC or other controlling device?
The lessons sometimes refer to specific models, hard to find out how to apply them to a different or newer model (see in detail the camera tracking). A textual tutorial could be more insensitive to such differences, when the labels in the controls have consistent names.
Furthermore I have problems in understanding the Delay and Speed settings. What's the difference, and to what do the values apply (Frame, Action, transition...)? I also couldn't find out yet what Jump To... and Transition To... does, and what's the intended use and purpose of these buttons. Where can I find more information?
Also interrupt handlers are commonly used with microcontrollers. Does there exist an equivalent in ARC, or how else to write code for reacting on events?
I understand that the intended audience of the tutorials and lessons are kids or other uneducated people, not programming experts. But the high quality of the EZ robot mechanics, equipment, and the sophisticated programming model and environment are somewhat oversized (and overpriced) for a toy. What about an Expert extension or product, that helps in writing more sophisticated or low level code for the robots, explaining the entire system from the inside?