Announcement

Collapse
No announcement yet.

Calling custom Java classes from Blocks OpModes

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

  • Calling custom Java classes from Blocks OpModes

    I have functionality that I am building using Android Studio and creating most of my OpModes on that. However, I have some junior programmers that I am starting in Blocks mode. Is there a way to call my custom Java classes from Block Op Modes? If not, I am thinking a Block callJava type object that takes a classname and a single integer parameter would be enough. Note, I am NOT talking about calling my Java OpMode from Blocks. I want to call my helper classes.

    Thanks,

    Nathan

  • #2
    This is an interesting feature. I'll look into it.

    Comment


    • #3
      I came here specifically looking for exactly this ability. Did this ever get implemented? I am currently working to help junior programmers transition our team code from Blocks to java, but it seems an overwhelming task since it is an all-or-nothing proposal (each OpMode must be transitioned in its entirety). This suggested feature would allow small subroutines to be written in java (or exported from Blocks), yet still be called by the higher level OpMode already existing in Blocks. This would provide for a slower and smoother learning experience, by digesting java in much smaller chunks. It would also help to teach junior programmers the benefits of writing modular reusable code.

      Comment


      • #4
        I don't believe there is such a feature. Your best path would seem to be to take the code that Blocks generates for one of your existing opmodes or a create new simple opmode using Blocks and work from there.

        Comment


        • #5
          I've entered an issue in github: https://github.com/FIRST-Tech-Challe...one/issues/161

          Comment


          • #6
            This has been fixed in version 5.5. https://github.com/FIRST-Tech-Challe...0200824-090813

            Comment


            • #7
              HwSwFun
              Tim.Vargo


              Here's a tutorial for this feature you requested:
              https://github.com/WestsideRobotics/FTCmyBlocks/wiki

              We all owe many thanks to Comrade 17 ​​​​​for developing this valuable programming tool!

              Comment

              Working...
              X