0
$\begingroup$

(I uploaded this a while ago but got no response whatsoever, so I'm uploading it again) I am trying to use hector_mapping so I can get odom data just from my LiDAR to make a map of and navigate around my house. However, I'm getting intermittent errors with the base_footprint and base_link frames on Rviz (it says for a split second that they don't have transforms into map). Also, my TF axis thing teleports all over the place, and in the terminal, I get the following errors:

[ERROR] [1711113360.849915980]: Transform failed during publishing of map_odom transform: "odom" passed to lookupTransform argument target_frame does not exist.

[ERROR] [1711113361.354725490]: Transform failed during publishing of map_odom transform: Lookup would require extrapolation at time 1711113360.346836090, but only time 1711113360.098104954 is in the buffe, when looking up transform from frame [base_link] to frame [odom]

[ERROR] [1711113361.860285724]: Transform failed during publishing of map_odom transform: Lookup would require extrapolation 0.132860000s into the future.  Requested time 1711113360.479696035 but the latest data is at time 1711113360.346836090, when looking up transform from frame [base_link] to frame [odom]

SearchDir angle change too large

Here is some more information: lidar_gmapping.launch (the file I launch with roslaunch):

<launch>
  <!-- Launch SLAM GMapping -->
  <include file="$(find lidar)/launch/slam_gmapping_pr2.launch" />

  <!-- Launch LiDAR driver -->
  <include file="$(find lidar)/launch/X4.launch" />

  <!-- Launch RViz with the desired configuration -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find lidar)/launch/mapping.rviz" />
</launch>

slam_gmapping_pr2.launch:

<launch>
    <param name="use_sim_time" value="false"/>
    
    <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
        <param name="pub_map_odom_transform" value="true"/>
        <param name="map_frame" value="map" />
        <param name="base_frame" value="base_link" />
        <param name="odom_frame" value="odom" />
        <param name="map_update_interval" value="0.5"/>
        <param name="maxUrange" value="8.0"/>
        <param name="sigma" value="0.05"/>
        <param name="kernelSize" value="1"/>
        <param name="lstep" value="0.05"/>
        <param name="astep" value="0.05"/>
        <param name="iterations" value="5"/>
        <param name="lsigma" value="0.075"/>
        <param name="ogain" value="3.0"/>
        <param name="lskip" value="0"/>
        <param name="minimumScore" value="100"/>
        <param name="srr" value="0.1"/>
        <param name="srt" value="0.2"/>
        <param name="str" value="0.1"/>
        <param name="stt" value="0.2"/>
        <param name="linearUpdate" value="1.0"/>
        <param name="angularUpdate" value="0.2"/>
        <param name="temporalUpdate" value="0.5"/>
        <param name="resampleThreshold" value="0.5"/>
        <param name="particles" value="100"/>
        <param name="xmin" value="-10.0"/>
        <param name="ymin" value="-10.0"/>
        <param name="xmax" value="10.0"/>
        <param name="ymax" value="10.0"/>
        <param name="delta" value="0.05"/>
        <param name="llsamplerange" value="0.01"/>
        <param name="llsamplestep" value="0.01"/>
        <param name="lasamplerange" value="0.005"/>
        <param name="lasamplestep" value="0.005"/>
        <remap from="scan" to="scan"/>
        <remap from="poseupdate" to="poseupdate"/>
    </node>

    <node pkg="map_server" type="map_server" name="map_server" args="$(find lidar)/launch/map.yaml"/>

    <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link" 
          args="0.0 0.0 0.0 0 0 0 /base_footprint /base_link 40" />
          
    <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser_frame" 
          args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /laser_frame 40" />
          
    <node pkg="tf" type="static_transform_publisher" name="laser_frame_to_map" 
          args="0.0 0.0 0.0 0.0 0.0 0.0 /laser_frame /map 40" />
          
    <node pkg="tf" type="static_transform_publisher" name="base_link_to_map" 
          args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /map 40" />
          
    <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_map" 
          args="0.0 0.0 0.0 0.0 0.0 0.0 /base_footprint /map 40" />
</launch>

map.yaml:

image: ./map.pgm
resolution: 0.050000
origin: [-10.0, -10.0, 0.0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

X4.launch:

<launch>
  <node name="ydlidar_lidar_publisher"  pkg="ydlidar_ros_driver"  type="ydlidar_ros_driver_node" output="screen" respawn="false" >
    <!-- string property -->
    <param name="port"         type="string" value="/dev/ydlidar"/>  
    <param name="frame_id" type="string" value="laser_frame"/>
    <param name="ignore_array"     type="string" value=""/>

    <!-- int property -->
    <param name="baudrate"         type="int" value="128000"/>  
    <!-- 0:TYPE_TOF, 1:TYPE_TRIANGLE, 2:TYPE_TOF_NET -->
    <param name="lidar_type"       type="int" value="1"/>  
    <!-- 0:YDLIDAR_TYPE_SERIAL, 1:YDLIDAR_TYPE_TCP -->
    <param name="device_type"         type="int" value="0"/>  
    <param name="sample_rate"         type="int" value="5"/>  
    <param name="abnormal_check_count"         type="int" value="4"/>  

    <!-- bool property -->
    <param name="resolution_fixed"    type="bool"   value="true"/>
    <param name="auto_reconnect"    type="bool"   value="true"/>
    <param name="reversion"    type="bool"   value="false"/>
    <param name="inverted"    type="bool"   value="true"/>
    <param name="isSingleChannel"    type="bool"   value="false"/>
    <param name="intensity"    type="bool"   value="false"/>
    <param name="support_motor_dtr"    type="bool"   value="true"/>
    <param name="invalid_range_is_inf"    type="bool"   value="false"/>
    <param name="point_cloud_preservative"    type="bool"   value="false"/>

    <!-- float property -->
    <param name="angle_min"    type="double" value="-180" />
    <param name="angle_max"    type="double" value="180" />
    <param name="range_min"    type="double" value="0.1" />
    <param name="range_max"    type="double" value="12.0" />
    <!-- frequency is invalid, External PWM control speed -->
    <param name="frequency"    type="double" value="10.0"/>
  </node>
</launch>

mapping.rviz (though I don't think this one matters too much):

Panels:
  - Class: rviz/Displays
    Help Height: 70
    Name: Displays
    Property Tree Widget:
      Expanded: ~
      Splitter Ratio: 0.5
    Tree Height: 454
Preferences:
  PromptSaveOnExit: true
Toolbars:
  toolButtonStyle: 2
Visualization Manager:
  Class: ""
  Displays:
    - Alpha: 0.699999988079071
      Class: rviz/Map
      Color Scheme: map
      Draw Behind: false
      Enabled: true
      Name: Map
      Topic: /map
      Unreliable: false
      Use Timestamp: false
      Value: true
    - Alpha: 0.5
      Cell Size: 1
      Class: rviz/Grid
      Color: 160; 160; 164
      Enabled: true
      Line Style:
        Line Width: 0.029999999329447746
        Value: Lines
      Name: Grid
      Normal Cell Count: 0
      Offset:
        X: 0
        Y: 0
        Z: 0
      Plane: XY
      Plane Cell Count: 10
      Reference Frame: <Fixed Frame>
      Value: true
    - Class: rviz/TF
      Enabled: true
      Filter (blacklist): ""
      Filter (whitelist): ""
      Frame Timeout: 15
      Frames:
        All Enabled: true
        base_footprint:
          Value: true
        laser_frame:
          Value: true
        map:
          Value: true
        odom:
          Value: true
      Marker Alpha: 1
      Marker Scale: 1
      Name: TF
      Show Arrows: true
      Show Axes: true
      Show Names: true
      Tree:
        base_footprint:
          laser_frame:
            {}
        map:
          odom:
            {}
        base_footprint:
          map:
            {}
        laser_frame:
          map:
            {}
      Update Interval: 0
      Value: true
  Enabled: true
  Global Options:
    Background Color: 48; 48; 48
    Default Light: true
    Fixed Frame: map
    Frame Rate: 30
  Name: root
  Tools:
    - Class: rviz/MoveCamera
  Value: true
  Views:
    Current:
      Class: rviz/Orbit
      Distance: 14.28176212310791
      Enable Stereo Rendering:
        Stereo Eye Separation: 0.05999999865889549
        Stereo Focal Distance: 1
        Swap Stereo Eyes: false
        Value: false
      Field of View: 0.7853981852531433
      Focal Point:
        X: 0
        Y: 0
        Z: 0
      Focal Shape Fixed Size: true
      Focal Shape Size: 0.05000000074505806
      Invert Z Axis: false
      Name: Current View
      Near Clip Distance: 0.009999999776482582
      Pitch: 0.6503981351852417
      Target Frame: <Fixed Frame>
      Yaw: 1.3453978300094604
    Saved: ~
Window Geometry:
  Displays:
    collapsed: false
  Height: 678
  Hide Left Dock: false
  Hide Right Dock: false
  QMainWindow State: 000000ff00000000fd0000000100000000000001560000024afc0200000001fb000000100044006900730070006c006100790073010000003e0000024a000000ca00ffffff000002c30000024a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
  Width: 1055
  X: 50
  Y: 50

Also, my TF tree varies between this: https://i.sstatic.net/7eNCa.png

this: https://i.sstatic.net/H9ehV.png

and this: https://i.sstatic.net/AqhXz.png

Can anyone please tell me what's wrong with my setup?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.