1

I recently run into following problem. While trying create a map from simulation data using slam_toolbox, my laserScan data are shifting based on robot movement instead of him. Robot stay in 0,0 position despite odometry changing.

Im sending data from simulator over UDP socket to ROS nodes that receive them and publish them to specific topics, these include /odom (receiver_node) and /scan (receiver_node2).

My launch file:

<launch>
    <arg name="open_rviz" default="true" />

    <node pkg="slam_toolbox" type="sync_slam_toolbox_node" name="slam_toolbox" output="screen">
        <rosparam command="load" file="$(find analyzer_lab)/config/mapper_params_online_sync.yaml" />
    </node>

    <node pkg="analyzer_lab" type="receiver_node" name="receiver_node" output="screen"/>

    <node pkg="analyzer_lab" type="receiver_node2" name="receiver_node2" output="screen"/>

    <param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_waffle.urdf.xacro laser_visual:=true" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" />

    <node pkg="dynamic_transform_publisher" type="dynamic_transform_publisher" name="dynamic_tf_pub" >
        <rosparam>
            frame_id: odom
            child_frame_id: base_footprint
            x: 0.0
            y: 0.0
            z: 0.0
            roll: 0.0
            pitch: 0.0
            yaw: 0.0
            use_rpy : True
        </rosparam>
    </node>

    <node pkg="dynamic_transform_publisher" type="dynamic_transform_publisher" name="dynamic_tf_pub1" >
        <rosparam>
            frame_id: base_link
            child_frame_id: wheel_left_link
            x: 0.0
            y: 0.115
            z: 0.0
            roll: 0.0
            pitch: 0.0
            yaw: 0.0
            use_rpy : True
        </rosparam>
    </node>

    <node pkg="dynamic_transform_publisher" type="dynamic_transform_publisher" name="dynamic_tf_pub2" >
        <rosparam>
            frame_id: base_link
            child_frame_id: wheel_right_link
            x: 0.0
            y: -0.115
            z: 0.0
            roll: 0.0
            pitch: 0.0
            yaw: 0.0
            use_rpy : True
        </rosparam>
    </node>


    <!-- rviz -->
    <group if="$(arg open_rviz)">
      <node pkg="rviz" type="rviz" name="rviz" required="true"
        args="-d $(find analyzer_lab)/rviz/gmapping.rviz" />
    </group>
</launch>

Frames and transformations: enter image description here

Nodes and topics: enter image description here

Problem looks as follows: enter image description here

After turning robot slightly left-> enter image description here

Please help!

I tried reversing transformations, adding specific dynamic_transformers instead of robot_state_publisher and simulation joint_states data, as seen in frames picture.

0 Answers0