-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature/flexible layer #22
base: develop
Are you sure you want to change the base?
Conversation
Last change that I forgot: There is no more |
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.
Looks great! I think will make quite a few things nicer and easier to use!
* @param node_id node to get | ||
* @returns a potentially valid node constant reference | ||
*/ | ||
const SceneGraphNode* findNode(NodeId node_id) const; |
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.
Minor: While we're at it, wanted to throw out the point of mutable/const access with pointer members. How much do we care about the scene graph actually not being modified (including node attributes etc) when it is constant? I know this requires more duplicate interfaces for const access but might make some designs (multi-threading, read-only) easier.
/** | ||
* @brief Get a particular node in the layer | ||
* @param node_id node to get | ||
* @returns a potentially valid node constant reference |
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.
Can const refs be invalid?
*/ | ||
const SceneGraphNode* findNode(NodeId node_id) const override; | ||
const SceneGraphEdge* findEdge(NodeId source, NodeId target) const; |
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.
Minor: It would also be useful to have a findEdges(src)
function that gives all connectivity of a node. Maybe that is already implemented somewhere else though.
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.
There's a connections()
method that will get you the IDs of all the neighbors (but it is annoying to have to grab the edge attributes once you have those)
* @brief Get node id of deleted nodes | ||
*/ | ||
void getRemovedNodes(std::vector<NodeId>& removed_nodes, bool clear_removed) override; | ||
void getNewNodes(std::vector<NodeId>& new_nodes, bool clear_new) const; |
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.
Is there a reason for getting the result by reference? I usually like std::vector<NodeId> newNodes(bool clear_new=false)
better.
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.
I agree, but these get used in the scene graph class to populate all the new nodes, etc. for every layer (so it feels slightly cleaner to fill an existing vector instead of returning a new one and inserting)
include/spark_dsg/scene_graph_node.h
Outdated
@@ -70,29 +69,13 @@ class SceneGraphNode { | |||
* @param id the id of the node to create | |||
* @param layer the layer that the node will belong to | |||
* @param attrs attributes for the node | |||
* @param timestamp Optional node timestamp in nanoseconds |
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.
Is this still accurate?
} | ||
|
||
return total_nodes; | ||
} | ||
|
||
size_t DynamicSceneGraph::numDynamicNodes() const { | ||
size_t DynamicSceneGraph::numUnpartitionedNodes() const { |
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.
What does unpartitioned nodes mean? This looks like just num nodes in DSG to me?
@@ -108,7 +120,7 @@ void parseEdge(const AttributeFactory<EdgeAttributes>& factory, | |||
|
|||
void writeLayer(const SceneGraphLayer& graph, std::vector<uint8_t>& buffer) { | |||
BinarySerializer serializer(&buffer); | |||
serializer.write(graph.id); | |||
serializer.write(graph.id.layer); // we don't save partition IDs |
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.
Is there a reason not to save these? Just thinking of confusion potential if partitions get re-shuffeled/indexed during I/O.
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.
This serialization is distinct from the graph serialization. Layers can't be constructed standalone with a partition ID. I guess this would be a problem if you wanted to serialized a bunch of partitions from a graph independent of saving the graph (I think I punted on this because I didn't want to branch on file version)
* forward declare DynamicSceneGraph where possible * rework NodeSymbol and hide eigen in new file * forward declare node attributes and some bounding boxes * forward declare mesh for bounding box * forward declare edge attributes and remove graph utilities from layer * split bindings into separate files * push edges towards derived layers * (wip) move traits and status * split layer prefix from types * minor cleanup of node * simplify eraseVertices * drop getPosition and eigen dep * drop node symbol include * remove typedef from * add missing bindings and fix compilation * add binary serialization for python layers * fix pytorch tests * remove commented code --------- Co-authored-by: Nathan Hughes <[email protected]>
* try adding python workflow * add test deps * install torch cpu only * fix url typo * add python badge --------- Co-authored-by: Nathan Hughes <[email protected]>
* switch feature vector to single precision * bump version
* add room colormap and cleanup ironbow * add conversion to hsv and hls * move colormaps to be functions * move colormaps to new file * add 150 class map and divergent map * clean up discrete colormaps * better sort colormaps * improve divergent docstring --------- Co-authored-by: Nathan Hughes <[email protected]>
* add khronos object bindings * make complex types readonly for safety for now
* correctly parse flat meshes from old versions * Update src/node_attributes.cpp Co-authored-by: Lukas Schmid <[email protected]> --------- Co-authored-by: Nathan Hughes <[email protected]> Co-authored-by: Lukas Schmid <[email protected]>
* add mesh append function * expand mesh python bindings * add default args for transform
* recombine bindings and use system pybind11 * fix binding ordering for default args * revert back to fetch content and reformat cmake * revert changes for avoiding newer pybind features * conditionally enable zmq implementation * clean up dependencies and other changes * switch to submodule * enable verbose build * add more status * revert debugging and use recursive clone * install git before checking out code
* add graph metadata object * skip networkx tests if not available * add python metadata interface * add node and edge metadata * use nodesymbol as primary arg type and add implicit conversion * add node and edge metadata bindings
8de35eb
to
fb5a9b8
Compare
* fix ci build issue * update deprecated zmq functions
338ff0f
to
56363e3
Compare
0a8b0f2
to
0a8b29b
Compare
This includes several major changes that I want to put in front of everyone sooner rather than later:
DynamicSceneGraphLayer
withSceneGraphLayer
and changes terminology: "dynamic" layers are now "partitions" of a layer (where the normal layers are partition 0)setNodeAttributes
was removed in favor ofaddOrUpdateNode
)SceneGraphNode
no longer has a timestamp. Dynamics are being pushed to the attributesLayerPrefix
class that could be constructed via achar
). Most of the python functionality will still accept achar
in place of an integer partition ID, but it'll map to the ascii valueI haven't updated Hydra, etc. yet so some of the API is still subject to change (I'm trying to use the python unit tests here and Hydra to make sure the API is sane / things don't change too much)