Code Monkey home page Code Monkey logo

Comments (8)

ddemidov avatar ddemidov commented on July 30, 2024

Sorry for the noise, I did not look at the system names.

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

It turns out the real problem is that the specification states that hold_pid/* properties have read access, but reading the properties results in an error:

cat /sys/class/tacho-motor/motor0/hold_pid/Kp
cat: /sys/class/tacho-motor/motor0/hold_pid/Kp: Operation not supported

from ev3dev-lang.

WasabiFan avatar WasabiFan commented on July 30, 2024

Don't the docs files that you linked to say that they support both read and write?

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

The docs say so, but the properties are not readable on my ev3. This is probably an error in the driver, so I opened ev3dev/ev3dev#314 as well.

from ev3dev-lang.

dlech avatar dlech commented on July 30, 2024

If an attribute does not have read or write access, you will get a permission error (-EACCESS I think) rather than an operation not supported error (-EOPNOTSUPP). This is working as indented. Reading and writing the hold_pid parameters for the legoev3-motor driver is not implemented, thus the -EOPNOTSUPP error. When using the ms-nxtmmx driver, these attributes will actually do something.

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

Ok, thanks for the explanation. This means that currently both ev3dev-lang-test.cpp and ev3dev-lang-demo.cpp should be edited manually after autogeneration (as I have done here).

I am thinking of adding a try/catch block to the generated text here and outputting something like 'not supported' when this exception is thrown. @WasabiFan, what do you think?

from ev3dev-lang.

WasabiFan avatar WasabiFan commented on July 30, 2024

I am thinking of adding a try/catch block to the generated text here and outputting something like 'not supported' when this exception is thrown. @WasabiFan, what do you think?

That sounds like it would not only mitigate the errors, but also provide useful information on the status and usage of the motors, so I'm happy with that plan. Just make sure that the message makes it clear that the error isn't actually a problem.

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

Resolved by #55

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.