When programming doesn't get enough time


1 Like

I know the feeling :smiley:


Best way to avoid this: set a schedule, and keep to it. Something that comes up on our team too. End up doing a lot of the testing during our 6 hour unbag time.

Curse those filthy wrench-swinging rivet-popping screw-driving hammer-smashing mechanical barbarians.

Hand over the robot to the programmers!

We were competing in a week 1 regional and the programmers had to do all the code on the plane.

Even at work you never get enough time to program. Sales and Managers seem to think that programming is easy. If I hear “I JUST want…” Nothing is ever “JUST”


Hi cjl2625,

I noticed you had an issue with people rivet-popping. In particular, you called them barbarians.

While it’s true that rivets have been around for quite a long time (archaeological findings date rivet use back to the bronze period) that does not make the people who implement them barbarians. In fact, it typically implies the opposite. Rivets are an extremely useful and lightweight fastener system that have allowed for a number of technological advancements to occur!

Hope this has helped pop your feelings about those of us who use rivets.

Best Regards,

EXACTLY! Those barbarians are SOO difficult to deal with right?!?

You must spread some Reputation around before giving it to cjl2625 again.

Most true statement I’ve read in a while


In sympathy with the programmers, how about this (and check the legality of any of it):
(1) Is wireless flash of the controller available? If so:
(2) Bag the robot with a charged battery.
(3) Put the robot up on blocks.
(4) Depending on what is in the bag, and attached:
(5) Programmers can modify code and wirelessly flash and do limited testing?
(6) Yes electrons are passing though the bag. Yes an electrical change is being made on the robot, but not mechanical.

Just thowing it out there. . . . .

It is human nature to let things slide, especially when the deadline appears far away, and you are not on the tail end of the process. Off season, endeavor to think about scheduling, robot modular design, practice robot, or even partial practice robot that can be controlled and powered. For example, if the mechanical design crew is working on the game manipulator, with a modular design, the programmers can work on chassis control.

Hoping to make the process more effective for as many teams as possible.

We got around this very effectively this year by taking a test-driven approach.

Split whatever code you’re trying to test out into its own class, and have its entire interface with the robot be a single function call. Make sure the controlling code doesn’t talk directly with WPILib (or else it ups the complexity of doing your simulated tests) We had something like:

class ArmController
  Tick(double currentTime, double armPosition, double* shoulderPower, double* elbowPower);
  PIDController m_myPidController;
  int myCurrentState; // 0 = stowing, 1 = going out, 2 = out, 3 = stowed, etc.

Usage in the robot code looks like:

double shoulderPower=0;
double elbowPower=0;
m_armController.Tick(currentTime, m_armPot.Get(), &shoulderPower, &elbowPower);


Then, elsewhere (in our case in Visual Studio), write some other code like:

ArmController controller;
double desiredShoulderPower;
double desiredElbowPower;
controller.Tick(0, OUT_POSITION, &desiredShoulderPower, &desiredElbowPower);

assert(desiredShoulderPower == 0); // the arm is out, so we shouldn't be trying to drive it
assert(desiredElbowPower == 0); // the arm is out, so we shouldn't be trying to drive it.

And do that for every other state that the arm might be in. We ended up with 20-30 unique tests for our arm controller, found a ton of subtle bugs (some that we may not have found while doing in-pit testing anyway), and it worked flawlessly. We wrote it in the stands at Waterloo while the team was unbagging the robot, and basically didn’t even give it a classic on-robot test.

Just wanted to put this here as it seems fitting:

As Bongle said: simulation is everything. We write simulation wrappers for almost every bit of code we do, and test it on a PC before it ever sees the robot.

The key is to structure your code such that it can be executed on a PC - in other words, don’t bury calls to the hardware input reading or output setting functions within each code unit. This will allow you to test your code unit off the robot.

Every year I tell the programmers they get the robot first. They program it. Then we build it. They have yet to take me up on the offer so they get what they get. :yikes:

This… is a terrible idea. Not only do you run the risk of putting a hole in the bag but you can’t really test anything this way. My programmers and I can make any bot WORK in about an hour or two but it takes days of coding AND FIELD testing to make it work RIGHT.

There’s a reason we’re building two robots now. As programmers, we frequently find flaws mechanical didn’t consider. Some require a moderate redesign. e.g. We sheared the rivets again, you need to make this more durable. If you think the programmers are being hard on the robot, you should see what Drive Team does to it…

This is a great strategy, and my team was able to get a lot of programming done in build season before the real robot was even finished with just a practice drivetrain and a camera!

EDIT: But sometimes I still wished that the Mechanical people could just hurry up and finish the robot :slight_smile:

Perfect! This is exactly true. :smiley:

This would be perfectly doable if you would just build a robot capable of exactly what the programmers wrote the code for. :wink: :yikes: LOL