This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AWR1642BOOST: ROS package msg data format

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: AWR1642

Tool/software: Linux

Hi,

I'm handling the AWR1642 ROS package. I tried to echo the data from publisher out, and I received the data in the following format:

header:
  seq: 948
  stamp:
    secs: 0
    nsecs:         0
  frame_id: "base_radar_link"
height: 1
width: 71
fields:
  -
    name: "x"
    offset: 0
    datatype: 7
    count: 1
  -
    name: "y"
    offset: 4
    datatype: 7
    count: 1
  -
    name: "z"
    offset: 8
    datatype: 7
    count: 1
  -
    name: "intensity"
    offset: 16
    datatype: 7
    count: 1
is_bigendian: False
point_step: 32
row_step: 2272
data: [0, 0, 64, 60, 0, 0, 48, 61, 0, 0, 0, 0... (lots of data here)]

is_dense: True

I am wondering how the data is packed in the "data" list? Also, is there a way to get the position of objects easily?

Best regards.

Gelei

  • Hi Gelei,

    Which message and publisher are you referring to? I need to do some investigation on this topic so please expect a response by Monday next week (02-Apr)

    Thanks
    -Nitin
  • Hi Nitin,

    I'm referring to the ROS msg /mmWaveDataHdl/RScan. I tried to echo this msg out and I don't quite understand how to read the "data" within. I can identify how many objects in each frame, and some other information, but I don't know how to read the data vector.

    For instance:

    ---
    header:
      seq: 66963
      stamp:
        secs: 0
        nsecs:         0
      frame_id: "base_radar_link"
    height: 1
    width: 78
    fields:
      -
        name: "x"
        offset: 0
        datatype: 7
        count: 1
      -
        name: "y"
        offset: 4
        datatype: 7
        count: 1
      -
        name: "z"
        offset: 8
        datatype: 7
        count: 1
      -
        name: "intensity"
        offset: 16
        datatype: 7
        count: 1
    is_bigendian: False
    point_step: 32
    row_step: 2496
    data: [0, 0, 0, 61, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 128, 63, 157, 246, 5, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 61, 0, 0, 128, 61, 0, 0, 0, 0, 0, 0, 128, 63, 182, 80, 10, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 61, 0, 0, 192, 61, 0, 0, 0, 0, 0, 0, 128, 63, 170, 222, 1, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 62, 0, 0, 32, 61, 0, 0, 0, 0, 0, 0, 128, 63........]
    is_dense: True
    ---
    I know there are 78 objects detected in this frame, but may I know how to read the x, y, z of each point from the data?

    Best regards,

    Gelei

  • Hi Gelei,

    Sorry for the delay. ROS defines the PointCloud2 message as given on ROS wiki at wiki.ros.org/.../Overview.

    The PointCloud2 message encapsulates the core PointCloud data type for the point object as defined in the point cloud library (PCL). More information on this data type is available here:

    pointclouds.org/.../adding_custom_ptype.php.

    PCL defines various pre-defined point types as given on this page e.g. PointXYZ, PointXYZI, PointXYZRGB etc. The particular one being used in the mmWave ROS driver is PointXYZI (X, Y, Z and Intensity)

    The Point information which consists of X, Y, Z and Intensity is being populated in the RScan message in the folling file:

    ~/catkin_ws/src/ti_mmwave_rospkg/src/DataHandlerClass.cpp, Method: DataUARTHandler::sortIncomingData (look under case READ_OBJ_STRUCT).

    The information about the field name and data type is provided in the message header e.g.:

    name: "x"
    offset: 0
    datatype: 7
    count: 1
    -

    datatype 7 represents Float32 as given here: docs.ros.org/.../PointField.html.

    So the data array consists of structures of XYZI values.

    Regards
    -Nitin