The positives of doing your own code

Sorry for grammar and spelling ahead of time…

So for the past few years I had done labview in the fashion of begin, teleop and finish and sometimes timed tasks I think only for pneumatics. Iv seen some other people posting homemade code that looks a lot more complex but I don’t know how to start doing it that way (or how it works hehe). If I could get some help on how to do that and get a lot of “stupid” questions answered it would be most appreciated.

Including the pros and cons of why I should switch to that type.

A little about how Iv don it in the past 3 years to get a perspective.

I understand the stuff that I’ve made so far (as in I know how to put it together in the begin and ect) but that’s about it. Mainly its the knowledge of if I put this together with this, than it works but other than that I have no clue. Most of the time if I have to add anything new (for example we want to have a sensor to be able to know how fast we are going) I take what I know so far and apply it. Usually it’s not anuf so I look for pictures that I can understand and revers engineer it and threw trial and error ill get it to work. That’s just the way I do thing, I don’t know why. But now that I am no longer the only programer and have to teach it I thought that I might actually learn how this black magic works.

In my opinion, learning how to learn is the whole point – of FIRST, of school, etc. So your description sounds pretty familiar.

Some days I know exactly what I’m doing and how to do it. Other days, I have no idea what solution will work and I begin by determining a system for knowing when I’m done, breaking the problem down into smaller steps, coming up with experiments where I will gain understanding, etc.

My suggestions are first to go through the example programs and tutorials, either alone, or ideally as a programming team. You may already know some of the stuff, but they should help to instill the basics since the examples don’t do everything at once.

Next, I’d suggest writing totally different programs that perform math or draw graphics. They are easier to verify, they have some application to the robot, and they are sorta fun. This summer, on a long airplane flight, I rewrote a program for my kids. It is one of the programs I wrote when I first started working at NI and needed to learn LV. The first picture below is the basic one where I worked out the math, and the second one was where we had fun adding multiple pens, showing the disks, adding a camera capture, and making it interactive where they decide the speed and direction to move the pens.

Anyway, pick something that interests you or something that you wonder about. Plot equations that show how your robot will respond. Make a toy or a game. And when you find black-magic, feel free to ask questions here.

As for your initial question about programming the robot differently, my suggestion there would be to make a few subsystems and isolate them from the rest of the robot code. At some point, I hope to update the templates to better promote this idea, but the roboRIO comes first.

As a simple example of this, the vision code is now a bit more isolated. The initialization code is no longer in Begin and Finish doesn’t close it. That code moved into the Vision VI. The camera control and communication are done through a few global variables. Even better would be to write a VI that updates the vision system’s state. Anyway, the idea is that the rest of the robot doesn’t need to not worry about the implementation and shouldn’t change the camera settings directly. Instead, it should make requests of the subsystems and harvest results. This also makes it easier for a team member to own certain functions of the robot and expose them in a way for others to use, but not break.

Good Luck.

Greg McKaskle







Bravo! :slight_smile:

This summer, on a long airplane flight, I rewrote a program for my kids. It is one of the programs I wrote when I first started working at NI and needed to learn LV.

Spirograph!!

*