-
Notifications
You must be signed in to change notification settings - Fork 55
feat: simulation and benchmark suite #435
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
8 commits
Select commit
Hold shift + click to select a range
ff0585e
feat: rai_sim (#415)
MagdalenaKotynia 3dc3d15
feat: rai_bench (#436)
jmatejcz 6dfc98a
fix: add __init__.py in rai_bench
maciejmajek 053eb81
refactor: requested changes to rai_bench (#439)
jmatejcz 3fff1b2
test: rai_sim tests (#437)
MagdalenaKotynia 70e824f
fix: simbench fixes (#443)
MagdalenaKotynia e7527b5
perf: improve performance of O3DE Benchmark (#442)
jmatejcz 84c6493
refactor: Task score always start at 0.0 (#444)
jmatejcz 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,3 +172,5 @@ logs/ | |
|
|
||
| src/examples/*-demo | ||
| artifact_database.pkl | ||
|
|
||
| imgui.ini | ||
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,59 @@ | ||
| # Copyright (C) 2025 Robotec.AI | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from launch import LaunchDescription | ||
| from launch.actions import ( | ||
| IncludeLaunchDescription, | ||
| ) | ||
| from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
| from launch_ros.actions import Node | ||
| from launch_ros.substitutions import FindPackageShare | ||
|
|
||
|
|
||
| # TODO (mkotynia) think about separation of launches | ||
| def generate_launch_description(): | ||
| launch_moveit = IncludeLaunchDescription( | ||
| PythonLaunchDescriptionSource( | ||
| [ | ||
| "src/examples/rai-manipulation-demo/Project/Examples/panda_moveit_config_demo.launch.py", | ||
| ] | ||
| ) | ||
| ) | ||
|
|
||
| launch_robotic_manipulation = Node( | ||
| package="robotic_manipulation", | ||
| executable="robotic_manipulation", | ||
| # name="robotic_manipulation_node", | ||
| output="screen", | ||
| parameters=[ | ||
| {"use_sim_time": True}, | ||
| ], | ||
| ) | ||
|
|
||
| launch_openset = IncludeLaunchDescription( | ||
| PythonLaunchDescriptionSource( | ||
| [ | ||
| FindPackageShare("rai_bringup"), | ||
| "/launch/openset.launch.py", | ||
| ] | ||
| ), | ||
| ) | ||
|
|
||
| return LaunchDescription( | ||
| [ | ||
| launch_openset, | ||
| launch_moveit, | ||
| launch_robotic_manipulation, | ||
| ] | ||
| ) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| ## RAI Benchmark | ||
|
|
||
| ## Description | ||
|
|
||
| The RAI Bench is a package including benchmarks and providing frame for creating new benchmarks | ||
|
|
||
| ## Frame Components | ||
|
|
||
| Frame components can be found in `src/rai_bench/rai_bench/benchmark_model.py` | ||
|
|
||
| - `Task` | ||
| - `Scenario` | ||
| - `Benchmark` | ||
|
|
||
| For more information about these classes go to -> `src/rai_bench/rai_bench/benchmark_model.py` | ||
|
|
||
| ### O3DE TEST BENCHMARK | ||
|
|
||
| O3DE Test Benchmark (`src/rai_bench/rai_bench/o3de_test_bench/`), contains 2 Tasks(`tasks/`) - GrabCarrotTask and PlaceCubesTask (these tasks implement calculating scores) and 4 scene_configs(`configs/`) for O3DE robotic arm simulation. | ||
|
|
||
| Both tasks calculate score, taking into consideration 4 values: | ||
|
|
||
| - initially_misplaced_now_correct | ||
| - initially_misplaced_still_incorrect | ||
| - initially_correct_still_correct | ||
| - initially_correct_now_incorrect | ||
|
|
||
| The result is a value between 0 and 1, calculated like (initially_misplaced_now_correct + initially_correct_still_correct) / number_of_initial_objects. | ||
| This score is calculated at the beggining and at the end of each scenario. | ||
|
|
||
| ### Example usage | ||
|
|
||
| Example of how to load scenes, define scenarios and run benchmark can be found in `src/rai_bench/rai_bench/examples/o3de_test_benchmark.py` | ||
|
|
||
| Scenarios can be loaded manually like: | ||
|
|
||
| ```python | ||
| one_carrot_simulation_config = O3DExROS2SimulationConfig.load_config( | ||
| base_config_path=Path("path_to_scene.yaml"), | ||
| connector_config_path=Path("path_to_o3de_config.yaml"), | ||
| ) | ||
|
|
||
| Scenario(task=GrabCarrotTask(logger=some_logger), simulation_config=one_carrot_simulation_config) | ||
| ``` | ||
|
|
||
| or automatically like: | ||
|
|
||
| ```python | ||
| scenarios = Benchmark.create_scenarios( | ||
| tasks=tasks, simulation_configs=simulations_configs | ||
| ) | ||
| ``` | ||
|
|
||
| which will result in list of scenarios with combination of every possible task and scene(task decides if scene config is suitable for it). |
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,17 @@ | ||
| [tool.poetry] | ||
| name = "rai-bench" | ||
| version = "0.1.0" | ||
| description = "Package for running and creating benchmarks." | ||
| authors = ["jmatejcz <[email protected]>"] | ||
| readme = "README.md" | ||
|
|
||
| packages = [ | ||
| { include = "rai_bench", from = "." }, | ||
| ] | ||
| [tool.poetry.dependencies] | ||
| python = "^3.10" | ||
|
|
||
|
|
||
| [build-system] | ||
| requires = ["poetry-core"] | ||
| build-backend = "poetry.core.masonry.api" |
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,13 @@ | ||
| # Copyright (C) 2025 Robotec.AI | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. |
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.