0
$\begingroup$

Rosanswers logo

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="model type [burger, waffle, waffle_pi]"/>
  <!-- <arg name="cmd_vel_topic" default="/cmd_vel" /> -->
  <arg name="cmd_vel_topic" default="/cmd_vel_1" />
  <arg name="odom_topic" default="odom" />
  <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" />

  <!-- move_base -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
    <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find turtlebot3_navigation)/param/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find turtlebot3_navigation)/param/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find turtlebot3_navigation)/param/move_base_params.yaml" command="load" />
    <rosparam file="$(find turtlebot3_navigation)/param/dwa_local_planner_params_$(arg model).yaml" command="load" />
    <remap from="cmd_vel" to="$(arg cmd_vel_topic)"/>
    <remap from="odom" to="$(arg odom_topic)"/>
    <param name="DWAPlannerROS/min_vel_x" value="0.0" if="$(arg move_forward_only)" />
  </node>
</launch>

Originally posted by Tima1995 on ROS Answers with karma: 17 on 2019-10-26

Post score: 0


Original comments

Comment by stevemacenski on 2019-10-26:
Where did you change those remaps? You didn't include the actual launch file. Please edit the question and include your full launch file.

Comment by Tima1995 on 2019-10-27:
Thanks for the response! I just added the .launch files for the navigation package and for the move_base package.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by stevemacenski with karma: 8272 on 2019-10-27

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Tima1995 on 2019-10-31:
Thanks for the answer. That worked out fine!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.