Code Monkey home page Code Monkey logo

Comments (6)

ddemidov avatar ddemidov commented on July 30, 2024

There is a state attribute, which returns a set of strings representing current motor state. So motor.state().count("running") should work as a test.

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

Also see the new tutorial here: http://www.ev3dev.org/docs/tutorials/tacho-motors/

from ev3dev-lang.

dsharlet avatar dsharlet commented on July 30, 2024

Thanks, those docs are exactly what I needed.

from ev3dev-lang.

dlech avatar dlech commented on July 30, 2024

@dsharlet, I had your ball catching robot in mind when I added the run-direct command. I'd be interested to know if you are able to make it work with other commands or if you have to use the run-direct command with your own PID as you did before.

from ev3dev-lang.

dsharlet avatar dsharlet commented on July 30, 2024

Thanks for that, I was pretty happy to see run-direct in the docs! I will also try to rebuild my motor class without using my own control loop and see how far I get, I'll let you know if I can make it work. It would be great to get rid of my custom servo class.

from ev3dev-lang.

dsharlet avatar dsharlet commented on July 30, 2024

@dlech, I've spent some time now updating my code. Everything seems to be working again, though I'm still using a custom controller with run_direct. I haven't been able to meet my requirements with the stock controller/API.

Here's a video that demonstrates what I'm trying to do (track a position with minimal delay): https://www.youtube.com/watch?v=vxx3bBVWaxg The video is old, but the behavior is the same today.

Here's the program used to generate that video (updated to latest ev3dev): https://github.com/dsharlet/ev3cv/blob/master/src/test/servo.cpp

I tried moving the call to "run_to_abs_pos" to outside the control loop, but the motor just stops as soon as it reaches the position setpoint and does not run again. I don't see an obvious candidate for another run command to use instead.

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.