Announcement

Collapse
No announcement yet.

Using the NXT as a legacy interface

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

  • Using the NXT as a legacy interface

    I'm investigating a solution to use the the new android platform with the NXT as "legacy interface".
    The NXT will be loaded with custom firmware that links the new SDK to the legacy tetrix/matrix controllers and sensors.
    Something like this:

    https://github.com/pbrier/ftc_app/wi...-Configuration

    Ideally it would use the HardwareManager and be a transparent solution, comparable to using the ModernRobotics legacy controller.

    I've made a proof of concept that still includes some programming on the NXT, but I think, technically, a transparent solution is possible.
    It might require some cooperation from FTC, but it could help in the adoption of the new platform.

    Are there any other thoughts on this?

  • #2
    A demo video is found here: http://youtu.be/1z7w8j9Q9pA

    Currently it uses a lejos control task on the NXT as the intermediate layer between usb and
    the lego legacy components. I could make a transparant usb to I2C conversion if anyone
    is interested in using such a configuration.

    Comment


    • #3
      A demo video is found here: http://youtu.be/1z7w8j9Q9pA

      Currently it uses a lejos control task on the NXT as the intermediate layer between usb and
      the lego legacy components. I could make a transparant usb to I2C conversion if anyone
      is interested in using such a configuration.

      Comment


      • #4
        Have you looked at the EV3 as a possibility? It's supported both by a more robust version of leJOS Java and by RobotC 4.X.

        I'm running an Android robot control app of my own design on both my Galaxy S5 and my ZTE Speed. It's communicating with an EV3-controlled robot using WiFi and my own home-grown TCPIP client-server socket comm protocol. I'm convinced that, if my team needs to, it can built a very workable robot with legacy motors and sensors, based on ZTE Speed-to-EV3 TCPIP communication. (With somewhat more battery drain, the ZTE Speed runs fine in its "Hot Spot" mode.)

        Comment


        • #5
          Originally posted by AlanG View Post
          Have you looked at the EV3 as a possibility? It's supported both by a more robust version of leJOS Java and by RobotC 4.X.

          I'm running an Android robot control app of my own design on both my Galaxy S5 and my ZTE Speed. It's communicating with an EV3-controlled robot using WiFi and my own home-grown TCPIP client-server socket comm protocol. I'm convinced that, if my team needs to, it can built a very workable robot with legacy motors and sensors, based on ZTE Speed-to-EV3 TCPIP communication. (With somewhat more battery drain, the ZTE Speed runs fine in its "Hot Spot" mode.)
          The only problem that I see with using WiFi for the communication between the EV3 and the Phone would be latency which is something that would most definitely cause issues. If some how someone could get a communication with the EV3 or NXT with USB-OTG via USB serial or something of the sort than it would work fine. It could be possible because the Samantha Module did something similar.

          Comment


          • #6
            I'm using a USB WiFi dongle plugged into the USB "A" port on the side of the EV3. Is a WiFi device somehow plugged into the EV3's mini USB port going to be faster?

            Comment


            • #7
              Ev3 is definitely a possibility. Code should be almost identical. I opted for a ntx because all teams have one already. Direct USB connection avoids additional WiFi connection problems and saves you an additional dongle.

              With the ev3 and WiFi you could also remove the whole android on the robot and use driver station to ev3 connection. Lejos is a capable robot control platform. But this a whole different discussion

              Comment


              • #8
                @team5648 this is actually what I did in my demo: android FTC robot controller app --> USB OTG serial connection directly to NXT.
                the NXT supports almost all legacy sensors, Lego motors and hitechnic servo + motor controllers using the lejos java software.

                The robot control is done in the NXT and receives (joystick) commands from the android opmode, similar to the Samantha module.

                It would also be possible to use robotC on the NXT (it would require some more programming). I do not have a license for robotc.

                Comment


                • #9
                  "A whole different discussion" - agreed! I'm hoping that we don't have to have it, once the new MR hardware ships, and teams begin to have success with it and the new Qualcomm/FTC APIs for motors and sensors.

                  But those of us with NXTs and EV3s should continue to research possible contingencies, because our teams know what they can do on a robot controlled by one of those. I don't think there's much of a burden of proof on the ZTE Speed as a driver station. But, for all but a very few teams, there is still a huge unmet burden of proof on the ZTE Speed as a robot controller, especially for teams with sophisticated autonomous code.

                  To Johnathan Berling and Tom Eng:

                  Could you possibly publish a white paper detailing the Wifi communication protocol you've designed to make the 2 ZTEs talk to one another during both teleop and (maybe)autonomous modes? I would love to convert my ZTE and EV3 code to that protocol, then see how responsive my robot is to teleop commands sent by my ZTE.

                  Comment


                  • #10
                    I found your post very interesting and tried it out, but I am not sure how you uploaded the lejos programs into your nxt. I currently use eclipse with the lejos plugin for the nxt and android studio for the phone. I have already uploaded the program to my robot controller app but have not figured out how to do so with the nxt. Can you explain to me how you did this?

                    Comment


                    • #11
                      I made a small instruction here: https://github.com/pbrier/ftc_app/wi...gacy-interface
                      You can also Google and search for the various LeJos tutorials for more information.

                      Comment


                      • #12
                        I'm using an EV3 only. My Eclipse installation includes the "leJOS EV3 Plugin" that's available from the Eclipse Marketplace. I've created a ".jardesc" file in the project directory, which is visible in Eclipse's "Package Explorer" list. When I right-click on it and select "Create JAR", a ".jar" file is created containing all the class files for the ".java" files that I've written. Then, I right-click on the ".jar" file and select "leJOS EV3 > Upload file to the EV3 Brick". At that point, if either a USB or a WiFi link connects my laptop to my EV3, the upload occurs. Then, by pushing the EV3's buttons, I can either run the program from the EV3's menu, or do a "Run Default", once I've made the program the default.

                        I'm sorry that I can't really advise you about building and uploading a leJOS program to an NXT, because I gave up on NXT leJOS some time ago.

                        Comment


                        • #13
                          to pbrier:

                          I've almost gotten this interesting setup working - the "pbrier" OP Mode did start executing in the FTC Robot Controller app, but it never seems to think that the NXT is connected. Likewise, the leJOS program on the NXT never comes out of its "Wait for Android" state and in fact became unresponsive (I had to take out the battery to stop it.)

                          Can you make the leJOS code available for your NtxControllerApp.nxj prgoram? I'm hoping this would enable me to do some debugging of my setup.

                          Comment

                          Working...
                          X