-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: add more scenarios #452
base: development
Are you sure you want to change the base?
Conversation
cab3f76
to
bf77f7c
Compare
ce51009
to
63a45ad
Compare
@jmatejcz Thank you for the PR |
6472625
to
1302a41
Compare
done |
@jmatejcz Quick note: In step 2, before running I configured the path the the demo binary as described. When I run this command: python src/rai_bench/rai_bench/examples/o3de_test_benchmark.py I can see that simulator started, but some ros2 nodes seem to be missing:
Here is a full log: I think one of the reasons is that I get this error. Did you also encounter it?
Also, in the logs of the benchmark I can see a lot (402 in total) of logs like:
Are they expected? If they are expected - should user know all of them? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmatejcz added some high-level comments/questions to the code
TypeError | ||
If any of the provided object types is not allowed. | ||
""" | ||
# TODO (jm) what if allowable_displament is greater then the size of object? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I' m not sure how to treat and how to calculate cases when displacement is that large that it allows objects to be not stacked properly. This issue emerges, because Task does not know what is the size of the object, only coordinates of it's center. I had an idea to check if next object's 'z' coord is greater, but how much? i would need the size of the object to estimate that. If we assume any greater 'z' is valid, what about cases like:
where the cube on top has greater z than the right cube so it can be treated as valid tower on top of the right cube, because allowable displacement allows it.
or :
where the middle cube has greater 'z' but it doesn't form a proper tower.
So i postponed this issue, as maybe in future we will have access to objects sizes via SimulationBridge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and allowable displacement is required as cubes won't be perfectly stacked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation! But in case 2 I think the center would be shifted on x/y axis and entities will no be grouped (code), right?
Also, for O3DE Manipulation benchmark we can easily check the size of the available 3d models of cubes and set sensible allowable_displacement in this task. It's manual checking in the O3DE Editor, but we can have a config for this task, that is well tuned to current o3de setup, even without support for object sizes by the SimulationBridge
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation! But in case 2 I think the center would be shifted on x/y axis and entities will no be grouped (code), right?
It depends on the allowable displacement, if it allows such big shift, they will be assigned to one group, like in the image, the center is in the range of allowable displacement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for O3DE Manipulation benchmark we can easily check the size of the available 3d models of cubes and set sensible allowable_displacement in this task. It's manual checking in the O3DE Editor, but we can have a config for this task, that is well tuned to current o3de setup, even without support for object sizes by the
SimulationBridge
.
Yes we can do it like this, but it would require providing this value separately for every object type and would limit the possibility of scaling the difficulty, as smaller allowable_displacement requires more precise stacking.
Though we could enforce upper limit like this, which makes sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideal solution would be getting object size directly from simulation and scaling this value accordingly. Not sure if this is possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we discussed in person, i added maximal allowable displacement to object type
applied here:
60a7577
src/rai_bench/rai_bench/o3de_test_bench/tasks/grab_carrot_task.py
Outdated
Show resolved
Hide resolved
yes it seems like you can't properly load grounded dino and grounded sam models, which results in: try removing any existing weights: rm -rf build/ install/ log/ then once again: colcon build --symlink-install
source setup_shell.sh
python src/rai_bench/rai_bench/examples/o3de_test_benchmark.py |
to the second part of the question, the logs about |
I tested with a fresh install. Probalby gdino weights got corrupted for some reason... but it worked now. Thank you!
Could you tell me a bit more about what this log message means? |
Every task validates if given simulation config is suitable by checking if required objects are present and if any of them is placed incorrectly: This is especially useful when scenarios are created automatically like stated in README. This means you can pass a list of tasks, list of simulation configs and get every possible combination of task x sim_config as scenarios. |
removed redundant NOTE
2a92e0d
to
c9133f5
Compare
src/rai_bench/rai_bench/o3de_test_bench/tasks/move_object_to_left_task.py
Outdated
Show resolved
Hide resolved
logger=bench_logger, | ||
results_filename=results_filename, | ||
) | ||
for i, s in enumerate(scenarios): | ||
# custom request to arm | ||
base_arm_pose = Pose( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't ensure that base_arm_pose
has been reached after each task.
I noticed that sometimes arm is in a blocked state and moveit can't fix it.
I would check if the base_arm_pose is achieved and restart the game launcher if there are problems
Otherwise benchmark task will fail, because moveit can't figure out the trajectory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knicked will create feature that allows to reset arm and all joints to base position, so waiting for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied here:
999d0e1
@jmatejcz I didn't run all the tasks myself, but I think next step after this PR is to select the final set of tasks. Besides tasks and llm/rai capabilities that they check we should take into account execution time. |
@jmatejcz Response to this message. |
i didn't run all myself too as this will take very long time. For example running 29 trivial and easy tasks took only ~15minutes ~30 second per task: and 30 very hard tasks took ~28 minutes , ~1minute per task, but it will certainly grow as in majority of scenarios agent didn't perform whole task . |
@jmatejcz Thanks! Thats very useful info!
Also, I think hard task timeout should be added, I don't see it in the code right now. |
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: | ||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think O3DE binary release for benchmarks should be mentioned in the readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not available publicly for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied here:
3e3abee
I can't think of an easy and fast solution right now, it would require probably terminating whole simulation. |
adjusted lunching for new binaries: @MagdalenaKotynia please check this change, as this is part of rai_sim package Changed o3de_config.yaml, so don't forget to update it. I edited description of PR to include new field in config |
2bc01ce
to
bbc6bc2
Compare
added resetting arm to base position which is available here: RobotecAI/rai-manipulation-demo#8 Please check once again if everything works with new binaries and resetting arm. |
Purpose
#433
Proposed Changes
Issues
Not able to test manually if scores are calculated properly in different scenarios, as number of possible scenarios grows significantly. Depending on unit tests to ensure that scores are calculated properly. These tests must cover all cases.
Not enough trivial scenarios (like move object to coords when few objects). Harder scenarios like creating structures from many objects can be created in various number of ways. It isn't the same for easy scenarios where the scenario should include 1, maybe 2 moves and scene setup that is not complicated. If you have ideas for other easy tasks, let me know in comments!
For now ManipulatorMoveTo tool does not allow changing orientation of the gripper, which makes some tasks like RotateObjectTask, or scenes with rotated objects not usable.
Corn entities are to small for gripper, always falling out, which result in them being avoided when defining tasks
When gripper is holding an object it can place it into other object
Testing
Setup
https://github.com/RobotecAI/rai/blob/main/docs/demos/manipulation.md
and:
Download GameLauncher binary: humble or jazzy
Populate
src/rai_bench/rai_bench/o3de_test_bench/configs/o3de_config.yaml
with:Run examples
Run the benchmark with example scenarios. I do not recommend running full packets as this will take some time.
In
src/rai_bench/rai_bench/examples/o3de_test_benchmark.py
there are prepared packets of scenarios.You can swap running all_scenarios for for example 3 trivial scenarios -> t_scenarios[:3] here:
then:
what to look for:
src/rai_bench/rai_bench/experiments/
Tests
Run unit tests: