Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obstacle does not inflate around it #11

Open
mustafaktaasbirfen opened this issue Apr 16, 2024 · 1 comment
Open

Obstacle does not inflate around it #11

mustafaktaasbirfen opened this issue Apr 16, 2024 · 1 comment

Comments

@mustafaktaasbirfen
Copy link

mustafaktaasbirfen commented Apr 16, 2024

Hello good work, I can get the package to work properly. But I have a problem, the obstacle that appears in the inflation layer does not inflate around it. Therefore it is moving too close to the target. What do you suggest for this? Also, is there a problem if I add it to both local and global costmap? I think you only added it to global_costmap. Below are the parameters and an example image:

global_costmap:
global_costmap:
ros__parameters:
update_frequency: 1.0
publish_frequency: 1.0
global_frame: map
robot_base_frame: base_footprint
use_sim_time: True
footprint: "[[-0.599, -0.389], [-0.599, 0.389], [0.599, 0.389], [0.599, -0.389]]"
resolution: 0.05
track_unknown_space: true
plugins: ["static_layer", "depth_camera", "obstacle_layer", "voxel_layer", "inflation_layer"]
static_layer:
plugin: "nav2_costmap_2d::StaticLayer"
map_subscribe_transient_local: True
depth_camera:
plugin: "nav2_costmap_2d::DepthCameraObstacleLayer"
use_global_frame_to_mark: True
forced_clearing_distance: 0.3 #0.1
ec_seg_distance: 0.1 # 0.2
ec_cluster_min_size: 6 # 5
size_of_cluster_rejection: 6 # 5
voxel_resolution: 0.2
check_radius: 0.2 # 0.1
number_clearing_threshold: 2 #2
enable_near_blocked_protection: False #False
number_points_considered_as_blocked: 6 # 5
use_voxelized_observation: False
observation_sources: top_depth_cam bottom_depth_cam rear_depth_cam
top_depth_cam:
sensor_frame: front_top_link #front_top_bottom_screw_frame
topic: /front_top/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: False
marking: True
bottom_depth_cam:
sensor_frame: front_bottom_link
topic: /front_bottom/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.0
FOV_V: 0.9
min_detect_distance: 0.05
max_detect_distance: 3.0
min_obstacle_height: 0.085
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: True
marking: True
rear_depth_cam:
sensor_frame: rear_link #front_top_bottom_screw_frame
topic: /rear/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: False
marking: True
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
# scan:
# topic: /depth_scan
# max_obstacle_height: 2.0
# clearing: True
# marking: True
# data_type: "LaserScan"
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
publish_voxel_map: True
origin_z: 0.0
z_resolution: 0.05
z_voxels: 16
max_obstacle_height: 2.0
mark_threshold: 0
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 7.58 # 5.0 , 6.58
inflation_radius: 0.45
inflate_around_unknown: True
inflate_unknown: true
always_send_full_costmap: True
global_costmap_client:
ros__parameters:
use_sim_time: False
global_costmap_rclcpp_node:
ros__parameters:
use_sim_time: False

planner_server:
ros__parameters:
expected_planner_frequency: 20.0
use_sim_time: False
planner_plugins: ["GridBased"]
GridBased:
plugin: "nav2_navfn_planner/NavfnPlanner"
tolerance: 0.2
use_astar: false
allow_unknown: true

local_costmap:
local_costmap:
ros__parameters:
update_frequency: 5.0
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_footprint
use_sim_time: False
rolling_window: true
width: 10
height: 10
resolution: 0.05
footprint: "[[-0.599, -0.389], [-0.599, 0.389], [0.599, 0.389], [0.599, -0.389]]"
plugins: ["depth_camera", "obstacle_layer", "voxel_layer", "inflation_layer"]
depth_camera:
plugin: "nav2_costmap_2d::DepthCameraObstacleLayer"
use_global_frame_to_mark: False
forced_clearing_distance: 0.3 #0.1
ec_seg_distance: 0.1 # 0.2
ec_cluster_min_size: 6 # 5
size_of_cluster_rejection: 6 # 5
voxel_resolution: 0.2
check_radius: 0.2 # 0.1
number_clearing_threshold: 2 #2
enable_near_blocked_protection: False #False
number_points_considered_as_blocked: 6 # 5
use_voxelized_observation: False
observation_sources: top_depth_cam bottom_depth_cam rear_depth_cam
top_depth_cam:
sensor_frame: front_top_link #front_top_bottom_screw_frame
topic: /front_top/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: True
marking: True
bottom_depth_cam:
sensor_frame: front_bottom_link
topic: /front_bottom/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.0
FOV_V: 0.9
min_detect_distance: 0.05
max_detect_distance: 3.0
min_obstacle_height: 0.085
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: True
marking: True
rear_depth_cam:
sensor_frame: rear_link #front_top_bottom_screw_frame
topic: /rear/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: False
marking: True
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
# scan:
# topic: /depth_scan
# max_obstacle_height: 2.0
# clearing: True
# marking: True
# data_type: "LaserScan"
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
publish_voxel_map: True
origin_z: 0.0
z_resolution: 0.05
z_voxels: 16
max_obstacle_height: 2.0
mark_threshold: 0
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 6.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
inflation_radius: 0.3 # 0.3 , 0.2
cost_scaling_factor: 7.58 # 5.0 , 6.58
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True
local_costmap_client:
ros__parameters:
use_sim_time: False
local_costmap_rclcpp_node:
ros__parameters:
use_sim_time: False

deneme

@mustafaktaasbirfen
Copy link
Author

mustafaktaasbirfen commented Apr 16, 2024

I solved the problems I mentioned as follows. I changed the order of the other layers in the code and it worked. However, I am still not sure about adding to both local and global. I would appreciate if you could answer me about this.

Now I am having a problem with the camera I am trying to recognize objects on the ground. This camera is looking at the ground at an angle of 45 degrees. The min_obstacle_height parameter makes sense for this problem but it still doesn't help. What is your suggestion? Thanks for your help.

Finally, I think I'm having a problem with the rate even though I added all my cameras. I couldn't understand why this was happening. I am sharing a video about this. As far as you see in the video, can you give me suggestions? With what parameters can I solve this? Thank you for your help :)

41b0754e-f42c-4615-996d-f5ce2608d8e9.mp4

I know I'm asking a lot, but there's also this. When I set a target, while on the road, the robot restarts itself as follows. What could be the reason for this?

[controller_server-4] [WARN] [1713435607.389645516] [controller_server]: Control loop missed its desired rate of 20.0000Hz
[controller_server-4] [INFO] [1713435607.537871033] [controller_server]: Passing new path to controller.
[controller_server-4] [WARN] [1713435608.393579341] [controller_server]: Control loop missed its desired rate of 20.0000Hz
[controller_server-4] [INFO] [1713435608.587873359] [controller_server]: Passing new path to controller.
[controller_server-4] [WARN] [1713435609.388577696] [controller_server]: Control loop missed its desired rate of 20.0000Hz
[controller_server-4] [ERROR] [1713431614.190267569] [controller_server]: Failed to make progress
[controller_server-4] [WARN] [1713431614.190313717] [controller_server]: [follow_path] [ActionServer] Aborting handle.
[bt_navigator-8] [WARN] [1713431614.223529956] [BehaviorTreeEngine]: Behavior Tree tick rate 100.00 was exceeded!
[bt_navigator-8] [WARN] [1713431614.233657685] [bt_navigator_navigate_to_pose_rclcpp_node]: Node timed out while executing service call to local_costmap/clear_entirely_local_costmap.
[behavior_server-7] [INFO] [1713431614.234263159] [behavior_server]: Running backup
[bt_navigator-8] [WARN] [1713431614.234601292] [BehaviorTreeEngine]: Behavior Tree tick rate 100.00 was exceeded!
[controller_server-4] [INFO] [1713431614.321130461] [local_costmap.local_costmap]: Received request to clear entirely the local_costmap
[controller_server-4] [INFO] [1713431614.322130052] [local_costmap.local_costmap]: depth_camera was reseted.
[controller_server-4] [INFO] [1713431614.322156736] [local_costmap.local_costmap]: depth_camera was deactivated.
[controller_server-4] [INFO] [1713431614.325269695] [local_costmap.local_costmap]: depth_camera was activated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant