Sample Code: XRP Logo

I started building a Logo programming emulator for the XRP. My project guide is available at XRP Project Guide-Turtle Graphics IRL - Google Docs. It has links on where to find the code.

I’m considering this version 0.4. I’m so excited about this that I wanted to get it out to the community right away. It handles working through the Apple Logo User Guide through Chapter 12.

The XRP team has done all the work. The blocks available in the DriveTrain tray and the XRP Movement Guide (https://www.youtube.com/watch?v=jHKAQSRTRaM) with Rob and Dryw has all the information a new Programmer needs to do what this code can do.

All I’ve done so far is create functions that bring the commands of Apple Logo to the Blockly environment. The cool thing is that the Apple Logo User Guide has some great activities for students to do to create great Turtle Graphics.

I remember spending hours on my Apple IIe building cool images with Apple Logo. The Apple Logo User Guide is available at https://logothings.github.io/logothings/documents/Apple_Logo.pdf. The XRP is a great way to bring Logo into real life. This is not the first time there have been Turtle robots. It just seems to be a great application of XRP and XRP Blockly.

2 Likes

Here’s a picture of the drawing using Apple Logo Flags project. (I’m still working on transcoding the video from *.mov to a format I can post here.)

It was tuned on a different whiteboard where we had issues with the turns not rotating about the pen. We’re having some trouble with oscillating around the final pointing direction. Trying to steady the XRP can get the gyroscope closed-loop feedback to exit so the program can continue.

I’ve got a *.mov video. I’ll try to convert it so I can share here.

BTW, the student who developed this program had almost no prior coding experience and very brief instruction on the XRP Logo OpMode.

They started drawing a square. Then they created a function to do that. After they had a square, they drew a flag, and moved that into a Flag function. This is using the Flag function to create Flags (as defined in the Apple Logo User Manual).

This is very awesome. Both in the creation and the story.
A couple of weeks ago we updated the XRPLib to help fix some of these problems. Can you verify the version that XRP is running? Look at the file lib/XRPLib/version.py to get the current version.

Sounds like this young person should be on a FIRST team!

I just updated the XRP. I think it was on 1.0.2. It is now on 1.0.3.

The young person is a student on FTC 26706, Thunder Lab. This is a first year FTC team from Columbia Falls, MT.

As most of the students are drawn to the hardware, it was great to have an XRP with the XRP Logo program available. There isn’t enough room for everyone to be wrenching on the robot, so I was able to draw one of the students watching over to the XRP and the whiteboard and got them working through some exercises.

I showed them the existing functions, like Forward and Right. Then asked them to draw a square. With the square done, I showed them how to move the code into a function and call it square and put that back in the main routine. Next I asked for a flag. They created the flag function, so I next asked for four flags in the four directions.

By the time they got that far, it was time to clean up. I was very happy with the progress made in a single team practice. It was much less intimidating than the competition code. We also didn’t have to worry about powering the Control Hub while the mechanical team was making changes to the hardware.

1 Like

I’ve added a Polygon function to this project. It is available as a separate file called XRP Logo with Poly.blocks. I was inspired by the polygon method in the drive_examples.py file.

The more I looked at the function, the more I thought that this is something that a Programmer working through the various Logo exercises could do as an exercise. It uses things they’ve learned with creating new functions, using functions inputs, and building math blocks in the code. It adds to their experience using more than one input for a function.

The original XRP Logo file does not include a Polygon function. I added a section to the XRP Logo guide leading the student through how to build this function. If you would like to have an XRP Logo file that already has the Polygon function, then this is available in the same folder as XRP Logo with Poly.