feat(arcor2_ur): extend ros_worker for collision primitives and basic tests#891
feat(arcor2_ur): extend ros_worker for collision primitives and basic tests#891SimonKadnar wants to merge 5 commits intorobofit:masterfrom
Conversation
|
@SimonKadnar U těchto balíčků bude potřeba aktualizovat verzi, bohužel to nelze pinnout nějak rozumně. |
| set_enabled.__action__ = ActionMetadata() # type: ignore | ||
|
|
||
|
|
||
| class GraspableState(str, Enum): |
There was a problem hiding this comment.
Tady to určitě bude chtít docstring/komentáře s vysvětlením.
There was a problem hiding this comment.
A v rámci arcor2 máme definovaný Arcor2StrEnum.
| LOST = "LOST" | ||
|
|
||
|
|
||
| class GraspableSource(str, Enum): |
There was a problem hiding this comment.
Tady taky doplnit docstring s vysvětlením k čemu je to celkově a k čemu jsou jednotlivé položky.
| source: str | None = None, | ||
| stamp: str | None = None, | ||
| ) -> None: | ||
| params = model.to_dict() |
There was a problem hiding this comment.
Proč dataclass převádíte na dict?
| pose: common.Pose | ||
|
|
||
|
|
||
| class GraspableObjectTuple(NamedTuple): |
There was a problem hiding this comment.
To už tady myslím vidím podruhé...
|
|
||
|
|
||
| @app.route("/graspables/sphere", methods=["PUT"]) | ||
| def put_graspable_sphere() -> RespT: |
There was a problem hiding this comment.
Je tady docela velká duplikace s původními metodami... Nemohlo by být static/graspable rozlišené jen nějaký parametrem?
| @@ -0,0 +1,62 @@ | |||
| import math | |||
| from arcor2_ur.tests.conftest import Urls | ||
|
|
||
|
|
||
| def _dist(a: Pose, b: Pose) -> float: |
There was a problem hiding this comment.
Tohle už pose/position z arcor2 umí samo o sobě, mrkněte na to...
| from arcor2_ur.tests.conftest import Urls | ||
|
|
||
|
|
||
| def _dist(a: Pose, b: Pose) -> float: |
| from arcor2_ur.tests.conftest import Urls | ||
|
|
||
|
|
||
| def _dist(a: Pose, b: Pose) -> float: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70cae31176
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for cid in collision_ids(): | ||
| delete_collision_id(cid) |
There was a problem hiding this comment.
Iterate graspable IDs when deleting all graspables
delete_all_graspable() currently iterates collision_ids() and calls delete_collision_id(), so invoking it removes collisions but leaves graspables behind. Any cleanup path that relies on this helper will retain stale graspable objects and can pollute later planning/state checks; it should iterate graspable_ids() and call delete_graspable_id() instead.
Useful? React with 👍 / 👎.
| # elif isinstance(obj.model, object_type.Mesh): | ||
|
|
||
| collision_object.primitives.append(prim) | ||
| collision_object.primitive_poses.append(obj_pose) |
There was a problem hiding this comment.
Guard unsupported mesh models in collision conversion
create_collision_object() appends a SolidPrimitive even when the model is a mesh, because only box/sphere/cylinder initialize prim.type and dimensions. Since apply_collision_objects() now feeds all collisions/graspables through this path, requests to /collisions/mesh or /graspables/mesh can push an invalid primitive into MoveIt and break scene updates/planning; mesh objects need explicit mesh handling or must be skipped.
Useful? React with 👍 / 👎.
Extended arcor2_ur ros_worker to support collision primitives (Box / Cylinder / Sphere)
Added basic collision-aware planning tests for box/cylinder/sphere obstacles.
Ensures the planner detours around obstacles when the direct path is blocked.