1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 18:40:57 +02:00

gnu: Add python-orocos-kinematics-dynamics.

* gnu/packages/engineering.scm (python-orocos-kinematics-dynamics): New variable.

Change-Id: I257d63b61d8fab0fdfdf27dea59f1f89c8667f35
Reviewed-by: Cayetano Santos <csantosb@inventati.org>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>

Change-Id: I8cc0b705c81c191ede7624062bd1e62afe5e340b
This commit is contained in:
Matthew Elwin 2025-06-27 13:16:07 -05:00 committed by Sharlatan Hellseher
parent 897f1f03e7
commit c912d63eae
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -5597,3 +5597,50 @@ towards field theory.")
and representations for kinematic structures and their inverse and
forward kinematics solvers.")
(license license:lgpl2.1+))))
(define-public python-orocos-kinematics-dynamics
(package
(inherit orocos-kinematics-dynamics)
(name "python-orocos-kinematics-dynamics")
(source
(origin
(inherit (package-source orocos-kinematics-dynamics))
(snippet '(begin
(substitute* "python_orocos_kdl/CMakeLists.txt"
;; Use the system pybind11 instead of the bundled version
(("add_subdirectory\\(pybind11\\)")
"find_package(pybind11)")
;; change debian-specific python install directory
(("dist-packages")
"site-packages"))
;; ROS 1 uses some dynamic attributes, which are
;; disabled by default in pybind11. No harm in enabling them
;; See "https://github.com/ros2/geometry2/issues/624
;; and https://pybind11.readthedocs.io/en/stable/classes.html
;; #dynamic-attributes <Both accessed June 1 2025>
(substitute* "python_orocos_kdl/PyKDL/frames.cpp"
(("m, \"Vector\"")
"m, \"Vector\", py::dynamic_attr()")
(("m, \"Frame\"")
"m, \"Frame\", py::dynamic_attr()")
(("m, \"Twist\"")
"m, \"Twist\", py::dynamic_attr()")
(("m, \"Wrench\"")
"m, \"Wrench\", py::dynamic_attr()"))))))
(native-inputs (list python pybind11 python-psutil))
(inputs (list orocos-kinematics-dynamics))
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _
(chdir "python_orocos_kdl")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(setenv "PYTHONPATH" "./")
(when tests?
(invoke "python3"
"../python_orocos_kdl/tests/PyKDLtest.py")))))))
(synopsis "Python bindings for orocos-kinematics-dynamics")
(description "Python bindings for orocos-kinematics-dynamics.")))