LeJos: all robot classes and methods in 1?
Re: LeJos: all robot classes and methods in 1?
xander: It wouldn't be the first time I used a srewdriver for hammering a nail - that's not my problem...
gloomy: with Motor.A.rotate(70) I could deal. But I can't expand methods by 7 or 8 different ones.
Can you design a robot instance by which I can access everything that's possible in Java?
Or can you show me a real simple C GUI for Lejos? (no gcc, and no eclipse, just C plus simple multithreading, nothing like nctOSEK)
Otherwise I'll have to wait for stack and heap and recursion by NXC...
gloomy: with Motor.A.rotate(70) I could deal. But I can't expand methods by 7 or 8 different ones.
Can you design a robot instance by which I can access everything that's possible in Java?
Or can you show me a real simple C GUI for Lejos? (no gcc, and no eclipse, just C plus simple multithreading, nothing like nctOSEK)
Otherwise I'll have to wait for stack and heap and recursion by NXC...
Re: LeJos: all robot classes and methods in 1?
I can't see anything "unfortunate" in this.gloomyandy wrote:Yes I can understand that. Unfortunately the leJOS classes are designed assuming an OO model
I'm afraid that you will neither get lucky with that nor achieve satisfying results, as it's like trying to use a plane without wings and motors or a computer without the electronics in it.doc-helmut wrote:I'd like to use LeJos, but without objects.
If you are not into OO, don't use an OO-based framework.
Better invest your valuable time in, say, NXC, when you want to do procedural stuff - in your case, what is the actual problem at hand that you can't solve with NXC?
Re: LeJos: all robot classes and methods in 1?
as I often wrote:in your case, what is the actual problem at hand that you can't solve with NXC?
no stack, no heap, no pointers, no recursions, no dynamic memory allocation
with the underlying OOP part it's to me like when using C++: you may use the OO part, but you don't have to.
Re: LeJos: all robot classes and methods in 1?
Doc,
I'm yet to see a real-world NXT robot issue that can be solved with leJOS, but not with NXC.
So just putting everything in one monster class will not help - you do not remove the object-orientated concept from an OO-based framework simply by reducing the API to just one class.
These seem to be no real NXT robotic problems to me but rather technical issues of a language architecture.doc-helmut wrote: no stack, no heap, no pointers, no recursions, no dynamic memory allocation
I'm yet to see a real-world NXT robot issue that can be solved with leJOS, but not with NXC.
Except for the fact that unlike to C++ (which technically was a wrapper around a C core, conceptually an OO extension to C), there is no noticeable non-OO part in Java (thus non in leJOS NXJ beyond the firmware access layer).doc-helmut wrote:
with the underlying OOP part it's to me like when using C++: you may use the OO part, but you don't have to.
So just putting everything in one monster class will not help - you do not remove the object-orientated concept from an OO-based framework simply by reducing the API to just one class.
Re: LeJos: all robot classes and methods in 1?
I need pointers, memalloc, recursion.
But maybe 1 Lejos monster class to bind them all would help
But maybe 1 Lejos monster class to bind them all would help
Re: LeJos: all robot classes and methods in 1?
Java has no pointers.
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: LeJos: all robot classes and methods in 1?
correct
(...again thinking in C categories...)
but I need them actually only for dynamic mem allocation - that's possible, isn't it?
(...again thinking in C categories...)
but I need them actually only for dynamic mem allocation - that's possible, isn't it?
Re: LeJos: all robot classes and methods in 1?
I really did not want to get involved in this discussion but.....
An advise first. Use your tools the way they are intended to. Otherwise you'll get frustrated ( in case of software tools) or hurt (in case of hardware tools).
.......If you really need recursion you can write your function in such a way that it mimics recursion. If you need dynamic memory you can do so by using arrays. If you needs stacks, again your solution is in using arrays.
Remember, programming is the art of finding solutions within the limited resources you have.
An advise first. Use your tools the way they are intended to. Otherwise you'll get frustrated ( in case of software tools) or hurt (in case of hardware tools).
.......If you really need recursion you can write your function in such a way that it mimics recursion. If you need dynamic memory you can do so by using arrays. If you needs stacks, again your solution is in using arrays.
Remember, programming is the art of finding solutions within the limited resources you have.
My blog: nxttime.wordpress.com
Re: LeJos: all robot classes and methods in 1?
this is easily said and sounds a bit flashy.If you really need recursion you can write your function in such a way that it mimics recursion.
...
Remember, programming is the art of finding solutions within the limited resources you have.
It was not possible though I already tried it (e.g., in my chess program).
You may show me how to do it if you can, but anyway it's not the topic (please read the TO question closely again).
-
- Posts: 76
- Joined: 29 Sep 2010, 06:57
Re: LeJos: all robot classes and methods in 1?
Of course, you would have to write the code for this class, so you'd still have to figure out OO to some extent. IMHO, if you're going to do that, you may as well go the whole hog and learn how to use Java properly.doc-helmut wrote: But maybe 1 Lejos monster class to bind them all would help
Matt
Who is online
Users browsing this forum: Semrush [Bot] and 5 guests