Feb 19, 2018 - Vision Processing Future

Alright, so I’ve (Cade) been thinking about advanced vision lately, and I think our most efficient path forward is actually python-based.

One of our team members (Logan) suggested we might look at C++ for performance, however, I think for VPL, the best choice forward is python.

Here’s a breakdown of C++/Python:

C++ (pros):

  • More efficient (less overhead, but this is actually probably only like 1-4%, so not that bad)
  • Easier to manipulate pixel data directly (like iterating over points, etc is MUCH faster than python)
  • Can link to any other C/C++ library directly

C++ (cons):

  • You have to recompile each time you want to run (which takes some time in C++)
  • Again, it is compiled, so distributing binaries could be difficult (think about dependencies)
  • Code is much more verbose, so lots of lines, and more room for bugs
  • Insanely difficult to do any sort of multithreaded work

Python (pros):

  • Fast prototyping (you can write a VPL in 15 lines, and don’t need to compile it)
  • You can use numpy functions, which can be faster than C++ naive loops (numpy may use multithreading, etc to speed it up)
  • Easily import other python libraries

Python (cons):

  • Multithreaded work is not fully parallelized (due to python GIL)
  • Directly iterating over pixels is difficult (so we are limited to what functions we can use in python)

For the last problem with python, pixel iteration, however, I think I have a solution: OpenCL.

If you don’t know what OpenCL is, here’s an example file I’ve written: https://github.com/ChemicalDevelopment/fractalrender/blob/master/kernel.cl

Essentially, OpenCL is a way for us to run code on the GPU. OpenCV utilizes this through cv2.UMat(image) to get a GPU-allocated area. All the standard functions work with the GPU.

We can also write our own code in OpenCL in python, using pyopencl, another project.

And, yes, OpenCL does work on the Raspberry PI’s:

https://github.com/doe300/VC4CL (install instructions: https://github.com/doe300/VC4CL/wiki/How-to-get).

This allows us to write OpenCL code that runs on the GPU for raspberry PI and other machines

Jan 20, 2018 - Autonomous Field Mapping

After attending the 2018 FIRST Kickoff, the programming team decided to make diagrams to map the autonomous paths and determine the best path to take.

Alt-Key for Diagrams:

Pc = Power cube
B = Black
G = Green
Pi = Pink
Pu = Purple
O = Orange

Red:

  • Displays position on the alliance station as well as which side of switch and scale are possessed

Black:

  • Switch only - 1 pc
  • Points: Auto run: 5pts
    Ownership (Switch): 2 + 2/sec
    Total: 7 + 2/sec

Green:

  • Scale only - 1 pc
  • Points: Auto run: 5pts
    Ownership (Scale): 2 + 2/sec
    Total: 7 + 2/sec

Pink:

  • Scale to Switch (picking up a pc from platform) - 2 pc
  • Points: Auto run: 5 pts
    Ownership (Scale): 2 + 2/sec
    Ownership (Switch): 2 + 2/sec
    Total: 9 + 4/sec

Purple:

  • Switch to Scale (picking up a pc from platform) - 2 pc
  • Points: Auto run: 5 pts
    Ownership (Switch): 2 + 2/sec
    Ownership (Scale): 2 + 2/sec
    Total: 9 + 4/sec

Orange:

  • Switch to Scale (picking up a pc from pc zone) - 2 pc
  • Points: Auto run: 5 pts
    Ownership (Switch): 2 + 2/sec
    Ownership (Scale): 2 + 2/sec
    Total: 9 + 4/sec
Start Switch Scale
R R R
R R L
R L L
R L R
M R R
M R L
M L L
M L R

*Left start position will be reverse as right

Right, Right, Right

This diagram shows the paths available if the team starts on the right side of the alliance station and has the right side of the switch and the scale.

Right, Right, Left

This diagram shows the paths available if the team starts on the right side of the alliance station and has the right side of the switch and the left side of the scale.

Right, Left, Right

This diagram shows the paths available if the team starts on the right side of the alliance station and has the left side of the switch and the right side of the scale.

Right, Left, Left

This diagram shows the paths available if the team starts on the right side of the alliance station and has the left side of the switch and the scale.

Middle, Right, Right

This diagram shows the paths available if the team starts in the middle of the alliance station and has the right side of the switch and the scale.

Middle, Right, Left

This diagram shows the paths available if the team starts in the middle of the alliance station and has the right side of the switch and the left side of the scale.

Middle, Left, Right

This diagram shows the paths available if the team starts in the middle of the alliance station and has the left side of the switch and the right side of the scale.

Middle, Left, Left

This diagram shows the paths available if the team starts in the middle of the alliance station and has the left side of the switch and the scale.

Points

RRR Pu Pi O B G
RRL Pu O Pi B G
RLL Pu Pi O B G
RLR Pu Pi O G B
MRR Pu O Pi B G
MRL Pu Pi O B G
MLL Pu Pi O B G
MLR Pu O Pi B G

Simplicity

RRR B G Pu Pi O
RRL B G Pu O Pi
RLL B G Pu Pi O
RLR G B Pu Pi O
MRR B G Pu O Pi
MRL B G Pu Pi O
MLL B G Pu Pi O
MLR B G Pu O Pi

We look forward to using these diagrams to work with our game strategy team and determine what autonomous programs will be beneficial.

Oct 17, 2017 - A New Year Begins

First Power Up Logo

With the 2018 build season nearing, the programming team looks ahead to the future.

Here are a few of our goals for the 2018 season:

  • Educate all of our rookie members in the ways of Java and Python, as well as general programming concepts.
  • Fine tune our autonomous code.
  • Strengthen our vision processing program, punkvision.
  • Create distributable images and instructions so that other FRC teams can use our programs and techniques to accelerate their vision processing.
  • Collaborate with other robotics teams to create a neural network for our vision processing We have been diligently learning to use the excellent Python 3 port of the FRC Robot coding platform.

In other news, we have won our first competition as a team ever, the Tennessee Robo Rodeo! We are so greatful to our fellow alliance members: Team 2393, the Robotichauns and Team 4630, the RoboDragons!

Also, check out our 8-bit themed favicon!

In addition to this, the FIRST 2018 Teaser Video was dropped a couple of weeks ago for 2018’s game: FIRST Power Up! Based on the name, logo, and theme of the video, we can generally say that this game will center around old, arcade style games. There are two prevailing theories. The first is that since the actor walks down steps, ramps in arcade games were just steps, and that Dean Kamen has produced a stair-climbing robot all seem to point to the idea that we will have to climb stairs in our game. I do not know how the field could support something this size. One cool idea would be to create the Penrose Staircase and have our robot drive along it. The other theory is that since the actor puts a coin into the machine, we will have to put coin-like objects into slots to “power up” the machine to start the “game”. I would love a combination of these ideas, but I guess we will have to wait and see.