Nav2d Exploration Stops working if I add dynamic Obstacles

asked 2020-09-17 18:04:21 -0500

aditi741997 gravatar image

Hello everyone,

I have been going through the nav2d tutorials : http://wiki.ros.org/nav2d/Tutorials . TUtorial 3 is working perfectly fine. I even created a model in stage and added a small square [i.e. static obstacle], and the autonomous exploration still works correctly. The robot explores the whole map.

Now, I wanted to add dynamic obstacles. I tried setting the velocity for the model I added, within the .inc file, but the object stays stationary. I am now trying to add another robot as a dynamic obstacle. Here is my launch file (tutorial4_new.launch). I am not creating any node for robot_1 since I was trying to control it from the terminal [by giving cmd_vel commands]. I have also updated the costmap.yaml file as follows : global_frame: robot_0/odom robot_base_frame: robot_0/base_link I also had to update the function bufferCloud in observation_buffer.cpp to be able to transform the incoming scan which is in frame /robot_0/base_Scan. [by removing the initial '/'].

The issue I'm facing is, that, I first call the service robot_0/StartMapping, which works fine, but then, when I call robot_0/StartExploration,the exploration stops very quickly, and the output is either 'Exploration has finished' or 'Exploration failed' [less common]. This happens regardless of where the second robot (i.e. robot_1) is.

<launch>

<!-- Some general parameters -->
<param name="use_sim_time" value="true" />

<!-- Start Stage simulator with a given environment -->
<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_tutorials)/world/tutorial4.world">
    <param name="base_watchdog_timeout" value="0" />
</node>

<!-- Start the joystick-driver and remote-controller for operation-->
<node name="Joystick" pkg="joy" type="joy_node" />
<node name="SimController" pkg="nav2d_remote" type="sim_joy" args="2"/>

<node name="R0_MapAlign" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 /map /robot_0/map 100"/>
<node name="R1_MapAlign" pkg="tf" type="static_transform_publisher" args="40 0 0 0 0 0 /map /robot_1/map 100"/>

<group ns="robot_0">
    <param name="robot_id" value="1" />
    <param name="tf_prefix" type="string" value="robot_0"/>
    <rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

    <node name="Mapper" pkg="nav2d_karto" type="mapper">
        <remap from="scan" to="base_scan"/>
        <rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>
    </node>

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

</group>

<!-- RVIZ to view the visualization -->
<node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/param/tutorial4 ...
(more)
edit retag flag offensive close merge delete