-
Notifications
You must be signed in to change notification settings - Fork 65
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
Updated the URDFPrefabMaker to avoid referencing SDF link names #523
Updated the URDFPrefabMaker to avoid referencing SDF link names #523
Conversation
Gems/ROS2/Code/Source/RobotImporter/ROS2RobotImporterEditorSystemComponent.cpp
Show resolved
Hide resolved
3eb291b
to
84e765b
Compare
I've rebased it locally to test but I've one test failing:
Here is rebased branch : https://github.com/RobotecAI/o3de-extras/tree/mp/sdf-multi-model-support-fixes_rb |
That test failure isn't due to this change, but do to the combination that the UrdfParserTests.cpp is using an updated version of the AZ::IO::Path CompareRelative internal function to fix comparing paths with paths in them added in this commit https://github.com/o3de/o3de/blame/3d70b5c813119f14723409dd01b339a6be8afded/Code/Framework/AzCore/AzCore/IO/Path/PathParser.inl#L773-L776. |
Now there are three choices here that can resolve or mitigate the issue.
"/home/foo/ros_ws/install/foo_robot/meshes/bar.dae" == "/home/foo/ros_ws/install/foo_robot/./meshes/bar.dae" The test failure can be ignored.
|
For test files, the |
…ey are not globally unique The `CreatePrefabTemplateFromUrdfOrSdf` function has been modified to create a JointMapper object which stores a mapping of joints to all their parent and child links. It also creates a mapping of joints to the model they are directly attached to. A similar LinkMapper structure has been added for SDF links, which stores a mapping of the link to their attached model. Instead of `CreatePrefabTemplateFromUrdfOrSdf` creating a mapping of SDF link name to O3DE Entity, that mapping has now been updated toi map the SDF link pointer to O3DE Entity. This ensures that SDF links with same name are not lost when mapping to O3DE entities. This is needed as SDF links and joints are only required to be unique relative to their attached model. Two links on different models, can have the same link name (http://sdformat.org/tutorials?tut=composition_proposal#1-6-proposed-parsing-stages) Updated the Robot Importer Visitor callback to require "ModelStack" parameters, which passes in the stack of `sdf::Model` objects that were visited on the way to the sdf element being visited be that a link, joint or nested model. Also updated the GetAllJoints and GetAllLinks function to store a fully qualified name for the joint/link including the ancestor model names when returning the name to joint and name to link map respectively. Signed-off-by: lumberyard-employee-dm <[email protected]>
… grammar Signed-off-by: lumberyard-employee-dm <[email protected]>
84e765b
to
0235b0d
Compare
The AZ::IO::Path changes have been cherry picked to the |
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.
My previous concerns were unrelated to this change. Approving.
…#523) Updated the URDFPrefabMaker to avoid referencing SDF link names as they are not globally unique The `CreatePrefabTemplateFromUrdfOrSdf` function has been modified to create a JointMapper object which stores a mapping of joints to all their parent and child links. It also creates a mapping of joints to the model they are directly attached to. A similar LinkMapper structure has been added for SDF links, which stores a mapping of the link to their attached model. Instead of `CreatePrefabTemplateFromUrdfOrSdf` creating a mapping of SDF link name to O3DE Entity, that mapping has now been updated toi map the SDF link pointer to O3DE Entity. This ensures that SDF links with same name are not lost when mapping to O3DE entities. This is needed as SDF links and joints are only required to be unique relative to their attached model. Two links on different models, can have the same link name (http://sdformat.org/tutorials?tut=composition_proposal#1-6-proposed-parsing-stages) Updated the Robot Importer Visitor callback to require "ModelStack" parameters, which passes in the stack of `sdf::Model` objects that were visited on the way to the sdf element being visited be that a link, joint or nested model. Also updated the GetAllJoints and GetAllLinks function to store a fully qualified name for the joint/link including the ancestor model names when returning the name to joint and name to link map respectively. Signed-off-by: lumberyard-employee-dm <[email protected]> Addressed PR feedback for o3de/o3de-extra#523 around invalid text and grammar Signed-off-by: lumberyard-employee-dm <[email protected]>
Link names within an SDF are only unique with a tag, not unique across the entire SDF document.
The
CreatePrefabTemplateFromUrdfOrSdf
function has been modified to create a JointMapper object which stores a mapping of joints to all their parent and child links. It also creates a mapping of joints to the model they are directly attached to.A similar LinkMapper structure has been added for SDF links, which stores a mapping of the link to their attached model.
Instead of
CreatePrefabTemplateFromUrdfOrSdf
creating a mapping of SDF link name to O3DE Entity, that mapping has now been updated toi map the SDF link pointer to O3DE Entity. This ensures that SDF links with same name are not lost when mapping to O3DE entities. This is needed as SDF links and joints are only required to be unique relative to their attached model. Two links on different models, can have the same link name (http://sdformat.org/tutorials?tut=composition_proposal#1-6-proposed-parsing-stages)Updated the Robot Importer Visitor callback to require "ModelStack" parameters, which passes in the stack of
sdf::Model
objects that were visited on the way to the sdf element being visited be that a link, joint or nested model. Also updated the GetAllJoints and GetAllLinks function to store a fully qualified name for the joint/link including the ancestor model names when returning the name to joint and name to link map respectively.