-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Nav2 path planner issues #4759
Comments
Please provide more information about your setup, configuration files, launch files, etc |
Ok, My setup is the pavillion gaming laptop as seen here For files, this is my launch file which I use to bringup my robot and slam: import os
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, TimerAction
from ament_index_python.packages import get_package_share_directory
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch.conditions import UnlessCondition
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
def generate_launch_description():
use_slam_arg = DeclareLaunchArgument(
"use_slam",
default_value="True",
description="Whether to use SLAM or not"
)
use_slam = LaunchConfiguration("use_slam")
gazebo = IncludeLaunchDescription(
os.path.join(
get_package_share_directory("bumperbot_description"),
"launch",
"gazebo.launch.py"
),
)
controller = IncludeLaunchDescription(
os.path.join(
get_package_share_directory("bumperbot_controller"),
"launch",
"controller.launch.py"
),
launch_arguments={
"use_simple_controller": "False",
"use_python": "True"
}.items(),
)
joystick = IncludeLaunchDescription(
os.path.join(
get_package_share_directory("bumperbot_controller"),
"launch",
"joystick_teleop.launch.py"
),
)
localization = IncludeLaunchDescription(
os.path.join(
get_package_share_directory("bumperbot_localization"),
"launch",
"global_localization.launch.py"
),
condition=UnlessCondition(use_slam)
)
slam = IncludeLaunchDescription(
os.path.join(
get_package_share_directory("bumperbot_mapping"),
"launch",
"slam.launch.py"
),
condition=IfCondition(use_slam)
)
# safety_stop = Node(
# package="bumperbot_utils",
# executable="safety_stop",
# output="screen"
# )
local_or_slam = TimerAction(
period=15.0,
actions=[
Node(
package="rviz2",
executable="rviz2",
name="rviz_localization",
output="screen",
arguments=[
"-d", os.path.abspath("bumperbot_ws/src/bumperbot_localization/rviz/global_localization.rviz")],
parameters=[{"use_sim_time": True}],
condition=UnlessCondition(use_slam)
),
Node(
package="rviz2",
executable="rviz2",
name="rviz_slam",
output="screen",
arguments=[
"-d", os.path.abspath("bumperbot_ws/src/bumperbot_mapping/rviz/slam.rviz")],
parameters=[{"use_sim_time": True}],
condition=IfCondition(use_slam)),
# Nav2 Bringup Launch File
IncludeLaunchDescription(
os.path.join(get_package_share_directory("nav2_bringup"),
"launch", "navigation_launch.py"),
launch_arguments={"use_sim_time": "True"}.items()
)
]
)
return LaunchDescription([
use_slam_arg,
gazebo,
controller,
joystick,
# safety_stop,
localization,
slam,
local_or_slam,
]) This file is the slam.launch.py file import os
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
def generate_launch_description():
use_sim_time = LaunchConfiguration("use_sim_time")
slam_config = LaunchConfiguration("slam_config")
lifecycle_nodes = ["map_saver_server", "slam_toolbox"]
use_sim_time_arg = DeclareLaunchArgument(
"use_sim_time",
default_value="true"
)
slam_config_arg = DeclareLaunchArgument(
"slam_config",
default_value=os.path.join(
get_package_share_directory("bumperbot_mapping"),
"config",
"slam_toolbox.yaml"
),
description="Full path to slam yaml file to load"
)
nav2_map_saver = Node(
package="nav2_map_server",
executable="map_saver_server",
name="map_saver_server",
output="screen",
parameters=[
{"save_map_timeout": 5.0},
{"use_sim_time": use_sim_time},
{"free_thresh_default", "0.196"},
{"occupied_thresh_default", "0.65"},
],
)
slam_toolbox = Node(
package="slam_toolbox",
executable="sync_slam_toolbox_node",
name="slam_toolbox",
output="screen",
parameters=[
slam_config,
{"use_sim_time": use_sim_time},
],
)
nav2_lifecycle_manager = Node(
package="nav2_lifecycle_manager",
executable="lifecycle_manager",
name="lifecycle_manager_slam",
output="screen",
parameters=[
{"node_names": lifecycle_nodes},
{"use_sim_time": use_sim_time},
{"autostart": True}
],
)
return LaunchDescription([
use_sim_time_arg,
slam_config_arg,
nav2_map_saver,
slam_toolbox,
nav2_lifecycle_manager,
]) This is my slam_toolbox param file: slam_toolbox:
ros__parameters:
# Plugin params
solver_plugin: solver_plugins::CeresSolver
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
ceres_preconditioner: SCHUR_JACOBI
ceres_trust_strategy: LEVENBERG_MARQUARDT
ceres_dogleg_type: TRADITIONAL_DOGLEG
ceres_loss_function: None
# ROS Parameters
odom_frame: odom
map_frame: map
base_frame: base_footprint
scan_topic: /scan
use_map_saver: true
mode: mapping #localization
# if you'd like to immediately start continuing a map at a given pose
# or at the dock, but they are mutually exclusive, if pose is given
# will use pose
#map_file_name: test_steve
#map_start_pose: [0.0, 0.0, 0.0]
#map_start_at_dock: true
debug_logging: false
throttle_scans: 1
transform_publish_period: 0.02 #if 0 never publishes odometry
map_update_interval: 5.0
resolution: 0.05
max_laser_range: 12.0 #for rastering images
minimum_time_interval: 0.5
transform_timeout: 0.2
tf_buffer_duration: 30.
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps
enable_interactive_mode: true
# General Parameters
use_scan_matching: true
use_scan_barycenter: true
minimum_travel_distance: 0.5
minimum_travel_heading: 0.5
scan_buffer_size: 10
scan_buffer_maximum_scan_distance: 10.0
link_match_minimum_response_fine: 0.1
link_scan_maximum_distance: 1.5
loop_search_maximum_distance: 3.0
do_loop_closing: true
loop_match_minimum_chain_size: 10
loop_match_maximum_variance_coarse: 3.0
loop_match_minimum_response_coarse: 0.35
loop_match_minimum_response_fine: 0.45
# Correlation Parameters - Correlation Parameters
correlation_search_space_dimension: 0.5
correlation_search_space_resolution: 0.01
correlation_search_space_smear_deviation: 0.1
# Correlation Parameters - Loop Closure Parameters
loop_search_space_dimension: 8.0
loop_search_space_resolution: 0.05
loop_search_space_smear_deviation: 0.03
# Scan Matcher Parameters
distance_variance_penalty: 0.5
angle_variance_penalty: 1.0
fine_search_angle_offset: 0.00349
coarse_search_angle_offset: 0.349
coarse_angle_resolution: 0.0349
minimum_angle_penalty: 0.9
minimum_distance_penalty: 0.5
use_response_expansion: true And for nav2 navigation, I am using the default config files found in the package. |
Do you see the issue with our default bringups in You also don't show any navigation use, only sim/rviz and slam. It doesn't appear that you have any planner/controller or other navigation systems enabled. Please provide full details that we can work from to try to identify an issue. Though, what I'm likely to ask is to check if |
Hi Steve, thanks for the help so far. # Nav2 Bringup Launch File
IncludeLaunchDescription(
os.path.join(get_package_share_directory("nav2_bringup"),
"launch", "navigation_launch.py"),
launch_arguments={"use_sim_time": "True"}.items()
) I tried modifying the controller frequency in the nav2_params.yaml file, in the controller server. I changed it to a 100 and the error just outputs something along the lines of: Control loop missed its desired rate of 100.0000 Hz. Current loop rate is 111.1871 Hz. |
Required Info:
Expected behavior
The robot is meant to move to the desired location
Actual behavior
The robot does nothing; these are the log files
The text was updated successfully, but these errors were encountered: