Skip to content

analogdevicesinc/tof-ros2

Repository files navigation

ROS2 Wrapper for Time of Flight SDK of Analog Devices (for Ubuntu)

Ubuntu 20.04: Foxy Ubuntu 22.04: Humble Ubuntu 22.04: Rolling
Build Status Build Status Build Status

1. Install ROS2

  • Install the recommended ROS2 distribution for your operating system**

  • In order to prepare the system to run the ROS wrapper in the general catkin workspace make sure to install correctly the following libraries:

1.1 Install ROS2 on NXP

  • The installation is described on file doc/ros2_on_nxp.md

2. ToF dependency

Download debian package:

For Crosby:

For Adsd3030:

Install command: sudo dpkg -i tof_lib.deb

Building from sources

In order to prepare the system to run the ROS wrapper in the general catkin workspace make sure to install correctly the following library:

Also make sure to run sudo make install at the end of the build

3. Usage

In directory ros2_ws/src/ clone the repository:

  git clone https://github.com/analogdevicesinc/tof-ros2

After cloning the repository in the ``ros2_ws/ run the following command:

  colcon build
  source install/setup.sh

Starting camera node

  • In the general ROS2 workspace run the following code, setting up the path towards shaed library:
  export LD_LIBRARY_PATH="$LD_LIBRARY_PATH;/opt/websockets/lib;/usr/local/lib"

With roslaunch

  • EVAL-ADTF3175D :
ros2 launch tof_ros2cpp EVAL-ADTF3175D.launch.xml

With ros2 run

  • Starting the node
  ros2 run tof_ros2cpp tof_ros2cpp_node ip=10.42.0.1 config_file=<config file path> mode=<mode number> enable_multithread=<true/false>

Parameters:

[ip = "<ip address of camera>"]

  • for remote acces specify the cameras ip: 10.42.0.1
  • for on target use, leave empty: ""

Default value: "" (empty string)

[config_file = "<config file path>"]

  • config/config_adsd3500_adsd3100.json ("Crosby")
  • config/config_adsd3500_adsd3030.json ("Adsd3030")

Default value: config/config_adsd3500_adsd3100.json

[mode = "<mode>"] (for both cameras):

  • 0: sr-native (short-range native)
  • 1: lr-native (long-range native)
  • 2: sr-qnative (short-range quarter native)
  • 3: lr-qnative (long-range quarter native)
  • 4: pcm-native
  • 5: sr-mixed (short-range mixed)
  • 6: lr-mixed (long-range mixed)

Default value: 0

[enable_multithread = "<True/False>"]:

  • True: Node creates different threads for each publishing topics
  • False: All publishers are updated on the same thread

Default value: False

Note: Although multithreading provides a faster publishing rate on certain platforms, on less performant Hosts this might not be beneficial and the single thread implementation can be more relevant.

ROS Parameters

Camera parameters:

  • adsd3500ABinvalidationThreshold
  • adsd3500ConfidenceThreshold
  • adsd3500JBLFfilterEnableStat
  • adsd3500JBLFfilterSize
  • adsd3500RadialThresholdMin
  • adsd3500RadialThresholdMax

Thread parameters:

  • ir
  • depth
  • raw
  • conf
  • xyz

To enable or disable a publisher thread you can use ros2 param set commnad:

  ros2 param set /tof_camera_node depth false

The thread parameter name are: ir, depth, raw, conf and xyz. The thread parameter type are bool: true, false. Info: You must run twice the ros2 param set commnad to have effect on the node.