Announcement

Collapse
No announcement yet.

MECANUM DRIVE w/ Block Coding... HELP

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

  • #16
    Originally posted by benmcl View Post
    Ok, I posted the screen shots to my Dropbox - hope this works for you!
    driveMecanum: https://www.dropbox.com/s/xwcq3tmgu4...canum.png?dl=0
    teleop Mecanum: https://www.dropbox.com/s/soxsk2qhni...canum.png?dl=0
    Whoops - over-aggressive housecleaning deleted these files. Here they are again, re-uploaded and re-shared. Sorry for any frustration!

    Comment


    • #17
      Our program was a bit different, we used the left joystick to translate the robot (front/back and strafing) and the right joystick to turn instead of using triggers. Personally, I think this is easier to drive because the robot will move in the direction you move the left joystick, and it's easier to go diagonally, but it does require a bit of math. Anyway here's the logic:

      //First we had three variables:

      drive = - leftjoystick y
      turn = rightjoystick x
      strafe = leftjoystick x

      //drive is set to negative of the y-axis because the y-axis goes from -1 to 1

      leftFront = drive + turn - strafe
      leftBack = drive + turn + strafe
      rightFront = drive - turn + strafe
      right Back = drive - turn - strafe

      I might have mixed up the the math a bit, so you'll have to try it out. Also, I found another post where they use trigonometry to make the robot go in the angle of the joystick. It's in java, but here's the link anyway:
      https://ftcforum.usfirst.org/forum/f...e-code-example

      Again, I found this to be really easy to drive, but your drivers should be the ones decide which one they feel more comfortable with.

      Comment


      • #18
        Getting the control algorithm to work in blocks is not an issue. Getting mecanum wheels that perform consistently was the problem for us. We tried many methods for compensation, but never trusted it enough in autonomous.

        Comment


        • #19
          We have a rookie team with inexperienced block programmers. Thank you for providing the information on how to add strafing using block programming. Would you please post the screen shots to your dropbox again because the links listed above have expired? We are not sure how to add the mecanum algorithm to the program. Thank you.

          Comment


          • #20
            Look at the Functions category of the toolbox.
            Here's a screenshot: https://drive.google.com/file/d/1Fae...ew?usp=sharing

            ​​​You can create a function block (with or without a return value) and then call it.
            We are still trying to figure out how to do the mecanum drive in blocks. We understand why all the calculations are there but it's still not sending power to the motors of the wheels. I think our problem has something to do with the above quote. How do you 'create a function. I don't see a button to 'create' like I do in variables. I will post our code as it is now. Any help would be much appreciated.
            Screen Shot 2019-10-29 at 7.00.46 PM.png

            Comment


            • #21
              Originally posted by FTC0273 View Post

              We are still trying to figure out how to do the mecanum drive in blocks. We understand why all the calculations are there but it's still not sending power to the motors of the wheels. I think our problem has something to do with the above quote. How do you 'create a function. I don't see a button to 'create' like I do in variables. I will post our code as it is now. Any help would be much appreciated.
              Screen Shot 2019-10-29 at 7.00.46 PM.png
              Your gamepad reads occurs once before the loop. So it reads zero on startup and never changes after that.

              Comment


              • #22
                The Wizards.EXE have a very nice tutorial on how to do a Mecanum or Holonomic drive with Blocks:

                https://www.youtube.com/watch?v=cXrDz1cb8N0

                Comment


                • #23
                  Originally posted by Tom Eng View Post
                  The Wizards.EXE have a very nice tutorial on how to do a Mecanum or Holonomic drive with Blocks:

                  https://www.youtube.com/watch?v=cXrDz1cb8N0
                  Yes, that is the one that we followed exactly and doesn't work for us.
                  Previous advice was to move the gamepad 'reads' to the init phase? (did I understand that correctly?)

                  I was told to contact you Thomas Eng but I also knew you were at World's! Do you have any more advice? We are close to switching to tank drive.

                  Comment


                  • #24
                    I may have figured it out - will test tmw... (just had to read the 'edit!' and put the read blocks inside the run loop.

                    Comment


                    • #25
                      Nope still not working... GAH!
                      Attached Files

                      Comment


                      • #26
                        Looks like it should work. Organized troubleshooting time.
                        First put robot on blocks so wheels don't touch.
                        2. Put a number like 1 into the setPower commands.
                        If that doesn't work, create a new blocks program as simple as possible to run a motor with a number.
                        Doesn't work - check configuration file, check motors are plugged in etc.
                        If worked with 2. , place a gamepad stick directly in setPower command.
                        If doesn't work - does gamepad icon show on driver station?, have you been making it 2 with start B instead of A?

                        Comment


                        • #27
                          Ok now our hubs aren't reading the correct config files. We have the two expansion hubs connected, and config files that tell expansion hub 1 that it has 3 DC motors (a stone collector and an arm) and a servo (PPF) connected THEN we tell hub 2 that it has 4 DC motors (the wheels: rightrear, leftfront, etc.) connected. But when we set that config file + the run the code for the wheels ONLY - it runs the stone collector and arm DC motors!!

                          Do we not have our hubs connected correctly? are we config-ing them wrong?
                          You do not have permission to view this gallery.
                          This gallery has 2 photos.

                          Comment


                          • #28
                            When everything is hooked up and ready to run, the REV hubs should be blinking.
                            The REV hub with address 1 will have a long green followed with a single blue blink then back to long green.
                            The REV hub with address 2 will have a long green followed with two blue blinks then back to long green.
                            They should have different addresses (page 12 section 2.5)
                            http://www.revrobotics.com/content/d...31-1153-GS.pdf


                            As of post #25 I would have expected to see the arm motors move with drive wheel commands at that point with swapped Hub names.

                            Comment


                            • #29
                              YES! that is exactly what happened! I have renamed the hubs a few times - I can never get the second Hub to flash it's address. it' is only a solid blue light.

                              Comment


                              • #30
                                Originally posted by FTC0273 View Post
                                YES! that is exactly what happened! I have renamed the hubs a few times - I can never get the second Hub to flash it's address. it' is only a solid blue light.
                                When changing the address you can only have one Hub attached at a time. Renaming and address change are not the same. Have you looked at the link I provided?

                                Comment

                                Working...
                                X