rosin-project / metacontrol_sim

2 stars 4 forks source link

Adapt rosgraph_manipulator to reconfigure using launch files generated by RosModel #36

Closed ipa-nhg closed 4 years ago

ipa-nhg commented 4 years ago

…d by RosModel

The only information needed is the name of the configuration that has to match with the name given on the Ros Tooling for the system model (that will also be the name of the ROS package and the name of the launch file). For consistency, I added to the script that auto-generates the different configurations models (the 27) a generator for a yaml file that can be loaded within the name space of the /rosgraph_manipulator and list all the names of the configuration alternatives, this is not mandatory, you can remove that part if you don't like it. See-> https://github.com/rosin-project/rosin-experiments/pull/8

Apart of that I created a new repository to hold all the roslaunch packages https://github.com/ipa-nhg/metacontrol_move_base_configurations, @chcorbato you have ownership rights to move it to the rosin-project Orga. I added the repository to the rosinstall file.

Modifications required: https://github.com/rosin-project/metacontrol_move_base_configurations/commit/cdbae9b08b2735cd4975ececec1a4d1846420250 and https://github.com/rosin-project/rosin-experiments/commit/38146f9e93141d8689211a47d440a414894d04ab (both meged to the master branches)

TEST:

1) launch the default configuration and check the move_base parameters

$ roslaunch metacontrol_sim MVP_metacontrol_world.launch

$ rosparam get /move_base -> OUTPUT:

TrajectoryPlannerROS:
  acc_lim_theta: 10.0
  acc_lim_x: 3.6
  acc_lim_y: 3.6
  angular_sim_granularity: 0.02
  controller_frequency: 20.0
  dwa: true
  escape_reset_dist: 0.1
  escape_reset_theta: 0.1
  escape_vel: -0.5
  gdist_scale: 0.6
  goal_distance_bias: 0.6
  heading_lookahead: 0.325
  heading_scoring: false
  heading_scoring_timestep: 0.8
  holonomic_robot: true
  latch_xy_goal_tolerance: false
  max_vel_theta: 0.785
  max_vel_x: 0.3 <------------------------------------------------------------------
  max_vel_y: 0.3
.......
aggressive_reset:
  reset_distance: 1.84
base_global_planner: navfn/NavfnROS
base_local_planner: base_local_planner/TrajectoryPlannerROS
clearing_rotation_allowed: true
conservative_reset:
  reset_distance: 3.0
conservative_reset_dist: 3.0
controller_frequency: 15.0 <------------------------------------------------------------------
controller_patience: 10.0
global_costmap:
  footprint: '[[0.48,-0.4],[0.48,0.4],[-0.48,0.4],[-0.48,-0.4]]'
  footprint_padding: 0.1
  global_frame: map
  height: 40
  inflater_layer:
    cost_scaling_factor: 10.0
    enabled: true
    inflate_unknown: false
    inflation_radius: 0.3
  map_type: costmap
  meter_scoring: true
  obstacle_range: 10.0
  obstacles_layer:
    combination_method: 1
    enabled: true
    footprint_clearing_enabled: true
    max_obstacle_height: 2.0
    observation_sources: scan
    obstacle_range: 10.0
........
local_costmap:
  footprint: '[[0.48,-0.4],[0.48,0.4],[-0.48,0.4],[-0.48,-0.4]]'
  footprint_padding: 0.1
  global_frame: map
  height: 10
  inflater_layer:
    cost_scaling_factor: 10.0
    enabled: true
    inflate_unknown: false
    inflation_radius: 0.3 <------------------------------------------------------------------
  map_type: costmap
.........

2) swicht to the f3_v3_r3 configuration (using the action of the rosgrap_manipulator) and check the move_base parameters

$ rostopic pub /rosgraph_manipulator_action_server/goal metacontgs/MvpReconfigurationActionGoal "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
goal_id:
  stamp:
    secs: 0
    nsecs: 0
  id: ''
goal:
  desired_configuration_name: 'f3_v3_r3'"

$ rosparam get /move_base -> OUTPUT:

TrajectoryPlannerROS:
  acc_lim_theta: 10.0
  acc_lim_x: 3.6
  acc_lim_y: 3.6
  angular_sim_granularity: 0.02
  controller_frequency: 20.0
  dwa: true
  escape_reset_dist: 0.1
  escape_reset_theta: 0.1
  escape_vel: -0.5
  gdist_scale: 0.6
  goal_distance_bias: 0.6
  heading_lookahead: 0.325
  heading_scoring: false
  heading_scoring_timestep: 0.8
  holonomic_robot: true
  latch_xy_goal_tolerance: false
  max_vel_theta: 0.785
  max_vel_x: 0.75 <------------------------------------------------------------------
  max_vel_y: 0.3
......
aggressive_reset:
  reset_distance: 1.84
base_global_planner: navfn/NavfnROS
base_local_planner: base_local_planner/TrajectoryPlannerROS
clearing_rotation_allowed: true
conservative_reset:
  reset_distance: 3.0
conservative_reset_dist: 3.0
controller_frequency: 25.0 <------------------------------------------------------------------
controller_patience: 10.0
global_costmap:
  footprint: '[[0.48,-0.4],[0.48,0.4],[-0.48,0.4],[-0.48,-0.4]]'
  footprint_padding: 0.1
  global_frame: map
  height: 40
  inflater_layer:
    cost_scaling_factor: 10.0
    enabled: true
    inflate_unknown: false
    inflation_radius: 0.3
  map_type: costmap
  meter_scoring: true
  obstacle_range: 10.0
  obstacles_layer:
    combination_method: 1
    enabled: true
    footprint_clearing_enabled: true
    max_obstacle_height: 2.0
    observation_sources: scan
    obstacle_range: 10.0
........
local_costmap:
  footprint: '[[0.48,-0.4],[0.48,0.4],[-0.48,0.4],[-0.48,-0.4]]'
  footprint_padding: 0.1
  global_frame: map
  height: 10
  inflater_layer:
    cost_scaling_factor: 10.0
    enabled: true
    inflate_unknown: false
    inflation_radius: 0.6  <------------------------------------------------------------------
  map_type: costmap
.........
ipa-nhg commented 4 years ago

@marioney please confirm that the launch files modify the right parameters:

/move_base/controller_frequency
/move_base/TrajectoryPlannerROS/max_vel_x
/move_base/local_costmap/inflater_layer/inflation_radius

there are also the parameters /move_base/TrajectoryPlannerROS/controller_frequency and /move_base/global_costmap/inflater_layer/inflation_radius :exclamation: :exclamation:

marioney commented 4 years ago

@marioney please confirm that the launch files modify the right parameters:

/move_base/controller_frequency
/move_base/TrajectoryPlannerROS/max_vel_x
/move_base/local_costmap/inflater_layer/inflation_radius

Those are OK, but there are some additional parameters, dependent on the main ones, that need to be set aswell.

You can get the full list on this document:

https://docs.google.com/spreadsheets/d/12aB35Jj4qmarIq3OWHocATmnDfUa6ftp_j09W5twy1g/edit#gid=1491795427&range=A4

ipa-nhg commented 4 years ago

Those are OK, but there are some additional parameters, dependent on the main ones, that need to be set aswell.

You can get the full list on this document:

https://docs.google.com/spreadsheets/d/12aB35Jj4qmarIq3OWHocATmnDfUa6ftp_j09W5twy1g/edit#gid=1491795427&range=A4

@marioney Thanks for the pointer, see: https://github.com/rosin-project/rosin-experiments/pull/10 and https://github.com/rosin-project/metacontrol_move_base_configurations/pull/1

marioney commented 4 years ago

@marioney Thanks for the pointer, see: rosin-project/rosin-experiments#10 and rosin-project/metacontrol_move_base_configurations#1

Should we merge this then? @chcorbato is the mros1_reasoner side ready for this change?