ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Need help with basic navigation

asked 2017-08-11 17:45:58 -0600

Raisintoe gravatar image

updated 2017-08-13 01:50:40 -0600

I am trying to wrap my head around the navigation stack, and how to run it.

My objective is to get my simple, differential-drive robot to navigate using the nav stack. I want to set a simple goal in rviz, and let my robot navigate to that position.

My robot is publishing tf frames: "base_laser" to "base_link", and "base_link" to "odom". It also sends odometry data (I use stepper motors), and laser scan data from a sonar sensor. I have been following the ROS navigation tutorials to get this far.

My robot currently shows this rqt graph shown below:

Nodes only image description

Nodes and topics image description

Right now, it seems that everything is in order, except that I get the tf error "Timed out waiting for transform from base_link to map to become available before running costmap . . . "

isn't the move_base node in charge of publishing the "base_link" to "map" transform?

Screen shot of tf tree: image description

<launch>
  <master auto="start"/>

  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find tf_test)/myTestMap.pgm 0.02"/>


  <!--- Run AMCL -->
  <include file="$(find amcl)/examples/amcl_diff.launch" />

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find tf_test)/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find tf_test)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find tf_test)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find tf_test)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find tf_test)/base_local_planner_params.yaml" command="load" />
  </node>
</launch>


//[costmap_common_params.yaml]///////////////////////////////////////////////////////////
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-0.10, 0.10], [-0.10, -0.10], [0.10, -0.10], [0.10, 0.10]]
#robot_radius: ir_of_robot
inflation_radius: 0.15

observation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: base_laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}

//[local_costmap_params.yaml]////////////////////////////////////////////////////////////
local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 10.0
  publish_frequency: 10.0
  static_map: false
  rolling_window: true
  width: 2.0
  height: 2.0
  resolution: 0.02

//[global_costmap_params.yaml]///////////////////////////////////////////////////////////
global_costmap:
  global_frame: /map
  robot_base_frame: base_link
  update_frequency: 0.5
  static_map: true

//[base_local_planner_params.yaml]///////////////////////////////////////////////////////
TrajectoryPlannerROS:
  max_vel_x: 0.1409946783
  min_vel_x: 0.0007049734
  max_vel_theta: 2.311388169
  min_in_place_vel_theta: 0.01155694

  acc_lim_theta: 2.311388169
  acc_lim_x: 0.1409946783
  acc_lim_y: 0

  holonomic_robot: true

amcl_diff.launch:

<launch>
<node pkg="amcl" type="amcl" name="amcl" output="screen">
  <!-- Publish scans from best pose at a max of 10 Hz -->
  <param name="odom_model_type" value="diff"/>
  <param name="odom_alpha5" value="0.1"/>
  <param name="transform_tolerance" value="0.2" />
  <param name="gui_publish_rate" value="10.0"/>
  <param name="laser_max_beams" value="30"/>
  <param name="min_particles" value="500"/>
  <param name="max_particles" value="5000"/>
  <param name="kld_err" value="0.05"/>
  <param name="kld_z" value="0.99"/>
  <param name="odom_alpha1" value="0.2"/>
  <param name="odom_alpha2" value="0.2"/>
  <!-- translation std dev, m -->
  <param name="odom_alpha3" value="0.8"/>
  <param name="odom_alpha4" value="0.2"/>
  <param name="laser_z_hit" value="0.5"/>
  <param name="laser_z_short" value="0.05"/>
  <param name="laser_z_max" value="0.05"/>
  <param name="laser_z_rand" value="0.5"/>
  <param name="laser_sigma_hit" value="0.2"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_model_type" value="likelihood_field"/>
  <!-- <param name="laser_model_type" value ...
(more)
edit retag flag offensive close merge delete

Comments

Can you post screenshot of your tf tree?

jayess gravatar image jayess  ( 2017-08-11 19:48:13 -0600 )edit

Can you include the parameter files the Navigation stack? Please also include information from the terminal that is running the Nav Stack. I'm guessing that AMCL isn't running due to perhaps a slow update of laser scan. How often do you publish a new laser scan?

billy gravatar image billy  ( 2017-08-11 20:31:39 -0600 )edit

It might be because of a slow laser scan update. I get an output warning, telling me that it hasn't received scan messages, but scan messages are sent about every second. Odom also is only sent while the robot is moving. I have sent cmd_vel messages to my robot to force it to move.

Raisintoe gravatar image Raisintoe  ( 2017-08-12 02:17:43 -0600 )edit

Raisintoe gravatar image Raisintoe  ( 2017-08-12 02:35:30 -0600 )edit

Also, I get:

Raisintoe gravatar image Raisintoe  ( 2017-08-12 03:03:23 -0600 )edit

I get this from roswtf: WARNING The following node subscriptions are unconnected: * /amcl: * /tf_static * /move_base: * /tf_static * /rviz_1502523805001460332: * /tf_static

Raisintoe gravatar image Raisintoe  ( 2017-08-12 03:06:33 -0600 )edit
1

@Raisintoe: please always just edit your original question if you have new info, want to add screenshots or logging output. The comments are not suited for that.

And please also use the Preformatted Text button (the one with 101010 on it) to format console copy-pastes, or xml or yaml. Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2017-08-12 03:08:56 -0600 )edit
1

I see no scan message in the rqt-graph, do you have a laser scanner or something simulating (e.g. 3d camera) one?

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-08-12 11:12:28 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-08-12 13:05:56 -0600

StevenCoral gravatar image

updated 2017-08-13 11:55:46 -0600

Just to make things clear, move_base is "only" in charge of taking all the info it can get to generate a "cmd_vel" topic for the robot to follow. it is the one utilizing the parameter yamls and operating the planners, costmaps, etc.

The amcl node is the one publishing the Tf between /odom and /map, and it is the one giving you the trouble. It will not publish the needed info nor tell you what's missing until you get it all. I've had similar trouble and I can possibly help if you post the amcl launch-file (amcl_diff) content and a rostopic list while everything is running (in addition to the thorough info you've already posted). As a side-note, if you have a differential drive robot, you might want to turn false the "holonomic" part in the local planner, because it cannot move sideways. I also used dwa_local_planner, don't really know whats the difference except for the amount of parameters that need tuning and what I could google.

EDIT: Well, I'm actually not sure now with the extra details. usually its about an inconsistency between some topics and/or link names. I would suggest 2 things: 1. when all is running, type rostopic echo scan and check that you get incoming data. If not, then the problem is in the publishing. 2. you seem to be missing parameters, such as: and perhaps a few more... I'm just not sure what would be the effect in case you haven't added those - I guess some defaults should appear.

edit flag offensive delete link more

Comments

Thanks, I added the information that you asked for. Also, I have wondered if I should be using dwa_local_planner, but am still learning what that is, and how to use it.

Raisintoe gravatar image Raisintoe  ( 2017-08-12 15:03:23 -0600 )edit

Upon trying to run dwa_local_planner dwa_planner, it appears that my navigation stack is not fully built. I have had trouble building my nav_stack once installed. Isn't there a straightforward tutorial for installing the nav_stack? I swear I found one once, but I can't find it again.

Raisintoe gravatar image Raisintoe  ( 2017-08-12 15:23:27 -0600 )edit

Regarding your question about straightforward tutorials, I started here (sections 3 and 6.1) and went through all subpages. It wasn't quick, but it was pretty straightforward. I was learning Ubuntu at the same time so it took a long time. I had many questions though.

http://wiki.ros.org/navigation

billy gravatar image billy  ( 2017-08-12 21:38:36 -0600 )edit

I have tried following that tutorial, but when it comes to installing the nav stack, I get a boat-load of errors when I try building it from a github clone. Isn't there an alternative way to install the nav stack, and other ros packages? Cloning from github just isn't a happy time for me.

Raisintoe gravatar image Raisintoe  ( 2017-08-12 23:50:34 -0600 )edit

How did you install ROS? Did you not do the full desktop install? Also, are you compiling the correct branch for your version of ROS?

jayess gravatar image jayess  ( 2017-08-13 02:06:51 -0600 )edit

I did the full ROS kinetic desktop installation. It did not include the nav stack; I installed that later. I don't know if all of the packages where built properly when I ran catkin_make.

Raisintoe gravatar image Raisintoe  ( 2017-08-13 03:10:43 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2017-08-11 17:45:58 -0600

Seen: 1,891 times

Last updated: Aug 13 '17