Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0

    BEST Robotics Programming - Using diagonal on RC as a "button"


    I am in BEST Robotics and part of the programming team. I don't really understand much of C, but we are trying to set it up so that on the controller we can use the diagonals to send out a certain IR signal from our IR transmitter. If I need to explain further, I can get some pictures later.

    We can figure out the values we want to use for the IR (which uses the setServo command thing) but we aren't sure how to have the diagonals do what I said above, especially keeping them independent from the arm and grabber we have set on those same two channels, but independent from each other.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Insufficient information. First read this:

    New user how to post a question - READ THIS FIRST

    You are probably in the wrong forum anyway as your problem probably has more to do with algorithms or details of your control system than the C language. I suggest you start with the Software Design forum and explain a lot more about the hardware you are using.
    I no longer wish to be associated with this site.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    Ok sorry. I am using IAR Workbench, and my basic question is this: on the controller, the channels I want to mix are 3 and 4, which are turned into 2 and 3 when put into C. I'm not sure how to tell it to used the combination of those two, so any help would be great, but none is expected due to this being a fairly specific-to-this-program question.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Can't help you. Haven't a clue what those channels are used for, much less whether they can be "mixed". There may yet be a C language question in there somewhere, but we need more information. IAR Workbench can be used to target more than one processor and those can all be soldered to infinite permutations of board designs. Pointers to your controller docs would be very useful.
    I no longer wish to be associated with this site.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    BTW, I would love to provide free consults on this project. You can find my contact information at www.odonahue.com. I have worked a handful of robotics projects over the years and am fairly familiar with IAR Workbench and most of the hardware/software that goes into developing robotics. I can also connect you with other experts in the field, who are usually willing to assist on student projects (schedules allowing), if/when you should need them.

    While I have not been active at the Seattle Robotics Society since the late 80's, I drop in on them from time to time and I am sure we can find expert assistance among their members, even if some of them may be mentoring other BEST competitors. You may also be able to find a local Robotics Society or equivalent club in your own area. It's always easier to help with these things when you can physically touch the equipment involved and communications bandwidth is always highest face to face.
    I no longer wish to be associated with this site.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    Click this link then look at the Advanced Brain powerpoint.

    That site has some files, namely the one called Advanced Team Training. This gives some basic information, as well as some more advanced information and some basic programming and some syntaxes for this specific thing. Does that help?
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Got it. I'll take a look.
    I no longer wish to be associated with this site.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Ok, here's an example of poorly written, non-defensive code:

    Code:
    for (chan=0;chan!=4;chan++)
    	{
    	 inval=getRcValue(chan,8,100);  // no gain, ok deadband
    
    	  // insert other processing with the input values
    	  
    	 setServo(chan,inval); // set the servo position
    	 setMotor(chan,inval); // set the motor speed
    	} // for loop
    Never mind their failure to use the one true bracing style. Take a look at the for loop conditional. If chan ever winds up greater than 4, this puppy runs off into the weeds screaming like R2 with a power overload. That should be chan < 4 kids. Please don't follow their examples at home and do wear protective clothing.

    Of course, in this trivial example, chan is likely to remain within the range (0..4], but this stuff gets picked up by folks who are just learning how to code, and they go off and add all kinds of things to it and before you know it, somebody's on their way to an emergency room and/or the school nurse is spritzing bleach all over the bot to clean off the blood.

    Whoever wrote the code for that power point presentation should be fired.
    I no longer wish to be associated with this site.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    I get what you're saying, and it made me laugh really hard. (I like to make -ist jokes, so the following is meant to JUST BE A JOKE, no matter how truthful the information is) It's probably because that person is a girl. Ha.

    And we're not using that certain program because it's simply lame and hard to work with without redoing it completely.

    Anyways, do you now understand what I'm trying to do with the diagonals? I understand how to program the IR to work, just not how to assign it to diagonals.

    However, just my brain thinking and people talking, I thought that if you could put in some like "for (chan2=1024) etc...not sure how to write that so that it doesn't just flop over and die, but oh well.

    Comments on this post

    • gamo disagrees : THIS IS JUST A JOKE...you're a buttface...
    • sizablegrin agrees : Cancelling gamo. Maybe I'll run across THAT buttface someday.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2009
    Posts
    837
    Rep Power
    527
    Code:
    inval=getRcValue(chan,8,100);  // no gain, ok deadband
    The "magic numbers" here (8, 100) should be replaced with appropriately named const's.

    This may be a stupid question:

    What is "the diagonal", and where in the documentation can I find information re: "the diagonal".
    Last edited by MadDogBrown; October 22nd, 2009 at 09:04 PM.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Originally Posted by Apetrunk
    Anyways, do you now understand what I'm trying to do with the diagonals? I understand how to program the IR to work, just not how to assign it to diagonals.
    Not there yet. Perhaps you could explain what you mean by "assign it to diagonals"?
    I no longer wish to be associated with this site.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    So here's a major design flaw:

    Code:
    Diagnostic LEDs (D41/D42) indicate status:
    	* D41 – Control Processor; D42 – User Processor
    	* Slow blink (once per second) – normal operation
    	* Fast blink (five times per second) – absence of tether/receiver signal, or absence of communication between processors.
    	* Solid on/off – something is hung up, cycle power first then reprogram if power cycle doesn’t solve.
    So, there's lots of ways that a failure can masquerade as either the slow blinking normal mode or the fast blinking "missing signal" indicator. I once watched a crane operator load an entire rail car full of scrap metal, thinking our industrial crane scale was working correctly, when it fact, it was resetting itself at almost exactly the same rate as the "slow blinking normal indicator" rate. LOL. You may need to turn that thing off and generate your own diagnostic outputs.
    I no longer wish to be associated with this site.
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0
    Maybe it'll let me post URLs now.
    In the representation on one of the joysticks shown below, the colored parts are what I mean by diagonals.



    Sorry for not being very informative. I just don't quite know what I need to tell. And thanks for the help and for putting up with me. =P
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Ick! I won't be visiting their public message board:

    Code:
    Public Message Board (for anyone)
    	* Must register for Yahoo login account
    	* Share ideas, resolve issues, …
    	*http://tech.groups.yahoo.com/group/bestinc
    I no longer wish to be associated with this site.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2009
    Posts
    837
    Rep Power
    527
    Okay, so you've established that you must be able to obtain diagonal inputs from the joystick.

    Once those inputs are obtained, what must occur next?

    If this sounds simplistic, please understand that I'm trying to help you form the logic in your native language.

    If you can state clearly in english the steps that must be undertaken, then the code you write will be a reflection of that.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo