-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PI-ADHERENT framework to ML (#889)
- Loading branch information
Showing
31 changed files
with
4,755 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
bindings/python/ML/include/BipedalLocomotion/bindings/ML/VelMANN.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @file VelMANN.h | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#ifndef BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANN(pybind11::module& module); | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_H |
26 changes: 26 additions & 0 deletions
26
bindings/python/ML/include/BipedalLocomotion/bindings/ML/VelMANNAutoregressive.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @file VelMANNAutoregressive.h | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#ifndef BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_TRAJECTORY_GENERATION_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_TRAJECTORY_GENERATION_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANNAutoregressive(pybind11::module& module); | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_TRAJECTORY_GENERATION_H |
26 changes: 26 additions & 0 deletions
26
bindings/python/ML/include/BipedalLocomotion/bindings/ML/VelMANNAutoregressiveInputBuilder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* @file VelMANNAutoregressiveInputBuilder.h | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#ifndef BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_AUTOREGRESSIVE_INPUT_BUILDER_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_AUTOREGRESSIVE_INPUT_BUILDER_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANNAutoregressiveInputBuilder(pybind11::module& module); | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_AUTOREGRESSIVE_INPUT_BUILDER_H |
26 changes: 26 additions & 0 deletions
26
bindings/python/ML/include/BipedalLocomotion/bindings/ML/VelMANNTrajectoryGenerator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* @file VelMANNTrajectoryGenerator.h | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#ifndef BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_TRAJECTORY_GENERATOR_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_TRAJECTORY_GENERATOR_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANNTrajectoryGenerator(pybind11::module& module); | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_ML_VEL_MANN_TRAJECTORY_GENERATOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* @file VelMANN.cpp | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#include <pybind11/eigen.h> | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
#include <BipedalLocomotion/ML/VelMANN.h> | ||
#include <BipedalLocomotion/bindings/ML/VelMANN.h> | ||
#include <BipedalLocomotion/bindings/System/Advanceable.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANN(pybind11::module& module) | ||
{ | ||
namespace py = ::pybind11; | ||
namespace ML = BipedalLocomotion::ML; | ||
namespace System = BipedalLocomotion::System; | ||
|
||
py::class_<ML::VelMANNInput>(module, "VelMANNInput") | ||
.def(py::init()) | ||
.def_readwrite("base_linear_velocity_trajectory", &ML::VelMANNInput::baseLinearVelocityTrajectory) | ||
.def_readwrite("base_angular_velocity_trajectory", &ML::VelMANNInput::baseAngularVelocityTrajectory) | ||
.def_readwrite("joint_positions", &ML::VelMANNInput::jointPositions) | ||
.def_readwrite("joint_velocities", &ML::VelMANNInput::jointVelocities); | ||
|
||
py::class_<ML::VelMANNOutput>(module, "VelMANNOutput") | ||
.def(py::init()) | ||
.def_readwrite("future_base_linear_velocity_trajectory", | ||
&ML::VelMANNOutput::futureBaseLinearVelocityTrajectory) | ||
.def_readwrite("future_base_angular_velocity_trajectory", | ||
&ML::VelMANNOutput::futureBaseAngularVelocityTrajectory) | ||
.def_readwrite("joint_positions", &ML::VelMANNOutput::jointPositions) | ||
.def_readwrite("joint_velocities", &ML::VelMANNOutput::jointVelocities); | ||
|
||
BipedalLocomotion::bindings::System::CreateAdvanceable<ML::VelMANNInput, // | ||
ML::VelMANNOutput>(module, "VelMANN"); | ||
py::class_<ML::VelMANN, System::Advanceable<ML::VelMANNInput, ML::VelMANNOutput>>(module, "VelMANN") | ||
.def(py::init()); | ||
} | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* @file VelMANNAutoregressive.cpp | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#include <iDynTree/Model/Model.h> | ||
#include <pybind11/eigen.h> | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
#include <BipedalLocomotion/ML/VelMANNAutoregressive.h> | ||
#include <BipedalLocomotion/bindings/ML/VelMANNAutoregressive.h> | ||
#include <BipedalLocomotion/bindings/System/Advanceable.h> | ||
#include <BipedalLocomotion/bindings/type_caster/swig.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANNAutoregressive(pybind11::module& module) | ||
{ | ||
namespace py = ::pybind11; | ||
namespace ML = BipedalLocomotion::ML; | ||
namespace System = BipedalLocomotion::System; | ||
|
||
py::class_<ML::VelMANNAutoregressiveInput>(module, "VelMANNAutoregressiveInput") | ||
.def(py::init()) | ||
.def_readwrite("desired_future_base_trajectory", | ||
&ML::VelMANNAutoregressiveInput::desiredFutureBaseTrajectory) | ||
.def_readwrite("desired_future_base_directions", | ||
&ML::VelMANNAutoregressiveInput::desiredFutureBaseDirections) | ||
.def_readwrite("desired_future_base_velocities", | ||
&ML::VelMANNAutoregressiveInput::desiredFutureBaseVelocities) | ||
.def_readwrite("desired_future_base_angular_velocities", | ||
&ML::VelMANNAutoregressiveInput::desiredFutureBaseAngVelocities); | ||
|
||
py::class_<ML::VelMANNAutoregressiveOutput>(module, "VelMANNAutoregressiveOutput") | ||
.def(py::init()) | ||
.def_readwrite("joint_positions", &ML::VelMANNAutoregressiveOutput::jointsPosition) | ||
.def_readwrite("joint_velocities", &ML::VelMANNAutoregressiveOutput::jointsVelocity) | ||
.def_readwrite("base_pose", &ML::VelMANNAutoregressiveOutput::basePose) | ||
.def_readwrite("base_velocity", &ML::VelMANNAutoregressiveOutput::baseVelocity) | ||
.def_readwrite("left_foot_pose", &ML::VelMANNAutoregressiveOutput::leftFootPose) | ||
.def_readwrite("right_foot_pose", &ML::VelMANNAutoregressiveOutput::rightFootPose) | ||
.def_readwrite("left_foot_velocity", &ML::VelMANNAutoregressiveOutput::leftFootVelocity) | ||
.def_readwrite("right_foot_velocity", &ML::VelMANNAutoregressiveOutput::rightFootVelocity) | ||
.def_readwrite("left_foot", &ML::VelMANNAutoregressiveOutput::leftFoot) | ||
.def_readwrite("right_foot", &ML::VelMANNAutoregressiveOutput::rightFoot); | ||
|
||
BipedalLocomotion::bindings::System::CreateAdvanceable<ML::VelMANNAutoregressiveInput, // | ||
ML::VelMANNAutoregressiveOutput> // | ||
(module, "VelMANNAutoregressive"); | ||
py::class_<ML::VelMANNAutoregressive, | ||
System::Advanceable<ML::VelMANNAutoregressiveInput, // | ||
ML::VelMANNAutoregressiveOutput>>(module, "VelMANNAutoregressive") | ||
.def(py::init()) | ||
.def("reset", | ||
py::overload_cast<Eigen::Ref<const Eigen::VectorXd>, const manif::SE3d&>( | ||
&ML::VelMANNAutoregressive::reset), | ||
py::arg("joint_positions"), | ||
py::arg("base_pose")) | ||
.def("set_robot_model", [](ML::VelMANNAutoregressive& impl, ::pybind11::object& obj) { | ||
iDynTree::Model* cls = py::detail::swig_wrapped_pointer_to_pybind<iDynTree::Model>(obj); | ||
|
||
if (cls == nullptr) | ||
{ | ||
throw ::pybind11::value_error("Invalid input for the function. Please provide " | ||
"an iDynTree::Model object."); | ||
} | ||
return impl.setRobotModel(*cls); | ||
}); | ||
} | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion |
46 changes: 46 additions & 0 deletions
46
bindings/python/ML/src/VelMANNAutoregressiveInputBuilder.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @file VelMANNAutoregressiveInputBuilder.cpp | ||
* @authors Evelyn D'Elia | ||
* @copyright 2024 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the BSD-3-Clause license. | ||
*/ | ||
|
||
#include <pybind11/eigen.h> | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
#include <BipedalLocomotion/ML/VelMANNAutoregressiveInputBuilder.h> | ||
#include <BipedalLocomotion/bindings/ML/VelMANNAutoregressiveInputBuilder.h> | ||
#include <BipedalLocomotion/bindings/System/Advanceable.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace ML | ||
{ | ||
|
||
void CreateVelMANNAutoregressiveInputBuilder(pybind11::module& module) | ||
{ | ||
namespace py = ::pybind11; | ||
namespace ML = BipedalLocomotion::ML; | ||
namespace System = BipedalLocomotion::System; | ||
|
||
py::class_<ML::VelMANNDirectionalInput>(module, "VelMANNDirectionalInput") | ||
.def(py::init()) | ||
.def_readwrite("motion_direction", &ML::VelMANNDirectionalInput::motionDirection) | ||
.def_readwrite("base_direction", &ML::VelMANNDirectionalInput::baseDirection); | ||
|
||
BipedalLocomotion::bindings::System::CreateAdvanceable<ML::VelMANNDirectionalInput, // | ||
ML::VelMANNAutoregressiveInput> // | ||
(module, "VelMANNAutoregressiveInputBuilder"); | ||
py::class_<ML::VelMANNAutoregressiveInputBuilder, | ||
System::Advanceable<ML::VelMANNDirectionalInput, // | ||
ML::VelMANNAutoregressiveInput>>(module, | ||
"VelMANNAutoregressiveInputBuilder") | ||
.def(py::init()); | ||
} | ||
|
||
} // namespace ML | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion |
Oops, something went wrong.