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

Remapping navigation topics for own nodes

asked 2019-10-26 04:17:03 -0600

Tima1995 gravatar image

updated 2019-10-27 05:53:31 -0600

Hello ROS forum,

I am just trying to make my navigation algorithm "user-friendly" and started using the navigation package for ROS and the turtlebot3. There, after a map is created with a SLAM algo, I choose the estimated position of the robot and the goal position. I already introduced both topics (initialpose, move_base_simple/goal) to my own navigation and now the problem arises. When I use the SLAM package (with RVIZ) and explore the map and after exploration I choose the goal position, that does not result in any problems (the start position is not needed here, as the robot knows where he is in the map he just generated . The robot starts navigating from the position where he already is to the goal.

However I want to generate a map and upload it into RVIZ like in navigation package. There, I choose the start and goal position and the robot shall start navigating. Now I want my algo to execute the navigation and not the algo from the navigation package. Thats why I remaped the topic names in the navigation launch file like the following:

<launch>
    ...
    <remap from="move_base_simple/goal" to="move_base_simple/goal_dqn" />
    <remap from="initialpose" to="initialpose_dqn" />
    ...
</launch>

Still, if I choose the positions, the navigation node starts working and not my own. I then made a test within the SLAM package and launched the SLAM also with the remapping of the nodes above. And then my code starts working fine. My question is now, why does the navigation package algorithm also starts workin although i changed the topic names for the start and goal position (normally the algo shouldn´t do anything)?

As some kind of "emergency solutuion" I changed the published navigation topic to publish to the cmd_vel_1 topic so it does´t publish anything relevant for the robot. But then it is still processing which should´t be.

Thanks in advance!

Here the full .launch file for the navigation package:

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="map_file" default="$(find turtlebot3_navigation)/maps/map.yaml"/>
  <arg name="open_rviz" default="true"/>
  <arg name="move_forward_only" default="false"/>

  <remap from="move_base_simple/goal" to="move_base_simple/goal_dqn" />
  <remap from="initialpose" to="initialpose_dqn" />

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

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

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

  <!-- move_base -->
  <include file="$(find turtlebot3_navigation)/launch/move_base.launch">
    <arg name="model" value="$(arg model)" />
    <arg name="move_forward_only" value="$(arg move_forward_only)"/>
  </include>

  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find turtlebot3_navigation)/rviz/turtlebot3_navigation.rviz"/>
  </group>
</launch>

And here the move_base .launch file:

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc ...
(more)
edit retag flag offensive close merge delete

Comments

Where did you change those remaps? You didn't include the actual launch file. Please edit the question and include your full launch file.

stevemacenski gravatar image stevemacenski  ( 2019-10-26 18:51:04 -0600 )edit

Thanks for the response! I just added the .launch files for the navigation package and for the move_base package.

Tima1995 gravatar image Tima1995  ( 2019-10-27 05:54:26 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-10-27 17:17:00 -0600

Thanks for giving the full files, I see the problem now.

You need to remap inside the node. You have the remap in the root of the launch file when you want it to be applied to the move_base node. If you move those 2 remoaps into the launch file the way you also have the remaps for odom and cmd_vel, it should then remap your move_base to use those topics.

edit flag offensive delete link more

Comments

Thanks for the answer. That worked out fine!

Tima1995 gravatar image Tima1995  ( 2019-10-31 04:34:37 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-10-26 04:17:03 -0600

Seen: 779 times

Last updated: Oct 27 '19