-
Notifications
You must be signed in to change notification settings - Fork 24
Get Simulation to work with multiple robots #949
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 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ac6680b
Select config loaded by the parameter blackboard based on the bot_id.
e327325
Use a manual timer implementation for team_comm in sim
a76a875
Make auto IP address select localhost in sim
df5f00a
Remove old launch file, use domain id directly
acc0a9f
pixi format
38f842f
Update tests for resolve_target_ip
ad94464
Reduce config duplication
0f19a27
Check if we are in sim and robot domain is set for loading custom ove…
44ce41f
Add back field parameter
d4157c0
Merge remote-tracking branch 'origin/main' into feature/seperate_mult…
8a2f62e
pixi format & pixi lock
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
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
5 changes: 5 additions & 0 deletions
5
src/bitbots_misc/bitbots_parameter_blackboard/config/sim_game_settings_11.yaml
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,5 @@ | ||
| parameter_blackboard: | ||
| ros__parameters: | ||
| bot_id: 1 | ||
| position_number: 0 | ||
| role: offense | ||
5 changes: 5 additions & 0 deletions
5
src/bitbots_misc/bitbots_parameter_blackboard/config/sim_game_settings_12.yaml
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,5 @@ | ||
| parameter_blackboard: | ||
| ros__parameters: | ||
| bot_id: 2 | ||
| position_number: 0 | ||
| role: goalie |
5 changes: 5 additions & 0 deletions
5
src/bitbots_misc/bitbots_parameter_blackboard/config/sim_game_settings_13.yaml
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,5 @@ | ||
| parameter_blackboard: | ||
| ros__parameters: | ||
| bot_id: 3 | ||
| position_number: 0 | ||
| role: defense |
5 changes: 5 additions & 0 deletions
5
src/bitbots_misc/bitbots_parameter_blackboard/config/sim_game_settings_14.yaml
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,5 @@ | ||
| parameter_blackboard: | ||
| ros__parameters: | ||
| bot_id: 4 | ||
| position_number: 1 | ||
| role: defense |
19 changes: 0 additions & 19 deletions
19
src/bitbots_misc/bitbots_parameter_blackboard/launch/parameter_blackboard.launch
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
src/bitbots_misc/bitbots_parameter_blackboard/launch/parameter_blackboard.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,54 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import os | ||
|
|
||
| from ament_index_python.packages import get_package_share_directory | ||
| from launch import LaunchDescription | ||
| from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
| from launch.launch_description_sources import AnyLaunchDescriptionSource | ||
| from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression | ||
| from launch_ros.actions import Node | ||
| from launch_ros.parameter_descriptions import ParameterFile | ||
|
|
||
|
|
||
| def generate_launch_description() -> LaunchDescription: | ||
| package_name = "bitbots_parameter_blackboard" | ||
| package_share = get_package_share_directory(package_name) | ||
|
|
||
| sim = LaunchConfiguration("sim") | ||
| field_name = PythonExpression(["'hsl_kid' if '", sim, "' == 'true' else 'labor'"]) | ||
|
|
||
| parameters = [ | ||
| {"simulation_active": sim}, | ||
| {"use_sim_time": sim}, | ||
| {"field.name": field_name}, | ||
| ParameterFile(PathJoinSubstitution([package_share, "config", "fields", field_name, "config.yaml"])), | ||
| ParameterFile(PathJoinSubstitution([package_share, "config", "global_parameters.yaml"])), | ||
| ParameterFile(PathJoinSubstitution([package_share, "config", "game_settings.yaml"])), | ||
| ] | ||
|
|
||
| robot_domain = os.environ.get("ROS_DOMAIN_ID") | ||
| if robot_domain is not None: | ||
|
jaagut marked this conversation as resolved.
Outdated
|
||
| parameters.append( | ||
| ParameterFile( | ||
| PathJoinSubstitution([package_share, "config", f"sim_game_settings_{int(robot_domain)}.yaml"]) | ||
| ) | ||
| ) | ||
|
|
||
| return LaunchDescription( | ||
| [ | ||
| DeclareLaunchArgument("sim", default_value="false"), | ||
| IncludeLaunchDescription( | ||
| AnyLaunchDescriptionSource( | ||
| PathJoinSubstitution([get_package_share_directory("bitbots_utils"), "launch", "welcome.launch"]) | ||
| ) | ||
| ), | ||
| Node( | ||
| package="demo_nodes_cpp", | ||
| executable="parameter_blackboard", | ||
| name="parameter_blackboard", | ||
| arguments=["--ros-args", "--log-level", "WARN"], | ||
| parameters=parameters, | ||
| ), | ||
| ] | ||
| ) | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <launch> | ||
| <!-- load the global parameters --> | ||
| <include file="$(find-pkg-share bitbots_utils)/launch/parameter_blackboard.launch" /> | ||
| <include file="$(find-pkg-share bitbots_utils)/launch/parameter_blackboard.launch.py" /> | ||
| <include file="$(find-pkg-share udp_bridge)/launch/sender.launch" /> | ||
| </launch> |
Oops, something went wrong.
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.