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

map_server can't load map

asked 2018-05-22 07:03:24 -0600

kenhero gravatar image

updated 2018-05-23 10:37:31 -0600

I have this launch file in order to use nagigation stack. I follower a tutorial on robotigniteacademy path planning but he used husky robots to simulate path planning on gazebo,i want to do the same thing with turtlebot3 on gazebo simulation but there isn't on turtlebot3 manual the chance to simulate path planning (only if you have real robot)

<launch>

 <!-- Turtlebot3 -->
 <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch" />


 <!-- Run the map server -->
 <arg name="map_file" default="$(find my_move_base_launcher)/maps/map.yaml"/>

 <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />


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

 <!--- Run Move Base -->
 <include file="$(find my_move_base_launcher)/launch/turtlebot3_navigation_path_planning_2.launch" />

</launch>

When i launch this file i have this error :

NODES

/ amcl (amcl/amcl) map_server (map_server/map_server) move_base (move_base/move_base) robot_state_publisher (robot_state_publisher/robot_state_publisher)

ROS_MASTER_URI=http://localhost:11311

process[robot_state_publisher-1]: started with pid [25865]
process[map_server-2]: started with pid [25866]
process[amcl-3]: started with pid [25868]
process[move_base-4]: started with pid [25880]
[ INFO] [1526983048.924109442]: Subscribed to map topic.
[map_server-2] process has died [pid 25866, exit code 255, cmd /opt/ros/kinetic/lib/map_server/map_server /home/bera/catkin_ws/src/my_move_base_launcher/maps/map.yaml __name:=map_server __log:=/home/bera/.ros/log/17326908-5da3-11e8-afab-9c2a7033abfa/map_server-2.log].
log file: /home/bera/.ros/log/17326908-5da3-11e8-afab-9c2a7033abfa/map_server-2*.log
[ WARN] [1526983054.004897998]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.1015 timeout was 0.1.

Obv i have a maps folder with map.pgm and map.yaml files and inside yaml file i have to right path of the image file. Suggestion?

------------EDIT:UPDATE --------------

this is my amcl.launch.xml that i call inside turtlebot3_navigation_path_planning_1.launch

<launch> <arg name="scan_topic" default="scan"/> <arg name="use_map_topic" default="true"/> <arg name="initial_pose_x" default="0.0"/> <arg name="initial_pose_y" default="0.0"/> <arg name="initial_pose_a" default="0.0"/>

<node pkg="amcl" type="amcl" name="amcl">

<param name="use_map_topic" value="$(arg use_map_topic)"/>

<param name="min_particles"             value="500"/>
<param name="max_particles"             value="3000"/>
<param name="kld_err"                   value="0.02"/>
<param name="kld_z" value="0.99"/>
<param name="update_min_d"              value="0.20"/>
<param name="update_min_a"              value="0.20"/>
<param name="resample_interval"         value="1"/>
<param name="transform_tolerance"       value="0.5"/>
<param name="recovery_alpha_slow"       value="0.00"/>
<param name="recovery_alpha_fast"       value="0.00"/>
<param name="initial_pose_x"            value="$(arg initial_pose_x)"/>
<param name="initial_pose_y"            value="$(arg initial_pose_y)"/>
<param name="initial_pose_a"            value="$(arg initial_pose_a)"/>
<param name="gui_publish_rate"          value="50.0"/>

<remap from="scan"                      to="$(arg scan_topic)"/>
<param name="laser_max_range"           value="3.5"/>
<param name="laser_max_beams"           value="180"/>
<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_likelihood_max_dist" value="2.0"/>
<param name="laser_model_type"          value="likelihood_field"/>

<param name="odom_model_type"           value="diff"/>
<param name="odom_alpha1"               value="0.1"/>
<param name="odom_alpha2"               value="0.1"/>
<param name="odom_alpha3"               value="0.1 ...
(more)
edit retag flag offensive close merge delete

Comments

Just to let you know, as a subscriber of Robot Ignite Academy, you can do the course on programming T3 which explains how to do navigation: http://www.theconstructsim.com/constr...

R. Tellez gravatar image R. Tellez  ( 2018-05-22 13:14:22 -0600 )edit

link is corrupted. Btw i just followed the navigation course in the Academy and i just want to simulate path planning with turtlebot3 because it's the robot that i use to program in C++

kenhero gravatar image kenhero  ( 2018-05-22 13:58:34 -0600 )edit
R. Tellez gravatar image R. Tellez  ( 2018-05-22 14:08:58 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-05-25 03:12:09 -0600

kenhero gravatar image

updated 2018-05-25 03:18:28 -0600

Ok I solved. I made several errors : 1)I didn't generate map with gmapping node 2)Error of localization , in the amcl.launch.xml file there were an error about initial pose of turtlebot3 , it was different from the initial coordinates of turtlebot3_house.launch coordinates,so local map wasn't around my turtlebot so 3)I didn't kill gmapping node before start simulation so i wasn't able to see the entire map on rviz

I'm using relaxed A* algorithm to find the best map (plugin found on github) There are 2 issues now,with this algorithm 1)When turtlebot3 is close to goal it starts to call rotate behaviour recovery (basically turtlebot start to rotate in loop) 2)the second issue is that it's not able to find a path in gazebo house world,probably because map is too big. It works only for short distances. It says : " The planner failed to find a path ,choose other goal position" or "Not valid start or goal" "Clearing costap to unstuck robot(0.100000m) "Rotate recovery behavior started" Is there a way to set some parameters or a way to test C++ code? I'd like to discover if this package has some type of limitations, like memory or staff like that Thanks

edit flag offensive delete link more
0

answered 2018-05-22 07:29:01 -0600

updated 2018-05-22 07:29:21 -0600

Make sure that the you have the "map.yaml" and "map.pgm" inside the "maps" folder, which in turn is inside the "turtlebot3_navigation" package.

If this is correct, open the "map.yaml" and make sure that you have the following line pointing correctly to the right image file:

image: map.pgm
edit flag offensive delete link more

Comments

I don't have "map.pgm" but I have the entire path of map.pgm file. Is it wrong?

kenhero gravatar image kenhero  ( 2018-05-22 08:09:44 -0600 )edit

Both ways are correct if the 2 files are inside the same folder.

However, your map_server is trying to open this file: /home/bera/catkin_ws/src/my_move_base_launcher/maps/map.yaml

but the yaml should be inside the "turtlebot3_navigation" package. Are you launching the correct launch file??

DavidPortugal gravatar image DavidPortugal  ( 2018-05-22 08:24:58 -0600 )edit

I'm so sorry,i edited now the post because i paste the wrong launch file. Btw i have in my package that folder with my launch files and maps folder with map.pgm and map.yaml files. The map basically is the turtlebot3 house that i created with multislam tutorial of turtlebot3

kenhero gravatar image kenhero  ( 2018-05-22 13:01:53 -0600 )edit

Another doubt is that basically i don't understand if it's a map_server issue or it's a AMCL issue.

kenhero gravatar image kenhero  ( 2018-05-22 13:05:18 -0600 )edit

Your map_server is crashing when you start it through the launch file. You can easily check whether map_server is working by entering a "roscore" in a terminal, and then open another terminal inside the "maps" folder, and run: "rosrun map_server map_server map.yaml".

DavidPortugal gravatar image DavidPortugal  ( 2018-05-22 15:49:02 -0600 )edit

If the map_server crashes, you likely have an error in your "map.yaml" configuration file. Please show us the content of the file.

DavidPortugal gravatar image DavidPortugal  ( 2018-05-22 15:49:55 -0600 )edit

i tried,no output ,map doesn't crash but if i run : rospitc /list i only have: 1)rosout 2)rosout_agg

kenhero gravatar image kenhero  ( 2018-05-22 19:29:26 -0600 )edit

what do you mean by "no output"? what happens after the "rosrun map_server map_server map.yaml" command? Can you show us the "map.yaml" file?

DavidPortugal gravatar image DavidPortugal  ( 2018-05-23 16:59:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-22 07:03:24 -0600

Seen: 5,627 times

Last updated: May 25 '18