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

Don't make top-level spaces their own children #1100

Merged
merged 4 commits into from
Feb 6, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Feb 5, 2023

Now that top-level spaces can have transforms, they were hitting the path of add_children that identifies them as sub-spaces.

This avoids that by only adding children (we've already done the other insertions as appropriate).

Also for updating the transform-3d demo I wanted to log a root-level view_coordinates.

image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

@jleibs jleibs changed the title Don't make root-spaces their own children Don't make top-level spaces their own children Feb 5, 2023
@jleibs jleibs marked this pull request as ready for review February 5, 2023 17:01
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

I think you also need to readd the reverted 891a5b2 again - when you merge in master, you should find that reverting this prevents logging any transform to top level items

Very happy you took a look at this. I doubt I would have noticed the view_coordinates problem!

@@ -190,7 +190,15 @@ impl SpaceInfoCollection {
.child_spaces
.insert(tree.path.clone(), transform);

add_children(entity_db, &mut spaces_info, &mut space_info, tree, &query);
for child_tree in tree.children.values() {
Copy link
Member

Choose a reason for hiding this comment

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

ahh I didn't consider that add_children adds to the parent!

Hmm almost wondering now if we should instead do this loop on the root only (instead of having nested loops on children of children of root) plus having add_children something like this internally:

            let transform = query_transform(entity_db, entity_path, &query)
.or_else(|| (entity_path.len() == 1).then(|| Transform::Rigid3(re_log_types::Rigid3::IDENTITY)));

does that make sense?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was thinking the same thing but was trying to keep the fix small.

Comment on lines +527 to +532
// We normally disallow logging to root, but we make an exception for view_coordinates
let entity_path = if entity_path_str == "/" {
EntityPath::root()
} else {
parse_entity_path(entity_path_str)?
};
Copy link
Member

Choose a reason for hiding this comment

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

didn't think of this whole thing at all :O

@Wumpf Wumpf merged commit 81162f9 into main Feb 6, 2023
@Wumpf Wumpf deleted the jleibs/root_transform_fixes branch February 6, 2023 09:16
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.

None yet

2 participants