Code Monkey home page Code Monkey logo

dynamic_reconfig_usage's Introduction

Execute the service pythomm first

<node pkg="dynamic_reconfig" name="dynamic_server" type="dynamic_server.py" output="screen"/>

Features

  • Change spesific defined config
  • Cnange many configs at a time
  • Change parameters from *.yaml

Bash testing command

  • test service only
rosservice call /DynamicUpdate  "{node_name: ['/move_base/global_costmap/inflation_layer/'], config_name: ['inflation_radius'], config_type: ['float'], new_config: ['40.0']}"
  • using self-test node
    • the node is used for show how to use the client api
    • It can only change the inflation radius temporarily
    • The below command would change the radius to 30.0
rosrun dynamic_reconfig dynamic_reconfig_client_test_node 0 30.0

API usage

  • See dynamic_reconfig_client_test.cpp

Using Yaml to Do Config.

Write A YAML Example

dynamic_update_define:
  scenario_list:
   - local_planner_scenario_1
   - local_planner_scenario_2
   - inflation_scenario_1
   - inflation_scenario_2

local_planner_scenario_1:
  node_name: "/move_base/DWAPlannerROS/"
  float_configs:
    max_vel_x: 0.60
    min_vel_x: 0.07
    max_vel_y: 0.4
    min_vel_y: -0.4

local_planner_scenario_2:
  node_name: "/move_base/DWAPlannerROS/"
  float_configs:
    max_vel_x: 0.45
    min_vel_x: 0.01
    max_vel_y: 0.2
    min_vel_y: -0.2
    
inflation_scenario_1:
  node_name: "/move_base/global_costmap/inflation_layer/"
  bool_configs:
    enabled: 1
  float_configs:
    inflation_radius: 12.5

inflation_scenario_2:
  node_name: "/move_base/global_costmap/inflation_layer/"
  bool_configs:
    enabled: 0
  float_configs:
    inflation_radius: 40.0

Yaml Details Explaination

dynamic_update_define:
  scenario_list:
   - local_planner_scenario_1
   - local_planner_scenario_2
   - inflation_scenario_1
   - inflation_scenario_2

  1. I will find the scenario names under "dynamic_update_define/scenario_list"
  2. Each Scenario names shows the group of parameters under the same node name
local_planner_scenario_1:
  node_name: "/move_base/DWAPlannerROS/"
  float_configs:
    max_vel_x: 0.60
    min_vel_x: 0.07
    max_vel_y: 0.4
    min_vel_y: -0.4

inflation_scenario_2:
  node_name: "/move_base/global_costmap/inflation_layer/"
  bool_configs:
    enabled: 0
  float_configs:
    inflation_radius: 40.0
  1. For each scenario, it has two kind of parameters. One is the node_name, and the other is $(Type)_configs
  2. The node_name will guide us to the right dynamic server.
  3. There are 4 types in $(Type)_configs, which are "float_configs", "bool_configs", "int_configs" and "string_configs"
  4. The usage is easy. All we have to do is add the config name and value under the right type tag.
  5. e,g, I put "max_vel_x: 0.60" under "float_configs:", and "enabled: 0" under "bool_configs:"

Rosparameter

After setting the yaml, we have to add the parameters into rosparam server

There are two ways:

  • rosparam load dynamic_update_config_alter.yaml
  • <rosparam file="dynamic_update_config_alter.yaml" command="load"/>

API usage

It can change parameter by using the scenario names.

See dynamic_reconfig_client_test.cpp for the detail.

Note: at "} else if (atoi(argv[1]) == 4) {"

dynamic_reconfig_usage's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.