Unable to create map with custom robot in a custom world
I have setup a differential drive robot with a Hokyo sensor. I can load it in to gazebo and also visualize it in rviz. All the data /scan /robot model can be visualized in rviz. However when i try to run gmapping it provides no result as its waiting for scans to be read. However the base_footprint -> base_link
Broadcaster: /robot_state_publisher Average rate: 10000.000 Hz Most recent transform: 0.000 ( 4200.859 sec old) Buffer length: 0.000 sec
base_link->laserscan has the following in tf tree
Broadcaster: /robot_state_publisher Average rate: 10000.000 Hz Most recent transform: 0.000 ( 4200.859 sec old) Buffer length: 0.000 sec
I checked the tf frame tree, it seems the robot state publisher is not publishing the laser_scan correctly. However I can visualize the data in rviz. and other odom based transformations seems ok.
the gmapping setup
<?xml version="1.0"?>
<launch>
<node name="slam_gmapping" pkg="gmapping" type="slam_gmapping">
<param name="pub_map_odom_transform" value="true"/>
<remap from="/scan" to="/laser_scan"/>
<param name="base_frame" value="base_footprint"/>
<param name="odom_frame" value="odom"/>
<param name="map_frame" value="map"/>
</node>
</launch>
the gazebo launch
<launch>
<!--Robot Description from URDF-->
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find mybot_description)/urdf/mybodbot.xacro"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
<!--RViz-->
<node name="rviz" pkg="rviz" type="rviz" required="true"/>
<!--Gazebo empty world launch file-->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="debug" value="false" />
<arg name="gui" value="true" />
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="headless" value="false"/>
<arg name="verbose" value="true"/>
<arg name="world_name" value="$(find kbot_description)/maps/room.world"/>
</include>
<!--Gazebo Simulator-->
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model kbot" output="screen"/>
</launch>
PARAMETERS * /rosdistro: melodic * /rosversion: 1.14.3 * /slam_gmapping/base_frame: base_footprint * /slam_gmapping/map_frame: map * /slam_gmapping/odom_frame: odom
NODES / slam_gmapping (gmapping/slam_gmapping)
ROS_MASTER_URI=http://localhost:11311
process[slam_gmapping-1]: started with pid [1706]
[ WARN] [1594211981.650487744]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_filter] rosconsole logger to DEBUG for more information.
[ WARN] [1594211981.654699708]: MessageFilter [target=odom ]: The majority of dropped messages were due to messages growing older than the TF cache time. The last message's timestamp was: 214.214000, and the last frame_id was: sensor_laser
^C[slam_gmapping-1] killing on exit
virtual GMapping::GridSlamProcessor::~GridSlamProcessor(): Start
virtual GMapping::GridSlamProcessor::~GridSlamProcessor(): Deleting tree
shutting down processing monitor...
... shutting down processing monitor complete