Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singular strange data values #2

Open
hauserandr opened this issue Mar 19, 2019 · 0 comments
Open

Singular strange data values #2

hauserandr opened this issue Mar 19, 2019 · 0 comments

Comments

@hauserandr
Copy link

hauserandr commented Mar 19, 2019

Hey, first of all I wanted to thank you for the shared ROS package. It helped me a lot with a private project.

When I tried to integrate your package to support SLAM, firstly I visualized the IMU messages in RVIZ and noticed strange peaks in the data. I played around with your code a bit and managed to find the issue in the read_word function:

def read_word(adr):
    high = bus.read_byte_data(ADDR, adr)
    low = bus.read_byte_data(ADDR, adr+1)
    val = (high << 8) + low
    return val

The high and low values are read separately and sometimes it seems like that the values are updated in between each read call which leads to obscured values from time to time.

python smbus2 offers a read_i2c_block_data function where you could read data from multiple registers at once so they won't get updated in between. I changed it and did not observe any anomaly since. I could create a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant