Skip to content

Commit a305bad

Browse files
author
Murilo Marinho
committed
Addings stubs with pybind11-stubgen.
1 parent 8d8eb88 commit a305bad

File tree

4 files changed

+36
-29
lines changed

4 files changed

+36
-29
lines changed

.github/workflows/python_package.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555
run: |
5656
python -m pip install --upgrade pip
5757
pip install setuptools wheel setuptools-git-versioning
58+
- name: Generate Stubs
59+
run: |
60+
pip install pybind11-stubgen
61+
pybind11-stubgen dqrobotics --output-dir .
5862
- name: Compile
5963
run: |
6064
python setup.py bdist_wheel

py.typed

Whitespace-only changes.

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def build_extension(self, ext):
7979
'dqrobotics.interfaces.json11',
8080
'dqrobotics.robot_control',
8181
'dqrobotics.solvers'],
82+
package_data={
83+
'dqrobotics': ['py.typed'],
84+
},
8285
classifiers=[
8386
"Programming Language :: Python :: 3.10",
8487
"Programming Language :: Python :: 3.11",

src/dqrobotics_module.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,6 @@ PYBIND11_MODULE(_dqrobotics, m) {
4242
//DQ_Math
4343
init_DQ_Math_py(utils_py);
4444

45-
/*****************************************************
46-
* Robots Kinematic Models
47-
* **************************************************/
48-
py::module robots_py = m.def_submodule("_robots", "A submodule of dqrobotics");
49-
50-
//#include <dqrobotics/robots/Ax18ManipulatorRobot.h>
51-
py::class_<Ax18ManipulatorRobot> ax18manipulatorrobot_py(robots_py, "Ax18ManipulatorRobot");
52-
ax18manipulatorrobot_py.def_static("kinematics",&Ax18ManipulatorRobot::kinematics,"Returns the kinematics of the Ax18ManipulatorRobot");
53-
54-
//#include <dqrobotics/robots/BarrettWamArmRobot.h>
55-
py::class_<BarrettWamArmRobot> barrettwamarmrobot_py(robots_py, "BarrettWamArmRobot");
56-
barrettwamarmrobot_py.def_static("kinematics",&BarrettWamArmRobot::kinematics,"Returns the kinematics of the BarrettWamArmRobot");
57-
58-
//#include <dqrobotics/robots/ComauSmartSixRobot.h>
59-
py::class_<ComauSmartSixRobot> comausmartsixrobot_py(robots_py, "ComauSmartSixRobot");
60-
comausmartsixrobot_py.def_static("kinematics",&ComauSmartSixRobot::kinematics,"Returns the kinematics of the ComauSmartSixRobot");
61-
62-
//#include <dqrobotics/robots/KukaLw4Robot.h>
63-
py::class_<KukaLw4Robot> kukalw4robot_py(robots_py, "KukaLw4Robot");
64-
kukalw4robot_py.def_static("kinematics",&KukaLw4Robot::kinematics,"Returns the kinematics of the KukaLw4Robot");
65-
66-
//#include <dqrobotics/robots/KukaYoubotRobot.h>
67-
py::class_<KukaYoubotRobot> kukayoubotrobot_py(robots_py, "KukaYoubotRobot");
68-
kukayoubotrobot_py.def_static("kinematics",&KukaYoubotRobot::kinematics,"Returns the kinematics of the KukaYoubotRobot");
69-
70-
//#include <dqrobotics/robots/FrankaEmikaPandaRobot.h>
71-
py::class_<FrankaEmikaPandaRobot> frankaemikapandarobot_py(robots_py, "FrankaEmikaPandaRobot");
72-
frankaemikapandarobot_py.def_static("kinematics",&FrankaEmikaPandaRobot::kinematics,"Returns the kinematics of the FrankaEmikaPandaRobot");
73-
7445
/*****************************************************
7546
* Robot Modeling <dqrobotics/robot_modeling/...>
7647
* **************************************************/
@@ -109,6 +80,35 @@ PYBIND11_MODULE(_dqrobotics, m) {
10980
//DQ_SerialWholeBody
11081
init_DQ_SerialWholeBody_py(robot_modeling);
11182

83+
/*****************************************************
84+
* Robots Kinematic Models
85+
* **************************************************/
86+
py::module robots_py = m.def_submodule("_robots", "A submodule of dqrobotics");
87+
88+
//#include <dqrobotics/robots/Ax18ManipulatorRobot.h>
89+
py::class_<Ax18ManipulatorRobot> ax18manipulatorrobot_py(robots_py, "Ax18ManipulatorRobot");
90+
ax18manipulatorrobot_py.def_static("kinematics",&Ax18ManipulatorRobot::kinematics,"Returns the kinematics of the Ax18ManipulatorRobot");
91+
92+
//#include <dqrobotics/robots/BarrettWamArmRobot.h>
93+
py::class_<BarrettWamArmRobot> barrettwamarmrobot_py(robots_py, "BarrettWamArmRobot");
94+
barrettwamarmrobot_py.def_static("kinematics",&BarrettWamArmRobot::kinematics,"Returns the kinematics of the BarrettWamArmRobot");
95+
96+
//#include <dqrobotics/robots/ComauSmartSixRobot.h>
97+
py::class_<ComauSmartSixRobot> comausmartsixrobot_py(robots_py, "ComauSmartSixRobot");
98+
comausmartsixrobot_py.def_static("kinematics",&ComauSmartSixRobot::kinematics,"Returns the kinematics of the ComauSmartSixRobot");
99+
100+
//#include <dqrobotics/robots/KukaLw4Robot.h>
101+
py::class_<KukaLw4Robot> kukalw4robot_py(robots_py, "KukaLw4Robot");
102+
kukalw4robot_py.def_static("kinematics",&KukaLw4Robot::kinematics,"Returns the kinematics of the KukaLw4Robot");
103+
104+
//#include <dqrobotics/robots/KukaYoubotRobot.h>
105+
py::class_<KukaYoubotRobot> kukayoubotrobot_py(robots_py, "KukaYoubotRobot");
106+
kukayoubotrobot_py.def_static("kinematics",&KukaYoubotRobot::kinematics,"Returns the kinematics of the KukaYoubotRobot");
107+
108+
//#include <dqrobotics/robots/FrankaEmikaPandaRobot.h>
109+
py::class_<FrankaEmikaPandaRobot> frankaemikapandarobot_py(robots_py, "FrankaEmikaPandaRobot");
110+
frankaemikapandarobot_py.def_static("kinematics",&FrankaEmikaPandaRobot::kinematics,"Returns the kinematics of the FrankaEmikaPandaRobot");
111+
112112
/*****************************************************
113113
* Solvers <dqrobotics/solvers/...>
114114
* **************************************************/

0 commit comments

Comments
 (0)