Skip to content
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

CollisionObjects: Allow import of URDFs and update file location finder #1

Open
17 tasks
egordon opened this issue May 17, 2023 · 1 comment
Open
17 tasks
Labels
enhancement New feature or request

Comments

@egordon
Copy link

egordon commented May 17, 2023

Currently, the only available functions for handling CollisionObjects are add_collision_mesh(<path to mesh>) and remove_collision_mesh(<id>)

This interface needs to be expanded:

  • remove_collision_mesh(<id>) -> remove_collision(<id>) (deprecate previous)
  • get_collision_ids(): return list of all collision object string IDs currently in the planning scene. Use the service /get_planning_scene: setting components.components = WORLD_OBJECT_NAMES and returning [obj.id for obj in scene.world.collision_objects]
  • get_collision(<id list, default = []>), return CollisionObjects currently in the planning scene with the specified IDs (default == all collision objects). Use the service /get_planning_scene: setting components.components = WORLD_OBJECT_NAMES & WORLD_OBJECT_GEOMETRY and return [obj for obj in scene.world.collision_objects where obj.id in id_list]
  • add_collision(<CollisionObject>): just publishes a raw collision object to the planning scene. Prevents code reuse between all add functions.
  • add_collision_primitive([<SolidPrimitive>](http://docs.ros.org/en/noetic/api/shape_msgs/html/msg/SolidPrimitive.html)): Constructs a collision object from a single primitive.
  • Create a file path resolver util using pathlib
    • Call expanduser() to resolve ~
    • Optionally call with list of accepted file extensions, e.g., dae and stl for mesh, urdf for URDF
    • Update add_collision_mesh() to us e the new resolver
  • Create add_collision_urdf(<path to urdf>) with new resolver
    • Validation: fixed joints ONLY
    • Start at the link get_root(). Link.origin is CollisionObject.pose is the object frame
    • DFS through tree (via child_map) and recursively calculate the origin of each link in the object frame
    • Loop through all Link collisions, and create the corresponding SolidPrimitive or Mesh object, concat origin with link origin to get pose in object frame
    • Construct CollisionObject out of SolidPrimitive and Mesh objects, add to planning scene
@egordon egordon added the enhancement New feature or request label May 17, 2023
@egordon
Copy link
Author

egordon commented Jul 7, 2023

Update: add 2 functions:

  • add_collision_box(name, pose, dims)
  • add_collision_sphere(name, pose, radius)
  • make sure delete_collision_obj(name) works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant