No map generated with nav2d simulation using turtlebot3 [closed]

asked 2018-04-10 05:15:02 -0500

ryuzaki gravatar image

Hi, i'm new to ROS and i'm trying to use the nav2d package for simulations of Turtlebot3 using Gazebo instead of Stage. The problem is that when i launch the simulation, no map is generated and because of that, the exploration and mapping(of course) don't work. I've tried to control topics and as one can guess, no messages are published on /map topic. The fact is that i haven't touched anything, except adding Turtlebot3 model and Gazebo to launch file. I attach my launch file. `<launch>

<!-- Some general parameters -->
<!-- <param name="use_sim_time" value="true" /-->
<rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

<!-- Start Gazebo simulator with a given environment -->
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="x_pos" default="-3.0"/>
<arg name="y_pos" default="1.0"/>
<arg name="z_pos" default="0.0"/>

<!-- node pkg="tf" type="static_transform_publisher" name="camera_tf" args="-1.95 -0.55 2.0 -1.58 0 -1.58 /odom /camera_link 100"/ -->

<include file="$(find gazebo_ros)/launch/empty_world.launch">
  <arg name="world_name" value="$(find turtlebot3_gazebo)/worlds/turtlebot3_house.world"/>
  <arg name="paused" value="false"/>
  <arg name="use_sim_time" value="true"/>
  <arg name="gui" value="true"/>
  <arg name="headless" value="false"/>
  <arg name="debug" value="false"/>
</include>

<param name="robot_description" command="$(find xacro)/xacro.py $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro"/>

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model turtlebot3 -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" >
</node>

<!-- Start the Operator to control the simulated robot -->
<node name="Operator" pkg="nav2d_operator" type="operator" >
    <remap from="base_scan" to="scan"/>
    <rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
    <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />
</node>

<!-- Start Mapper to genreate map from laser scans -->
<node name="Mapper" pkg="nav2d_karto" type="mapper">
    <remap from="base_scan" to="scan"/>
    <rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>
</node>

<!-- Start the Navigator to move the robot autonomously -->
<node name="Navigator" pkg="nav2d_navigator" type="navigator">
    <rosparam file="$(find nav2d_tutorials)/param/navigator.yaml"/>
</node>

<node name="GetMap" pkg="nav2d_navigator" type="get_map_client" />
<node name="Explore" pkg="nav2d_navigator" type="explore_client" />
<node name="SetGoal" pkg="nav2d_navigator" type="set_goal_client" />

<!-- RVIZ to view the visualization -->
<include file="$(find turtlebot3_gazebo)/launch/turtlebot3_gazebo_rviz.launch">
    <arg name="model" value="$(arg model)"/>
</include>

</launch>`

Thanks for help!!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by ryuzaki
close date 2018-06-10 08:59:33.608580

Comments

Hi :)

May you copy and paste with error messages in terminal?

Darby Lim gravatar image Darby Lim  ( 2018-04-10 19:34:00 -0500 )edit

HI! The fact is that no error occurs. I think the problem could be that i haven't done some remapping, because if i do the simulation with stage, everything works well and there are three topics that with Gazebo don't appear. I've tried to check the code, but i don't find the way to solve this

ryuzaki gravatar image ryuzaki  ( 2018-04-11 04:23:50 -0500 )edit