Code Monkey home page Code Monkey logo

vl53l1x_ros's Introduction

vl53l1x_ros

This is STM VL53L1X time-of-flight rangefinder driver for ROS. Tested on a Raspberry Pi 3 and 4 with CJMCU-531 board.

The code is based on the STM VL53L1X API library.

Connecting

Example of I²C connecting VL53L1X module to Raspberry Pi:

Installation

From package

For Raspberry Pi, there exist prebuilt Debian packages. For installation, get the package (Noetic, Melodic, Kinetic) to the Raspberry and install it with dpkg -i <package-name>.deb.

Manual

  1. Clone the repository into your Catkin workspace:

    cd ~/catkin_ws/src
    git clone https://github.com/okalachev/vl53l1x_ros.git
  2. Build the package:

    cd ~/catkin_ws
    catkin_make -DCATKIN_WHITELIST_PACKAGES="vl53l1x"

Quick start

Run with the default settings:

rosrun vl53l1x vl53l1x_node

See the ranging results:

rostopic echo /vl53l1x/range

See the ranging rate:

rostopic hz /vl53l1x/range

Parameters

All parameters are optional. Check the launch folder for launch-file templates.

  • ~i2c_bus (int) – I2C bus number (default: 1).
  • ~i2c_address (int) – I2C address (default: 0x29).
  • ~mode (int) – distance mode, 1 = short, 2 = medium, 3 = long (default: 3).
  • ~timing_budget (double) – timing budget for measurements, s (default: 0.1)
  • ~poll_rate (double) – polling data rate, Hz (default: 100).
  • ~ignore_range_status (bool) – ignore validness of measurements (default: false).
  • ~pass_statuses (array of int) – measurement statuses, that considered valid (default: [0, 6, 11]).
  • ~min_signal (double) – minimum amplitude of the signal reflected from the target to be considered valid, MCPS (default: 1).
  • ~max_sigma (double) – maximum standard deviation of the measurement to be considered valid, m (default: 0.015).
  • ~offset (float) – offset to be automatically added to measurement value, m (default: 0.0).
  • ~frame_id (string) – frame id for output Range messages (default: "").
  • ~field_of_view (float) – field of view for output Range messages, rad (default: 0.471239).
  • ~min_range (float) – minimum range for output Range messages, m (default: 0.0).
  • ~max_range (float) – maximum range for Range output messages, m (default: 4.0).

timing_budget is the time VL53L1X uses for ranging. The larger this time, the more accurate is measurement and the larger is maximum distance. Timing budget can be set from 0.02 s up to 1 s.

  • 0.02 s is the minimum timing budget and can be used only in Short distance mode.
  • 0.033 s is the minimum timing budget which can work for all distance modes.
  • 0.14 s is the timing budget which allows the maximum distance of 4 m (in Long distance mode).

The resulting measurement rate is 1 / (timing budget + 0.004) Hz.

Setting ignore_range_status to true makes the node to ignore RangeStatus field of measurements. This may significantly improve maximum distance and rate but affects quality of measurements.

mode is one of three distance modes, with the timing budget of 0.1 s, Short, Medium and Long modes have maximum distances of 136, 290, and 360 cm, respectively.

~min_range and ~max_range don't affect any device settings and only define min_range and max_range values of the output Range messages.

See the official documentation for more information on mode and timing budget.

Topics

Published

Copyright

Copyright © 2019 Oleg Kalachev.

Distributed under BSD 3-Clause License (https://opensource.org/licenses/BSD-3-Clause).

vl53l1x_ros's People

Contributors

deadln avatar goldarte avatar okalachev avatar sfalexrog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vl53l1x_ros's Issues

could not get message class for topic type "vl53l1x/MeasurementData" on topic "/rangefinder/data"

raspi 4b, ros-noetic,
im using a pre-made image from coex.tech/clover. Ive connected up my rangefinder, and get the could not get message class for topic type "vl53l1x/Measurement/Data" on topic "/rangefinder/data". Disconnected rangefinder, connected to arduino to test - works fine..
tried pulling repo down and recompiling, to no avail. ive searched everywhere looking for a cause for the error, but im at a loss right now. any help is appreciated.

ubuntu 20.04 i2c failed

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

extension to N sensors

hi !
first of all thank you for this great package
is there any chance it can be extended to N sensors using the 'i2c address reset' (essentially using the xshut pin) approach? [https://forum.pololu.com/t/using-multiple-vl53l1x-with-raspberry-pi/16651/17]
I had it work with the vl53l0x but I would like to try it with this sensor (longer range) and the API are quite different

Thank you in advance!

master branch vs. calibration branch

Hi okalachev,

thanks a lot for your amazing package.
I use the master-branch for the vl53l1x in my Jetson Xavier, it works very well.

I'm wondering, whether I need to add an extra part about calibration by myself when I use the master-branch? What would be the negative influence if there were no calibration part?

Or should I directly use the calibration-branch instead?

Thank you in advance.
Best regards

sensor_msgsConfig.cmake Missing

Hi together,
I am trying since two weeks to get the lib working. But I am not able to.

I am using noetic and when I do catkin_make I get the following error:

+++ processing catkin package: 'vl53l1x'
-- ==> add_subdirectory(vl53l1x_ros/vl53l1x)
-- Could NOT find sensor_msgs (missing: sensor_msgs_DIR)
-- Could not find the required component 'sensor_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /home/pi/catkin_ws/devel/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "sensor_msgs" with
any of the following names:

sensor_msgsConfig.cmake
sensor_msgs-config.cmake

Add the installation prefix of "sensor_msgs" to CMAKE_PREFIX_PATH or set
"sensor_msgs_DIR" to a directory containing one of the above files. If
"sensor_msgs" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
vl53l1x_ros/vl53l1x/CMakeLists.txt:11 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/pi/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:838: cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

If I search manually for the sensor_msgs lib, it is availble under /opt/ros/noetic/share/sensor_msgs

Can anybody help me please?

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.