Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow "drilling down" into nested model frames (#381)
* Expect nested_explicit_canonical_link.sdf is valid Split nested_invalid_explicit_canonical_link.sdf into nested_explicit_canonical_link.sdf and nested_without_links_invalid.sdf and update UNIT_ign_TEST and an integration test. Signed-off-by: Steve Peters <[email protected]> * Support :: syntax in *NameExists and *ByName APIs This extends the `Model::*NameExists` and `Model::*ByName` APIs (like LinkNameExists and LinkByName) that allow passing nested names that can begin with a sequence of nested model names separated by :: and may end with the name of an object of the specified type, such as "outer_model::inner_model::inner_joint". For now, if a nested model is not found that matches the nested name preceding the final ::, then it checks for objects in the current model that match the entire name. This extra check should be disabled when "::" is reserved and not allowed in frame names. Signed-off-by: Steve Peters <[email protected]> * Changelog and Migration guide Signed-off-by: Steve Peters <[email protected]> * Ensure CanonicalLink pointer is valid Signed-off-by: Steve Peters <[email protected]> * Add ScopedGraph header Signed-off-by: Addisu Z. Taddese <[email protected]> * Frame attached to tests passing Signed-off-by: Addisu Z. Taddese <[email protected]> * FrameSemantics_TEST passing Signed-off-by: Addisu Z. Taddese <[email protected]> * Pass ChildScope with new scope name Signed-off-by: Addisu Z. Taddese <[email protected]> * Add command line tool to generate graph Signed-off-by: Addisu Z. Taddese <[email protected]> * Avoid using the RawPose of the DOM object when the object is a frame (implicit or explicit) Instead use the edges in the pose graph. This allows us to update only the pose graph when handling placement frames. Signed-off-by: Addisu Z. Taddese <[email protected]> * Handle placement frames with new PoseRelativeTo construction scheme The PoseRelativeTo used to be constructed in each nested model's Load funcition. Now, it's only constructed at the outer most model. Because of this decoupling and Since the model is `const` when the graph is constructed, placement frames are handled differently. Instead of updating the raw pose of the model, the edge connecting the model frame to it's relative_to frame is modified to take into account the placement frame. Signed-off-by: Addisu Z. Taddese <[email protected]> * Add __root__ scope The __root__ vertex is the root node of both world and model PoseRelativeTo graphs. It corresponds to the `<sdf>` tag in SDFormat files. Having this node makes it possible to keep the a model's pose and (possibly accounting for placement_frame) information in the edge from the _root__ vertex to the model vertex. Signed-off-by: Addisu Z. Taddese <[email protected]> * Revert changes in loadUniqueRepeated Signed-off-by: Addisu Z. Taddese <[email protected]> * Make ScopedGraph use pointer semantics Signed-off-by: Addisu Z. Taddese <[email protected]> * Cleanup Signed-off-by: Addisu Z. Taddese <[email protected]> * Remove `__root__` scope name The `__root__` vertex still exits, but has either a `__model__` scope or a `world` scope. Signed-off-by: Addisu Z. Taddese <[email protected]> * SemanticPose::Resolve and JointAxis::ResolveXyz to a SemanticPose object to set the scope Signed-off-by: Addisu Z. Taddese <[email protected]> * Add missing file Signed-off-by: Addisu Z. Taddese <[email protected]> * Remove aliasing edges, there is no need for them. Also remove updateGraphPose Signed-off-by: Addisu Z. Taddese <[email protected]> * Refactor Signed-off-by: Addisu Z. Taddese <[email protected]> * Cleanup Signed-off-by: Addisu Z. Taddese <[email protected]> * Add Resolve function that takes DOM objects Signed-off-by: Addisu Z. Taddese <[email protected]> * Add test for placement attribute with nested link Signed-off-by: Addisu Z. Taddese <[email protected]> * Codecheck Signed-off-by: Addisu Z. Taddese <[email protected]> * Fix macOS build error Signed-off-by: Addisu Z. Taddese <[email protected]> * Add nested model pose relative_to test Signed-off-by: Addisu Z. Taddese <[email protected]> * Add nested model frame attached_to test Signed-off-by: Addisu Z. Taddese <[email protected]> * Add test for joints that reference entities in nested models Signed-off-by: Addisu Z. Taddese <[email protected]> * Add API documentation for ScopedGraph, refactor Signed-off-by: Addisu Z. Taddese <[email protected]> * Add test for placement_frame element that references nested frames Signed-off-by: Addisu Z. Taddese <[email protected]> * Add test for empty models that contain a nested static model Signed-off-by: Addisu Z. Taddese <[email protected]> * Resolve SemanticPose objects relative to other SemanticPose objects Signed-off-by: Addisu Z. Taddese <[email protected]> * Add missing file Signed-off-by: Addisu Z. Taddese <[email protected]> * Revert the SemanticPose::Resolve API that takes SemanticPose objects This proved to be problematic since the graph contained in the input SemanticPose can be at a different scope than the graph in the current object. Thus it becomes necessary to find the least common ancestor vertex between two vertices in the graph. This is feasible, but it would be best to do it in a separate PR. Signed-off-by: Addisu Z. Taddese <[email protected]> * Remove addNestedModel Signed-off-by: Addisu Z. Taddese <[email protected]> * Add more documentation, cleanup Signed-off-by: Addisu Z. Taddese <[email protected]> * Validate __root__ vertices Signed-off-by: Addisu Z. Taddese <[email protected]> * Add more error cases in validate* functions Signed-off-by: Addisu Z. Taddese <[email protected]> * Remove obsolete test Signed-off-by: Addisu Z. Taddese <[email protected]> * Prevent users from referencing `__root__` in SDFormat XML. Signed-off-by: Addisu Z. Taddese <[email protected]> * More expectations in LoadJointNestedParentChild Test `Joint::Resolve*Link` methods in LoadJointNestedParentChild test case. Signed-off-by: Steve Peters <[email protected]> * Address Reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * Add and update doxygen for SetFrameAttachedToGraph and SetPoseRelativeToGraph Signed-off-by: Addisu Z. Taddese <[email protected]> * Add doxygen to new SemanticPose constructor Signed-off-by: Addisu Z. Taddese <[email protected]> * Remove unnecessary code Signed-off-by: Addisu Z. Taddese <[email protected]> * Refactor code that handles PlacementFrame into a function Signed-off-by: Addisu Z. Taddese <[email protected]> * Address reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * Add failing test showing bug in checkFrameAttachedToNames Signed-off-by: Addisu Z. Taddese <[email protected]> * Fix how frame attached_to names are checked for existence Signed-off-by: Addisu Z. Taddese <[email protected]> * Add unit test for the output stream of sdf::Errors Signed-off-by: Addisu Z. Taddese <[email protected]> * Return void from Model::SetPoseRelativeToGraph Signed-off-by: Addisu Z. Taddese <[email protected]> * Add test for world level nested references Signed-off-by: Addisu Z. Taddese <[email protected]> * Add test for ign graph command Signed-off-by: Addisu Z. Taddese <[email protected]> * Be more selective about checking for usage of __root__ Instead of checking if any attribute has a value of "__root__", only the following attributes are checked: * //frame/[@attached_to] * //pose/[@relative_to] * //model/[@placement_frame] * //model/[@canonical_link] * //sensor/imu/orientation_reference_frame/custom_rpy/[@parent_frame] In addition, the elements //joint/parent, //joint/child and //include/placement_frame are checked for validity Signed-off-by: Addisu Z. Taddese <[email protected]> * Address reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * Scoped -> scoped Signed-off-by: Addisu Z. Taddese <[email protected]> * Address reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * Change scopeName to scopeContextName Signed-off-by: Addisu Z. Taddese <[email protected]> * Add warning to the help message of ign sdf -g command Signed-off-by: Addisu Z. Taddese <[email protected]> * Remove extraneous error comments Signed-off-by: Addisu Z. Taddese <[email protected]> * Address reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * Resolve additional merge conflicts Signed-off-by: Addisu Z. Taddese <[email protected]> * Cleanup Signed-off-by: Addisu Z. Taddese <[email protected]> * Address reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * State that *Count functions only count immediate child elements Signed-off-by: Addisu Z. Taddese <[email protected]> * Address reviewer feedback Signed-off-by: Addisu Z. Taddese <[email protected]> * Typo Signed-off-by: Addisu Z. Taddese <[email protected]> * Revert documentation updates to Root::*ByName and World::*ByName functions Signed-off-by: Addisu Z. Taddese <[email protected]> * Keep some of the changes from the previous commit Signed-off-by: Addisu Z. Taddese <[email protected]> * Move construction of PoseRelativeToGraph and FrameAttachedToGraph to sdf::Root (#1) * Move graph creation to sdf::Root from sdf::World and sdf::Model. Signed-off-by: Addisu Z. Taddese <[email protected]> * Convert ScopedGraph to hold a strong reference to the underlying graph Signed-off-by: Addisu Z. Taddese <[email protected]> * Add copy/move constructors to sdf::Root Signed-off-by: Addisu Z. Taddese <[email protected]> * Additional test of sdf::Root objects before copy and move Signed-off-by: Addisu Z. Taddese <[email protected]> * Fix typo Signed-off-by: Addisu Z. Taddese <[email protected]> * Explicitly delete copy constructor and assignment. Signed-off-by: Addisu Z. Taddese <[email protected]> Co-authored-by: Steve Peters <[email protected]>
- Loading branch information