Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   The increasing amount of pre-canned code (http://www.chiefdelphi.com/forums/showthread.php?t=82250)

Greg McKaskle 10-02-2010 03:15

Re: The increasing amount of pre-canned code
 
Quote:

That said, after spending 8+ hours debugging a firmware issue in the cRio this year (which turned out to be a problem in the 24vdc supply on the PD board), I would say that the cRio is definitely not as robust as the IFI system. While talking to the NI tech support, if they say "Ummm... That's Bad" then you know they must not have found that problem in their testing and aren't prepared to solve it. When a problem arises with this new system, there are so many more points of error that it's quite difficult to debug some times.

cRio boot times: They bug me. Waiting for the robot to boot is the most annoying thing there is. However, after talking to NI tech support for around 4 hours, he claims that the cRio itself boots in several seconds and then the FIRST code waits for FMS comm to timeout (25s) before loading the team code. Is this the case? If so, they could make the FMS timeout a little faster.
Sorry it took so long to debug.

Since the cRIO and many of the other control system are off the shelf, not specially designed for this competition, their interactions, especially when one of them is failing, is indeed something not that many people have seen. Also, the AEs are mostly new to this system too. They are familiar with NI products in normal usage.

As for the boot time. The cRIO FPGA is booted very quickly. The PPC typically boots in about ten. The bridge and other elements, the FRC specific tasks all take a bit longer. But the boot time isn't waiting for any particular element such as FMS to timeout -- no magic bullet.

Greg McKaskle

AustinSchuh 10-02-2010 03:35

Re: The increasing amount of pre-canned code
 
Quote:

Originally Posted by apalrd (Post 916626)
However, after talking to NI tech support for around 4 hours, he claims that the cRio itself boots in several seconds and then the FIRST code waits for FMS comm to timeout (25s) before loading the team code. Is this the case?

You can get a really good idea on what's taking so long to boot up by connecting up a serial cable to the cRio and booting it. The debugging that I've done using the serial port confirms Greg's claim that there is no magic bullet.

Chris Hibner 10-02-2010 08:07

Re: The increasing amount of pre-canned code
 
Quote:

Originally Posted by 1075guy (Post 916388)
Do you think the increasing amount of pre-canned code (in the form of WPILib and all its flavours) is helping or hurting the effectiveness of young teams?

I've seen quite a few teams this year, asking for help with LabVIEW, and specifically the Holonomic.vi. I think what has started to happen, is that these teams are seeing both the veterans, and the code that makes such drive systems seem easy, and jumping on the bandwagon before really understanding how these systems work.

A similar effect has happened with the cameras.

If you hand teams code on a silver platter, they often don't understand WHY it works. Which causes problems when something breaks and it stops working, because they can't know how to fix it if they don't understand how it works.

This is a pretty interesting topic. My post here may wander a bit, but I hope I'll get to the point before too long.

From a standpoint of simulating what a real-world controls/embedded software engineer experiences, having the WPI Library make the FIRST experience much more real-world-like.

While at some point each company has to start from scratch, that work has usually been done and incorporated into the company software library many years ago. It's the job of each engineer to utilize the tried and true library and not to reinvent the wheel.

While at first glance using a library seems too easy, libraries present of a lot of challenges of their own. The post that started this topic brought up a lot of good points. I just started a new job recently (I'm a controls engineer working with embedded software), and getting up to speed on all of the library code is quite a challenge. Like 1075guy pointed out, you really should know what the library is doing before using it, or else you may not know how to fix some problems.

As someone else pointed out, it can often be difficult to figure out what some libraries are actually doing. As software becomes more complex, deciphering what the software engineer was trying to do can be difficult at times. I'll admit that there have been times where I said to myself, "I can re-write this to do the same thing in less time than it would take for me to figure out what going on in this code." However, actually re-writing it is usually a pretty bad idea since there are usually a lot of lessons learned in the code that you're looking through, and you probably don't know all of them. That being said, it's often very helpful just to give it a go re-writing it. After that exercise, you can usually get through the library code pretty easily since you went through the thought process yourself. (Just be sure not to use your own code - you'll probably get fired. :) )

I said I'd get to the point eventually, so here it goes. In the real world, you're more likely to faced with a problem like we have now in FIRST. You have a new challenge and you have some good code on the bookshelf. You have to determine how to make the best use of the library code and then fill in the gaps. But just keep in mind that if you use code that you don't understand, you're playing with fire - and don't expect the insurance company to bail you out if you burn down your house playing with fire.

Racer26 10-02-2010 09:37

Re: The increasing amount of pre-canned code
 
Quote:

Originally Posted by Chris Hibner (Post 916979)
<snip>
I said I'd get to the point eventually, so here it goes. In the real world, you're more likely to faced with a problem like we have now in FIRST. You have a new challenge and you have some good code on the bookshelf. You have to determine how to make the best use of the library code and then fill in the gaps. But just keep in mind that if you use code that you don't understand, you're playing with fire - and don't expect the insurance company to bail you out if you burn down your house playing with fire.

This is exactly the point I was trying to get to and not quite sure how to get there.

I remember in 2009, my team reached the Waterloo Regional, and had to reflash our cRIO and update workbench, and so forth. From the version of WPILib we'd been using in testing, to the version that got flashed there, the Library had changed. They changed the timer code from returning something in seconds to returning in microseconds, or vice versa, I can't remember exactly. This caused our steering code to stop working as it used a timer, and the numbers were now different by a factor of 1 million. I tracked it down fairly quickly, but making changes like that to precanned code could cause problems that less experienced programmers might not track down as quickly.

Admittedly, we should have updated before ship, but I hadn't thought of it, and I certainly wasn't expecting a change that changed the outward functionality of the black-box that is WPILib.

I'm not really griping about the new system. I actually rather like it. The object-oriented approach to coding the robot is so much more logical. I just sort of feel like, particularly for the C++ last year that WPILib was poorly documented, and somewhat unfinished at time of release. Perhaps it could have been handled better, or perhaps they could have documented changes like the above change better in some sort of changelog. Maybe they did and I just didn't see it.

mswalker 10-02-2010 09:53

Re: The increasing amount of pre-canned code
 
I would like to add a vote for encouraging systems level design instead of low level programming. I believe this does more to inspire interest in science and technology than learning how to interface with a sensor. With the LabView and WPILib tools the teams can do cool things that might encourage them to pursue technology as a career. (And maybe then learn the details of how semiconductor gyros work.)

We might also be giving the libraries too much credit. Our team is using mecanum wheels this year for the first time. I don't think anyone said, "Hey, there is a holonomic.vi, let's go holonomic!" The team looked at the game requirements and decided that omnidirectional movement was important and besides, they always wanted to try mecanum wheels. No one mentioned the software, after all it's just a "simple matter of programming" to run the wheels.

We have a pretty lean team so our programmers are builders too. Having high level libraries allows us to try new sensors and equipment without learning the low level coding. Without those resources we would have to prioritize the work which would probably mean just getting a drive and kicker to work. Knowing that, we probably wouldn't even bother with the other sensors and thus miss the learning of how such devices might be employed in the robotic system.

I believe the cRIO and LabVIEW have allowed at least our team to get to the next level of design and understanding.

Racer26 10-02-2010 10:12

Re: The increasing amount of pre-canned code
 
I'm not so much advocating teams building their own low-level code so much as suggesting that the more advanced libraries might be causing teams to get in over their heads, and trying more advanced stuff before they've had a chance to build more simple things, like a tank drive.

synth3tk 10-02-2010 10:58

Re: The increasing amount of pre-canned code
 
This year, we were blessed to have our school continue the team with leftover funds that we happened to have found, just a month before kick-off. We didn't really have time to recruit new members like we wanted, so we ended up with no student programmers. That left myself, who is great with web programming, but completely lost with C++/Java. We ended up using Java, and the pre-canned code was a Godsend.

I think it just helps newer teams or teams with fewer resources than most to get something working, and in the case of Java, it's documented pretty well, so we can easily fix the code if we need to. I'm the type of person that learns by editing others' code, not starting from scratch. That's how I learned PHP, Smarty, MySQL, etc.

pilum40 11-02-2010 12:34

Re: The increasing amount of pre-canned code
 
I respectfully disagree. The pre-canned code actually helped us stay on build schedule as rookies. We're still having issues with how to make the autonomous work (it doesn't work at all), but getting the bot up, running and able to go under the tunnel/over the hump is major for us since we're majority 9th-10th graders. We'll take time to re-learn code from scratch when we're not pressed for time.:)

Quote:

Originally Posted by apalrd (Post 916626)
I like the IFI processor, it worked well at its time.
The biggest advantages to me using the cRio are that I no longer have to write lookup tables for things, as I have the power to calculate them in real time.

Working in LAbVIEW: Some of the WPIlib is nice, like integrating gyros and counting encoder clicks. Some of it is not, such as the really really really annoying fact that you must set both the forward and reverse coils of a relay at the same Set (I actually wrote a vi to set them separately, based on copied code from that Set). I would totally agree with the fact that PID and Holonomic are probably going too far. Jim (Zondag) actually didn't tell us programmers that there was a PID library, and since we didn't find it until after writing the crab-drive code, we didn't use it.

The cRio: Being a first year programmer in 2009, I probably would have never been able to code the 4-wheel independent steering code without the trig power on the cRio. It was nice to have all of the power I needed. That said, after spending 8+ hours debugging a firmware issue in the cRio this year (which turned out to be a problem in the 24vdc supply on the PD board), I would say that the cRio is definitely not as robust as the IFI system. While talking to the NI tech support, if they say "Ummm... That's Bad" then you know they must not have found that problem in their testing and aren't prepared to solve it. When a problem arises with this new system, there are so many more points of error that it's quite difficult to debug some times.

cRio boot times: They bug me. Waiting for the robot to boot is the most annoying thing there is. However, after talking to NI tech support for around 4 hours, he claims that the cRio itself boots in several seconds and then the FIRST code waits for FMS comm to timeout (25s) before loading the team code. Is this the case? If so, they could make the FMS timeout a little faster.

PID and Holonomic: They are sitting unused in my WPIlib pallate. They will never be touched. As I teach the newbees (freshmen), they too will learn to leave them alone. At least they didn't give us crab-drive code. Debugging that is too much fun for them to just hand us.


bcieslak 11-02-2010 13:17

Re: The increasing amount of pre-canned code
 
I am all for good pre-canned code for FIRST robotics...When do you think it will be available???

BC

Racer26 11-02-2010 15:15

Re: The increasing amount of pre-canned code
 
It already is, in large quantities, as part of WPILib.

This discussion was about whether or not the amount included is not enough, too much, or just right.

Akash Rastogi 11-02-2010 15:17

Re: The increasing amount of pre-canned code
 
Are you also referring to code that teams open-source to others? Or just the NI and Labview libraries?

Racer26 11-02-2010 15:46

Re: The increasing amount of pre-canned code
 
To a lesser extent, yes Akash. But I'm mostly referring to WPILib. I'm torn, I think its a good thing, but I also think it encourages teams to try more advanced things before they've gotten a handle on the simple stuff, which could lead to problems down the road.

bcieslak 12-02-2010 13:52

Re: The increasing amount of pre-canned code
 
Quote:

Originally Posted by 1075guy (Post 918047)
It already is, in large quantities, as part of WPILib.

This discussion was about whether or not the amount included is not enough, too much, or just right.

I should have emphasized when will 'good' code be available. This season has been spent developing work arounds for the WPILib code.

BC

Racer26 12-02-2010 13:56

Re: The increasing amount of pre-canned code
 
Theres nothing wrong with the WPILib code that I'm aware of... It all works exactly as advertised.

Kims Robot 12-02-2010 15:23

Re: The increasing amount of pre-canned code
 
I'm seeing the original point was more about trying fancier mechanical things than teams are capable of, and less about how much code you write...?

As was already alluded to FIRST has come a LONG way. Teams now have the option to try crazy things like meccanum drive because they dont have to design their own gearboxes with parts out of the small parts catalog and program in PBasic (yup thats what I programmed my first robot in! Ever try to implement your OWN random number generator??? UGH!). Anyways, FIRST has a struggle to keep the old veteran teams excited, interested and the kids attempting newer challenges every year, while allowing rookies to compete at a reasonable level with them. The ONLY way to do that in my mind is to make sure everyone can start with something.

Back in 1997 it was common to see a robot that couldnt drive... there WAS no Kitbot drivetrain... that revolution was huge!! That kitbot allowed 1511 to come up with something fun the first year - a 6WD center traction corner omni that could drive circles around some of the veterans... that was because we already had a frame and gearboxes in our kit, so we could play with some more advanced features. Had we had to design our own gearbox, we never would have tried it. And you guessed it when the gearbox failed, we took it apart, figured out what was failing and put it back together. it was a struggle, but we learned how a gearbox worked AND got a fancy drivetrain.

I also am very much of the opinion that you learn MUCH more when you fail than when you succeed. If everything is easy, you arent trying hard enough or challenging yourself enough. Starting with the black box gives you somewhere to get running, when something stops working, you start poking around at the edges and tweaking the interfaces... when you wonder why the box does xyz instead of yza, you open up the box and look inside, and work from the outside in until you understand it. Thats called reverse engineering and its done all of the time and its how many of us gain knowledge we might never have had.

And I agree with Chris, as long as teams arent turning around and pointing the finger at FIRST for making things too hard, or "giving" them failed code, then we are all on the right track. When you start blaming someone for a "gift", you are wrong. So what if the gift causes you to struggle a little bit, if you can try to do so much more because of it, even if you fail, if you learn from your failures, you HAVE succeeded.

In short, I'm all for anything that makes teams get creative, think outside the box and do things they might never have done before... kitbot or code-wise :)


All times are GMT -5. The time now is 23:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi