Occupancy grid not displaying in Rviz
I have a custom model which I created from my xacro files and I can move around using a teleop node. BUT I now want to map a virtual room and I added the AMCL and Gmapping nodes to my launch file but I notice a number of things in Rziv which are definately NOT right :
- The occupancy grid is not visible in Rviz so the room is not being mapped
- The /map topic has no data published into it
- 2D pose estimates in Rviz does not show particle filters
The following is my launch file:
<?xml version="1.0"?>
<launch>
<!-- PARAMETERS -->
<param name="robot_description" command="$(find xacro)/xacro $(find sweep_bot)/urdf/cleaner.xacro"/>
<!-- RVIZ -->
<node name='robot_state_publisher' pkg='robot_state_publisher' type='robot_state_publisher'/>
<node name='joint_state_publisher_gui' pkg='joint_state_publisher_gui' type='joint_state_publisher_gui'/>
<node name='rviz' pkg='rviz' type='rviz'/>
<!-- GAZEBO -->
<include file="$(find gazebo_ros)/launch/willowgarage_world.launch"></include>
<node name='sweeper_bot' pkg='gazebo_ros' type='spawn_model' args='-urdf -model sweeper -param robot_description'/>
<!--- Run AMCL -->
<include file="$(find amcl)/examples/amcl_omni.launch" />
<!-- GMAPPING -->
<node pkg="gmapping" type="slam_gmapping" name="gmapping" output="screen"></node>
<!-- Move Base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"/>
</launch>
My /tf and /odom topics show data is being published into them.
My terminal prints the following message repeatedly:
[ WARN] [1612313212.923369324, 5.005000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: source_frame base_link does not exist.. canTransform returned after 0.1 timeout was 0.1.
As shown in the image above, rviz shows the laser detects obstacles but the occupancy grid does not display.
My questions :
I know my /tf is generated from joints as defined in my urdf file(s) but is the data in the /odom topic also auto generated from the urdf ?
Can anyone give me any insight into why my /map topic is empty ?
*UPDATE *
Below is the tf :
First
AMCL
is for localization when you already know the map andgmapping
is for localization while creating the map so they shouldn't be used at the same time. You should try to create the map first using onlygmapping
and then useAMCL
with the map you've created.Now you might have something wrong with your TFs, can you show us your tf tree ? (Using
rosrun rqt_tf_tree rqt_tf_tree
)@Delb: Thanks for your input. I added my tf tree as requested.