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

Fix python bindings import issues #279

Merged
merged 3 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Release Versions:
- Improve installation script and python installation guide (#274)
- Fix path in protocol installation guide (#275)
- Add force limit parameter to Impedance controller (#276)
- Fix python bindings import issues (#279)

## 5.1.0

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.4
5.1.5
2 changes: 1 addition & 1 deletion doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Control Libraries"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 5.1.4
PROJECT_NUMBER = 5.1.5

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion protocol/clproto_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.9)
project(clproto VERSION 5.1.4)
project(clproto VERSION 5.1.5)

set(CMAKE_CXX_STANDARD 17)

Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
osqp_path_var = 'OSQP_INCLUDE_DIR'
openrobots_path_var = 'OPENROBOTS_INCLUDE_DIR'

__version__ = "5.1.4"
__version__ = "5.1.5"
__libraries__ = ['state_representation', 'clproto', 'controllers', 'dynamical_systems', 'robot_model']
__include_dirs__ = ['include']

Expand Down
3 changes: 2 additions & 1 deletion python/source/controllers/bind_cartesian_controllers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ using namespace state_representation;
using namespace py_parameter;

void cartesian_controller(py::module_& m) {
py::class_<IController<CartesianState>, std::shared_ptr<IController<CartesianState>>, ParameterMap, PyController<CartesianState>> c(m, "ICartesianController");
py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap");
py::class_<IController<CartesianState>, std::shared_ptr<IController<CartesianState>>, PyController<CartesianState>> c(m, "ICartesianController", parameter_map);

c.def(
"compute_command", py::overload_cast<const CartesianState&, const CartesianState&>(&IController<CartesianState>::compute_command),
Expand Down
3 changes: 2 additions & 1 deletion python/source/controllers/bind_joint_controllers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ using namespace state_representation;
using namespace py_parameter;

void joint_controller(py::module_& m) {
py::class_<IController<JointState>, std::shared_ptr<IController<JointState>>, ParameterMap, PyController<JointState>> c(m, "IJointController");
py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap");
py::class_<IController<JointState>, std::shared_ptr<IController<JointState>>, PyController<JointState>> c(m, "IJointController", parameter_map);

c.def(
"compute_command", py::overload_cast<const JointState&, const JointState&>(&IController<JointState>::compute_command),
Expand Down
2 changes: 2 additions & 0 deletions python/source/controllers/controllers_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ PYBIND11_MODULE(controllers, m) {
m.attr("__version__") = "dev";
#endif

py::module_::import("state_representation");

bind_type(m);
bind_computational_space(m);
bind_cartesian_controllers(m);
Expand Down
3 changes: 2 additions & 1 deletion python/source/dynamical_systems/bind_cartesian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
using namespace state_representation;

void cartesian(py::module_& m) {
py::class_<IDynamicalSystem<CartesianState>, std::shared_ptr<IDynamicalSystem<CartesianState>>, ParameterMap, PyDynamicalSystem<CartesianState>> c(m, "ICartesianDS");
py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap");
py::class_<IDynamicalSystem<CartesianState>, std::shared_ptr<IDynamicalSystem<CartesianState>>, PyDynamicalSystem<CartesianState>> c(m, "ICartesianDS", parameter_map);

c.def(py::init<>());

Expand Down
3 changes: 2 additions & 1 deletion python/source/dynamical_systems/bind_joint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
using namespace state_representation;

void joint(py::module_& m) {
py::class_<IDynamicalSystem<JointState>, std::shared_ptr<IDynamicalSystem<JointState>>, ParameterMap, PyDynamicalSystem<JointState>> c(m, "IJointDS");
py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap");
py::class_<IDynamicalSystem<JointState>, std::shared_ptr<IDynamicalSystem<JointState>>, PyDynamicalSystem<JointState>> c(m, "IJointDS", parameter_map);

c.def(py::init<>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ PYBIND11_MODULE(dynamical_systems, m) {
m.attr("__version__") = "dev";
#endif

py::module_::import("state_representation");

bind_type(m);
bind_cartesian(m);
bind_joint(m);
Expand Down
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(control_libraries VERSION 5.1.4)
project(control_libraries VERSION 5.1.5)

# Build options
option(BUILD_TESTING "Build all tests." OFF)
Expand Down