Skip to content

Commit

Permalink
[wrapper.cpp] feat: export total_mass
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroIshida committed Jul 11, 2024
1 parent 158c9f6 commit 2f1fe1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/tinyfk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ def compute_inter_link_sqdists(
def clear_cache(self) -> None:
self._robot.clear_cache()

@property
def total_mass(self) -> float:
return self._robot.total_mass_

def __getstate__(self): # pickling
state = self.__dict__.copy()
state["_robot"] = None
Expand Down
1 change: 1 addition & 0 deletions src/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ PYBIND11_MODULE(_tinyfk, m) {

py::class_<KinematicsModelPyWrapper>(m, "RobotModel")
.def(py::init<std::string &>())
.def_readonly("total_mass_", &KinematicsModelPyWrapper::total_mass_)
.def("get_root_link_name", &KinematicsModelPyWrapper::get_root_link_name)
.def("solve_forward_kinematics",
&KinematicsModelPyWrapper::solve_forward_kinematics)
Expand Down

0 comments on commit 2f1fe1f

Please sign in to comment.