Skip to content

Commit

Permalink
add khronos object bindings (#15)
Browse files Browse the repository at this point in the history
* add khronos object bindings

* make complex types readonly for safety for now
  • Loading branch information
Schmluk committed Aug 14, 2024
1 parent 91bf2e2 commit e03d875
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions python/bindings/src/node_attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ void addBindings(pybind11::module_& module) {
attrs.world_R_object = rot;
});

py::class_<KhronosObjectAttributes, ObjectNodeAttributes>(module,
"KhronosObjectAttributes")
.def(py::init<>())
.def_readonly("first_observed_ns", &KhronosObjectAttributes::first_observed_ns)
.def_readonly("last_observed_ns", &KhronosObjectAttributes::last_observed_ns)
.def(
"mesh",
[](const KhronosObjectAttributes& attrs) { return &attrs.mesh; },
py::return_value_policy::reference_internal)
.def_readonly("trajectory_timestamps",
&KhronosObjectAttributes::trajectory_timestamps)
.def_readonly("trajectory_positions",
&KhronosObjectAttributes::trajectory_positions)
.def_readonly("dynamic_object_points",
&KhronosObjectAttributes::dynamic_object_points)
.def_readonly("details", &KhronosObjectAttributes::details);

py::class_<RoomNodeAttributes, SemanticNodeAttributes>(module, "RoomNodeAttributes")
.def(py::init<>())
.def_readwrite("semantic_class_probabilities",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = spark_dsg
version = 0.0.1
version = 1.0.5
author = Nathan Hughes
author_email = [email protected]
url: https://github.com/MIT-SPARK/Spark-DSG
Expand Down

0 comments on commit e03d875

Please sign in to comment.