Programing without cycles ?!?

9 posts / 0 new
Last post
FREEEK
FREEEK's picture
Programing without cycles ?!?

   What kind of autonomous robot (program functionality) do not have a way to make a "feedback" I mean It is VITAL to have a way to put some "out-puts" to some earlyer (upper level) " inputs.

   I sent a mail to Wow Wee 2 days ago and I wait for an answer ... 

Nocturnal
Nocturnal's picture

Answer, very simple ones.

If you could explain what it is you are trying to do, I may be able to assist you.

FREEEK
FREEEK's picture

FREEEK
FREEEK's picture

Can I put somehow one "out-put" (for NO answer in this case) back to some "upper" level (to go back few "lines") ... ?!?!?

I've just got an answer from WoW Wee, check this out:

---------------------------------------------------------------------------------------------- 

 Hello Horia,

The current version of RS Media Editing Suite does not allow looping, which
includes the "for loop", "while loop" or the "until loop", however if you
have a slight knowledge of programming in linux, this can be achieved. You
can search simple bash shell programming for loops, and edit the .sh file.
I could pass your comments to the R&D department and perhaps they can
implement such a feature in the macro editor for the future versions.

Note that RS Media uses the bash shell.

Regards,
--
Amar Minhas

--------------  I have no idea about LINUX programming :(( -------------------- 

Nocturnal
Nocturnal's picture

Yes and no. You can't do it with WowWee's software, and since what you seem to want is a goto, you can't do that with a bash script either, You can however do something similar.

If you open the file up in a text editor, rather than wowwee's software, you should see something like this (after all the comments at the top of the file).

if [ $(RSM_FOOT_R_F) -eq "1" ]
then
   do something for yes
else
   do something for no
fi

What you need to do is change it to is something like this

while [ $(RSM_FOOT_R_F) -ne "1" ]
do
   do something for no
done
do something for yes

Notice that the test has gone from -eq (equal) to -ne (not equal), and we have gone from a if to a while. This will cause the test to be repeated, and the "no" action to be preformed, until the condition becomes true. You can also use subroutines. So something like this

notpressed() {
   some actions here
}

pressed() {
   some other actions here
}

while [ $(RSM_FOOT_R_F) -eq "1" ]
do
   notpressed
done
pressed

Its all pretty simple, as long as you have some experience with programing.

EDIT : Would you believe that it took me 20 minutes to space that stuff in a fashion that the forum didn't screw it up again when I submitted it.

FREEEK
FREEEK's picture

   Wow Wee  should put this "facility" in the software ... If they want the Macro Editor to be used by non-progammers ... This is not a so difficult thing to do by them ... no?!?

     P.S.: Did you see the Microsoft Robotics Studio and all the afiliate robots Producers?!?!? (mabey another topic should be opened)

Dradts
Dradts's picture

How long do the conditionals wait until they decide whether they return "true" or "false"? I mean, when I use the conditional "see green", how long will he wait for something "green" to appear in front of him?

Also, is it possible to have him put to free_roam_mode via shell-script? Are all his commands accessible via script? And is it possible to have him look for something green while walking around in free_roam? 

I know, lots of questions... Laughing

Just.b
Just.b's picture

They really need to add a loop function into the main program.

This is in the Mindstorms program and it is very usefull.

 

FREEEK
FREEEK's picture

   The new PC Suite should include this feature and a few... I hope some of this friendly chat will make some sense for WoW Wee ... if they called their robot autonomous :(