Ask Your Question

Model in gazebo goes forward crashing into the wall while model display in rviz goes backwards - Hector autonomous nav

asked 2016-08-14 18:16:30 -0500

patrchri gravatar image

updated 2016-08-17 11:47:03 -0500


I am new to navigation and ROS generally and I am trying to use hector_slam and hector_navigation metapackages to implement autonomous navigation to my 3 wheel robot with a lidar on it.

I did the following:

  • Spawn my robot in a maze that I built with boxes in gazebo.

  • Roslaunch labrob_gazebo state_publisher.launch

  • Rosrun tf_base_link_to_map_broadcaster_node --> I wrote this node, could be the problem be here ? This tf is being used from the hector_exploration_node.

  • Roslaunch hector_mapping mapping_default.launch --> Got correct map data from teleoperating the robot in there.

  • Roslaunch hector_exploration_node exploration_planner.launch

  • Rosrun hector_exploration_controller simple_exploration_controller

  • Rviz --> I added to view the path topic from the exploration node, the /slam_out_pose topic from the hector_mapping_node ,the polygon from the robot's footprint from the exploration node, the global costmap from the exploration node and the robot model.


  • The path generated at the beginning was correct, but the robot didn't follow it. The robot model in rviz went the other direction, while the actual robot in gazebo moved forward entirely wrong.

  • the /slam_out_pose was correct and
    according to what the robot's pose
    was in gazebo.

  • The footprint's polygon marker at the start was where the robot was in gazebo, but after the simulation started it moved in the opposite direction of what the robot was doing in gazebo.

  • The global costmap was correct.

  • The robot model in rviz followed the footprint's polygon, while the robot in the simulation was going in another direction.

  • Because of that lack of coordination between the robot in gazebo and the polygon marker, the robot in gazebo moved forward and crashed into a wall, while in rviz the robot model following the robot's footprint moved backwards, got behind a wall (that it was identified in the costmap) and stopped.

  • I let the simulation to flow a bit more to see what happened. The robot in gazebo pushed a box/wall which was identified by the lidar and kept moving in various directions. Once, the polygon and the robot in gazebo met, but the bad navigation continued because they separated again.

I cannot find the reason why this happens. In case you need more information or a video to understand the issue please tell me to re-edit my post.

Thank you for answer and your time in advance,


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-08-17 15:09:33 -0500

patrchri gravatar image

updated 2016-08-17 15:12:52 -0500

I fixed the issue the robot's footprint polygon moving in another direction by changing my tf_base_link_to_map_broadcaster_node's code. Now the coordination is better. Some minuses were missing in SetOrigin and SetRotation functions. The problem with the navigation still remains, but the robot does better movements than before. I will post another question with the new issue.

edit flag offensive delete link more

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


Asked: 2016-08-14 18:16:30 -0500

Seen: 556 times

Last updated: Aug 17 '16