-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactor the from_urdf
function from RobotLibrary to Robot
#437
base: main
Are you sure you want to change the base?
Conversation
@@ -110,6 +112,49 @@ def __from_data__(cls, data): | |||
robot.attributes = attributes | |||
return robot | |||
|
|||
@classmethod | |||
def from_urdf(cls, urdf_filename, srdf_filename=None, local_package_mesh_folder=None, client=None): | |||
# type: (str, Optional[str], Optional[str], Optional[ClientInterface]) -> Robot |
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.
ClientInterface
is not imported, is it? Does this work? Can you do a fully-qualified type here (ie. compas_fab.backends.interfaces.ClientInterface
) to avoid importing only for the purpose of type checking?
|
||
if srdf_filename: | ||
semantics = RobotSemantics.from_srdf_file(srdf_filename, model) | ||
else: | ||
semantics = None |
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.
Maybe this is a bit neater?
if srdf_filename: | |
semantics = RobotSemantics.from_srdf_file(srdf_filename, model) | |
else: | |
semantics = None | |
semantics = None | |
if srdf_filename: | |
semantics = RobotSemantics.from_srdf_file(srdf_filename, model) |
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.
lgtm + minor feedback
Seems a really cool contribution. Any reason keeping you from merging @yck011522 ? |
I'm just slightly away from office these days. Will work on it soon. |
Happy holidays! |
This would allow other access to use that function.
What type of change is this?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas_fab.robots.CollisionMesh
.