Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
d1deed3
feat: add ManipulationTask
jmatejcz Feb 28, 2025
62ff34f
feat: add helper funtions to find clusters in objects
jmatejcz Feb 28, 2025
022c664
feat: add GroupVegetablesTask
jmatejcz Feb 28, 2025
ebc6368
style: formatting change
jmatejcz Feb 28, 2025
605d404
chore: add licenses to new files
jmatejcz Feb 28, 2025
057f44c
refactor: adjusted GroupVegetablesTask to rebased code
jmatejcz Mar 10, 2025
ce02683
moved common logic to ManipulationTask
jmatejcz Mar 10, 2025
260a732
feat: added 5th scene
jmatejcz Mar 10, 2025
02673e0
style: variables naming correction
jmatejcz Mar 10, 2025
92f08f5
feat: added build tower task
jmatejcz Mar 10, 2025
5aee1b2
style: naming changes
jmatejcz Mar 10, 2025
21e9577
feat: add buildtower sub tasks
jmatejcz Mar 10, 2025
7c61378
refactor: add Entity Generic to do calculations not only on Spawned E…
jmatejcz Mar 10, 2025
070e3da
style: adjust formatting
jmatejcz Mar 10, 2025
18d5268
fix: config validation now correctly takes entites
jmatejcz Mar 10, 2025
7e0767f
feat: add new cube scenes
jmatejcz Mar 11, 2025
3b1f5b0
feat: parametrize MoveObjectsToLeftTask to take object types as argument
jmatejcz Mar 11, 2025
b2dfe02
feat : parametrize GroupObjectsTask to take object types as argument
jmatejcz Mar 11, 2025
8b12098
refactor: delete unused code from tasks
jmatejcz Mar 11, 2025
e537f00
refactor: increased recusrsion limit for agent
jmatejcz Mar 11, 2025
28fe3d9
feat: parametrize BuildTowetTask to take objects types as arguments
jmatejcz Mar 11, 2025
ed74526
feat: add new scenes
jmatejcz Mar 11, 2025
b8797bd
fix: adjust validation in MoveObjectToLeftTask
jmatejcz Mar 11, 2025
950b999
test: basic test for Task helper methods
jmatejcz Mar 11, 2025
c6d3828
test: basic buildTowerTask tests
jmatejcz Mar 11, 2025
8a07171
fix: adjust calculations in Task helper methods
jmatejcz Mar 11, 2025
1ca37e8
refactor: score calculation in BuildCubeTowerTask
jmatejcz Mar 12, 2025
ba8f3d4
fix: multiple towers test fix
jmatejcz Mar 12, 2025
32e8cd9
refactor: distance parameters as args
jmatejcz Mar 12, 2025
d7befc5
test: basic GroupObjectsTask tests
jmatejcz Mar 12, 2025
273089b
fix: tasks now properly take all entities for calculations
jmatejcz Mar 12, 2025
5bd9e8f
fix: properly count initial objects
jmatejcz Mar 12, 2025
f317b53
style: added docstrings to benchmark_model
jmatejcz Mar 13, 2025
5bee263
refactor: moved distance args to tasks' constructors
jmatejcz Mar 13, 2025
3ee57e4
feat: add place object at coords task with unit tests
jmatejcz Mar 13, 2025
8c8fa60
test: add tests for place cubes task and move to left task
jmatejcz Mar 13, 2025
b3ffee3
feat: add change orientation task with unit tests
jmatejcz Mar 13, 2025
19722e2
feat: add new easy simulaiton configs
jmatejcz Mar 14, 2025
acd2141
feat: group scenarios into trivial and easy packets
jmatejcz Mar 14, 2025
a36367a
chore: deleted old scenes
jmatejcz Mar 14, 2025
f1fbe1c
style: added note about meters
jmatejcz Mar 14, 2025
5991007
feat: add more medium and hard simulation configs
jmatejcz Mar 17, 2025
278bf3e
feat: add scenarios packets of medium, hard, and very hard level
jmatejcz Mar 17, 2025
9fa4cc6
style: adjusted naming od rotateObjectTask file
jmatejcz Mar 17, 2025
88d4fc3
feat: update README
jmatejcz Mar 17, 2025
adabfcd
style: adjust comments naming and logs
jmatejcz Mar 17, 2025
819030f
refactor: longer wait for stack readiness
jmatejcz Mar 17, 2025
dad094f
style: removed type ignores from imports and loggers
jmatejcz Mar 19, 2025
8e52e96
style: adjusted doctrings and README
jmatejcz Mar 19, 2025
a027b4f
refactor: applied suggested changes to code and notes
jmatejcz Mar 19, 2025
61ff25b
refactor: run all scenarios by default
jmatejcz Mar 19, 2025
eac8463
style: add example to group_entities_along_z_axis
jmatejcz Mar 19, 2025
90ec22f
style: add links in README
jmatejcz Mar 19, 2025
3dcfa1c
fix: loop though all scenarios
jmatejcz Mar 19, 2025
6355bb6
refactor: changed MoveObjectsToLeftTask prompt to be more understandable
jmatejcz Mar 19, 2025
f6984dd
refactor: moved validating config before creating scenario
jmatejcz Mar 19, 2025
91105b3
refactor: added maximum allowable displacement to buildTowerTask
jmatejcz Mar 19, 2025
c27cb8b
style: README capslock title removed
jmatejcz Mar 19, 2025
19a6bbe
test: add tests for not allowed displacement and types to buildTowerTask
jmatejcz Mar 20, 2025
75d024a
refactor: adjust launching binaries to match new binaries
jmatejcz Mar 20, 2025
4b0b0de
feat: reseting arm to base position after scenario
jmatejcz Mar 21, 2025
2990ed6
feat: include binaries links in README
jmatejcz Mar 21, 2025
f446547
fix: arm reset and cleanup in o3de manipulation benchmark (#481)
boczekbartek Mar 25, 2025
778b3b7
feat: add example config
boczekbartek Mar 26, 2025
e7bde7c
docs: improve benchmark readme
boczekbartek Mar 26, 2025
f094bd0
chore: pre-commit
boczekbartek Mar 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos.repos
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ repositories:
src/examples/rai-manipulation-demo:
type: git
url: https://github.com/RobotecAI/rai-manipulation-demo.git
version: development
version: kd/wait_for_clock
80 changes: 65 additions & 15 deletions src/rai_bench/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,56 @@
## RAI Benchmark

## Description
### 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`
### Frame Components

- `Task`
- `Scenario`
- `Benchmark`

For more information about these classes go to -> `src/rai_bench/rai_bench/benchmark_model.py`
For more information about these classes go to -> [benchmark_model](./rai_bench/benchmark_model.py)

### O3DE Test Benchmark

The O3DE Test Benchmark [o3de_test_benchmark_module](./rai_bench/o3de_test_bench/) provides tasks and scene configurations for robotic arm manipulation task. The tasks use a common `ManipulationTask` logic and can be parameterized, which allows for many task variants. The current tasks include:

- **MoveObjectToLeftTask**
- **GroupObjectsTask**
- **BuildCubeTowerTask**
- **PlaceObjectAtCoordTask**
- **RotateObjectTask** (currently not applicable due to limitations in the ManipulatorMoveTo tool)

The result of a task is a value between 0 and 1, calculated like initially_misplaced_now_correct / initially_misplaced. This score is calculated at the end of each scenario.

### O3DE TEST BENCHMARK
Current O3DE simulation binaries:

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.
### Running

Both tasks calculate score, taking into consideration 4 values:
1. Download O3DE simulation binary and unzip it.

- initially_misplaced_now_correct
- initially_misplaced_still_incorrect
- initially_correct_still_correct
- initially_correct_now_incorrect
- [ros2-humble](https://robotec-ml-rai-public.s3.eu-north-1.amazonaws.com/RAIManipulationDemo_jammyhumble.zip)
- [ros2-jazzy](https://robotec-ml-rai-public.s3.eu-north-1.amazonaws.com/RAIManipulationDemo_noblejazzy.zip)

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.
2. Follow step 2 from [Manipulation demo Setup section](../../docs/demos/manipulation.md#setup)

3. Adjust the path to the binary in: [o3de_config.yaml](./rai_bench/o3de_test_bench/configs/o3de_config.yaml)
4. Run benchmark with:

```bash
cd rai
source setup_shell.sh
python src/rai_bench/rai_bench/examples/o3de_test_benchmark.py
```

> [!NOTE]
> For now benchmark runs all available scenarios (~160). See [Examples](#example-usege)
> section for details.

### 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`
Example of how to load scenes, define scenarios and run benchmark can be found in [o3de_test_benchmark_example](./rai_bench/examples/o3de_test_benchmark.py)

Scenarios can be loaded manually like:

Expand All @@ -52,3 +72,33 @@ scenarios = Benchmark.create_scenarios(
```

which will result in list of scenarios with combination of every possible task and scene(task decides if scene config is suitable for it).

or can be imported from exisitng packets [scenarios_packets](./rai_bench/o3de_test_bench/scenarios.py):

```python
t_scenarios = trivial_scenarios(
configs_dir=configs_dir, connector_path=connector_path, logger=bench_logger
)
e_scenarios = easy_scenarios(
configs_dir=configs_dir, connector_path=connector_path, logger=bench_logger
)
m_scenarios = medium_scenarios(
configs_dir=configs_dir, connector_path=connector_path, logger=bench_logger
)
h_scenarios = hard_scenarios(
configs_dir=configs_dir, connector_path=connector_path, logger=bench_logger
)
vh_scenarios = very_hard_scenarios(
configs_dir=configs_dir, connector_path=connector_path, logger=bench_logger
)
```

which are grouped by their subjective difficulty. For now there are 10 trivial, 42 easy, 23 medium, 38 hard and 47 very hard scenarios.
Check docstrings and code in [scenarios_packets](./rai_bench/o3de_test_bench/scenarios.py) if you want to know how scenarios are assigned to difficulty level.

### Development

When creating new task or changing existing ones, make sure to add unit tests for score calculation in [rai_bench_tests](../../tests/rai_bench/).
This applies also when you are adding or changing the helper methods in `Task` or `ManipulationTask`.

The number of scenarios can be easily extened without writing new tasks, by increasing number of variants of the same task and adding more simulation configs but it won't improve variety of scenarios as much as creating new tasks.
Loading