Remapping navigation topics for own nodes
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 ...
Where did you change those remaps? You didn't include the actual launch file. Please edit the question and include your full launch file.
Thanks for the response! I just added the .launch files for the navigation package and for the move_base package.