Page 4 of 6 FirstFirst 123456 LastLast
Results 31 to 40 of 60

Thread: Programming youtube channel

  1. #31
    Join Date
    Oct 2009
    Location
    Alabama
    Posts
    112

    Default Re: Programming youtube channel

    Quote Originally Posted by Dean Hystad View Post
    Select the NXT icon in the lower right corner of the programming area (by the download and run buttons). Click the memory tab. Look for the upload and download buttons.
    I almost forgot to add that stuff, instead its in the last video in the series.

    Note that you will have to click 'download' to put it on the robot... even though you are doing this command on a computer, so you are uploading it...

    There are many strategies for selecting the program, but the simplest is to make a program per each time the robot leaves the base, having a single fileDriver myblock, with the file name value appropriately chosen.

    I guess I could add a program chooser program... perhaps one where you press a combination of the three buttons to run each individual program (too easy to forget the combination!) or select it from a GUI. I think the latter would be better, but I would like to make it a bit more robust... speaking of which...

    Today I proved to myself that I could implement common abstract data types in the Mindstorms IDE (havent done it yet) but many of them might be of a higher order of complexity / require writing to files frequently. Can anyone think of a way of implementing a list or a binary tree without having to constantly write to files, or copy them or what not?
    Programming videos for FLL. (I don't like the videos that much and will be replacing them soon-ish)

    Easy data-logging and graphing for NXT-G.

  2. #32
    Join Date
    Sep 2008
    Location
    Minnesota
    Posts
    2,628

    Default Re: Programming youtube channel

    Quote Originally Posted by SciQuest View Post
    I almost forgot to add that stuff, instead its in the last video in the series.

    Note that you will have to click 'download' to put it on the robot... even though you are doing this command on a computer, so you are uploading it...

    There are many strategies for selecting the program, but the simplest is to make a program per each time the robot leaves the base, having a single fileDriver myblock, with the file name value appropriately chosen.

    I guess I could add a program chooser program... perhaps one where you press a combination of the three buttons to run each individual program (too easy to forget the combination!) or select it from a GUI. I think the latter would be better, but I would like to make it a bit more robust... speaking of which...

    Today I proved to myself that I could implement common abstract data types in the Mindstorms IDE (havent done it yet) but many of them might be of a higher order of complexity / require writing to files frequently. Can anyone think of a way of implementing a list or a binary tree without having to constantly write to files, or copy them or what not?
    Have done arrays using variables and a switch.

    My daughter and I wrote a command interpreter. We provide a menu for selection one of seven files to execute. Later on we added program editing to the NXT (can write programs only using a NXT. No laptop required) and the ability to transmit commands to other robots via BT. A fun demo is to have 3 robots duplicate actions I manually perform on a fourth.

  3. #33
    Join Date
    Oct 2009
    Location
    Alabama
    Posts
    112

    Default Re: Programming youtube channel

    Quote Originally Posted by Dean Hystad View Post
    Have done arrays using variables and a switch.

    My daughter and I wrote a command interpreter. We provide a menu for selection one of seven files to execute. Later on we added program editing to the NXT (can write programs only using a NXT. No laptop required) and the ability to transmit commands to other robots via BT. A fun demo is to have 3 robots duplicate actions I manually perform on a fourth.
    Thats pretty cool! Id love to see that and the stall detection program!

    Ive been trying to think of an hack I could do with all of our LEGOs (we something like 20 NXT kits) once things die down in the spring... I think Im going to make a remote control that is capable of automatically generating commands for the fileDriver myblock. Still looking for worthy ideas!

    That remote would be FLL legal, since the results would just be on a text file. Dont worry though, I wouldn't actually let the kids use it.

    ---

    A screen with 7 static programs to chose from is nice but we occasionally have teams with more than 7. So being able to loop through them, and redrawing the whole list as you go, would be nice. I think I can do that with just one file, but it'd add another O(n) to all operations on the list.
    Programming videos for FLL. (I don't like the videos that much and will be replacing them soon-ish)

    Easy data-logging and graphing for NXT-G.

  4. #34
    Join Date
    Oct 2009
    Location
    Alabama
    Posts
    112

    Default Re: Programming youtube channel

    Dont have time to post a video of this but I might have time to write it out:

    If you want to work on a program at home, without the board, there IS an "easy" way to do it. This method has worked with a <10% error for me in the past.

    First, measure how long one rotation is in centimeters. For our wheels, this is 17cm. If you get a different number, substitute it in for the various 17's in the equations below.

    Second, find an image of the board (techbrick has a few).

    Third, download a utility program that lets you see your mouse's position. I usually use AutoIt's window info tool but it requires you to download that scripting language and is slightly more complicated than it needs to be. I found an alternative at http://www.softpedia.com/progDownloa...oad-76369.html (Windows) just download and install then click Get Position and keep the utility in focus.

    Find how large the board is in centimeters (this info available on the usfirst.org website) then find how large the image of the board is in pixels. Set these two equal to each other and solve for 1cm = ??pixels.

    Then, solve the ration of 17cm = 1rotation for 1cm. You should get 1cm = (1/17)rotation

    Set (1/17)rotation = ??pixels. Then solve for 1pixel. You should get 1/(17*??)rotation = 1pixel. This number on the left hand is the number you need.

    Now, when you measure distance in pixels, you can multiply it by 1/(17*??) to get the number of rotations.

    Keep in mind though, that even when you turn on a dime the wheels DO move, so errors will creep in. This is just meant to be a good starting point, a way to help your team when you dont have access to the board.

    If you are not going straight horizontal or straight vertical, dont forget to use the Pythagorean theorem to figure out the distance. (a squared + b squared = c squared)

    As an exercise, lets say the two points you want to travel between are (335,520) and (440, 400). The difference of the first term is 105, and the difference of the second term is 120. Square both values separately (you can use a calculator). You should get 11025 and 14400 for their values. Now add them to get 25425. Now find the square root. It is 159.45

    All you have to do that now is multiply that pixel distance times the number we calculated earlier to find how many rotations your robot will have to travel.

    Have fun!
    Programming videos for FLL. (I don't like the videos that much and will be replacing them soon-ish)

    Easy data-logging and graphing for NXT-G.

  5. #35
    Join Date
    Sep 2008
    Location
    Minnesota
    Posts
    2,628

    Default Re: Programming youtube channel

    Their stall detection used a feature of the Move block that disappeared with V2.0. Used to be that Setting the direction to STOP would terminate any Move or Motor blocks using the same ports. So stall detection consisted of checking occasionally to see if the rotation sensor values change. If they didn't do a Move Stop.

    I don't have the block anymore, but the attached program is how I remember it looking. There was also a stall detect block for the attachment motor (port A).
    Attached Images Attached Images

  6. #36
    Join Date
    Jun 2009
    Location
    San Jose, CA
    Posts
    224

    Default Re: Programming youtube channel

    I did a stall detection program with two program lines. The top line executed the movement. The bottom line monitored the change in motion. The top line would set a flag to stop the bottom line if it finished (so the bottom line wouldn't go forever). The bottom line would send a flag to tell the top line to stop the motors and continue the program. It worked very well.

    My team generally just uses timed movements for attachments. That is the poor man's stall detection.

  7. #37
    Join Date
    Sep 2009
    Location
    Illinois USA
    Posts
    57

    Default Re: Programming youtube channel

    Quote Originally Posted by Dean Hystad View Post
    Their stall detection used a feature of the Move block that disappeared with V2.0. Used to be that Setting the direction to STOP would terminate any Move or Motor blocks using the same ports.
    I'm pretty sure I verified that the same effect can be accomplished in V2.0 using a RESET motor block.

  8. #38
    Join Date
    Jun 2009
    Location
    San Jose, CA
    Posts
    224

    Default Re: Programming youtube channel

    Quote Originally Posted by hastypete View Post
    i did a stall detection program with two program lines. The top line executed the movement. The bottom line monitored the change in motion. The top line would set a flag to stop the bottom line if it finished (so the bottom line wouldn't go forever). The bottom line would send a flag to tell the top line to stop the motors and continue the program. It worked very well.

    My team generally just uses timed movements for attachments. That is the poor man's stall detection.
    Untitled.png

  9. #39
    Join Date
    Sep 2009
    Location
    Madison, WI
    Posts
    38

    Default Re: Programming youtube channel

    Quote Originally Posted by Dean Hystad View Post
    Their stall detection used a feature of the Move block that disappeared with V2.0. Used to be that Setting the direction to STOP would terminate any Move or Motor blocks using the same ports. So stall detection consisted of checking occasionally to see if the rotation sensor values change. If they didn't do a Move Stop.

    I don't have the block anymore, but the attached program is how I remember it looking. There was also a stall detect block for the attachment motor (port A).
    It looks like the stall detection is simply checking the B and C rotation counters every 5 seconds. If either one hasn't changed since the last check, both the B and C motors are stopped. Is that all that was needed?

    Jeff
    Jeff Bartig
    BadgerBOTS
    FTC Coordinator
    Wisconsin FLL Affiliate Partner--Head Ref

    http://www.badgerbots.org/

  10. #40
    Join Date
    Sep 2008
    Location
    Minnesota
    Posts
    2,628

    Default Re: Programming youtube channel

    Quote Originally Posted by Jeff Bartig View Post
    It looks like the stall detection is simply checking the B and C rotation counters every 5 seconds. If either one hasn't changed since the last check, both the B and C motors are stopped. Is that all that was needed?

    Jeff
    Then you have to stop the motors. Used to do that with a Move Stop block. Sounds like a motor reset does the trick now.

    If you have the education version of the NXT software the robot academy has an example of using the rotation sensor to determine when the robot drives into a wall.

Page 4 of 6 FirstFirst 123456 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need to make a decision about programming
    By bruceba in forum Think Tank
    Replies: 3
    Last Post: 10-04-2013, 06:10 PM
  2. Programming videos
    By SciQuest in forum Team Resources
    Replies: 4
    Last Post: 10-16-2012, 09:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •