Skip to content

Commit

Permalink
Create the python bindings for BipedalLocomotion::Math::StandardAccel…
Browse files Browse the repository at this point in the history
…erationOfGravitation
  • Loading branch information
GiulioRomualdi committed Feb 25, 2021
1 parent 5e55b32 commit 94e84fc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pybind11_add_module(pybind11_blf MODULE
SwingFootPlaner.cpp
TimeVaryingDCMPlanner.cpp
RobotInterface.cpp
Constants.cpp
)

target_link_libraries(pybind11_blf PUBLIC
Expand All @@ -23,6 +24,7 @@ target_link_libraries(pybind11_blf PUBLIC
BipedalLocomotion::System
BipedalLocomotion::RobotInterfaceYarpImplementation
BipedalLocomotion::Contacts
BipedalLocomotion::Math
)

target_include_directories(pybind11_blf PRIVATE
Expand Down
18 changes: 18 additions & 0 deletions bindings/python/Constants.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @file Constants.cpp
* @authors Giulio Romualdi
* @copyright 2021 Istituto Italiano di Tecnologia (IIT). This software may be modified and
* distributed under the terms of the GNU Lesser General Public License v2.1 or any later version.
*/

#include "BipedalLocomotion/Math/Constants.h"

#include "bipedal_locomotion_framework.h"

void BipedalLocomotion::bindings::CreateConstants(pybind11::module& module)
{
using namespace BipedalLocomotion::Math;

module.attr("StandardAccelerationOfGravitation")
= pybind11::float_(StandardAccelerationOfGravitation);
}
2 changes: 2 additions & 0 deletions bindings/python/bipedal_locomotion_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ PYBIND11_MODULE(bindings, m)
bindings::CreateISensorBridge(m);
bindings::CreateYarpSensorBridge(m);

// Constants.cpp
bindings::CreateConstants(m);
}

std::string bindings::ToString(const manif::SE3d& se3)
Expand Down
3 changes: 3 additions & 0 deletions bindings/python/bipedal_locomotion_framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ void CreateYarpRobotControl(pybind11::module& module);
void CreateISensorBridge(pybind11::module& module);
void CreateYarpSensorBridge(pybind11::module& module);

// Constants.cpp
void CreateConstants(pybind11::module& module);

} // namespace BipedalLocomotion::bindings

0 comments on commit 94e84fc

Please sign in to comment.