ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Unable to create map with custom robot in a custom world

asked 2020-07-08 11:23:24 -0600

deco99 gravatar image

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
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-07-09 06:05:26 -0600

deco99 gravatar image

Actually I have found the problem. It seems even though the laser_scans were published it was not converted to the base frame. By writing my own tf::Transform and broadcasting it it problem was overcome.

http://wiki.ros.org/navigation/Tutorials/RobotSetup/TF

edit flag offensive delete link more

Comments

hello there, I am facing a similar problem: [ WARN] [1600177651.812953277]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_filter] rosconsole logger to DEBUG for more information.

If you don't mind can you share how you solved it..?

Gourav gravatar image Gourav  ( 2020-09-15 09:31:05 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-08 11:23:24 -0600

Seen: 339 times

Last updated: Jul 08 '20