Germany
Asked — Edited

Roli Dance

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?


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

United Kingdom
#1  

To add events to the sounds

  1. Add the soundboard EZB control
  2. Add a sound file
  3. Click on Edit for that sound file

    User-inserted image

  4. Where you want to add the script right click on the waveform to add a script as indicated

    User-inserted image

User-inserted image

  1. Write your script. Use ControlCommands to trigger Auto Position movements etc.

    User-inserted image

Under Cheat Sheet on the right of the script area are click and paste controlcommands for any control in your project, click on them and they are added to the script.

User-inserted image

United Kingdom
#2  

The scripts stop when they run out of commands to carry out. To look at it another way, say you want someone to get some water from your tap, that person has no idea how to get water from a tap, much like your robot not knowing anything at all.

So you tell them the tasks they need to carry out to achieve your request.

  1. Open the tap Water is coming out of the tap
  2. Close the tap Water stops

However, if you simply stopped giving commands after 1. above the water would continue to flow. The stop button in ARC scripts simply stops scripts issuing more commands. So if the script has opened a tap or set a H-Bridge to move a motor clockwise, simply stopping sending further commands wont stop the water flowing or motor moving, you need to issue commands to stop the water/motor.

DJ explained it a few years back using chickens as the subject matter, I will search and find that topic shortly (it's a good one, it stuck in my mind and helped me understand).

In short, to stop actions that you have started you need to send a command to stop them, the script ending will not stop them.

Edit: Here is the topic I mentioned about chickens.

DJ's amazing explanation:

Quote:

Once you set the speed for a servo, it is set. For example, pretend I came to your home and placed a chicken on your kitchen counter, and then I left your home. When I return to your home the next day, the chicken will still be there - unless you or someone else moved it. When you tell something to happen, it happens until you tell it to stop happening.

United Kingdom
#3  

To add text to the notepad, and please keep with me on this one as it's pretty complex...

  1. Click in the notepad
  2. Type what you require to be in the notepad

:D

Germany
#4  

Quote:

1) Click in the notepad 2) Type what you require to be in the notepad

I expected an cursor to occur at the place where the notepad was clicked. This seems not to work, instead the arrow keys have to be used to move the cursor to the insertion point. That's not what one can expect from a Windows notepad, and caused my confusion.

Just tested: a double click will move the cursor, but at the same time it will select the word near the clicked location.

Thanks for your hints :-)

Germany
#5  

Quote:

The scripts stop when they run out of commands to carry out.

That's only half the truth, does not answer my questions :-(

First a correction: Music editor seems never to execute actions by itself; dunno why I thought it did before the update :-(

Thus it looks like actions must be added explicitly to the music, either in the music editor, or by starting both music and action at the same time, in a button click script in the interface.

It also looks like the invocation of a script stops the previously active script, as can be observed in the music editor. This feature allows to stop some lengthy action (Dance), when the music reaches the next marker (with a Stop action). But when the music is stopped manually, the next marker will not be reached, and the previous script will continue. That's not very convenient when editing a new choreography, because then the music editor must be closed and the ongoing action must be stopped in the AutoPosition window.

In the Interface window, however, it's possible to add an Stop button with some action script, that causes to stop both the music and action when clicked.

United Kingdom
#6  

If you read through the rest of my reply and read through DJ's chicken analogy it answers the question on why pressing stop on a script does not stop an action. You must tell it to stop the action, I use the stop position in Auto Position to stop an action running, this returns the robot to it's normal, stopped position. You must also tell music to stop playing, motors to stop spinning, etc.

At the end of a set of instructions to build something or if you stopped reading the instructions part way through would that thing return to it's unbuilt state? No, it would remain part built. The same applies to the set of instructions which are within an EZ-Script.

Germany
#7  

Some commands can execute in parallel (independently), others only allow for sequential execution. Independent commands, like moving and playing music, must be stopped individually. It's unclear yet which movements can execute independently, when they affect different ports. At least positional actions (sequences of frames) can be stopped by starting another action. The HBridge (moving the Roli) seems to work independent from actions, too, so that a Stop action will keep an rolling Roli rolling.

Now the question is, how to determine what's currently possibly going on in parallel, so that a Stop script can really stop at least all movements. The same for starting movements, like when the Roli should start moving after picking up or depositing something, not while currently performing some action.

Germany
#8  

Another one: the HBridge can be steered from the controls, or from the keyboard (arrow keys). Is it possible to make the Roli move only as long as a button is pressed? How that? Does there exist something like an On Released script, in addition to the On Pressed script?

United Kingdom
#9  

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.

United Kingdom
#10  

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...

IF($hour = 13)
  # Entire script here
ElseIf
  SayEZB("It's not between 1 and 2, I'm not working")
EndIF

Or if the button is on port D0 and needs to be held down to allow the commands to run

IF(GetDigital(D0) = 1)
  # Entire script here
ElseIf
  SayEZB("Button not pressed, please hold down the button")
EndIF
Germany
#11  

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)?

United Kingdom
#12  

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.

#13  

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

Germany
#14  

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.

PRO
Synthiam
#15  

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.

Germany
#16  

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?

United Kingdom
#18  

Don't take this the wrong way but you are struggling with following the basics, "expert" tutorials would be of no benefit to you.

The only advice I can give you is to forget what you think you know and start again taking in all information. Your posts come across as though you expect something entirely different in most cases. EZ-Robot was not created for one person but for the majority, the majority follow and understand the lessons fine.

FYI, I enjoyed the lessons and regularly revisit the lessons despite the fact I am regarded as something of an expert by others and despite the fact I have given in excess of 320 solutions to community problems (probably twice that if the truth be told).

The EZ-Script manual is available, with examples should you believe you're above the tutorials for the "uneducated"... All commands are listed and explained.

If you require more information on control check out the respective pages in the ARC Manual or click on the question marks in ARC. If you require more information on EZ-Script read the EZ-Script manual. For third party robots there is also third party robot support For everything else which you do not understand there is this forum.

The hardware, software and community forum has been going for years without issue and with the community solving the community issues, advising on solutions etc. What more do you need?

#19  

@dodi ... I am too uneducated to help you.... But I appreciate you gracing us with your presence and hope you can continue to point out the error of our ways here....:)

United Kingdom
#20  

Quote:

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?

Are you aware of the meaning of "Delay" and "Speed" in the English language? The delay and speed do exactly what they say, they adjust the delay or the speed. I do not know how that can be made clearer. The values apply to the servos used in the frame/action, this should have been obvious really however it is implied that settings in an open control are relative to that control...

Jump To again does what it says, it moves all servos to the position instantly rather than transitioning to the position smoothly taking in to consideration the delay and speed settings set for the frame/action.

Transition To again does what it says, it transitions all servos to the position smoothly taking in to consideration the delay and speed settings set for the frame/action rather than jumping to it instantly.

The intended use and purpose is however you see fit to use them. On occasion you may wish to have the robot jump to a frame, such as stop. However if the robot is in an odd position that jump to may cause damage or not result in the correct end position therefore a transition to, or transitions to may be required.

These are plain English labels and are exactly what they say they are. It cannot be made much clearer and explanations would be redundant to most. However, if it is something which may cause confusion I am sure DJ could add another blue question mark to the control with an explanation for those who are "uneducated";)

Quote:

The lessons sometimes refer to specific models, hard to find out how to apply them to a different or newer model

There are no newer models. Any parts of lessons which are shared between robots should be extremely simple to understand how to apply it to your robot or a different robot. Regardless of the robot used the controls remain the same and operate the same. A H-Bridge will work the same way on Roli or on a Rover 5 or even a custom made 4 wheel driven base. Which parts are you not understanding? Ask questions and someone will guide you in the right direction.

Quote:

Does there exist an equivalent in ARC, or how else to write code for reacting on events?
Have a read through cloud projects and the forums. There are a lot of EZ-Script examples which show how to react with sensors etc. All scripts I post are commented to explain each part, what it does and why it's there.

#21  

@Rich.... You have the patience of a Saint, dude...;)

Germany
#22  

Ouch, it looks like I choose the wrong wording. Shame on me :-(

Germany
#23  

@Rich: Again you missed my points :-(

Why contains one dialog Delay, and another one Speed fields? What's the unit of Speed? To which item(s) do these settings apply?

Did you have a look at the color tracking lesson, before telling me that there exist no new models (or v4 dialogs)?

I'd appreciate if you would stop treating me as uneducated (pun intended), in trying to explain me only the obvious :-(

United Kingdom
#24  

I responded to each of the items I quoted, if there were points which were missed then you did not make them clear. I can only respond to what is written there.

The "speed" is as defined and explained in the manuals within the learn section of the site. They apply, as previously stated, to whatever the control is for. i.e. if you are in Auto Position and open up a frame the speed is applicable to whatever servos are being moved. Speed is a scale as explained in the manuals within the learn section of the site. The unit is not determined as different servos will have different speeds depending on gearing etc.

I have carried out all lessons multiple times. There are no new models. There are three models, JD, Six and Roli. None of which have altered since going in to production. JD has had minor cosmetic changes, Six I don't believe had any changes and Roli had the base redesigned rather than using the Rover 5 chassis but there are no new models, no models have changed.

The ARC dialogues may change, this was not previously mentioned and unfortunately I cannot read minds. The dialogues within ARC are always prone to change as the software is updated very regularly. However, the dialogues do not change substantially, are always very clear as to what is where and are complete with help within the software. Having said that, the camera control has not changed from the images shown in the lesson. Please be clearer if you believe something to be incorrect, post urls and screenshots to aid in us understanding what it is you are getting at.

The questions you ask I am answering as clearly as possible. If they imply that I treat you as uneducated you are mistaken (however, if you are asking questions then it implies that you are seeking to be educated thus are uneducated...), they are merely answers to your questions in as much detail as possible while being as clear as possible so that you and other community members can understand them.

#25  

Quote:

What's the unit of Speed?

Granted, I am uneducated but it unclear what are you looking for. Do you want to know in miles/hour how fast it moves from position to position depending on what you set? Kilometers/second perhaps?

I dunno. Maybe it's good enough to know something along the lines that speed = 1 is a slower than speed = 10? I mean, I can tell that volume level 1 on my stereo is not as loud as level 10 without having to know the decibel difference between the two and it really doesn't matter all that much.

United Kingdom
#26  

There is no unit for the speed it is a scale from 0 to 10 with 0 being unaltered and 10 being slowest. Speed 1 is faster than speed 2. Speed 5 is faster than speed 8. Speed 9 is slower than speed 4.

Speed determines how quickly the servo will reach it's requested position. For example, if a servo speed of 10 is set on port D10 and a speed of 3 is set on port D11, both servos are currently at position 90 and a script or Auto Position requests position 120 the servo on port D11 will reach position 120 before the servo on port D10, this is provided the servos are identical in every way.

With setting the speeds, you must ensure a position is set prior to setting the speed.

All of this is taken from the EZ-Script manual. I do not have any involvement in the development of ARC and have not had any additional training or guidance that is not readily available for everyone.