0
$\begingroup$

Rosanswers logo

Hi all,

I am interested in navigation on mobile robots. Following this tutorial I have successfully simulated the mobile robot running on rviz by given 2D Nav Goal. The rqt_graph is as attached.

However I want to test and learn how to use the functions inside the move_base package separately. I have no idea how to get the rqt_graph inside the move_base.

More specifically, if I want to test the global planner(or local planner) alone, which information(topics) I should give?
I am trying to use

rosnode info /node_name

to guess which topics I may receive and which to publish, but it doesn't seem to be a good way.

My launch file is

<launch>
  <master auto="start"/>

  <!-- Run the map server -->
  <arg name="map_file" default="$(find robot)/yaml/map.yaml"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <node pkg="global_planner" type="planner" respawn="false" name="planner" output="screen" />
  <node pkg="costmap_2d" type="costmap_2d_node" respawn="false" name="costmap_2d_node" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find robot)/rviz/config.rviz"/>

</launch>

I think there is still some works to do like remapping the topic names. Could anyone give me some hints?


Originally posted by kai1006 on ROS Answers with karma: 11 on 2016-04-15

Post score: 1


Original comments

Comment by Procópio on 2016-04-27:
Please, create a new question from your revised one. The way it looks now is you ask about planners (which has been answered) and then creates another question about costmaps, which is answered by yourself.

Comment by kai1006 on 2016-04-27:
sorry, thanks for your advice.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Afaik, move_base always work as a single ROS node, so you cannot do such a thing. The internal components are of two types:

  • plugins loaded at startup (but cannot be changed at runtime, I think) as the local or global planners, recovery behaviors, etc.
  • fixed components as the global and local costmaps.

But all the communications within move_base are function calls, no ROS messages at all.

That said, you can instantiate any of these components in your own nodes, for example create a costmap for your own navigation. See Component API section at the bottom of move_base wiki


Originally posted by jorge with karma: 2284 on 2016-04-15

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by spmaniato on 2016-04-15:
jorge, I think you meant to link to http://wiki.ros.org/move_base or http://wiki.ros.org/costmap_2d

Comment by jorge on 2016-04-15:
exactly, thanks! (fixed)

Comment by kai1006 on 2016-04-16:
Thanks for your reply. Sorry for not replying immediately. I spend some time reread the costmap_2d.

Comment by kai1006 on 2016-04-16:
In fact, I don’t intend to use the global_planner package alone. My intention is to test every function properly. So if I want to test the global planner, I only need to subscribe the /move_base/NavfnROS/plan and close the marking and clearing function right?

$\endgroup$
0
$\begingroup$

Rosanswers logo

I think you should be able to run the standalone global_planner like so:

<?xml version="1.0"?>
<launch>
    <master auto="start"/>

    <arg name="global_frame" default="/map"/>
    <arg name="robot_base_frame" default="base_link"/>

    <node pkg="tf" type="static_transform_publisher" name="base_link_to_map"
        args="0.0 0.0 0.0 0.0 0.0 0.0 $(arg robot_base_frame) $(arg global_frame) 40" />

    <node pkg="navfn" type="navfn_node" respawn="false" name="planner" output="screen">
        <param name="navfn_planner/visualize_potential" value="true" />
        <param name="navfn_planner/allow_unknown" value="true" />
        <param name="navfn_planner/planner_window_x" value="0.0" />
        <param name="navfn_planner/planner_window_y" value="0.0" />
        <param name="navfn_planner/default_tolerance" value="0.0" />
    
    <!-- or global_planner -->
     <!--<node pkg="global_planner" type="planner" respawn="false" name="planner" output="screen">
        <param name="planner/old_navfn_behavior" value="false" />
        <param name="planner/use_quadratic" value="true" />
        <param name="planner/use_dijkstra" value="true" />
        <param name="planner/use_grid_path" value="false" />
        <param name="planner/allow_unknown" value="true" />
        <param name="planner/planner_window_x" value="0.0" />
        <param name="planner/planner_window_y" value="0.0" />
        <param name="planner/default_tolerance" value="0.0" />
        <param name="planner/publish_scale" value="100" /> -->

        <remap from="/planner/goal" to="/move_base_simple/goal" />

        <!--costmap-->
            <!--required-->
            <param name="costmap/global_frame" value="$(arg global_frame)"/>
            <param name="costmap/robot_base_frame" value="$(arg robot_base_frame)"/>
            <param name="costmap/origin_x" value="-5.0"/>
            <param name="costmap/origin_y" value="-5.0"/>
            <!--optional-->
            <param name="costmap/width" value="10.0"/>
            <param name="costmap/height" value="10.0"/>
            <param name="costmap/resolution" value="0.05"/>
            <param name="costmap/transform_tolerance" value="0.2"/>
            <param name="costmap/update_frequency" value="5.0"/>
            <param name="costmap/publish_frequency" value="0.0"/>
            <param name="costmap/transform_tolerance" value="0.2"/>
            <param name="costmap/rolling_window" value="false"/>
            <param name="costmap/track_unknown_space" value="false"/>
            <param name="costmap/always_send_full_costmap" value="false"/>
            <param name="costmap/footprint_padding" value="0.0"/>
            <param name="costmap/robot_radius" value="0.5"/>
    </node>

    <node pkg="rviz" type="rviz" name="rviz"/>
</launch>

Minimal move_base roslaunch file can look like:

<launch>
    <node pkg="tf" type="static_transform_publisher" name="base_link_to_map"
        args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /map 40" />

    <arg name="base_global_planner" default="navfn/NavfnROS"/>
    <arg name="base_local_planner" default="dwa_local_planner/DWAPlannerROS"/>
    <!-- <arg name="base_local_planner" default="base_local_planner/TrajectoryPlannerROS"/> -->

    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <param name="base_global_planner" value="$(arg base_global_planner)"/>
        <param name="base_local_planner" value="$(arg base_local_planner)"/>  

        <param name="local_costmap/width" value="10.0"/>
        <param name="local_costmap/height" value="10.0"/>
        <param name="local_costmap/origin_x" value="-5.0"/>
        <param name="local_costmap/origin_y" value="-5.0"/>

        <param name="global_costmap/width" value="20.0"/>
        <param name="global_costmap/height" value="20.0"/>
        <param name="global_costmap/origin_x" value="-10.0"/>
        <param name="global_costmap/origin_y" value="-10.0"/>
    </node>
    <node pkg="rviz" type="rviz" name="rviz"/>
</launch>

Have fun!


Originally posted by abrzozowski with karma: 290 on 2016-10-13

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by burakaksoy on 2023-07-29:
Works great! Thanks

$\endgroup$

Your Answer

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