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
Nodes and topics
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:
<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="beam"/> -->
<param name="laser_likelihood_max_dist" value="2.0"/>
<param name="update_min_d" value="0.2"/>
<param name="update_min_a" value="0.5"/>
<param name="odom_frame_id" value="odom"/>
<param name="resample_interval" value="1"/>
<param name="transform_tolerance" value="0.1"/>
<param name="recovery_alpha_slow" value="0.0"/>
<param name="recovery_alpha_fast" value="0.0"/>
</node>
</launch>
rostopic list when everything is running:
derek@derek-G74Sx:~$ rostopic list
/amcl/parameter_descriptions
/amcl/parameter_updates
/amcl_pose
/cmd_vel
/initialpose
/map
/map_metadata
/move_base/current_goal
/move_base/goal
/move_base_simple/goal
/odom
/particlecloud
/rosout
/rosout_agg
/scan
/tf
/tf_static
move_base and amcl errors:
[ WARN] [1502606686.483551591]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: . canTransform returned after 0.102372 timeout was 0.1.
[ WARN] [1502606687.766040187]: No laser scan received (and thus no pose updates have been published) for 1502606687.765959 seconds. Verify that data is being published on the /scan topic.
[ WARN] [1502606687.766627339]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.amcl.message_notifier] rosconsole logger to DEBUG for more information.
Originally posted by Raisintoe on ROS Answers with karma: 51 on 2017-08-11
Post score: 0
Original comments
Comment by jayess on 2017-08-11:
Can you post screenshot of your tf tree?
Comment by billy on 2017-08-11:
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?
Comment by Raisintoe on 2017-08-12:
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.
Comment by Raisintoe on 2017-08-12:
[ WARN]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: . canTransform returned after 0.100641 timeout was 0.1.
[ WARN]: No laser scan received (and thus no pose updates have been published) for . . . verify that data is being published...
Comment by Raisintoe on 2017-08-12:
Also, I get:
[ WARN] [1502524814.408269556]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.amcl.message_notifier] rosconsole logger to DEBUG for more information.
Comment by Raisintoe on 2017-08-12:
I get this from roswtf:
WARNING The following node subscriptions are unconnected:
- /amcl:
- /tf_static
- /move_base:
- /tf_static
- /rviz_1502523805001460332:
- /tf_static
Comment by gvdhoorn on 2017-08-12:
@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.
Comment by Humpelstilzchen on 2017-08-12:
I see no scan message in the rqt-graph, do you have a laser scanner or something simulating (e.g. 3d camera) one?
Comment by billy on 2017-08-12:
I've seen where AMCL/MoveBase will set VEL_CMD to 0,0 if there is a delay(500ms) in laser scan. If this happens and your robot then also stops providing ODOM, you'll have two issues compounded. Can you modify the SW to issue both more frequently, even if you're just re-issuing same data twice.
Comment by Raisintoe on 2017-08-13:
I set up fake scan and odom publishers and tf_broadcasters that published at 10Hz, it didn't change anything.
Comment by Humpelstilzchen on 2017-08-13:
Feeding scans from sonar to amcl defeats its purpose. Because of the high field of view of the sensor I don't think amcl will be able to do anything useful.
Comment by Humpelstilzchen on 2017-08-13:
I recommend to 1. drop the amcl node, 2. Use odom in local and global costmap as global_frame and switch the obstacle layer against the the range layer.
Comment by Raisintoe on 2017-08-13:
I know that the sonar sensor will not work well, I am just using it to learn the ROS system. I have done as you suggested though, and dropped the amcl node . . .etc, and now I only get the error " . . . Dropped 100.00% of messages so far . . ."
Comment by Humpelstilzchen on 2017-08-13:
To learn: Get a simulation running, Turtlebot should do. So you get a working system you can compare yours to. About the error: AMCLs job is to provide the map->odom tf. Without amcl (or e.g. gmapping...) there is no map frame so you use odom as global frame everywhere (rviz, costmap,...)
Comment by Raisintoe on 2017-08-13:
Oooh! Something a little exciting happened, my robot will spin around, trying to locate itself when I set a goal in rviz. This might be all it will ever do with a sonar sensor, huh? I will try the Turtlebot_simulator as you suggest.
Comment by Raisintoe on 2017-08-14:
I am running ROS kinetic, do I need to install an earlier ROS distribution in order to run the turtlesim? I am having trouble installing it as usual. Maybe I am not finding decent instructions on installation.
Comment by jayess on 2017-08-14:
What instructions were you using? The installation instructions in the wiki are pretty comprehensive.