/xwr6843_ros2

Python ROS2 pointcloud retriever for TI XWR6843 mmWave devices

Primary LanguagePython

XWR6843 simple ROS2 package

mmw_pcl_gif

Python ROS2 pointcloud retriever for XWR6843 mmWave devices

Derived from: https://github.com/nhma20/iwr6843aop_pub

Prerequisites

  • ROS2 (Ubuntu 18.04.5 & dashing tested // Ubuntu 20.04.3 & foxy tested)
  • Python3 (3.6.9 & 3.8.10 tested)
  • XWR6843 mmWave radar device (e.g. IWR6843ISK or IWR6843AOPEVM) flashed with out-of-box firmware (either from this repo or inside downloaded mmwave_industrial_toolbox_x_x_x/labs/Out_Of_Box_Demo/prebuilt_binaries/ folder. Use uniflash to flash device (e.g. https://training.ti.com/hardware-setup-iwr6843isk-and-iwr6843isk-ods)). Set up switches as seen here:

Installation

  1. Clone the repo to workspace
    cd ~/ros2_ws/src/
    git clone https://github.com/nhma20/xwr6843_ros2.git
  2. Colcon build package
    cd ~/ros2_ws/
    colcon build --packages-select xrw6843_ros2

Usage

  1. Plug in XWR6843 device, make sure ports match (default /dev/ttyUSB0, /dev/ttyUSB1)

  2. Run ros package (make sure /opt/ros/dashing/setup.bash and <ros2_workspace>/install/setup.bash are sourced)

    ros2 run xwr6843_ros2 pcl_pub

    or with ROS2 parameters:

    ros2 run xwr6843_ros2 pcl_pub --ros-args -p cli_port:=/dev/ttyUSB0 -p data_port:=/dev/ttyUSB1 -p cfg_path:=/home/nm/ros2_ws/src/iwr6843isk_ros2/cfg_files/90deg_noGroup_18m_30Hz.cfg -p frame_id:=test_frame -p radar_azimuth_fov:=120

    or launch with default parameters:

    ros2 launch xwr6843_ros2 default_parameters.launch.py 

    When loading a cfg with a different antenna configuration than the previous, XWR6843 devices must be power cycled - can be done easily by simply unplugging and replugging the USB cable.

  3. Visualize with rviz

    rviz2
  4. 'Add' a new display (lower left corner)

  5. Select 'By topic' ribbon

  6. Find 'xwr6843_pcl PointCloud2' and add it

  7. (Optional) Set point size at PointCloud2 -> Size (m) to 0.1 for better clarity

Modify

All functional code (for the purpose of this ROS2 package) is located at

<ros2_workspace>/src/xwr6843_ros2/xwr6843_ros2/publisher_member_function.py

Two .cfg files are provided which dictate the functionality of the mmWave device. More profiles can be made with the mmWave Demo Visualizer tool: https://dev.ti.com/gallery/view/mmwave/mmWave_Demo_Visualizer/ver/3.5.0/