Coder Social home page Coder Social logo

Comments (4)

newpavlov avatar newpavlov commented on August 29, 2024

You need to call stop() after iter_scans(). Ideally it should be done automatically when iterator is not used any more. One way to solve it which I knew was to use with ... as, but I didn't like it much.

However after looking into this problem a bit more, it seems it can be solved elegantly by using "try finally" inside the iterator.

from rplidar.

jjehl avatar jjehl commented on August 29, 2024

if stop() is always needed, it could better to integrate the function in the iter_scans(). To make your code robust, it should support the eventuality that the users do things that you don't want.
I have also problem after a reset() command because my A2 send a response message.

Anyway I work on improvements and I'll send you a first pull request this afternoon, we 'll be able to discuss on this base.

from rplidar.

TeamMoscou avatar TeamMoscou commented on August 29, 2024

hello,
I got the same error while using the iter_measurments() in a for loop. this for loop is used in a thread which is running with two others threads.

from rplidar.

Masatoshi avatar Masatoshi commented on August 29, 2024

HI
When you got RPLidarException, you'd better to reconnect.
If it does not exceed max retry, make it to connect again.
In my case, it works.

from rplidar.

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.