[Fixed] Gmapping and tf
Hi all
My robot in rviz has some problems when i run gmapping launch file. the robot model and it's wheel got to take apart. How can i fix it. Sorry for my bad english. Thanks first.
Here is the image
My launch file
<?xml version="1.0"?>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
<param name="publish_frequency" type="double" value="5.0" />
</node>
<!--<node name="rviz" pkg="rviz" type="rviz" args="-d $(find urdf_tutorial)/urdf.rviz" />-->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find urdf_tutorial)/urdf.rviz" required="true" />
<!--Mapping-->
<node pkg="sicktoolbox_wrapper" type="sicklms" name="sicklms" >
<param name="port" value="/dev/ttyUSB0" /> <!--ttyUSB*-->
<param name="baud" value="38400" />
<param name="angle" value="180" />
<param name="resolution" value="1.0" />
<param name="units" value="mm" />
</node>
<!--TF-->
<node pkg="tf" type="static_transform_publisher" name="map_2_odom" args="0 0 0 0 0 0 /map /odom 100"/>
<node pkg="tf" type="static_transform_publisher" name="odom_2_base_link" args="0 0 0 0 0 0 /odom /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_2_laser_link" args="0.256 0 0.0925 0 0 0 1 /base_link /laser 100"/>
<arg name="scan_topic" default="scan" />
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
<param name="base_frame" value="/base_link" />
<param name="odom_frame" value="/odom" />
<param name="map_update_interval" value="5.0"/>
<param name="maxUrange" value="6.0"/>
<param name="maxRange" 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.01"/>
<param name="srt" value="0.02"/>
<param name="str" value="0.01"/>
<param name="stt" value="0.02"/>
<param name="linearUpdate" value="0.5"/>
<param name="angularUpdate" value="0.436"/>
<param name="temporalUpdate" value="1"/>
<param name="resampleThreshold" value="0.5"/>
<param name="particles" value="50"/> <!--xxxxxxxxxxx-->
<param name="xmin" value="-100.0"/>
<param name="ymin" value="-100.0"/>
<param name="xmax" value="100.0"/>
<param name="ymax" value="100.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"/>
<param name="transform_publish_period" value="0.05"/>
<remap from="scan" to="$(arg scan_topic)"/>
</node>
My urdf model
<?xml version="1.0"?>
<link name="base_link" >
<visual>
<geometry>
<box size="0.642 0.81 0.7"/> <!--kich thuoc robot-->
</geometry>
<origin rpy="0 0 0" xyz="-0.158 0 0.35"/> <!--vi tri so voi base link-->
<material name="magenta"> <!--blue 0 0 255 0.6-->
<color rgba="192 192 192 0.3"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.642 0.81 0.7"/>
</geometry>
</collision>
<inertial>
<mass value="100"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<link name="laser_link" >
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.156 0.155 0.185"/> <!--kich thuoc laser-->
</geometry>
<material name="blue">
<color rgba="0 0 1 0.5"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.156 0.155 0.185"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<link name="LW" >
<visual>
<origin xyz="0 0 0" rpy="1.57 0 0" />
<geometry>
<cylinder length="0.1" radius="0.1225"/> <!--kich thuoc banh xe-->
</geometry>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.1" radius="0.1225"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<link name="RW" >
<visual>
<origin xyz="0 0 0" rpy="-1.57 0 0" />
<geometry>
<cylinder length="0.1" radius="0.1225"/>
</geometry>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.1" radius="0.1225"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<joint name="base_link_laser_link" type="fixed">
<origin xyz="0.256 0 0.0925" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="laser"/>
</joint>
<joint name="base_link_RW" type="continuous">
<origin xyz="0 -0.275 0" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
<parent link="base_link"/>
<child link="RW"/>
</joint>
<joint name="base_link_LW" type="continuous">
<origin xyz="0 0.275 0" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
<parent link="base_link"/>
<child link="LW"/>
</joint>
Asked by NguyenPham on 2016-10-28 22:46:51 UTC
Comments
Can you edit your question to add more details about what you want and compare to what you're seeing different? Also please try provide more context so we might be able to reproduce your problem.
Asked by tfoote on 2016-10-29 18:22:29 UTC
Thankyou tfoote I want to use navigation stack for my real robot. But first, i want to create a map using gmapping. I have a real robot and urdf model of it. I created a launch file as above and run along with urdf model. Here the video of my robot.
Asked by NguyenPham on 2016-10-30 22:39:16 UTC
https://www.youtube.com/watch?v=0s2e9j4nBsA
Asked by NguyenPham on 2016-10-30 22:41:10 UTC
https://www.youtube.com/watch?v=c_MYm63NsPI&feature=youtu.be
Asked by NguyenPham on 2016-10-31 01:35:14 UTC
Perhaps you could post a picture of your tf tree by running rosrun tf view_frames. If I had to guess I would say that use of static_transform_publisher might be causing the issue. The tf from /odom to /base_link should come from an odometry source like wheel encoders.
Asked by shoemakerlevy9 on 2016-11-02 21:25:32 UTC
Thanks shoemakerlevy9. I fixed the problem. Just remove the line " " and the robot work fine. I think the problem come from my odometry node. It's also publish the tf of odom and baselink
Asked by NguyenPham on 2016-11-02 21:57:23 UTC