Skip to content
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

Add python bindings for dynamical_systems module #238

Merged
merged 9 commits into from
Jan 12, 2022

Conversation

domire8
Copy link
Contributor

@domire8 domire8 commented Jan 11, 2022

Here it is finally, python bindings for the DS module!

It may be better to merge #236 first, and then I update this PR here before we merge it

@domire8 domire8 force-pushed the feature/ds-bindings branch from b76e830 to 02cfe34 Compare January 12, 2022 10:37
eeberhard
eeberhard previously approved these changes Jan 12, 2022
Copy link
Member

@eeberhard eeberhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! Great to see all this work coming together.

py::class_<DefaultDynamicalSystem<JointState>, IDynamicalSystem<JointState>>(m, "JointDefaultDS").def(py::init<>());
py::class_<PointAttractor<JointState>, IDynamicalSystem<JointState>>(m, "JointPointAttractorDS").def(py::init<>());

m.def("create_joint_ds", [](DynamicalSystemFactory<CartesianState>::DYNAMICAL_SYSTEM type) -> py::object {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of annoying to have to use the template argument DynamicalSystemFactory<CartesianState>::DYNAMICAL_SYSTEM to access the type, but I realise it's not possible to just do DynamicalSystemFactory::DYNAMICAL_SYSTEM. Since it's hidden on the python side it doesn't really matter anyway!

python/test/dynamical_systems/test_circular.py Outdated Show resolved Hide resolved
buschbapti
buschbapti previously approved these changes Jan 12, 2022
Co-authored-by: Enrico Eberhard <32450951+eeberhard@users.noreply.github.com>
@domire8 domire8 dismissed stale reviews from buschbapti and eeberhard via ceeaea7 January 12, 2022 13:26
@domire8 domire8 merged commit 2a53a5c into develop Jan 12, 2022
@domire8 domire8 deleted the feature/ds-bindings branch January 12, 2022 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants