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

ubuntu 20.04 i2c failed #11

Closed
lurunawjan opened this issue Oct 4, 2021 · 5 comments
Closed

ubuntu 20.04 i2c failed #11

lurunawjan opened this issue Oct 4, 2021 · 5 comments

Comments

@lurunawjan
Copy link

Hello, i have problem with the I2c in ubuntu. I'm using raspberry pi4 with ubuntu 20.04 and make connection for sensor using I2c in raspberry pi. then i got the error at the terminal said that "failed to open I2c bus 1" is there anyone know how to solve this problem. I really need help since I need to solve it urgently. Thank you

@okalachev
Copy link
Owner

Hi!

You may try to debug your I2C bus using i2c-tools.

Get list of I2C busses - i2cdetect -l:

i2c-1   i2c             bcm2835 (i2c@7e804000)                  I2C adapter

Get list of devices on the bus 1 - i2cdetect -y 1:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --          

You can see the device with address 0x29, which is the rangefinder.

@lurunawjan
Copy link
Author

Thank you for your reply. I manage to solve the problem. Since I'm new with ROS I wanted to ask how can I use the sensor with rviz? Thank you

@okalachev
Copy link
Owner

okalachev commented Oct 5, 2021

Run rviz on your computer with pointing ROS_MASTER_URI to your RPi's hostname; add /vl53l1x/range topic visualization.

Some more info here: https://clover.coex.tech/en/rviz.html#start-rviz

@lurunawjan
Copy link
Author

I tried to use that but why it said that for frame [] fixed frame [map] does not exist

@okalachev
Copy link
Owner

In ROS, in order to visualize the sensor data each sensor should declare its pose in space (most often relative to the robot's body), using a TF frame. Please, address the main TF documentation to learn details.

By default, the driver publishes an empty frame (header.frame_id = ""), so you should configure it manually in the launch-file.

The simplest way to see something is to put any string you want there (e. g. rangefinder) and set it as the rviz fixed frame name.

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

2 participants