I am working now with the real robot which is turtlebot3 burger. As shown in the rqt_graph below, I've run my custom package which is Im adding the ann3_publisher
node to be published to the gmapping
package and run in the real robot.
But when I move the robot, it seems that the robot in the rviz application is not moving at all. The map and the robot is there as shown in the figure below but the robot is not moving:
I try to run rosrun rviz rviz
on the terminal and add one by one, there is a warning message appear as shown in the figure below
When I run the common package roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
it works and I dont have this problem. May I know why and how to solve this?
This is my custom turtlebot3_slam.launch file to subscribe the /scan_new3 topic.
<launch>
<!-- Arguments -->
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="configuration_basename" default="turtlebot3_lds_2d.lua"/>
<arg name="set_base_frame" default="base_footprint"/>
<arg name="set_odom_frame" default="odom"/>
<arg name="set_map_frame" default="map"/>
<arg name="open_rviz" default="true"/>
<!-- TurtleBot3 -->
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
<arg name="model" value="$(arg model)" />
</include>
<!-- Gmapping -->
<node pkg="gmapping" type="slam_gmapping" name="turtlebot3_slam_gmapping" output="screen">
<param name="base_frame" value="$(arg set_base_frame)"/>
<param name="odom_frame" value="$(arg set_odom_frame)"/>
<param name="map_frame" value="$(arg set_map_frame)"/>
<rosparam command="load" file="$(find turtlebot3_slam)/config/gmapping_params.yaml" />
<remap from="/scan" to="/scan_new3"/>
</node>
<!-- rviz -->
<group if="$(arg open_rviz)">
<node pkg="rviz" type="rviz" name="rviz" required="true"
args="-d $(find turtlebot3_slam)/rviz/turtlebot3_scan3.rviz"/>
</group>
</launch>
Below is the tf_tree of the real robot. One more information is when I run in gazebo simulation. it works and the robot moves. But when I run in real world, the robot doesnt move in rviz application.
I have got the answer. It is because the sensor of the robot reading that there is obstacle around it but there isn't. You can see on the second figure, the sensor detect the walls in circle (green color) and build the walls around it. So the robot cannot move in rviz. When I eliminate that reading, the robot can move as usual in rviz