magazino / move_base_flex

Move Base Flex: a backwards-compatible replacement for move_base
https://uos.github.io/mbf_docs/
BSD 3-Clause "New" or "Revised" License
424 stars 154 forks source link

Bug with Teb Local Planner? Can't Load Footprint for Trajectory Optimization #283

Closed troshyoon closed 2 years ago

troshyoon commented 2 years ago

EDIT: Solved, thanks dorezyuk!

Hi,

the robot shows a different behavior with move_base_flex compared to move_base when I'm implementing either the mpc_local_planner and teb_local_planner examples from https://github.com/rst-tu-dortmund/mpc_local_planner and https://github.com/rst-tu-dortmund/teb_local_planner_tutorials.

Using move_base I could load the robot footprint such as "line", or "polygon". However, with the exact configurations, I got an error: "No robot footprint model specified for trajectory optimization. Using point-shaped model."

Everything else can be loaded from the teb_local-planner_params.yaml or the mpc_local_planner_params.yaml files except this footprint for trajectory optimization and I don't know why. Any idea?

Some code snippets:

_carlike_minimumtime.launch

        <!--  ************** Navigation ***************  -->
    <node name="move_base_flex" pkg="mbf_costmap_nav" type="mbf_costmap_nav" required="true" output="screen" clear_params="true">
        <rosparam file="$(find mpc_local_planner_examples)/cfg/carlike/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find mpc_local_planner_examples)/cfg/carlike/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find mpc_local_planner_examples)/cfg/carlike/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find mpc_local_planner_examples)/cfg/carlike/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find mpc_local_planner_examples)/cfg/carlike/mpc_local_planner_params.yaml" command="load" />

        <rosparam file="$(find mpc_local_planner_examples)/cfg/move_base_flex.yaml" command="load"/>

    </node>

    <!-- ****************** MBF Goal Relay ******************** -->
        <node name="move_base_relay" pkg="mpc_local_planner_examples" type="mb_relay_subscriber.py"/>

_move_baseflex.yaml

planners:
  - name: global_planner/GlobalPlanner
    type: global_planner/GlobalPlanner

controllers:
  - name: mpc_local_planner/MpcLocalPlannerROS
    type: mpc_local_planner/MpcLocalPlannerROS

_mpc_local_plannerparams.yaml

MpcLocalPlannerROS:
  ## Footprint model for collision avoidance
  footprint_model: # types: "point", "circular", "two_circles", "line", "polygon"
    type: "line"
    radius: 0.2 # for type "circular"
    line_start: [0.0, 0.0] # for type "line"
    line_end: [0.4, 0.0] # for type "line"
    is_footprint_dynamic: False
dorezyuk commented 2 years ago

The problem in your code is that the name of the controller in the first yaml is mpc_local_planner/MpcLocalPlannerROS and in the second yaml just MpcLocalPlannerROS. Make sure they match and you should be good