Ask Your Question

Problem with navigation move_base [closed]

asked 2019-05-09 13:36:19 -0600

aefka gravatar image

updated 2019-05-12 16:45:18 -0600

Hello, I have a problem with navigation in rviz. I have a model P3dx, I want to set goal on the map and my model have to move to this point. I am newbie in ROS, and tutorials don't hel me :/

I use Ubuntu 18.04 and ROS Melodic

I describe, what I done.

  1. I done a map thanks gmapping. I have my map in .yaml and png.
  2. Run the map - rosrun map_server map_server src/PioneerModel/map.yaml
  3. I Open rviz and load the map on topic /map
  4. Open node move_base and amcl rosrun move_base move_base / rosrun amcl amcl

After open amcl I got a warning:

[ WARN] [1557425810.906842985, 3433.961000000]: No laser scan received (and thus no pose updates have been published) for 3433.961000 seconds.  Verify that data is being published on the /scan topic.

In rviz I can't load laserscan - error:

Transform [sender=unknown_publisher]
For frame [lms100]: No transform to fixed frame [map]. TF error: [Lookup would require extrapolation into the future. Requested time 4097.345000000 but the latest data is at time 2376.773000000, when looking up transform from frame [lms100] to frame [map]]

I tried to open my navigation node:

#include <ros/ros.h>
#include <move_base_msgs/MoveBaseAction.h>
#include <actionlib/client/simple_action_client.h>

typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;

int main(int argc, char **argv)
    ros::init(argc, argv, "navigation_goals");

    MoveBaseClient ac("move_base", true);

    while (!ac.waitForServer(ros::Duration(5.0)))
        ROS_INFO("Waiting for the move_base action server");

    move_base_msgs::MoveBaseGoal goal;

    goal.target_pose.header.frame_id = "map";
    goal.target_pose.header.stamp = ros::Time::now();

    goal.target_pose.pose.position.x = 9.8;
    goal.target_pose.pose.position.y = -16.8;
    goal.target_pose.pose.orientation.w = 1.0;
    ROS_INFO("Sending goal: base");

    if (ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
        ROS_INFO("You have arrived to the charging base");
        ROS_INFO("The base failed for some reason");
    return 0;

But I only have Waiting for the move_base action server

I know, that better is use launch file, but now, I want to move my model, next I will be "cleaning".
I Think that error is from load map.yaml on topic /map, but my knowledge about ROS is low and I can't handle with it :/

Thanks in advance!


I had wrong topic send to amcl, so now, amcl node is correct and I have answer:

[ INFO] [1557695476.070436657]: Requesting the map...   
[ INFO] [1557695476.079127924]: Received a 312 X 536 map @ 0.050 m/pix    
[ INFO] [1557695476.099264435]: Initializing likelihood field model; this can take some time on large maps...    
[ INFO] [1557695476.181160845]: Done initializing likelihood field model.

topic tf:

Type: tf2_msgs/TFMessage

 * /gazebo (http://pawel-X550LC:44491/)
 * /robot_state_publisher (http://pawel-X550LC:42323/)
 * /amcl (http://pawel-X550LC:34617/)
 * /slam_gmapping (http://pawel-X550LC:40877/)

 * /rviz_1557694756783817626 (http://pawel-X550LC:44329/)
 * /amcl (http://pawel-X550LC:34617/)
 * /slam_gmapping (http://pawel-X550LC:40877/)
 * /move_base_node (http://pawel-X550LC:44079/)
 * /rviz_1557695649952641928 (http://pawel-X550LC:45149/)


Type: sensor_msgs/LaserScan

 * /gazebo (http://pawel-X550LC:44491/)

 * /rostopic_11205_1557695085155 (http://pawel-X550LC:34697/)
 * /amcl (http://pawel-X550LC:34617/)
 * /slam_gmapping (http://pawel-X550LC:40877/)
 * /rviz_1557695649952641928 ...
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by aefka
close date 2019-06-03 02:10:59.837794


movebase action server will not start until movebase has received a laser scan (among other things). So you need to address the laser scan problem first.

billy gravatar image billy  ( 2019-05-09 21:25:10 -0600 )edit

scan (sensor_msgs/LaserScan)   
tf (tf/tfMessage)
initialpose (geometry_msgs/PoseWithCovarianceStamped)
map (nav_msgs/OccupancyGrid)

Check those topics and make sure they all have data being sent to them

Tyrel gravatar image Tyrel  ( 2019-05-09 23:59:12 -0600 )edit

Sory for late answear, but I don't have access to my project in the weekend. I edited my post, I understand that amcl node was looking for in wrong topic and I correct this.

Tyrel - I checked this topics, and they are subscribers.

Now, I have in rviz my static map( but have wrong orientaion), I can see laser scan, but when I run my navigation node, I still have Waiting for the move_base action server

aefka gravatar image aefka  ( 2019-05-12 16:31:15 -0600 )edit

anyone know how the quarterion/orientation in send goal navigation code works?

Usui gravatar image Usui  ( 2019-06-02 17:50:43 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-05-13 04:04:20 -0600

Veera Ragav gravatar image

Did you upload config files to the parameter server that has parameters required for move_base and amcl ?

edit flag offensive delete link more


I don't have idea about config files You are talking :/ Can you explain what files you are talking about or some tuts?

aefka gravatar image aefka  ( 2019-05-13 05:18:52 -0600 )edit
Veera Ragav gravatar image Veera Ragav  ( 2019-05-13 05:24:52 -0600 )edit

I have these types of files, but I have a few problems when I try to enable them. I think that's because I'm doing this project very chaotically. Is there anyone who can write to me, what should I do step by step to navigate my robot, e.g. from step when I have static map?

aefka gravatar image aefka  ( 2019-05-13 12:55:57 -0600 )edit

Please relax yourself and refer some youtube videos or some packages in Github.

Veera Ragav gravatar image Veera Ragav  ( 2019-05-13 23:37:59 -0600 )edit

I thought u need something like this:

your file is really long with a lot of lines

Usui gravatar image Usui  ( 2019-06-02 17:46:07 -0600 )edit

Yes, I read this, but now I have another problem: here

aefka gravatar image aefka  ( 2019-06-03 02:10:21 -0600 )edit

So you did create a move_base launch file that includes amcl and all the config files (cost map, global costmap, etc)?

Usui gravatar image Usui  ( 2019-06-03 19:22:43 -0600 )edit

Yes, I have this files. First I run amcl node with parameters, next move_base with config files (costmaps)

aefka gravatar image aefka  ( 2019-06-04 00:46:29 -0600 )edit

Question Tools



Asked: 2019-05-09 13:36:19 -0600

Seen: 280 times

Last updated: May 13 '19