Can C# work on programing robots?because i already know a little bit of C#
On a purely theoretical level, yes. But why would you want to? It would be like hanging a picture with a sledgehammer… Overkill…
For the most part, C#, C+ and C++ are supersets containing C. While there are exceptions to any overly simplistic statement like that, you likely already know nearly everything you need to to program in C.
The same goes for Java. C is the grandfather computer language that spawned many others and is really quite simple. Review this tutorial exerpted from Kernighan & Ritchie’s “The C Programming Language” and ignore all the references to interfacing with operating systems (like command line parameters, et cetera) and you will be fine.
Also, C# works on the .NET framework, and the CLR to run. This is highly impractical to put on a FIRST robot (even if you could) due to the fact that the framework eats memory like crazy.
And it really isn’t necessary. If you know C#, picking up C should be relatively painless (especially since the code for most of the robot isn’t all that complex compared to possibilities in C#).
There are ways to do this, but it would require a co-processor [cough]used Windows Mobile PDA[/cough] which could run the .net framework.
Even though it is possible I don’t see the advantage. Most tasks on the robot are simple, and C is very similar to C#.
Exactly my point. The .NET framework is… sluggish, to say the least, and most of robot tasks are simple. It would be much better to just figure it out in C.
Good find, but I’ll need to run those tests myself before I believe them. Even though I like .net.
The .net micro frameworkcan run an ARM7 and ARM9 processors with as little as 256k of RAM.
The .net micro frameowrk also supports the same debugging experiance that you get with regular PC debugging with .net.
This is a somewhat interesting discussion about the .net micro framework.
Don’t get me wrong. I love the .NET framework for a lot of things. But not so much for others. I was more referring to the amount of memory it takes up, and on a PC, it’s controls are sluggish when updated. Besides, there are ways to work around floating point math, saving a lot of time on your processor.
I’m not saying that you are right or wrong. Just don’t make sweeping generalities, because there will always be someone with the facts.
There is nothing wrong with the stats posted, and honestly C# is definitely not significantly “slower” than any other language (it is more than fast enough for any computation I’ve ever seen done on FIRST robots) … the problem is that C# is usually compiled down to an intermediate byte-code rather than assembly code, this means you need to run a virtual machine which interprets the byte code. Again this is not going to be that much “slower” however there will be a memory overhead which was not shown by the tests, since they only checked floating point operations.
The whole point of C# is to make it easier to develop large software projects, most FIRST robots have like 8 functions, and you don’t exactly need polymorphism or all of the other things that make C# useful, so I would say there is no advantage to use C#.
If you want a challenge, try writing a LISP interpreter on the RC… it’s one of the easiest languages to write an interpreter for.
Doesn’t help for FIRST really, but if you’re interested in C# and robots, borrow a LEGO NXT kit from a FLL team and get a copy of the free Microsoft Robotics Studio (http://msdn.microsoft.com/robotics/). Requires a decent knowledge of the C# language and then some additional learning about the Concurrency and Coordination Runtime (CCR), which isn’t quite as scary as it sounds.
Once you get going it’s really fun and powerful. I took a class last summer that used it, and we got all the way to using vision recognition, (Requires a robot that you can hook a camera to, so NXTs won’t work, but we just used webcams) which is made pretty easy because it’s all built into MSRS.
In addition, this is what a lot of colleges and even some corporations are starting to use, so you’ll have a head start if you want to keep going in robotics. Have fun!
I’d actually expect this to happen sooner rather than later - eventually, as people start doing more and more ‘AI’ typical work for their autonomous modes, they will realize the clear and inherent superiority of LISP.
(not to start a language-war or anything, but I prefer LISP to C, especially when trying to abstractly develop behaviors and writing code underneath that. LISP also has the advantage of there being multiple GP systems that are implemented in it).