Log in

View Full Version : Introducing FRC Blocks - A starter program for FRC coding novices


nickbrickmaster
23-12-2015, 14:48
FRC Blocks is a web interface that allows you to code FRC robots using an intuitive drag-and-drop interface. It compiles to Python in real time, allowing you to see the code that you "write". FRC Blocks is intended to be a bridge between drag-and-drop languages (scratch, labview) and more traditional programming languages.

FRC Blocks is great for:

Workshops
Demonstrations
Novice Programmers


I started this project as a way to get more members of my team involved in programming the robot, even if they have no prior experience or build season is only 3 weeks away.

Try it out (no persistence or runner) (http://nickschatz.com/frcblocks)

View on GitHub (http://github.com/frc3184/frcblocks)

It's simple to install and use.

Download FRC Blocks off github
Install pyfrc on development computer and robot
Start webserver (run.bat)
Navigate to localhost:8000/cgi-bin/index.py
Start coding! Use procedures named robotInit, teleopPeriodic, etc as starting points. All blocks are very similar to their robotpy counterparts.


Pneumatics, motors, some sensors, and joysticks are implemented. The live version does not spit out runnable code, as it needs a bootstrap IterativeRobot class, which is provided in the _runner.py file.

Disclaimer: I have not tried this on a robot yet. However, it works on the pyfrc simulator. I'll update this soon with info on robot testing.

DrWaSaBi
23-12-2015, 15:22
Wow. Very cool. thanks for sharing. Will have to check it out in more detail tonight.

Dr W

Ari423
23-12-2015, 16:04
This looks really cool! It's a little confusing at first without any instructions, but I got the hang of it after a few minutes. I will have to show this to my new programmers to introduce them to robot programming (as opposed to regular programming). I would love to see a good set of instructions, and pneumatic control.

Foster
23-12-2015, 16:41
Blockly is cool, interesting the way that you've changed/extended it.

I've been using Snap! recently since it also allows you to create your own blocks.

How did you pick Blockly as your base?

nickbrickmaster
23-12-2015, 17:09
Blockly is cool, interesting the way that you've changed/extended it.

I've been using Snap! recently since it also allows you to create your own blocks.

How did you pick Blockly as your base?

I've never heard of Snap! before now. I got this idea from MIT App Inventor 2, which uses Blockly.

Actually, after looking it up, I realize that I once used BYOB, a long while ago. Does that also compile to some language that uses wpilib?

Foster
23-12-2015, 19:25
If you run Snap! and go into the examples look for Codification. It's a short example that produces C, Smalltalk, Javascript and Python.

virtuald
23-12-2015, 23:50
Needs some refinement, but very cool.