Code Monkey home page Code Monkey logo

Comments (6)

BertLindeman avatar BertLindeman commented on July 30, 2024

Without any prior knowledge, but maybe a begin of getting started:

Getting started:
Used as a start: http://data.princeton.edu/R/gettingStarted.html
cd to the directory you (downloaded and) unzipped the develop.zip
cd to the R directory within the ev3dev-lang-develop path.

On a terminal (I did this on ssh session) start R: R

Wait until the R prompt > is shown.
Remember to enter q() to quit the R-session.

Load the ev3dev R bindings: source("ev3dev.R")
Do not expect subsecond response times ;-)

> source("ev3dev.R")
[1] "Creating a new generic function for ‘Position’ in the global environment"
>

(maybe more later, do not yet know how to go further)
How to re-load an updated source?
E.g.

> source("ev3dev.R")
Error in eval(expr, envir, enclos) :
  cannot change value of locked binding for 'ports'

from ev3dev-lang.

WasabiFan avatar WasabiFan commented on July 30, 2024

@BertLindeman Maybe the required packages aren't available for ARM?

@bmegli Any ideas for @BertLindeman ?

from ev3dev-lang.

BertLindeman avatar BertLindeman commented on July 30, 2024

Update to "howto reload" above:
To reload the bindings, remove the bindings for ports:
rm(ports)
After that source("ev3dev.R") can be re-done.

Packages installed at the moment here:

  r-base r-cran-boot r-recommended

Packages that came along:

  cdbs libblas-common libblas-dev libblas3 libjpeg-dev libjpeg62-turbo-dev liblapack-dev
  liblapack3 liblzma-dev libncurses5-dev libpcre3-dev libpcrecpp0 libpng12-dev libtcl8.5
  libtk8.5 libxss1 r-base-core r-base-dev r-base-html r-cran-class r-cran-cluster
  r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix
  r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-doc-html

Cannot find Rserve (as indicated to be installed in the readme.md on the R page. )

But: R does work as far as I know.

A next step is to run an example from the R bindings. E.g.
source("ev3dev_test_power_supply.R")

OK that works.
I cannot understand what is reported by Speak, would prefer textual response instead of that ;-)

Will try to make a listports.R that might be used as an IVP (installation verification procedure).

from ev3dev-lang.

bmegli avatar bmegli commented on July 30, 2024

I am happy that somebody tried it. Thank you for the feedback.

@BertLinderman "How to re-load an updated source?"

This is already fixed in awaiting PR

"I cannot understand what is reported by Speak, would prefer textual response instead of that ;-)"

The tests are meant be run remotely through Rserve, so you would not see the output. But you are right, outputting them also for local call would be better. Will be in the next version.

"Still rserve not found, also not found r-serve"

It's r-cran-rserve - GNU R Rserve tcp/ip server and sample clients:
sudo apt-get install r-cran-rserve

As far as I remember I had to also add some switch for apt-get to install it correctly.

Also installing it directly from inside R will fail (in R shell install.packages(...)) (not enough memory?)

I am going to write a detailed getting started from clean ev3dev install.
I have to redo all the things I did and I don't remember.
Please, be patient.

Now some note - R is not the fastest and thinnest environment.
It's not inteded for real time control, rather mixed use:
-on EV3 side simple functions for gathering data from sensors
-on PC in, say, RStudio, executing those functions remotely on EV3
-plotting data and building statistical models on PC
-using built models on EV3, possibly reimplemented in say C++

E.g. model for turning IR proximity sensor (its probably giving the energy detected as most IRs) into distance sensor coming as an example (using Phong model, but the reverse way as in graphics)

Thank you kindly for the feedback!

P.S. I am sorry for the delay in response, just too much work and too little time to play with ev3dev :/

from ev3dev-lang.

BertLindeman avatar BertLindeman commented on July 30, 2024

Thanks, @bmegli A bit of environment:
I just use PuTTY to the EV3 at the moment, indeed to avoid client-server problems.
apt-get install r-cran-rserve OK now.
Test runs OK (local on EV3) so no problem on the apt-get (for me).
Do not hesitate to ask me to test.
I am flip-flopping between "Snap with nodejs" and "R"

from ev3dev-lang.

BertLindeman avatar BertLindeman commented on July 30, 2024

Updated readme.md of R and made pull request for it.

from ev3dev-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.