Skip to content

feat(arcor2_ur): extend ros_worker for collision primitives and basic tests#891

Draft
SimonKadnar wants to merge 5 commits intorobofit:masterfrom
SimonKadnar:master
Draft

feat(arcor2_ur): extend ros_worker for collision primitives and basic tests#891
SimonKadnar wants to merge 5 commits intorobofit:masterfrom
SimonKadnar:master

Conversation

@SimonKadnar
Copy link
Contributor

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.

@ZdenekM
Copy link
Member

ZdenekM commented Feb 2, 2026

@SimonKadnar U těchto balíčků bude potřeba aktualizovat verzi, bohužel to nelze pinnout nějak rozumně.

E: Version '0.11.0-1noble.20251108.003726' for 'ros-jazzy-ros-base' was not found
E: Version '3.6.0-1noble.20251114.095610' for 'ros-jazzy-ur' was not found
E: Version '2.12.3-1noble.20251108.011222' for 'ros-jazzy-moveit-py' was not found

set_enabled.__action__ = ActionMetadata() # type: ignore


class GraspableState(str, Enum):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tady to určitě bude chtít docstring/komentáře s vysvětlením.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A v rámci arcor2 máme definovaný Arcor2StrEnum.

LOST = "LOST"


class GraspableSource(str, Enum):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proč dataclass převádíte na dict?

pose: common.Pose


class GraspableObjectTuple(NamedTuple):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To už tady myslím vidím podruhé...



@app.route("/graspables/sphere", methods=["PUT"])
def put_graspable_sphere() -> RespT:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

překlep v názvu souboru

from arcor2_ur.tests.conftest import Urls


def _dist(a: Pose, b: Pose) -> float:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplikace...

from arcor2_ur.tests.conftest import Urls


def _dist(a: Pose, b: Pose) -> float:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kolikrát ještě? :-D

@ZdenekM
Copy link
Member

ZdenekM commented Mar 6, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +142 to +143
for cid in collision_ids():
delete_collision_id(cid)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +332 to +335
# elif isinstance(obj.model, object_type.Mesh):

collision_object.primitives.append(prim)
collision_object.primitive_poses.append(obj_pose)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants