Navigation doesn't work when launching robot under a ns

asked 2021-03-03 05:11:17 -0500

shlock gravatar image

Hey, I'm trying to get multi-robot simulations on noetic. I used to do it in melodic using tf_namespace but now that it has been removed in noetic I cannot run them and the PR for restoring tf_prefix if failing checks. When I launch a robot with navigation in gazebo without a ns, it works fine.

The output from tf2_tools view_frames is - image description

The launch file is as follows -

<?xml version='1.0'?>
    <!-- <group ns="dbot"> -->
        <arg name="x" default="0.0"/>
        <arg name="y" default="0.0"/>
        <arg name="z" default="0.0"/>    
        <param name="robot_description" command="$(find xacro)/xacro '$(find deliverybot_description)/urdf/dbot.xacro'"/>
        <node name="dbot_spawn" pkg="gazebo_ros" type="spawn_model" 
                output="screen" args="-urdf -param robot_description -model dbot -x $(arg x) -y $(arg y) -z $(arg z)">
        <node name="map_server" pkg="map_server" type="map_server" args="$(find deliverybot_navigation)/maps/willowgarage.yaml">
        <include file="$(find deliverybot_control)/launch/deliverybot_controller.launch">
        <include file="$(find deliverybot_control)/launch/deliverybot_hw_controller.launch">
        <include file="$(find deliverybot_navigation)/launch/move_base.launch">
    <!-- </group> -->


Now if I put this in a group under a namespace, this is warning I get -

[ WARN] [1614769555.770850662, 5.008000000]: 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.101 timeout was 0.1.

and frames -

image description

There is no map frame and the links connected to differential drive controller plugin come under a different namespace than the rest of the links.

How should I proceed?

edit retag flag offensive close merge delete


I'm having a similar issue, have you been able to find a solution?

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-05 14:54:13 -0500 )edit

Nope. I had to go back to melodic. You can follow this Issue for noetic. Once it gets solved we'll be able to do it on noetic. I think it has been fixed on foxy.

shlock gravatar image shlock  ( 2021-04-05 22:48:55 -0500 )edit

I cloned the PR earlier, and it worked fine for the robot_state_publisher itself. My problem is more with the robot_localization not recognizing the namespaces, but it's probably a different issue. Thanks anyway

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-06 02:23:29 -0500 )edit