Skip to content

Singular strange data values  #2

@hauserandr

Description

@hauserandr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions