ev3dev / ev3dev-lang

(deprecated) language bindings for ev3dev sensors, motors, LEDs, etc.
GNU General Public License v2.0
56 stars 39 forks source link

R bindings for ev3dev - preliminary version #13

Closed bmegli closed 10 years ago

bmegli commented 10 years ago

Compatibility with ev3dev-jessie-2014-10-07 (pre-release).

Implementation follows wrapper-specification.md and naming conventions of cpp bindings and R language (e.g. Position for getter and SetPosition for setter, Run, Stop, Running for motor, ...).

What's working:

What was tested:

TO DO:

fdetro commented 10 years ago

I hadn't a chance to test the binding myself, but on a first view it looks pretty OK.

When do you plan to add the exception / connected property stuff?

WasabiFan commented 10 years ago

The only missing property that I see (and it isn't a big one) is the Device Index sensor property, which is just the number at the end of the device's directory name. Everything else looks like it's there, although I haven't tested it on my brick.

bmegli commented 10 years ago

@fdetro Next version, probably in two weeks time. I am busy at work. @WasabiFan Ooops, DeviceIndex coming in the same update.

For the Connected property - funny thing - this is not obvious in R. In basic R, objects can only by passed by value ;-) so chaniging the state of the object in the parent lexical scope (caller of the function) is tricky.

There are solutions for passing by reference ranging from dirty tricks, clever tricks and switching to the new reference class system R5 (yes, three separate systems of formal classes in core R now ;-)

I have to investigate and choose one of the solutions.

As for the exceptions: the script would simply stop execution with error message now. Its a matter of giving more informative error message.

For those reasons and the fact of targetting pre-release the pull request was made to branch develop (not master).

WasabiFan commented 10 years ago

@fdetro Unless you see any other reasons not to, I'd say we can merge this. We can add an "experimental" tag to this one in the readme until those final few things are worked out.