placo 0.4.9__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of placo might be problematic. Click here for more details.
- {placo-0.4.9 → placo-0.5.1}/CMakeLists.txt +1 -0
- {placo-0.4.9 → placo-0.5.1}/PKG-INFO +1 -1
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-dynamics.cpp +3 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-kinematics.cpp +12 -2
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-problem.cpp +2 -1
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-robot-wrapper.cpp +6 -0
- {placo-0.4.9 → placo-0.5.1}/placo.pyi +151 -5
- {placo-0.4.9 → placo-0.5.1}/pyproject.toml +1 -1
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/dynamics_solver.cpp +8 -1
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/dynamics_solver.h +22 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/walk_tasks.cpp +8 -10
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/com_polygon_constraint.cpp +0 -1
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/gear_task.cpp +0 -1
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/kinematics_solver.cpp +49 -24
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/kinematics_solver.h +22 -5
- placo-0.5.1/src/placo/kinematics/manipulability_task.cpp +73 -0
- placo-0.5.1/src/placo/kinematics/manipulability_task.h +50 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/model/robot_wrapper.cpp +21 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/model/robot_wrapper.h +10 -0
- {placo-0.4.9 → placo-0.5.1}/.clang-format +0 -0
- {placo-0.4.9 → placo-0.5.1}/.gitattributes +0 -0
- {placo-0.4.9 → placo-0.5.1}/.gitignore +0 -0
- {placo-0.4.9 → placo-0.5.1}/.readthedocs.yaml +0 -0
- {placo-0.4.9 → placo-0.5.1}/Doxyfile +0 -0
- {placo-0.4.9 → placo-0.5.1}/LICENSE +0 -0
- {placo-0.4.9 → placo-0.5.1}/Makefile +0 -0
- {placo-0.4.9 → placo-0.5.1}/README.md +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-eigen.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-footsteps.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-parameters.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-tools.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-utils.hpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/expose-walk-pattern-generator.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/module.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/module.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/registry.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/bindings/registry.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/doxygen_parse.py +0 -0
- {placo-0.4.9 → placo-0.5.1}/python/.vscode/settings.json +0 -0
- {placo-0.4.9 → placo-0.5.1}/python/Makefile +0 -0
- {placo-0.4.9 → placo-0.5.1}/python/placo_utils/__init__.py +0 -0
- {placo-0.4.9 → placo-0.5.1}/python/placo_utils/tf.py +0 -0
- {placo-0.4.9 → placo-0.5.1}/python/placo_utils/visualization.py +0 -0
- {placo-0.4.9 → placo-0.5.1}/python/run_tests.sh +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/com_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/com_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/contacts.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/contacts.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/frame_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/frame_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/gear_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/gear_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/joints_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/joints_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/orientation_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/orientation_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/position_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/position_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/reaction_ratio_constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/reaction_ratio_constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/relative_frame_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/relative_frame_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/relative_orientation_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/relative_position_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/relative_position_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/torque_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/dynamics/torque_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/foot_trajectory.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/foot_trajectory.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/footsteps_planner.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/footsteps_planner.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/humanoid_parameters.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/humanoid_robot.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/humanoid_robot.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/kick.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/kick.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/lipm.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/lipm.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/swing_foot.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/swing_foot.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/swing_foot_cubic.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/swing_foot_quintic.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/walk_pattern_generator.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/walk_pattern_generator.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/humanoid/walk_tasks.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/axis_align_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/axis_align_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/centroidal_momentum_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/com_polygon_constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/com_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/com_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/cone_constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/cone_constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/distance_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/distance_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/frame_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/frame_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/gear_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/joints_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/joints_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/orientation_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/orientation_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/position_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/position_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/regularization_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/regularization_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/relative_frame_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/relative_frame_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/relative_orientation_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/relative_position_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/relative_position_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/wheel_task.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/kinematics/wheel_task.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/expression.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/expression.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/integrator.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/integrator.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/polygon_constraint.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/polygon_constraint.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/problem.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/problem.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/qp_error.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/qp_error.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/sparsity.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/sparsity.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/variable.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/problem/variable.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/axises_mask.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/axises_mask.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/cubic_spline.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/cubic_spline.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/cubic_spline_3d.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/cubic_spline_3d.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/prioritized.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/prioritized.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/utils.cpp +0 -0
- {placo-0.4.9 → placo-0.5.1}/src/placo/tools/utils.h +0 -0
- {placo-0.4.9 → placo-0.5.1}/stubs.py +0 -0
- {placo-0.4.9 → placo-0.5.1}/tweak_sdist.sh +0 -0
- {placo-0.4.9 → placo-0.5.1}/wks.yml +0 -0
|
@@ -78,6 +78,7 @@ add_library(libplaco SHARED
|
|
|
78
78
|
src/placo/kinematics/gear_task.cpp
|
|
79
79
|
src/placo/kinematics/wheel_task.cpp
|
|
80
80
|
src/placo/kinematics/regularization_task.cpp
|
|
81
|
+
src/placo/kinematics/manipulability_task.cpp
|
|
81
82
|
src/placo/kinematics/kinetic_energy_regularization_task.cpp
|
|
82
83
|
src/placo/kinematics/constraint.cpp
|
|
83
84
|
src/placo/kinematics/avoid_self_collisions_constraint.cpp
|
|
@@ -24,6 +24,8 @@ void exposeDynamics()
|
|
|
24
24
|
"tau", +[](const DynamicsSolver::Result& result) { return result.tau; })
|
|
25
25
|
.add_property(
|
|
26
26
|
"qdd", +[](const DynamicsSolver::Result& result) { return result.qdd; })
|
|
27
|
+
.add_property(
|
|
28
|
+
"tau_contacts", +[](const DynamicsSolver::Result& result) { return result.tau_contacts; })
|
|
27
29
|
.def(
|
|
28
30
|
"tau_dict", +[](const DynamicsSolver::Result& result, RobotWrapper& robot) {
|
|
29
31
|
boost::python::dict dict;
|
|
@@ -81,6 +83,7 @@ void exposeDynamics()
|
|
|
81
83
|
.def_readwrite("dt", &DynamicsSolver::dt)
|
|
82
84
|
.def_readwrite("qdd_safe", &DynamicsSolver::qdd_safe)
|
|
83
85
|
.def_readwrite("gravity_only", &DynamicsSolver::gravity_only)
|
|
86
|
+
.def_readwrite("torque_cost", &DynamicsSolver::torque_cost)
|
|
84
87
|
.def("mask_fbase", &DynamicsSolver::mask_fbase)
|
|
85
88
|
.def("add_point_contact", &DynamicsSolver::add_point_contact, return_internal_reference<>())
|
|
86
89
|
.def("add_unilateral_point_contact", &DynamicsSolver::add_unilateral_point_contact, return_internal_reference<>())
|
|
@@ -20,7 +20,6 @@ void exposeKinematics()
|
|
|
20
20
|
class_<KinematicsSolver> solver_class =
|
|
21
21
|
class__<KinematicsSolver>("KinematicsSolver", init<RobotWrapper&>())
|
|
22
22
|
.add_property("problem", &KinematicsSolver::problem)
|
|
23
|
-
.add_property("noise", &KinematicsSolver::noise, &KinematicsSolver::noise)
|
|
24
23
|
.add_property("dt", &KinematicsSolver::dt, &KinematicsSolver::dt)
|
|
25
24
|
.add_property("N", &KinematicsSolver::N)
|
|
26
25
|
.add_property("scale", &KinematicsSolver::scale)
|
|
@@ -77,6 +76,10 @@ void exposeKinematics()
|
|
|
77
76
|
// Regularization task
|
|
78
77
|
.def("add_regularization_task", &KinematicsSolver::add_regularization_task, return_internal_reference<>())
|
|
79
78
|
|
|
79
|
+
// Manipulability task
|
|
80
|
+
.def<ManipulabilityTask& (KinematicsSolver::*)(std::string, std::string, double)>(
|
|
81
|
+
"add_manipulability_task", &KinematicsSolver::add_manipulability_task, return_internal_reference<>())
|
|
82
|
+
|
|
80
83
|
// Kinetic energy regularization task
|
|
81
84
|
.def("add_kinetic_energy_regularization_task", &KinematicsSolver::add_kinetic_energy_regularization_task,
|
|
82
85
|
return_internal_reference<>())
|
|
@@ -111,7 +114,8 @@ void exposeKinematics()
|
|
|
111
114
|
.def<void (KinematicsSolver::*)(Task&)>("remove_task", &KinematicsSolver::remove_task)
|
|
112
115
|
.def<void (KinematicsSolver::*)(FrameTask&)>("remove_task", &KinematicsSolver::remove_task)
|
|
113
116
|
.def("remove_constraint", &KinematicsSolver::remove_constraint)
|
|
114
|
-
.def("solve", &KinematicsSolver::solve)
|
|
117
|
+
.def("solve", &KinematicsSolver::solve)
|
|
118
|
+
.def("add_q_noise", &KinematicsSolver::add_q_noise);
|
|
115
119
|
|
|
116
120
|
class__<Task, bases<tools::Prioritized>, boost::noncopyable>("Task", no_init)
|
|
117
121
|
.add_property(
|
|
@@ -216,6 +220,12 @@ void exposeKinematics()
|
|
|
216
220
|
|
|
217
221
|
class__<RegularizationTask, bases<Task>>("RegularizationTask");
|
|
218
222
|
|
|
223
|
+
class__<ManipulabilityTask, bases<Task>>("ManipulabilityTask",
|
|
224
|
+
init<RobotWrapper::FrameIndex, ManipulabilityTask::Type, double>())
|
|
225
|
+
.def_readwrite("lambda", &ManipulabilityTask::lambda)
|
|
226
|
+
.def_readwrite("minimize", &ManipulabilityTask::minimize)
|
|
227
|
+
.def_readonly("manipulability", &ManipulabilityTask::manipulability);
|
|
228
|
+
|
|
219
229
|
class__<KineticEnergyRegularizationTask, bases<RegularizationTask>>("KineticEnergyRegularizationTask");
|
|
220
230
|
|
|
221
231
|
class__<Constraint, bases<tools::Prioritized>, boost::noncopyable>("KinematicsConstraint", no_init);
|
|
@@ -22,6 +22,7 @@ using namespace placo;
|
|
|
22
22
|
using namespace placo::problem;
|
|
23
23
|
|
|
24
24
|
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(expr_overloads, expr, 0, 2);
|
|
25
|
+
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(integrator_expr_overloads, expr, 1, 2);
|
|
25
26
|
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(configure_overloads, configure, 1, 2);
|
|
26
27
|
|
|
27
28
|
void exposeProblem()
|
|
@@ -91,7 +92,7 @@ void exposeProblem()
|
|
|
91
92
|
"B", +[](const Integrator& i) { return i.B; })
|
|
92
93
|
.add_property(
|
|
93
94
|
"final_transition_matrix", +[](const Integrator& i) { return i.final_transition_matrix; })
|
|
94
|
-
.def("expr", &Integrator::expr)
|
|
95
|
+
.def("expr", &Integrator::expr, integrator_expr_overloads())
|
|
95
96
|
.def("expr_t", &Integrator::expr_t)
|
|
96
97
|
.def("value", &Integrator::value)
|
|
97
98
|
.def("get_trajectory", &Integrator::get_trajectory);
|
|
@@ -43,6 +43,12 @@ void exposeRobotType(class_<RobotType, W1>& type)
|
|
|
43
43
|
.def("set_torque_limit", &RobotType::set_torque_limit)
|
|
44
44
|
.def("set_joint_limits", &RobotType::set_joint_limits)
|
|
45
45
|
.def("update_kinematics", &RobotType::update_kinematics)
|
|
46
|
+
.def("compute_hessians", &RobotType::compute_hessians)
|
|
47
|
+
.def(
|
|
48
|
+
"get_frame_hessian",
|
|
49
|
+
+[](RobotType& robot, const std::string frame, const std::string joint) {
|
|
50
|
+
return robot.get_frame_hessian(robot.model.getFrameId(frame), robot.get_joint_v_offset(joint));
|
|
51
|
+
})
|
|
46
52
|
.def("get_T_world_fbase", &RobotType::get_T_world_fbase)
|
|
47
53
|
.def("set_T_world_fbase", &RobotType::set_T_world_fbase)
|
|
48
54
|
.def("com_world", &RobotType::com_world)
|
|
@@ -52,6 +52,7 @@ KinematicsSolver = typing.NewType("KinematicsSolver", None)
|
|
|
52
52
|
KineticEnergyRegularizationTask = typing.NewType("KineticEnergyRegularizationTask", None)
|
|
53
53
|
LIPM = typing.NewType("LIPM", None)
|
|
54
54
|
LIPMTrajectory = typing.NewType("LIPMTrajectory", None)
|
|
55
|
+
ManipulabilityTask = typing.NewType("ManipulabilityTask", None)
|
|
55
56
|
OrientationTask = typing.NewType("OrientationTask", None)
|
|
56
57
|
PointContact = typing.NewType("PointContact", None)
|
|
57
58
|
PolygonConstraint = typing.NewType("PolygonConstraint", None)
|
|
@@ -2206,6 +2207,10 @@ class DynamicsSolver:
|
|
|
2206
2207
|
) -> DynamicsSolverResult:
|
|
2207
2208
|
...
|
|
2208
2209
|
|
|
2210
|
+
torque_cost: float # double
|
|
2211
|
+
"""Cost for torque regularization.
|
|
2212
|
+
"""
|
|
2213
|
+
|
|
2209
2214
|
|
|
2210
2215
|
class DynamicsSolverResult:
|
|
2211
2216
|
def __init__(
|
|
@@ -2220,6 +2225,8 @@ class DynamicsSolverResult:
|
|
|
2220
2225
|
|
|
2221
2226
|
tau: numpy.ndarray # Eigen::VectorXd
|
|
2222
2227
|
|
|
2228
|
+
tau_contacts: numpy.ndarray # Eigen::VectorXd
|
|
2229
|
+
|
|
2223
2230
|
def tau_dict(
|
|
2224
2231
|
arg1: DynamicsSolverResult,
|
|
2225
2232
|
arg2: RobotWrapper,
|
|
@@ -3256,6 +3263,13 @@ class HumanoidRobot:
|
|
|
3256
3263
|
"""Gets the CoM position in the world."""
|
|
3257
3264
|
...
|
|
3258
3265
|
|
|
3266
|
+
def compute_hessians(
|
|
3267
|
+
self: HumanoidRobot,
|
|
3268
|
+
|
|
3269
|
+
) -> None:
|
|
3270
|
+
"""Compute kinematics hessians."""
|
|
3271
|
+
...
|
|
3272
|
+
|
|
3259
3273
|
def dcm(
|
|
3260
3274
|
self: HumanoidRobot,
|
|
3261
3275
|
com_velocity: numpy.ndarray, # Eigen::Vector2d
|
|
@@ -3406,6 +3420,15 @@ class HumanoidRobot:
|
|
|
3406
3420
|
:return: Center of mass velocity"""
|
|
3407
3421
|
...
|
|
3408
3422
|
|
|
3423
|
+
def get_frame_hessian(
|
|
3424
|
+
self: HumanoidRobot,
|
|
3425
|
+
frame: any, # pinocchio::FrameIndex
|
|
3426
|
+
joint_v_index: int, # int
|
|
3427
|
+
|
|
3428
|
+
) -> numpy.ndarray:
|
|
3429
|
+
"""Get the component for the hessian of a given frame for a given joint."""
|
|
3430
|
+
...
|
|
3431
|
+
|
|
3409
3432
|
def get_joint(
|
|
3410
3433
|
self: HumanoidRobot,
|
|
3411
3434
|
name: str, # const std::string &
|
|
@@ -4351,6 +4374,23 @@ class KinematicsSolver:
|
|
|
4351
4374
|
:return: regularization task"""
|
|
4352
4375
|
...
|
|
4353
4376
|
|
|
4377
|
+
def add_manipulability_task(
|
|
4378
|
+
self: KinematicsSolver,
|
|
4379
|
+
frame: str, # std::string
|
|
4380
|
+
type: str = "both", # std::string
|
|
4381
|
+
lambda_: float = 1.0, # double
|
|
4382
|
+
|
|
4383
|
+
) -> ManipulabilityTask:
|
|
4384
|
+
"""Adds a manipulability regularization task for a given magnitude.
|
|
4385
|
+
|
|
4386
|
+
|
|
4387
|
+
:param frame: the reference frame
|
|
4388
|
+
|
|
4389
|
+
:param type: type (position, orientation or both)
|
|
4390
|
+
|
|
4391
|
+
:return: manipulability task"""
|
|
4392
|
+
...
|
|
4393
|
+
|
|
4354
4394
|
def add_orientation_task(
|
|
4355
4395
|
self: KinematicsSolver,
|
|
4356
4396
|
frame: str, # std::string
|
|
@@ -4383,6 +4423,17 @@ class KinematicsSolver:
|
|
|
4383
4423
|
:return: position task"""
|
|
4384
4424
|
...
|
|
4385
4425
|
|
|
4426
|
+
def add_q_noise(
|
|
4427
|
+
self: KinematicsSolver,
|
|
4428
|
+
noise: float = 1e-5, # double
|
|
4429
|
+
|
|
4430
|
+
) -> None:
|
|
4431
|
+
"""Adds some noise on the configuration of the robot (q)
|
|
4432
|
+
|
|
4433
|
+
|
|
4434
|
+
:param noise: noise level, expressed in ratio of the joint limits"""
|
|
4435
|
+
...
|
|
4436
|
+
|
|
4386
4437
|
def add_regularization_task(
|
|
4387
4438
|
self: KinematicsSolver,
|
|
4388
4439
|
magnitude: float = 1e-6, # double
|
|
@@ -4532,10 +4583,6 @@ class KinematicsSolver:
|
|
|
4532
4583
|
"""Decides if the floating base should be masked."""
|
|
4533
4584
|
...
|
|
4534
4585
|
|
|
4535
|
-
noise: float # double
|
|
4536
|
-
"""Some configuration noise added before solving.
|
|
4537
|
-
"""
|
|
4538
|
-
|
|
4539
4586
|
problem: Problem # placo::problem::Problem
|
|
4540
4587
|
"""The underlying QP problem.
|
|
4541
4588
|
"""
|
|
@@ -4816,6 +4863,89 @@ class LIPMTrajectory:
|
|
|
4816
4863
|
...
|
|
4817
4864
|
|
|
4818
4865
|
|
|
4866
|
+
class ManipulabilityTask:
|
|
4867
|
+
A: numpy.ndarray # Eigen::MatrixXd
|
|
4868
|
+
"""Matrix A in the task Ax = b, where x are the joint delta positions.
|
|
4869
|
+
"""
|
|
4870
|
+
|
|
4871
|
+
def __init__(
|
|
4872
|
+
self: ManipulabilityTask,
|
|
4873
|
+
frame_index: any, # pinocchio::FrameIndex
|
|
4874
|
+
type: any, # placo::kinematics::ManipulabilityTask::Type
|
|
4875
|
+
lambda: float = 1.0, # double
|
|
4876
|
+
|
|
4877
|
+
) -> any:
|
|
4878
|
+
...
|
|
4879
|
+
|
|
4880
|
+
b: numpy.ndarray # Eigen::MatrixXd
|
|
4881
|
+
"""Vector b in the task Ax = b, where x are the joint delta positions.
|
|
4882
|
+
"""
|
|
4883
|
+
|
|
4884
|
+
def configure(
|
|
4885
|
+
self: ManipulabilityTask,
|
|
4886
|
+
name: str, # std::string
|
|
4887
|
+
priority: any, # placo::kinematics::ConeConstraint::Priority
|
|
4888
|
+
weight: float = 1.0, # double
|
|
4889
|
+
|
|
4890
|
+
) -> None:
|
|
4891
|
+
"""Configures the object.
|
|
4892
|
+
|
|
4893
|
+
|
|
4894
|
+
:param name: task name
|
|
4895
|
+
|
|
4896
|
+
:param priority: task priority (hard, soft or scaled)
|
|
4897
|
+
|
|
4898
|
+
:param weight: task weight"""
|
|
4899
|
+
...
|
|
4900
|
+
|
|
4901
|
+
def error(
|
|
4902
|
+
self: ManipulabilityTask,
|
|
4903
|
+
|
|
4904
|
+
) -> numpy.ndarray:
|
|
4905
|
+
"""Task errors (vector)
|
|
4906
|
+
|
|
4907
|
+
|
|
4908
|
+
:return: task errors"""
|
|
4909
|
+
...
|
|
4910
|
+
|
|
4911
|
+
def error_norm(
|
|
4912
|
+
self: ManipulabilityTask,
|
|
4913
|
+
|
|
4914
|
+
) -> float:
|
|
4915
|
+
"""The task error norm.
|
|
4916
|
+
|
|
4917
|
+
|
|
4918
|
+
:return: task error norm"""
|
|
4919
|
+
...
|
|
4920
|
+
|
|
4921
|
+
lambda: float # double
|
|
4922
|
+
"""Importance of the hessian regularization.
|
|
4923
|
+
"""
|
|
4924
|
+
|
|
4925
|
+
manipulability: bool # bool
|
|
4926
|
+
"""The last computed manipulability value.
|
|
4927
|
+
"""
|
|
4928
|
+
|
|
4929
|
+
minimize: bool # bool
|
|
4930
|
+
"""Should the manipulability be minimized (can be useful to find singularities)
|
|
4931
|
+
"""
|
|
4932
|
+
|
|
4933
|
+
name: str # std::string
|
|
4934
|
+
"""Object name.
|
|
4935
|
+
"""
|
|
4936
|
+
|
|
4937
|
+
priority: any # placo::kinematics::ConeConstraint::Priority
|
|
4938
|
+
"""Object priority.
|
|
4939
|
+
"""
|
|
4940
|
+
|
|
4941
|
+
def update(
|
|
4942
|
+
self: ManipulabilityTask,
|
|
4943
|
+
|
|
4944
|
+
) -> None:
|
|
4945
|
+
"""Update the task A and b matrices from the robot state and targets."""
|
|
4946
|
+
...
|
|
4947
|
+
|
|
4948
|
+
|
|
4819
4949
|
class OrientationTask:
|
|
4820
4950
|
A: numpy.ndarray # Eigen::MatrixXd
|
|
4821
4951
|
"""Matrix A in the task Ax = b, where x are the joint delta positions.
|
|
@@ -5692,6 +5822,13 @@ class RobotWrapper:
|
|
|
5692
5822
|
"""Gets the CoM position in the world."""
|
|
5693
5823
|
...
|
|
5694
5824
|
|
|
5825
|
+
def compute_hessians(
|
|
5826
|
+
self: RobotWrapper,
|
|
5827
|
+
|
|
5828
|
+
) -> None:
|
|
5829
|
+
"""Compute kinematics hessians."""
|
|
5830
|
+
...
|
|
5831
|
+
|
|
5695
5832
|
def distances(
|
|
5696
5833
|
self: RobotWrapper,
|
|
5697
5834
|
|
|
@@ -5785,6 +5922,15 @@ class RobotWrapper:
|
|
|
5785
5922
|
:return: transformation"""
|
|
5786
5923
|
...
|
|
5787
5924
|
|
|
5925
|
+
def get_frame_hessian(
|
|
5926
|
+
self: RobotWrapper,
|
|
5927
|
+
frame: any, # pinocchio::FrameIndex
|
|
5928
|
+
joint_v_index: int, # int
|
|
5929
|
+
|
|
5930
|
+
) -> numpy.ndarray:
|
|
5931
|
+
"""Get the component for the hessian of a given frame for a given joint."""
|
|
5932
|
+
...
|
|
5933
|
+
|
|
5788
5934
|
def get_joint(
|
|
5789
5935
|
self: RobotWrapper,
|
|
5790
5936
|
name: str, # const std::string &
|
|
@@ -7302,4 +7448,4 @@ def wrap_angle(
|
|
|
7302
7448
|
...
|
|
7303
7449
|
|
|
7304
7450
|
|
|
7305
|
-
__groups__ = {'placo::dynamics': ['AvoidSelfCollisionsDynamicsConstraint', 'Contact', 'Contact6D', 'DynamicsCoMTask', 'DynamicsConstraint', 'DynamicsFrameTask', 'DynamicsGearTask', 'DynamicsJointsTask', 'DynamicsOrientationTask', 'DynamicsPositionTask', 'DynamicsReactionRatioConstraint', 'DynamicsRelativeFrameTask', 'DynamicsRelativeOrientationTask', 'DynamicsRelativePositionTask', 'DynamicsSolver', 'DynamicsSolverResult', 'DynamicsTask', 'DynamicsTorqueTask', 'ExternalWrenchContact', 'PointContact', 'PuppetContact', 'Relative6DContact', 'RelativePointContact', 'TaskContact'], 'placo::kinematics': ['AvoidSelfCollisionsKinematicsConstraint', 'AxisAlignTask', 'CentroidalMomentumTask', 'CoMPolygonConstraint', 'CoMTask', 'ConeConstraint', 'DistanceTask', 'FrameTask', 'GearTask', 'JointsTask', 'KinematicsConstraint', 'KinematicsSolver', 'KineticEnergyRegularizationTask', 'OrientationTask', 'PositionTask', 'RegularizationTask', 'RelativeFrameTask', 'RelativeOrientationTask', 'RelativePositionTask', 'Task', 'WheelTask'], 'placo::tools': ['AxisesMask', 'CubicSpline', 'CubicSpline3D', 'Prioritized'], 'placo::model': ['Collision', 'Distance', 'RobotWrapper', 'RobotWrapper_State'], 'placo::problem': ['Expression', 'Integrator', 'IntegratorTrajectory', 'PolygonConstraint', 'Problem', 'ProblemConstraint', 'QPError', 'Sparsity', 'SparsityInterval', 'Variable'], 'placo::humanoid': ['Footstep', 'FootstepsPlanner', 'FootstepsPlannerNaive', 'FootstepsPlannerRepetitive', 'HumanoidParameters', 'HumanoidRobot', 'LIPM', 'LIPMTrajectory', 'Support', 'SwingFoot', 'SwingFootCubic', 'SwingFootCubicTrajectory', 'SwingFootQuintic', 'SwingFootQuinticTrajectory', 'SwingFootTrajectory', 'WalkPatternGenerator', 'WalkTasks', 'WalkTrajectory']}
|
|
7451
|
+
__groups__ = {'placo::dynamics': ['AvoidSelfCollisionsDynamicsConstraint', 'Contact', 'Contact6D', 'DynamicsCoMTask', 'DynamicsConstraint', 'DynamicsFrameTask', 'DynamicsGearTask', 'DynamicsJointsTask', 'DynamicsOrientationTask', 'DynamicsPositionTask', 'DynamicsReactionRatioConstraint', 'DynamicsRelativeFrameTask', 'DynamicsRelativeOrientationTask', 'DynamicsRelativePositionTask', 'DynamicsSolver', 'DynamicsSolverResult', 'DynamicsTask', 'DynamicsTorqueTask', 'ExternalWrenchContact', 'PointContact', 'PuppetContact', 'Relative6DContact', 'RelativePointContact', 'TaskContact'], 'placo::kinematics': ['AvoidSelfCollisionsKinematicsConstraint', 'AxisAlignTask', 'CentroidalMomentumTask', 'CoMPolygonConstraint', 'CoMTask', 'ConeConstraint', 'DistanceTask', 'FrameTask', 'GearTask', 'JointsTask', 'KinematicsConstraint', 'KinematicsSolver', 'KineticEnergyRegularizationTask', 'ManipulabilityTask', 'OrientationTask', 'PositionTask', 'RegularizationTask', 'RelativeFrameTask', 'RelativeOrientationTask', 'RelativePositionTask', 'Task', 'WheelTask'], 'placo::tools': ['AxisesMask', 'CubicSpline', 'CubicSpline3D', 'Prioritized'], 'placo::model': ['Collision', 'Distance', 'RobotWrapper', 'RobotWrapper_State'], 'placo::problem': ['Expression', 'Integrator', 'IntegratorTrajectory', 'PolygonConstraint', 'Problem', 'ProblemConstraint', 'QPError', 'Sparsity', 'SparsityInterval', 'Variable'], 'placo::humanoid': ['Footstep', 'FootstepsPlanner', 'FootstepsPlannerNaive', 'FootstepsPlannerRepetitive', 'HumanoidParameters', 'HumanoidRobot', 'LIPM', 'LIPMTrajectory', 'Support', 'SwingFoot', 'SwingFootCubic', 'SwingFootCubicTrajectory', 'SwingFootQuintic', 'SwingFootQuinticTrajectory', 'SwingFootTrajectory', 'WalkPatternGenerator', 'WalkTasks', 'WalkTrajectory']}
|
|
@@ -462,6 +462,11 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
462
462
|
tau = tau + robot.non_linear_effects();
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
+
if (extra_force.size() > 0)
|
|
466
|
+
{
|
|
467
|
+
tau = tau + extra_force;
|
|
468
|
+
}
|
|
469
|
+
|
|
465
470
|
// J^T F
|
|
466
471
|
for (auto& contact : contacts)
|
|
467
472
|
{
|
|
@@ -563,7 +568,7 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
563
568
|
}
|
|
564
569
|
|
|
565
570
|
// We want to minimize torques
|
|
566
|
-
problem.add_constraint(tau == 0).configure(ProblemConstraint::Soft,
|
|
571
|
+
problem.add_constraint(tau == 0).configure(ProblemConstraint::Soft, torque_cost);
|
|
567
572
|
|
|
568
573
|
try
|
|
569
574
|
{
|
|
@@ -574,12 +579,14 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
574
579
|
// Exporting result values
|
|
575
580
|
result.tau = tau.value(problem.x);
|
|
576
581
|
result.qdd = qdd.value(problem.x);
|
|
582
|
+
result.tau_contacts = Eigen::VectorXd::Zero(N);
|
|
577
583
|
|
|
578
584
|
for (auto& contact : contacts)
|
|
579
585
|
{
|
|
580
586
|
if (contact->active)
|
|
581
587
|
{
|
|
582
588
|
contact->wrench = contact->f.value(problem.x);
|
|
589
|
+
result.tau_contacts += contact->J.transpose() * contact->wrench;
|
|
583
590
|
}
|
|
584
591
|
}
|
|
585
592
|
|
|
@@ -38,11 +38,23 @@ public:
|
|
|
38
38
|
// Checks if the gravity computation is a success
|
|
39
39
|
bool success;
|
|
40
40
|
|
|
41
|
+
// The following equation should hold: M qdd + b = tau + tau_contacts
|
|
42
|
+
|
|
43
|
+
// With:
|
|
44
|
+
// - M: the mass matrix
|
|
45
|
+
// - qdd: joint-space acceleration
|
|
46
|
+
// - b: non-linear (bias) terms
|
|
47
|
+
// - tau: applied torques vector
|
|
48
|
+
// - tau_contacts: contact forces
|
|
49
|
+
|
|
41
50
|
// Torques computed by the solver
|
|
42
51
|
Eigen::VectorXd tau;
|
|
43
52
|
|
|
44
53
|
// Accelerations computed by the solver
|
|
45
54
|
Eigen::VectorXd qdd;
|
|
55
|
+
|
|
56
|
+
// Contact forces computed by the solver
|
|
57
|
+
Eigen::VectorXd tau_contacts;
|
|
46
58
|
};
|
|
47
59
|
|
|
48
60
|
struct OverrideJoint
|
|
@@ -426,6 +438,16 @@ public:
|
|
|
426
438
|
*/
|
|
427
439
|
bool gravity_only = false;
|
|
428
440
|
|
|
441
|
+
/**
|
|
442
|
+
* @brief Cost for torque regularization
|
|
443
|
+
*/
|
|
444
|
+
double torque_cost = 1e-3;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @brief Extra force to be added to the system (similar to non-linear terms)
|
|
448
|
+
*/
|
|
449
|
+
Eigen::VectorXd extra_force = Eigen::VectorXd::Zero(0);
|
|
450
|
+
|
|
429
451
|
/**
|
|
430
452
|
* @brief Instance of the problem
|
|
431
453
|
*/
|
|
@@ -6,20 +6,19 @@ namespace placo::humanoid
|
|
|
6
6
|
using namespace placo::kinematics;
|
|
7
7
|
using namespace placo::tools;
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
void WalkTasks::initialize_tasks(KinematicsSolver* solver_, HumanoidRobot* robot_)
|
|
11
10
|
{
|
|
12
11
|
robot = robot_;
|
|
13
12
|
solver = solver_;
|
|
14
13
|
|
|
15
14
|
left_foot_task = solver->add_frame_task("left_foot", robot->get_T_world_left());
|
|
16
|
-
left_foot_task.configure("left_foot", scaled?"scaled":"soft", 1., 1.);
|
|
15
|
+
left_foot_task.configure("left_foot", scaled ? "scaled" : "soft", 1., 1.);
|
|
17
16
|
|
|
18
17
|
right_foot_task = solver->add_frame_task("right_foot", robot->get_T_world_right());
|
|
19
|
-
right_foot_task.configure("right_foot", scaled?"scaled":"soft", 1., 1.);
|
|
18
|
+
right_foot_task.configure("right_foot", scaled ? "scaled" : "soft", 1., 1.);
|
|
20
19
|
|
|
21
20
|
trunk_orientation_task = &solver->add_orientation_task("trunk", robot->get_T_world_trunk().rotation());
|
|
22
|
-
trunk_orientation_task->configure("trunk", scaled?"scaled":"soft", 1.);
|
|
21
|
+
trunk_orientation_task->configure("trunk", scaled ? "scaled" : "soft", 1.);
|
|
23
22
|
|
|
24
23
|
update_com_task();
|
|
25
24
|
}
|
|
@@ -36,7 +35,7 @@ void WalkTasks::update_com_task()
|
|
|
36
35
|
if (trunk_task == nullptr)
|
|
37
36
|
{
|
|
38
37
|
trunk_task = &solver->add_position_task("trunk", robot->get_T_world_frame("trunk").translation());
|
|
39
|
-
trunk_task->configure("trunk", scaled?"scaled":"soft", 1.);
|
|
38
|
+
trunk_task->configure("trunk", scaled ? "scaled" : "soft", 1.);
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
else
|
|
@@ -49,7 +48,7 @@ void WalkTasks::update_com_task()
|
|
|
49
48
|
if (com_task == nullptr)
|
|
50
49
|
{
|
|
51
50
|
com_task = &solver->add_com_task(robot->com_world());
|
|
52
|
-
com_task->configure("com", scaled?"scaled":"soft", 1.);
|
|
51
|
+
com_task->configure("com", scaled ? "scaled" : "soft", 1.);
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -69,13 +68,12 @@ void WalkTasks::reach_initial_pose(Eigen::Affine3d T_world_left, double feet_spa
|
|
|
69
68
|
|
|
70
69
|
update_tasks(T_world_left, T_world_right, com_world, R_world_trunk);
|
|
71
70
|
|
|
72
|
-
// Adding strong noise to avoid singularities
|
|
73
|
-
solver->noise = 0.1;
|
|
74
71
|
for (int i = 0; i < 100; i++)
|
|
75
72
|
{
|
|
76
|
-
if (i
|
|
73
|
+
if (i <= 10)
|
|
77
74
|
{
|
|
78
|
-
|
|
75
|
+
// Adding strong noise to avoid singularities
|
|
76
|
+
solver->add_q_noise(0.1);
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
robot->update_kinematics();
|
|
@@ -28,7 +28,6 @@ void CoMPolygonConstraint::add_constraint(placo::problem::Problem& problem)
|
|
|
28
28
|
// Future DCM is c + J dq + J dq / (dt * w)
|
|
29
29
|
// = c + J dq (1 + 1 / (dt * w))
|
|
30
30
|
com_xy.A *= (1. + 1. / (solver->dt * omega));
|
|
31
|
-
std::cout << "Coef: " << (1. + 1. / (solver->dt * omega)) << std::endl;
|
|
32
31
|
}
|
|
33
32
|
com_xy.b = com;
|
|
34
33
|
|
|
@@ -162,6 +162,35 @@ RegularizationTask& KinematicsSolver::add_regularization_task(double magnitude)
|
|
|
162
162
|
return task;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
ManipulabilityTask& KinematicsSolver::add_manipulability_task(model::RobotWrapper::FrameIndex frame,
|
|
166
|
+
ManipulabilityTask::Type type, double lambda)
|
|
167
|
+
{
|
|
168
|
+
return add_task(new ManipulabilityTask(frame, type, lambda));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
ManipulabilityTask& KinematicsSolver::add_manipulability_task(std::string frame, std::string type, double lambda)
|
|
172
|
+
{
|
|
173
|
+
ManipulabilityTask::Type type_;
|
|
174
|
+
if (type == "position")
|
|
175
|
+
{
|
|
176
|
+
type_ = ManipulabilityTask::Type::POSITION;
|
|
177
|
+
}
|
|
178
|
+
else if (type == "orientation")
|
|
179
|
+
{
|
|
180
|
+
type_ = ManipulabilityTask::Type::ORIENTATION;
|
|
181
|
+
}
|
|
182
|
+
else if (type == "both")
|
|
183
|
+
{
|
|
184
|
+
type_ = ManipulabilityTask::Type::BOTH;
|
|
185
|
+
}
|
|
186
|
+
else
|
|
187
|
+
{
|
|
188
|
+
throw std::runtime_error("Unknown manipulability type: " + type);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return add_manipulability_task(robot.get_frame_index(frame), type_, lambda);
|
|
192
|
+
}
|
|
193
|
+
|
|
165
194
|
KineticEnergyRegularizationTask& KinematicsSolver::add_kinetic_energy_regularization_task(double magnitude)
|
|
166
195
|
{
|
|
167
196
|
KineticEnergyRegularizationTask& task = add_task(new KineticEnergyRegularizationTask());
|
|
@@ -244,6 +273,23 @@ void KinematicsSolver::compute_limits_inequalities()
|
|
|
244
273
|
}
|
|
245
274
|
}
|
|
246
275
|
|
|
276
|
+
void KinematicsSolver::add_q_noise(double noise)
|
|
277
|
+
{
|
|
278
|
+
auto q_random = pinocchio::randomConfiguration(robot.model);
|
|
279
|
+
|
|
280
|
+
// Adding some noise in direction of a random configuration (except floating base)
|
|
281
|
+
for (int k = 7; k < robot.model.nq; k++)
|
|
282
|
+
{
|
|
283
|
+
if (robot.model.lowerPositionLimit(k) == std::numeric_limits<double>::lowest() ||
|
|
284
|
+
robot.model.upperPositionLimit(k) == std::numeric_limits<double>::max())
|
|
285
|
+
{
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
robot.state.q(k) += (q_random(k) - robot.state.q(k)) * noise;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
247
293
|
Eigen::VectorXd KinematicsSolver::solve(bool apply)
|
|
248
294
|
{
|
|
249
295
|
// Ensure variable is created
|
|
@@ -255,26 +301,6 @@ Eigen::VectorXd KinematicsSolver::solve(bool apply)
|
|
|
255
301
|
// Clear previously created constraints
|
|
256
302
|
problem.clear_constraints();
|
|
257
303
|
|
|
258
|
-
// Adding some random noise
|
|
259
|
-
auto q_save = robot.state.q;
|
|
260
|
-
|
|
261
|
-
if (noise > 0)
|
|
262
|
-
{
|
|
263
|
-
auto q_random = pinocchio::randomConfiguration(robot.model);
|
|
264
|
-
|
|
265
|
-
// Adding some noise in direction of a random configuration (except floating base)
|
|
266
|
-
for (int k = 7; k < robot.model.nq; k++)
|
|
267
|
-
{
|
|
268
|
-
if (robot.model.lowerPositionLimit(k) == std::numeric_limits<double>::lowest() ||
|
|
269
|
-
robot.model.upperPositionLimit(k) == std::numeric_limits<double>::max())
|
|
270
|
-
{
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
robot.state.q(k) += (q_random(k) - robot.state.q(k)) * noise;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
304
|
has_scaling = false;
|
|
279
305
|
|
|
280
306
|
// Updating all the task matrices
|
|
@@ -359,6 +385,9 @@ Eigen::VectorXd KinematicsSolver::solve(bool apply)
|
|
|
359
385
|
|
|
360
386
|
if (apply)
|
|
361
387
|
{
|
|
388
|
+
// Initial robot configuration
|
|
389
|
+
auto q_save = robot.state.q;
|
|
390
|
+
|
|
362
391
|
robot.state.q = pinocchio::integrate(robot.model, robot.state.q, qd_sol);
|
|
363
392
|
if (dt > 0)
|
|
364
393
|
{
|
|
@@ -367,10 +396,6 @@ Eigen::VectorXd KinematicsSolver::solve(bool apply)
|
|
|
367
396
|
robot.state.qdd = (robot.state.qd - qd_save) / dt;
|
|
368
397
|
}
|
|
369
398
|
}
|
|
370
|
-
else
|
|
371
|
-
{
|
|
372
|
-
robot.state.q = q_save;
|
|
373
|
-
}
|
|
374
399
|
|
|
375
400
|
return qd_sol;
|
|
376
401
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
#include "placo/kinematics/gear_task.h"
|
|
20
20
|
#include "placo/kinematics/wheel_task.h"
|
|
21
21
|
#include "placo/kinematics/regularization_task.h"
|
|
22
|
+
#include "placo/kinematics/manipulability_task.h"
|
|
22
23
|
#include "placo/kinematics/kinetic_energy_regularization_task.h"
|
|
23
24
|
#include "placo/kinematics/centroidal_momentum_task.h"
|
|
24
25
|
#include "placo/kinematics/axis_align_task.h"
|
|
@@ -249,6 +250,21 @@ public:
|
|
|
249
250
|
*/
|
|
250
251
|
RegularizationTask& add_regularization_task(double magnitude = 1e-6);
|
|
251
252
|
|
|
253
|
+
/**
|
|
254
|
+
* @brief Adds a manipulability regularization task for a given magnitude
|
|
255
|
+
* @return manipulability task
|
|
256
|
+
*/
|
|
257
|
+
ManipulabilityTask& add_manipulability_task(model::RobotWrapper::FrameIndex frame, ManipulabilityTask::Type type,
|
|
258
|
+
double lambda = 1.0);
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @brief Adds a manipulability regularization task for a given magnitude
|
|
262
|
+
* @param frame the reference frame
|
|
263
|
+
* @param type type (position, orientation or both)
|
|
264
|
+
* @return manipulability task
|
|
265
|
+
*/
|
|
266
|
+
ManipulabilityTask& add_manipulability_task(std::string frame, std::string type = "both", double lambda_ = 1.0);
|
|
267
|
+
|
|
252
268
|
/**
|
|
253
269
|
* @brief Adds a kinetic energy regularization task for a given magnitude
|
|
254
270
|
* @param magnitude regularization magnitude
|
|
@@ -299,6 +315,12 @@ public:
|
|
|
299
315
|
*/
|
|
300
316
|
Eigen::VectorXd solve(bool apply = false);
|
|
301
317
|
|
|
318
|
+
/**
|
|
319
|
+
* @brief Adds some noise on the configuration of the robot (q)
|
|
320
|
+
* @param noise noise level, expressed in ratio of the joint limits
|
|
321
|
+
*/
|
|
322
|
+
void add_q_noise(double noise = 1e-5);
|
|
323
|
+
|
|
302
324
|
/**
|
|
303
325
|
* @brief Masks (disables a DoF) from being used by the QP solver (it can't provide speed)
|
|
304
326
|
* @param dof the dof name
|
|
@@ -379,11 +401,6 @@ public:
|
|
|
379
401
|
*/
|
|
380
402
|
int N;
|
|
381
403
|
|
|
382
|
-
/**
|
|
383
|
-
* @brief Some configuration noise added before solving
|
|
384
|
-
*/
|
|
385
|
-
double noise = 1e-5;
|
|
386
|
-
|
|
387
404
|
/**
|
|
388
405
|
* @brief solver dt (for speeds limiting)
|
|
389
406
|
*/
|