速騰聚創16線レーダーオフラインとリアルタイムランニングLego-loam


前回の先輩のレゴラム機能パックを走った過程や、踏んだ穴を記録して、間違いがあったら指摘してください.
一:オフラインで自分で録画した点雲包を走る
もしあなたが速騰聚創16線レーダーであれば、このrunを直接使用します.launchファイル
<launch>
    
    <!--- Sim Time -->
    <param name="/use_sim_time" value="true" />

    <param name="/use_sim_time" value="true" />
    <node pkg="nodelet" type="nodelet" name="pcl_manager" args="manager" output="screen" />
    
    <!-- Run a passthrough filter to clean NaNs -->
    <node pkg="nodelet" type="nodelet" name="passthrough" args="load pcl/PassThrough pcl_manager" output="screen">
        <remap from="~input" to="/rslidar_points" />
        <remap from="/passthrough/output" to="/velodyne_points" />
        
        <rosparam>
        filter_field_name: z
        filter_limit_negative: True
        </rosparam>

    <rosparam>
        filter_field_name: x
        filter_limit_negative: True
        </rosparam>

    <rosparam>
        filter_field_name: y
        filter_limit_negative: True
       
        </rosparam>
    </node>

    <!--- Run Rviz-->
    <node pkg="rviz" type="rviz" name="rviz" args="-d $(find lego_loam)/launch/test.rviz" />

    <!--- TF -->
    <node pkg="tf" type="static_transform_publisher" name="camera_init_to_map"  args="0 0 0 1.570795   0        1.570795 /map    /camera_init 10" />
    <node pkg="tf" type="static_transform_publisher" name="base_link_to_camera" args="0 0 0 -1.570795 -1.570795 0        /camera /base_link   10" />

    <!--- LeGO-LOAM -->    
    <node pkg="my_slam" type="imageProjection"    name="imageProjection"    output="screen"/>
    <node pkg="my_slam" type="featureAssociation" name="featureAssociation" output="screen"/>
    <node pkg="my_slam" type="mapOptmization"     name="mapOptmization"     output="screen"/>
    <node pkg="my_slam" type="transformFusion"    name="transformFusion"    output="screen"/>




</launch>

この部分はNAN点群の除去です
<!-- Run a passthrough filter to clean NaNs -->
    <node pkg="nodelet" type="nodelet" name="passthrough" args="load pcl/PassThrough pcl_manager" output="screen">
        <remap from="~input" to="/rslidar_points" />
        <remap from="/passthrough/output" to="/velodyne_points" />

この部分を付けないと、次のような問題が発生します.
featureAssociation: /home/chenyi/pcl-1.9/kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp:136: int pcl::KdTreeFLANN::nearestKSearch(const PointT&, int, st
d::vector&, std::vector&) const [with PointT = pcl::PointXYZI; Dist = flann::L2_Simple]: Assertion `point_representation_->isValid (point) && "Inval
id (NaN, Inf) point coordinates given to nearestKSearch!"' failed.
[featureAssociation-6] process has died [pid 30877, exit code -6, cmd /home/chenyi/legoloam_ws/devel/lib/lego_loam/featureAssociation __name:=featureAssociation __log:
=/home/chenyi/.ros/log/c90973c6-82f3-11e9-a7c2-2c4d5498d09e/featureAssociation-6.log].
log file: /home/chenyi/.ros/log/c90973c6-82f3-11e9-a7c2-2c4d5498d09e/featureAssociation-6*.log


最後にバッグを走るときの命令は以下の通りです.
rosbag play xxx.bag --clock

忘れないで
二:リアルタイムラインランニングバッグ
最初のステップ
先ほど送ったlegoloamのlaunchファイルのtrueをfalseに変更します.以下に示します.
<param name="/use_sim_time" value="false" />

ステップ2
次のように、速騰集創レーダーの駆動launchファイルにマッピングを追加します.
<remap from="/rslidar_points" to="/velodyne_points" />

ステップ3
レーダーのlaunchを先に運転し、legoloamのlaunchを運転します
離陸完了