-
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.
Implement distance and gravity tasks (#717)
Co-authored-by: Ehasn <[email protected]> Co-authored-by: Giulio Romualdi <[email protected]>
- Loading branch information
1 parent
0a3afff
commit 7723da1
Showing
18 changed files
with
1,710 additions
and
81 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/IK/include/BipedalLocomotion/bindings/IK/DistanceTask.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 DistanceTask.h | ||
* @authors Stefano Dafarra | ||
* @copyright 2023 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_IK_DISTANCE_TASK_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_IK_DISTANCE_TASK_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace IK | ||
{ | ||
|
||
void CreateDistanceTask(pybind11::module& module); | ||
|
||
} // namespace IK | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_IK_DISTANCE_TASK_H |
26 changes: 26 additions & 0 deletions
26
bindings/python/IK/include/BipedalLocomotion/bindings/IK/GravityTask.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 GravityTask.h | ||
* @authors Stefano Dafarra | ||
* @copyright 2023 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_IK_GRAVITY_TASK_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_IK_GRAVITY_TASK_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace IK | ||
{ | ||
|
||
void CreateGravityTask(pybind11::module& module); | ||
|
||
} // namespace IK | ||
} // namespace bindings | ||
} // namespace BipedalLocomotion | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_IK_GRAVITY_TASK_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,39 @@ | ||
/** | ||
* @file DistanceTask.cpp | ||
* @authors Stefano Dafarra | ||
* @copyright 2023 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/IK/DistanceTask.h> | ||
|
||
#include <BipedalLocomotion/bindings/IK/DistanceTask.h> | ||
#include <BipedalLocomotion/bindings/IK/IKLinearTask.h> | ||
#include <BipedalLocomotion/bindings/System/LinearTask.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace IK | ||
{ | ||
|
||
void CreateDistanceTask(pybind11::module& module) | ||
{ | ||
namespace py = ::pybind11; | ||
using namespace BipedalLocomotion::IK; | ||
|
||
py::class_<DistanceTask, std::shared_ptr<DistanceTask>, IKLinearTask>(module, "DistanceTask") | ||
.def(py::init()) | ||
.def("set_desired_distance", &DistanceTask::setDesiredDistance, py::arg("desired_distance")) | ||
.def("set_set_point", &DistanceTask::setSetPoint, py::arg("desired_distance")) | ||
.def("get_distance", &DistanceTask::getDistance); | ||
} | ||
|
||
} // namespace IK | ||
} // 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,46 @@ | ||
/** | ||
* @file GravityTask.cpp | ||
* @authors Stefano Dafarra | ||
* @copyright 2023 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/IK/GravityTask.h> | ||
|
||
#include <BipedalLocomotion/bindings/IK/GravityTask.h> | ||
#include <BipedalLocomotion/bindings/IK/IKLinearTask.h> | ||
#include <BipedalLocomotion/bindings/System/LinearTask.h> | ||
|
||
namespace BipedalLocomotion | ||
{ | ||
namespace bindings | ||
{ | ||
namespace IK | ||
{ | ||
|
||
void CreateGravityTask(pybind11::module& module) | ||
{ | ||
namespace py = ::pybind11; | ||
using namespace BipedalLocomotion::IK; | ||
|
||
py::class_<GravityTask, std::shared_ptr<GravityTask>, IKLinearTask>(module, "GravityTask") | ||
.def(py::init()) | ||
.def("set_desired_gravity_direction_in_target_frame", | ||
&GravityTask::setDesiredGravityDirectionInTargetFrame, | ||
py::arg("desired_gravity_direction")) | ||
.def("set_feedforward_velocity_in_target_frame", | ||
&GravityTask::setFeedForwardVelocityInTargetFrame, | ||
py::arg("feedforward_velocity")) | ||
.def("set_set_point", | ||
&GravityTask::setSetPoint, | ||
py::arg("desired_gravity_direction"), | ||
py::arg("feedforward_velocity") = Eigen::Vector3d::Zero()); | ||
} | ||
|
||
} // namespace IK | ||
} // 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
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
Oops, something went wrong.