[ROS2][NAV2]How to disable gobal_costmap plugin at runtime ?

asked 2022-07-12 10:37:56 -0500

Bastian2909 gravatar image

updated 2022-07-13 02:44:54 -0500

I am using nav2 with ros2 Foxy and i saw somewhere (https://github.com/ros-planning/navig...) that there was an "enabled" parrameter to each layer in the global costmap. However i can't figure out how to use the set parrameter service :

$ ros2 service call /global_costmap/global_costmap/set_parameters rcl_interfaces/srv/SetParameters "{obstacle_layer.enabled: False}"
Failed to populate field: 'SetParameters_Request' object has no attribute 'obstacle_layer.enabled'

but the parrameter is visible withthe command

$ ros2 service call /global_costmap/global_costmap/list_parameters rcl_interfaces/srv/ListParameters
requester: making request: rcl_interfaces.srv.ListParameters_Request(prefixes=[], depth=0)

response:
rcl_interfaces.srv.ListParameters_Response(result=rcl_interfaces.msg.ListParametersResult(names=['always_send_full_costmap', 'clearable_layers', 'footprint', 'footprint_padding', 'global_frame', 'height', 'inflation_layer.cost_scaling_factor', 'inflation_layer.enabled', 'inflation_layer.inflate_around_unknown', 'inflation_layer.inflate_unknown', 'inflation_layer.inflation_radius', 'inflation_layer.plugin', 'lethal_cost_threshold', 'map_topic', 'observation_sources', 'obstacle_layer.combination_method', '***obstacle_layer.enabled***', 'obstacle_layer.footprint_clearing_enabled', 'obstacle_layer.max_obstacle_height', 'obstacle_layer.observation_sources', 'obstacle_layer.plugin', 'obstacle_layer.scan.clearing', 'obstacle_layer.scan.data_type', 'obstacle_layer.scan.expected_update_rate', 'obstacle_layer.scan.inf_is_valid', 'obstacle_layer.scan.marking', 'obstacle_layer.scan.max_obstacle_height', 'obstacle_layer.scan.min_obstacle_height', 'obstacle_layer.scan.observation_persistence', 'obstacle_layer.scan.obstacle_range', 'obstacle_layer.scan.raytrace_range', 'obstacle_layer.scan.sensor_frame', 'obstacle_layer.scan.topic', 'origin_x', 'origin_y', 'plugins', 'publish_frequency', 'resolution', 'robot_base_frame', 'robot_radius', 'rolling_window', 'static_layer.enabled', 'static_layer.map_subscribe_transient_local', 'static_layer.map_topic', 'static_layer.plugin', 'static_layer.subscribe_to_updates', 'static_layer.transform_tolerance', 'track_unknown_space', 'transform_tolerance', 'trinary_costmap', 'unknown_cost_value', 'update_frequency', 'use_maximum', 'use_sim_time', 'width'], prefixes=['inflation_layer', 'obstacle_layer', 'obstacle_layer.scan', 'static_layer']))

there is a "obstacle_layer.enabled" parrameter. Am I missing something or I just don't know how to call this service

edit retag flag offensive close merge delete