-
Notifications
You must be signed in to change notification settings - Fork 10
New custom bt logic and athena_map fixes #20
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6fc8f92
added new behavior tree structure
mdurrani808 e59861c
added note on xml file and fixed log level
mdurrani808 f11921c
additional fixes
mdurrani808 086f3cd
Merge branch 'main' into new-custom-bt
mdurrani808 dfa4d42
Merge branch 'main' into new-custom-bt
mdurrani808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/subsystems/navigation/athena_planner/behavior_trees/navigate_w_replanning_time.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <!-- | ||
| This Behavior Tree replans the global path periodically at 1 Hz. | ||
| --> | ||
|
|
||
| <root main_tree_to_execute="MainTree"> | ||
| <BehaviorTree ID="MainTree"> | ||
| <PipelineSequence name="NavigateWithReplanning"> | ||
| <RateController hz="1.0"> | ||
| <ComputePathToPose goal="{goal}" path="{path}" planner_id="GridBased"/> | ||
| </RateController> | ||
| <FollowPath path="{path}" controller_id="FollowPath"/> | ||
| </PipelineSequence> | ||
| </BehaviorTree> | ||
| </root> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
207 changes: 207 additions & 0 deletions
207
src/subsystems/navigation/athena_planner/launch/nav2_nodes.launch.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,207 @@ | ||
| from launch import LaunchDescription | ||
| from launch.actions import DeclareLaunchArgument | ||
| from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
| from launch_ros.substitutions import FindPackageShare | ||
| from launch_ros.actions import Node, SetParameter | ||
|
|
||
|
|
||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| use_sim_time = LaunchConfiguration('use_sim_time') | ||
| autostart = LaunchConfiguration('autostart') | ||
| params_file = LaunchConfiguration('params_file') | ||
| use_respawn = LaunchConfiguration('use_respawn') | ||
| log_level = LaunchConfiguration('log_level') | ||
|
|
||
|
|
||
| default_bt_xml_path = PathJoinSubstitution([ | ||
| FindPackageShare('athena_planner'), | ||
| 'behavior_trees', | ||
| 'navigate_w_replanning_time.xml' | ||
| ]) | ||
|
|
||
|
|
||
| lifecycle_nodes = [ | ||
| 'controller_server', | ||
| 'smoother_server', | ||
| 'planner_server', | ||
| 'behavior_server', | ||
| 'bt_navigator', | ||
| 'waypoint_follower', | ||
| 'velocity_smoother', | ||
| ] | ||
|
|
||
|
|
||
| remappings = [('/tf', 'tf'), ('/tf_static', 'tf_static')] | ||
|
|
||
|
|
||
| declare_use_sim_time_cmd = DeclareLaunchArgument( | ||
| 'use_sim_time', | ||
| default_value='false', | ||
| description='Use simulation clock if true', | ||
| ) | ||
|
|
||
|
|
||
| declare_params_file_cmd = DeclareLaunchArgument( | ||
| 'params_file', | ||
| description='Full path to the ROS2 parameters file', | ||
| ) | ||
|
|
||
|
|
||
| declare_autostart_cmd = DeclareLaunchArgument( | ||
| 'autostart', | ||
| default_value='true', | ||
| description='Automatically startup the nav2 stack', | ||
| ) | ||
|
|
||
|
|
||
| declare_use_respawn_cmd = DeclareLaunchArgument( | ||
| 'use_respawn', | ||
| default_value='False', | ||
| description='Whether to respawn if a node crashes', | ||
| ) | ||
|
|
||
|
|
||
| declare_log_level_cmd = DeclareLaunchArgument( | ||
| 'log_level', default_value='info', description='log level' | ||
| ) | ||
|
|
||
|
|
||
| ld = LaunchDescription() | ||
|
|
||
|
|
||
| ld.add_action(declare_use_sim_time_cmd) | ||
| ld.add_action(declare_params_file_cmd) | ||
| ld.add_action(declare_autostart_cmd) | ||
| ld.add_action(declare_use_respawn_cmd) | ||
| ld.add_action(declare_log_level_cmd) | ||
|
|
||
|
|
||
| ld.add_action(SetParameter('use_sim_time', use_sim_time)) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_controller', | ||
| executable='controller_server', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[params_file], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_smoother', | ||
| executable='smoother_server', | ||
| name='smoother_server', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[params_file], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings, | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_planner', | ||
| executable='planner_server', | ||
| name='planner_server', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[params_file], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings, | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_behaviors', | ||
| executable='behavior_server', | ||
| name='behavior_server', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[params_file], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_bt_navigator', | ||
| executable='bt_navigator', | ||
| name='bt_navigator', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[ | ||
| params_file, | ||
| {'default_nav_to_pose_bt_xml': default_bt_xml_path} | ||
| ], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings, | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_waypoint_follower', | ||
| executable='waypoint_follower', | ||
| name='waypoint_follower', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[params_file], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings, | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_velocity_smoother', | ||
| executable='velocity_smoother', | ||
| name='velocity_smoother', | ||
| output='screen', | ||
| respawn=use_respawn, | ||
| respawn_delay=2.0, | ||
| parameters=[params_file], | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| ld.add_action( | ||
| Node( | ||
| package='nav2_lifecycle_manager', | ||
| executable='lifecycle_manager', | ||
| name='lifecycle_manager_navigation', | ||
| output='screen', | ||
| arguments=['--ros-args', '--log-level', log_level], | ||
| parameters=[{'autostart': autostart}, {'node_names': lifecycle_nodes}], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| return ld | ||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.