Quote:
Originally Posted by spartango
WebDMA is pretty low-level, giving access to specific variables within the runtime environment--which is slightly dangerous---and perhaps a little crude in that you are altering the code execution, as opposed to the conceptual robot behavior.
To be a little more clear, it would probably be better to implement an API for your robot that provided an interface to the robot's abstracted components, as opposed to providing a pseudoDMA...this is better practice, safer, and logically more sound.
Yes this does have the downside that an API would have to be written specifically to your robot, but on the other hand, you would be describing an arm abstraction(for example) as opposed to a variable deep within the code.
|
I disagree that it would be a better approach to *force* a user to create a custom API -- however, I believe if one wanted to do that, it would be reasonably easy to either wrap the existing variable classes in something more generic or implement custom classes that do the interaction stuff.
You're right though that this is very low-level. However, this is an intentional design decision. As a low-level tool, its easy to shoot yourself in the foot. In particular, the fact that a variable can change its value right out from under you can lead to synchronization problems. I believe my documentation discusses some ways to avoid this problem however.
As a display mechanism for debugging, I think this tool excels (and if I got around to adding the ability to chart the incoming data using javascript, it would be even more amazing). I find the ability to take practically *any* variable declaration and replace it with a transparent proxy object is wonderful for debugging weird problems. I believe there is a readonly option for objects designed for this particular use case so you don't shoot yourself in the foot too much.
It is my hope that using WebDMA should be really really simple to use and include in your program, and I think that its mostly met that goal. But of course, if you have better ideas, feel free to send me a patch.

Once the build season starts going, I'll probably be adding more stuff to it as needs are recognized.