Hi my new friend!

UWB数据集分析

  • Home
  • UWB数据集分析
Scroll down

UWB

超宽带(Ultra Wide Band,UWB)技术是一种无线载波通信技术,它不采用正弦载波,而是利用纳秒级的非正弦波窄脉冲传输数据,因此其所占的频谱范围很宽。
UWB技术具有系统复杂度低,发射信号功率谱密度低,对信道衰落不敏感,截获能力低,定位精度高等优点,尤其适用于室内等密集多径场所的高速无线接入。

NoopLoop数据分析

使用NoopLoop公司的UWB节点,在塔克小车上采集数据,需要将数据集中的测距信息导出。本次实验使用Faster-Lio作为小车定位。

  • 录制rosbag
    rosbag中使用rosbag info查看数据集内容:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    path:        uwb
    version: 2.0
    duration: 36.9s
    start: Mar 30 2024 17:40:30.91 (1711791630.91)
    end: Mar 30 2024 17:41:07.78 (1711791667.78)
    size: 254.1 MB
    messages: 18347
    compression: none [275/275 chunks]
    types: dynamic_reconfigure/Config [958f16a05573709014982821e6822580]
    dynamic_reconfigure/ConfigDescription [757ce9d44ba8ddd801bb30bc456f946f]
    geometry_msgs/Twist [9f195f881246fdfa2798d1d3eebca84a]
    livox_ros_driver2/CustomMsg [e4d6829bdfe657cb6c21a746c86b21a6]
    nav_msgs/Odometry [cd5e73d190d741a2f92e81eda573aca7]
    nlink_parser/LinktrackNodeframe2 [5e015baafc881617fa57f6ba7fd27747]
    rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb]
    sensor_msgs/Imu [6a62c6daae103f4ff57a132d6f95cec2]
    sensor_msgs/PointCloud2 [1158d486dd51d683ce2f1be655c3c181]
    std_msgs/Float32 [73fcbf46b49191e672908e50842a83d4]
    tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
    topics: /Odometry 366 msgs : nav_msgs/Odometry
    /bat_vol 1831 msgs : std_msgs/Float32
    /cloud_registered 366 msgs : sensor_msgs/PointCloud2
    /cloud_registered_body 366 msgs : sensor_msgs/PointCloud2
    /cmd_vel 2 msgs : geometry_msgs/Twist
    /imu 1832 msgs : sensor_msgs/Imu
    /livox/imu 7334 msgs : sensor_msgs/Imu
    /livox/lidar 367 msgs : livox_ros_driver2/CustomMsg
    /nlink_linktrack_nodeframe2 1834 msgs : nlink_parser/LinktrackNodeframe2
    /odom 1831 msgs : nav_msgs/Odometry
    /rosout 17 msgs : rosgraph_msgs/Log (2 connections)
    /rosout_agg 2 msgs : rosgraph_msgs/Log
    /tarkbot_robot/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
    /tarkbot_robot/parameter_updates 1 msg : dynamic_reconfigure/Config
    /tf 2197 msgs : tf2_msgs/TFMessage (2 connections)
    其中,/Odometry是定位信息,/nlink_parser/LinktrackNodeframe2是测距信息。
  • 编译msg文件
    1
    2
    3
    4
    5
    mkdir -p catkin_uwb/src
    cd catkin_uwb/src
    git clone --recursive https://github.com/nooploop-dev/nlink_parser.git
    cd ..
    catkin_make
  • 使用Python和rosbag play实现数据回放和接收
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    import rospy
    from nav_msgs.msg import Odometry
    from nlink_parser.msg import LinktrackNodeframe2

    rospy.init_node('uwb_test')

    data = []
    data_single = []
    init_time = 0.0
    init = False

    def odom_callback(msg: Odometry):
    global data_single, init, init_time
    if not init:
    init_time = msg.header.stamp.to_sec()
    init = True
    # print(type(msg.header.stamp.to_sec()))
    data_tmp = [msg.header.stamp.to_sec() - init_time,
    msg.pose.pose.position.x,
    msg.pose.pose.position.y,
    msg.pose.pose.position.z]
    data.append([data_tmp, data_single])

    def uwb_callback(msgs):
    global data_single
    # print(len(msg.nodes))
    # print(msg.nodes[0])
    # print(msg.nodes[1])
    data_single = []
    for msgs in msgs.nodes:
    data_single.append(msgs.dis)

    if __name__ == '__main__':
    rospy.Subscriber('/Odometry', Odometry, odom_callback)
    rospy.Subscriber('/nlink_linktrack_nodeframe2', LinktrackNodeframe2, uwb_callback)
    # rospy.spin()
    while not rospy.is_shutdown():
    # print(data)
    pass
    with open('result.csv', 'w') as f:
    f.writelines('time,x,y,z,uwb1,uwb2,uwb3,uwb4\n')
    for da in data:
    f.writelines(str(da[0][0]) + ',' +
    str(da[0][1]) + ',' +
    str(da[0][2]) + ',' +
    str(da[0][3]) + ',')
    for sin in da[1]:
    f.writelines(str(sin) + ',')
    f.writelines('\n')
    在程序目录下会出现result.csv

我是学生,给我钱

其他文章
目录导航 置顶
  1. 1. UWB
  2. 2. NoopLoop数据分析
请输入关键词进行搜索