Does the XRP Blockly App work?

Hi, my team is planning on using the XRP app for a stem camp. We wanted to have the kids be able to drive the robot in real time while still using block code. We researched into using web servers for this, but they were too laggy and finicky for us to want to use, especially if we wanted controller support.

Therefore, I decided to try to make modifications to the XRP Blockly App. I fixed the saving functionality(which was broken) and added blocks to create Pesto Link stuff(i.e. inputs and that sort of thing). I just want to confirm that the App actually works when uploading to the XRP robot. We could alternatively just copy over the generated Python code to the web editor, but that would be a hassle.

If you want to see the fork, here is the link!

1 Like

@Advay Welcome!

I like to see the initiative you are taking to make the XRP work for your needs.
What is the age range and experience levels of campers in you program?

We are expecting elementary and middle school students, though the details are vague. We tried the app on a robot today, but for some reason, even though the robot’s port was registered as being used, the robot itself wasn’t showing up as connected, so I’m planning on diagnosing the issue in a few hours.

1 Like

Unfortunately the XRP Blockly repo you are forking from is not one that was finished or used at this point. It was abandoned about a year ago. All of our Blockly code has been done under the XRPCode IDE.
We are looking at a few different solutions for allowing people to drive an XRP with a controller. But at the moment none include blocks. We will want to make sure blocks added match any APIs we add to XRPLib.

@Advay:
Since the XRP Blockly approach will not currently work for your situation, you may want to consider using MicroBlocks (http://microblocks.fun) with elementary and middle school learners. We have found that even young elementary school students can easily transition to MicroBlocks from Scratch or Hour-of-Code activities.

@r3owen has recently completed MicroBlocks libraries for the XRP. You can find documentation for the XRP libraries at the MicroBlocks wiki:

The MicroBlocks WiFi Radio library:

should help in implementing remote controls that you describe.

Okay, the app was stubbornly not working, so instead we used the web editor and modded that. It was actually successful, and here is the new repo! Thanks for all the help!

I had problems getting the the XRPCode web app (https://xrpcode.wpi.edu) to work. In particular, it was not able to install MicroPython on the XRP board, although it was attempting to do that. For those who run into this, here is how I solved the problem:

I eventually followed the instructions on this Discourse post:

Recommended firmware version for the XRP robot for using both the XRP Code Editor and WPILib - #3 by sfong21

That lead me to install the generic MicroPython firmware for the RP2040:

https://projects.raspberrypi.org/en/projects/get-started-pico-w/1

In Chrome, I then opened:

https://xrpcode.wpi.edu/

I cleared the site data, then reloaded the page. (Not sure this step is necessary, and doing it will delete any XRPCode programs you’ve written and saved to the browser’s “local storage” file system. But since I hadn’t done that yet I didn’t mind wiping the slate clean.)

I then connected the board. The first time I did that, it asked to update the XRPLib installation, which I did.

Once I had done all that, both Blockly and MicroPython worked for me.

However, when I wrote a program to drive a in square my XRP robot did some wild oscillations on every other right-angle turn, which was a surprise. Has anyone else seen that with MicroPython XRPCode turns? I suspect the default PID parameters may need tuning.

FYI, I have a two year old M1 MacBook Pro running MacOS 14.1.1 (Sonora) and I was using the latest version of Chrome. A friend also tried this on his M1 desktop iMac and had the same problem: he couldn’t install MicroPython.

I hope this problem can be fixed.

1 Like

We are using the XRP in a summer camp and having the same problems.

We are handling the python update problem by not updating. Can anyone tell me if not updating is going to break the simple problems from the Sparkfun videos and their Delivery Challenge.

We are also getting the erratic turn problem on our robots. I’ve been searching and have not found a solution. Does any have any ideas?

Feeling a little lost here. Any help would be much appreciated.

Thank you.

I am the lead developer of MicroBlocks. As we were writing the MicroBlocks library for the XRP robot, we compared it to the XRPCode web app.

Like you, we also saw erratic turn behavior with the XRP Python library. I believe XRPCode automatically updated itself to the latest version of the library that was available at the time (end of May).

In one test, we programmed the robot to drive in a square – i.e. drive forward a bit, then make a 90 turn, repeated four times. We saw wild oscillations on some of the turns. Surprisingly, the oscillations happened on every other turn.

Are you seeing oscillations on some turns?

You might try MicroBlocks. The MicroBlocks XRP library has been well tested and the turns and distances are pretty accurate. (There is always some error due to things like wheel slippage.) The MicroBlocks XRP library is currently in the pilot release stream but it will move to a stable release by the end of July. The pilot release itself is quite stable, though, so no problem using it for workshops.

MicroBlocks recently added BLE support for the Raspberry Pi Pico W module used in the XRP robot. Users can now program their XRP robot wirelessly. MicroBlocks supports “live coding”, meaning that users can make changes to their programs and see the results immediately (as in Scratch) without stopping and waiting for the code to download.

One caveat: if you do try MicroBlocks – which involves installing the MicroBlocks firmware for the XRP (https://microblocks.fun/downloads/pilot/vm/vm_pico_xrp.uf2) on your XRP – you’ll need to re-install MicroPython to switch back to XRPCode. That isn’t difficult, and I explained the process for doing it earlier in this thread.

Good luck with your summer camp!

1 Like

John,

Both of your long post above are appreciated.

Yes. On several different robots we are have the same oscillations problems on turns that you are having.
Also no joy on updating MicroPython.

I just posted on Sparkfun’s forum hoping for solution.

After summer camp is over next Wednesday I will give your MicroBlocks a try.

Take care.

I’m curious on the problems with updating the Micropython. The only problem we have seen was on a specific version of mac OS that has been fixed on their end.
@bradmiller will respond on a patch for the oscillations.

We have a fix for the oscillations in turning that is in a PR on GitHub. It needs a quick final test, then needs to be merged with the library, then merged with the release version of the XRPCode. I’ll see about getting it in during the next few days.

If anyone wants to help test the module, feel free to get the DifferentialDrive python library file from the PR and give it a try. Report back with your results. It’s a little annoying to fully test as variables like the driving surface and turning speed all affect how it performs.

Brad

I want to try your fix.
Searching on https://github.com/ for XRP, Sparkfun or bamiller does not get me anything I recognize.
Where can I find it?
Is there somewhere to report issues and give feedback on the beta XRP?
Thanks again.

Here is the link for the repository GitHub - Open-STEM/XRP_MicroPython: The main programming tool for use with your Experiential Robotics Platform (XRP) Robots!

For general XRP issues you can report them in this forum. If there are XRPLib or XRPCode specific you can report them here or as a GitHub issues.

The XRP board had been running other software so, of course, I needed to re-install MicroPython. I got the expected dialog box saying:

Or click CANCEL and XRPCode will reinstall MicroPython onto the XRP.

I clicked CANCEL and followed the directions including putting the XRP into BOOTSEL mode and clicking “Edit Files” to allow Chrome to write to the USB drive.

However, that led to this error box:

This is with Chrome 126.0.6478.127 on an M1 Mac PowerBook Pro running Mac OS 14.1.1 (Sonoma). I know there is an update to Sonoma that I haven’t installed. Would that update fix the problem?

I have tested it with Sonoma 14.4 and it appears to have been fixed.

Good to know. I’ll try updating to the latest Sonoma.