Announcement

Collapse
No announcement yet.

Is there a way to organise programs on the robot?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a way to organise programs on the robot?

    Hello!

    Recently my FLL team has been having trouble figuring out how to organise programs on our bot. We want to organise our prograns in the order that we run them in, but can not figure out how. We figured out the basic order it puts the programs in ( Below ) but can not figure out how to change this order. Does anyone know? Thanks!

    Order

    When downloading multiple projects inside of a single program, it puts the highlighted program first, then the rest in backwards order.

  • #2
    Re: Is there a way to organise programs on the robot?

    As far as I know you cannot organize how files appear in projects. Your method may work for projects that only contain programs (BTW, good find, I was unable to see any pattern), but once you start writing my blocks, create files, use sounds or images you end up with a hodgepodge of files inside a project that makes it really difficult to find the program file you want. However you can somewhat order how programs appear in the recent programs list. When you run a program it pops to the top of the list. If you run each mission, starting with your last and ending with your first the programs will appear in order (first to last) in the list. When you run the programs on the table the first program will appear at the top. After running the first program it remains at the top and you have to click down to the second program, 1 click. After running the second program it becomes the first in the list, but the third program is still the third program in the list, so click down twice and press run. Repeat for all programs.

    This is a bit of a pain, so many teams write one or two programs that run all their missions. You can write these programs in such a way that allows jumping to a particular mission without running the others. Teams refer to these programs as a "master" program or a "sequencer" or "scheduler". A really simple sequencer uses the 5 brick buttons to run 1 of 5 different missions (each mission becomes a my block and they all go into a switch). If you have more than 5 missions you can write two such programs. More sophisticated sequencers might use menus to select and run any number of programs. I've even seen sequencers that let you stop a mission without stopping the sequencer program. A good sequencer program can save you a lot of time that is wasted selecting programs, and it provides opportunities to use some programming blocks that don't get used a lot in mission programs.

    A sequencer is not all sunshine and lollypops though. A lot of teams depend on everything getting reset at the start of a mission and everything getting turned off at the end. Putting missions inside a sequencer program stops this from happening and your missions might (probably) run a lot different than when you run them all by themselves. They may even run differently depending on the order you run the missions. It can all very mysterious and teams might get really frustrated. If you decide to write a sequencer program make sure to schedule a lot of time for testing and debugging.
    Last edited by Dean Hystad; 11-10-2016, 12:04 AM.

    Comment


    • #3
      Re: Is there a way to organise programs on the robot?

      @ BMR: You could consider "How To Make A Simple Quick Start Menu On The EV3": https://www.youtube.com/watch?v=Mi7j7k3kk84

      Comment


      • #4
        Re: Is there a way to organise programs on the robot?

        Hmm...

        These are both great ideas, I haven't ever thought of doing that. But with only 1 meet left before competition, we may not have enough time. Thank you for the ideas, though!

        Comment


        • #5
          Re: Is there a way to organise programs on the robot?

          Good choice. It is far better to waste some time selecting program than whipping together a sequencer and not having it work at all.

          Try running the programs in reverse order to set the order they appear in the recent programs list. You might find that beneficial and there are no pitfalls.

          Comment


          • #6
            Re: Is there a way to organise programs on the robot?

            The LEGO MINDSTORMS EV3 file is actually a Zip file--you can rename it with a .zip extension and open it with a Zip archive tool (7-Zip is my favorite free archive tool). Once you open it, you can then peek and poke the files within; namely the extremely important and complicated XML file Project.lvprojx, which, among other things, defines the order of appearance for objects in the software (and on the EV3 when downloaded). Use extreme caution when manipulating these files--they are all inter-related and you can easily corrupt your programs to make them unusable.

            Attached is a LINQPad C# script (LINQPad is another free tool that can be used to author Microsoft .NET Framework programs in C#). The script will open the EV3 file at the path defined at the top of the script, perform some crafty diagnostics (find unreferenced sound files, find unreferenced My Blocks), and then sort the programs, My Blocks, and sound files and re-save the file. Be sure to save the attached script with the .linq extension instead of .txt. And of course, make a backup copy of your EV3 file before running, just in case something odd occurs while running!

            Enjoy!
            Attached Files
            --
            Coach Brady P. Merkel
            Neon Supernova, 2016/2017 Animal Allies
            Neon Supernova, 2015/2016 Trash Trek, North Florida Regional Champions
            LEGO DestroyerZ, 2014/2015 World Class, State Champions Core Values
            LEGO Bosses, 2013/2014 Nature's Fury, Regional Rising Star

            Comment


            • #7
              Re: Is there a way to organise programs on the robot?

              Originally posted by Bpmerkel View Post
              Attached is a LINQPad C# script (LINQPad is another free tool that can be used to author Microsoft .NET Framework programs in C#). The script will open the EV3 file at the path defined at the top of the script, perform some crafty diagnostics (find unreferenced sound files, find unreferenced My Blocks), and then sort the programs, My Blocks, and sound files and re-save the file.
              Wow, that's a great tool! Thanks for sharing. The sorting alone is a great help.

              Comment


              • #8
                Re: Is there a way to organise programs on the robot?

                What are people's thoughts on the legality of a separate tool that organizes the project files? R07 says the "Robot may only be programmed using...", but a script like this doesn't really program the robot. It doesn't add any capability, and it's use would be undetectable except for noticing that the programs are in a specific order. I don't mention "undetectable" to indicate that it could/should be used illegally because nobody would know, it's because the script doesn't do anything to the programs that would be noticeable, and therefore it doesn't provide any special advantage (other than sorting the programs, which would be pretty handy).

                To extend this question, what if the team manually edited the files? I haven't looked yet, but I assume the order could be adjusted pretty easily in a text or XML editor. In this case the team member changed the project, not software.

                In the end, I'd rather have the team write a sequencer program or set up the recent programs page manually, but I have wondered about using tools like this to do helpful things (I'd really love to be able to use custom icons for My Blocks).

                Comment


                • #9
                  Re: Is there a way to organise programs on the robot?

                  From the FLL Animal Allies Challenge Guide, page 18:

                  "R07 - Software - The Robot may only be programmed using LEGO MINDSTORMS RCX, NXT, EV3, or RoboLab software (any release). No other software is allowed. Patches, add-ons, and new versions of the allowable software from the manufacturers (LEGO and NI) are allowed, but tool kits, including the LabVIEW tool kit, are not allowed."

                  SO, it seems that using other software (to create a Sequencer) is not allowed.

                  Comment


                  • #10
                    Re: Is there a way to organise programs on the robot?

                    Changing the order of some lines in the Project file does not change any programs or my blocks. The file only affect the order the programs are loaded onto the brick, the file itself never resides there. The software restriction only limits the tools used to PROGRAM the robot, and what this file does can hardly be called programming. It is akin to saying I can't use MS word to make my printouts for the programs. MS Word software not from LEGO.

                    It's nice to see someone in the community solve this problem and share the answer with the community.
                    Last edited by Dean Hystad; 11-14-2016, 09:27 PM.

                    Comment


                    • #11
                      Re: Is there a way to organise programs on the robot?

                      Originally posted by Dean Hystad View Post
                      It's nice to see someone in the community solve this problem and share the answer with the community.
                      Necessity is the Mother of Invention! Perhaps this is a feature we'll see in a future version of the MINDSTORMS software (that, and the ability to Edit a MyBlock definition without having to re-create the MyBlock and find/replace everywhere!)
                      --
                      Coach Brady P. Merkel
                      Neon Supernova, 2016/2017 Animal Allies
                      Neon Supernova, 2015/2016 Trash Trek, North Florida Regional Champions
                      LEGO DestroyerZ, 2014/2015 World Class, State Champions Core Values
                      LEGO Bosses, 2013/2014 Nature's Fury, Regional Rising Star

                      Comment


                      • #12
                        Re: Is there a way to organise programs on the robot?

                        Originally posted by Bpmerkel View Post
                        Necessity is the Mother of Invention! Perhaps this is a feature we'll see in a future version of the MINDSTORMS software (that, and the ability to Edit a MyBlock definition without having to re-create the MyBlock and find/replace everywhere!)
                        Ahh, I have a fix for that one, at least within the scope of a project.

                        To replace a my block:
                        1. Close all programs and my blocks
                        2. Open the my block you wand to modify.
                        3. Select entire content of the my block and create a new my block.
                        4. Delete the old my block.
                        5. Rename the new my block so it has the same name as the old my block.
                        6. When you open a program that used the old my block you'll find it's been replaced.

                        Comment


                        • #13
                          Re: Is there a way to organise programs on the robot?

                          Originally posted by dluders View Post
                          ...SO, it seems that using other software (to create a Sequencer) is not allowed.
                          In previous seasons, teams have been allowed to use Ruby programs and Visual Basic scripts along with Excel to help structure the input data for "Command Interpreter" type programs, so I suspect FIRST Headquarters wouldn't have a problem with someone using a program to re-order the contents of the EV3 project zip file.

                          See the following thread on Command Interpreters for some details.

                          I think those programs were designed for the NXT. Perhaps a team in need of a challenge could give it a try for the EV3.

                          Comment


                          • #14
                            Re: Is there a way to organise programs on the robot?

                            The mission sequencer programs so commonly seen in FLL started out as a way to save memory, not time. Early NXT software was a memory hog. You didn't have to worry about finding programs on the brick because you only had enough storage for 3-4 typical FLL programs. Doug Frevert studied the problem and noticed that each type of block used in a program had a one-time big memory hit, but multiple uses of the same kind of block inside a program did not. My blocks worked the same way; a fairly large one time cost with additional uses for free. The idea for the sequencer was to wrap all the missions into one program and pay the big one-time cost only once instead of 3-4 times. The storage problem was so bad we discussed posting code for a sequencer program on the high tech kids website (I had a real beaut). Thankfully LEGO came up with a solution shortly before the start of the FLL season and a sequencer remains a learning opportunity.

                            I did see a couple of sequencers for RCX. There it was to get around a limit on the number of programs (I think it was 5). The most ingenious sequencer of all time was on an RCX. It used a light sensor to look at the robot attachment. The intensity value determined which part of the program to run. To run the robot you mounted the attachment and pressed a touch sensor. No making selections, no room for human error.
                            Last edited by Dean Hystad; 11-15-2016, 03:03 PM.

                            Comment


                            • #15
                              Re: Is there a way to organise programs on the robot?

                              Here is a trick that helps solve part of the problem...it works better than the status quo.

                              The challenge we had was each of our programs appeared in our project in random order. We had run 1, run 2, run 4, run 3, run 6, run5. It appears the order is not so random after all. Our observation is that programs that gets created first appear first with the Myblocks used for that program. So the order is really in the order it got created - Now we can manipulate that a bit..so I just did the following

                              Opened two projects - one with the existing programs and another a blank project - The I went to the properties pages of each project - from my programs project I picked Run1 program first copied it using the copy button and then went to the blank project and pasted the program. What it did was also copy the myBlock and pasted in the MyBlocks used in Run 1 program. Then I copied Run 2 and pasted it to the new project...like wise I finished with all the runs - Now in the new project I had all the runs in sequence. The Myblocks were copied automatically but I had to delete some duplicates because when I copied the second or third run and if they used the same myBlock it gets copied again. - So I deleted the copies of myBlocks and made sure there was only a single copy of the MyBlocks

                              Now I saved the new project - closed Mindstorms program and reopened the new project - Viola - The runs appear in sequence - They don't necessarily appear as Run1 Run2 Run3 etc...They appear as Run1 MyBlock1 Run2 MyBlock 2 MyBlock3 MyBlock 4 Run3 Run4 Run5 MyBlock5...So at least the Runs are in sequence interspersed with the respective MyBlocks in between

                              I loaded this new program on the brick - it appears in that exact order - so at least we are going down the order rather than back and forth.

                              I know it is not an ideal solution but it helps

                              Comment

                              Working...
                              X