placo 0.5.4__tar.gz → 0.5.6__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.5.4 → placo-0.5.6}/PKG-INFO +2 -2
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-dynamics.cpp +7 -6
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-robot-wrapper.cpp +1 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-tools.cpp +1 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-walk-pattern-generator.cpp +4 -2
- {placo-0.5.4 → placo-0.5.6}/placo.pyi +60 -36
- {placo-0.5.4 → placo-0.5.6}/pyproject.toml +2 -2
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/contacts.cpp +1 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/dynamics_solver.cpp +20 -67
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/dynamics_solver.h +14 -39
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/torque_task.cpp +12 -3
- placo-0.5.6/src/placo/dynamics/torque_task.h +61 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/humanoid_robot.cpp +13 -4
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/centroidal_momentum_task.cpp +8 -2
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/axises_mask.h +1 -1
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/utils.cpp +48 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/utils.h +7 -1
- placo-0.5.4/src/placo/dynamics/torque_task.h +0 -35
- {placo-0.5.4 → placo-0.5.6}/.clang-format +0 -0
- {placo-0.5.4 → placo-0.5.6}/.gitattributes +0 -0
- {placo-0.5.4 → placo-0.5.6}/.gitignore +0 -0
- {placo-0.5.4 → placo-0.5.6}/.readthedocs.yaml +0 -0
- {placo-0.5.4 → placo-0.5.6}/CMakeLists.txt +0 -0
- {placo-0.5.4 → placo-0.5.6}/Doxyfile +0 -0
- {placo-0.5.4 → placo-0.5.6}/LICENSE +0 -0
- {placo-0.5.4 → placo-0.5.6}/Makefile +0 -0
- {placo-0.5.4 → placo-0.5.6}/README.md +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-eigen.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-footsteps.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-kinematics.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-parameters.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-problem.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/expose-utils.hpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/module.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/module.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/registry.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/bindings/registry.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/doxygen_parse.py +0 -0
- {placo-0.5.4 → placo-0.5.6}/python/.vscode/settings.json +0 -0
- {placo-0.5.4 → placo-0.5.6}/python/Makefile +0 -0
- {placo-0.5.4 → placo-0.5.6}/python/placo_utils/__init__.py +0 -0
- {placo-0.5.4 → placo-0.5.6}/python/placo_utils/tf.py +0 -0
- {placo-0.5.4 → placo-0.5.6}/python/placo_utils/visualization.py +0 -0
- {placo-0.5.4 → placo-0.5.6}/python/run_tests.sh +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/com_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/com_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/contacts.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/frame_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/frame_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/gear_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/gear_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/joints_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/joints_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/orientation_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/orientation_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/position_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/position_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/reaction_ratio_constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/reaction_ratio_constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/relative_frame_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/relative_frame_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/relative_orientation_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/relative_position_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/relative_position_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/dynamics/task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/foot_trajectory.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/foot_trajectory.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/footsteps_planner.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/footsteps_planner.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/humanoid_parameters.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/humanoid_robot.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/kick.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/kick.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/lipm.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/lipm.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/swing_foot.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/swing_foot.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/swing_foot_cubic.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/swing_foot_quintic.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/walk_pattern_generator.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/walk_pattern_generator.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/walk_tasks.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/humanoid/walk_tasks.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/axis_align_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/axis_align_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/com_polygon_constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/com_polygon_constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/com_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/com_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/cone_constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/cone_constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/distance_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/distance_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/frame_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/frame_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/gear_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/gear_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/joints_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/joints_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/kinematics_solver.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/kinematics_solver.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/manipulability_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/manipulability_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/orientation_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/orientation_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/position_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/position_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/regularization_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/regularization_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/relative_frame_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/relative_frame_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/relative_orientation_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/relative_position_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/relative_position_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/wheel_task.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/kinematics/wheel_task.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/model/robot_wrapper.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/model/robot_wrapper.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/expression.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/expression.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/integrator.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/integrator.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/polygon_constraint.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/polygon_constraint.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/problem.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/problem.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/qp_error.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/qp_error.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/sparsity.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/sparsity.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/variable.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/problem/variable.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/axises_mask.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/cubic_spline.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/cubic_spline.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/cubic_spline_3d.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/cubic_spline_3d.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/prioritized.cpp +0 -0
- {placo-0.5.4 → placo-0.5.6}/src/placo/tools/prioritized.h +0 -0
- {placo-0.5.4 → placo-0.5.6}/stubs.py +0 -0
- {placo-0.5.4 → placo-0.5.6}/tweak_sdist.sh +0 -0
- {placo-0.5.4 → placo-0.5.6}/wks.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: placo
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
4
4
|
Summary: PlaCo: Rhoban Planning and Control
|
|
5
5
|
Requires-Python: >= 3.8
|
|
6
6
|
License-Expression: MIT
|
|
@@ -13,7 +13,7 @@ Requires-Dist: eiquadprog >= 1.2.6, < 2
|
|
|
13
13
|
Requires-Dist: pin >= 2.6.18, < 3
|
|
14
14
|
Requires-Dist: rhoban-cmeel-jsoncpp
|
|
15
15
|
Requires-Dist: meshcat
|
|
16
|
-
Requires-Dist: numpy
|
|
16
|
+
Requires-Dist: numpy<2
|
|
17
17
|
Requires-Dist: ischedule
|
|
18
18
|
Provides-Extra: build
|
|
19
19
|
Requires-Dist: pin[build] >= 2.6.18, < 3 ; extra == "build"
|
|
@@ -13,8 +13,8 @@ using namespace placo::dynamics;
|
|
|
13
13
|
using namespace placo::model;
|
|
14
14
|
|
|
15
15
|
// Overloads
|
|
16
|
-
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(set_passive_overloads, set_passive, 1, 3);
|
|
17
16
|
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(solve_overloads, solve, 0, 1);
|
|
17
|
+
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(set_torque_overloads, set_torque, 2, 4);
|
|
18
18
|
|
|
19
19
|
void exposeDynamics()
|
|
20
20
|
{
|
|
@@ -79,7 +79,7 @@ void exposeDynamics()
|
|
|
79
79
|
|
|
80
80
|
class__<DynamicsSolver>("DynamicsSolver", init<RobotWrapper&>())
|
|
81
81
|
.add_property("problem", &DynamicsSolver::problem)
|
|
82
|
-
.def_readwrite("
|
|
82
|
+
.def_readwrite("damping", &DynamicsSolver::damping)
|
|
83
83
|
.def_readwrite("dt", &DynamicsSolver::dt)
|
|
84
84
|
.def_readwrite("qdd_safe", &DynamicsSolver::qdd_safe)
|
|
85
85
|
.def_readwrite("gravity_only", &DynamicsSolver::gravity_only)
|
|
@@ -99,9 +99,6 @@ void exposeDynamics()
|
|
|
99
99
|
return_internal_reference<>())
|
|
100
100
|
.def("add_reaction_ratio_constraint", &DynamicsSolver::add_reaction_ratio_constraint,
|
|
101
101
|
return_internal_reference<>())
|
|
102
|
-
.def("set_passive", &DynamicsSolver::set_passive, set_passive_overloads())
|
|
103
|
-
.def("set_tau", &DynamicsSolver::set_tau)
|
|
104
|
-
.def("reset_joint", &DynamicsSolver::reset_joint)
|
|
105
102
|
.def("enable_velocity_limits", &DynamicsSolver::enable_velocity_limits)
|
|
106
103
|
.def("enable_velocity_vs_torque_limits", &DynamicsSolver::enable_velocity_vs_torque_limits)
|
|
107
104
|
.def("enable_joint_limits", &DynamicsSolver::enable_joint_limits)
|
|
@@ -116,6 +113,8 @@ void exposeDynamics()
|
|
|
116
113
|
.def<void (DynamicsSolver::*)(FrameTask&)>("remove_task", &DynamicsSolver::remove_task)
|
|
117
114
|
.def("remove_contact", &DynamicsSolver::remove_contact)
|
|
118
115
|
.def("remove_constraint", &DynamicsSolver::remove_constraint)
|
|
116
|
+
.def("set_kp", &DynamicsSolver::set_kp)
|
|
117
|
+
.def("set_kd", &DynamicsSolver::set_kd)
|
|
119
118
|
.add_property(
|
|
120
119
|
"robot", +[](const DynamicsSolver& solver) { return solver.robot; })
|
|
121
120
|
.def(
|
|
@@ -239,7 +238,9 @@ void exposeDynamics()
|
|
|
239
238
|
update_map<std::string, double>(task.djoints, py_dict);
|
|
240
239
|
});
|
|
241
240
|
|
|
242
|
-
class__<TorqueTask, bases<Task>>("DynamicsTorqueTask", init<>())
|
|
241
|
+
class__<TorqueTask, bases<Task>>("DynamicsTorqueTask", init<>())
|
|
242
|
+
.def("set_torque", &TorqueTask::set_torque, set_torque_overloads())
|
|
243
|
+
.def("reset_torque", &TorqueTask::reset_torque);
|
|
243
244
|
|
|
244
245
|
class__<GearTask, bases<Task>>("DynamicsGearTask", init<>())
|
|
245
246
|
.def("set_gear", &GearTask::set_gear)
|
|
@@ -52,6 +52,7 @@ void exposeRobotType(class_<RobotType, W1>& type)
|
|
|
52
52
|
.def("get_T_world_fbase", &RobotType::get_T_world_fbase)
|
|
53
53
|
.def("set_T_world_fbase", &RobotType::set_T_world_fbase)
|
|
54
54
|
.def("com_world", &RobotType::com_world)
|
|
55
|
+
.def("centroidal_map", &RobotType::centroidal_map)
|
|
55
56
|
.def("joint_names", &RobotType::joint_names, joint_names_overloads())
|
|
56
57
|
.def("frame_names", &RobotType::frame_names)
|
|
57
58
|
.def("self_collisions", &RobotType::self_collisions)
|
|
@@ -31,6 +31,7 @@ void exposeTools()
|
|
|
31
31
|
def("rotation_from_axis", &rotation_from_axis);
|
|
32
32
|
def("frame_yaw", &frame_yaw);
|
|
33
33
|
def("flatten_on_floor", &flatten_on_floor);
|
|
34
|
+
def("optimal_transformation", &optimal_transformation);
|
|
34
35
|
|
|
35
36
|
exposeStdVector<int>("vector_int");
|
|
36
37
|
exposeStdVector<double>("vector_double");
|
|
@@ -110,8 +110,10 @@ void exposeWalkPatternGenerator()
|
|
|
110
110
|
.add_property("trunk_mode", &WalkTasks::trunk_mode, &WalkTasks::trunk_mode)
|
|
111
111
|
.add_property("com_x", &WalkTasks::com_x, &WalkTasks::com_x)
|
|
112
112
|
.add_property("com_y", &WalkTasks::com_y, &WalkTasks::com_y)
|
|
113
|
-
.add_property(
|
|
114
|
-
|
|
113
|
+
.add_property("trunk_orientation_task",
|
|
114
|
+
make_function(
|
|
115
|
+
+[](WalkTasks& tasks) -> OrientationTask& { return *tasks.trunk_orientation_task; },
|
|
116
|
+
return_value_policy<reference_existing_object>()));
|
|
115
117
|
|
|
116
118
|
class__<LIPM::Trajectory>("LIPMTrajectory", init<>())
|
|
117
119
|
.def("pos", &LIPM::Trajectory::pos)
|
|
@@ -266,7 +266,7 @@ class AxisesMask:
|
|
|
266
266
|
"""Used to mask some task axises.
|
|
267
267
|
"""
|
|
268
268
|
R_custom_world: numpy.ndarray # Eigen::Matrix3d
|
|
269
|
-
"""
|
|
269
|
+
"""Rotation from world to custom rotation (provided by the user)
|
|
270
270
|
"""
|
|
271
271
|
|
|
272
272
|
R_local_world: numpy.ndarray # Eigen::Matrix3d
|
|
@@ -2047,6 +2047,10 @@ class DynamicsSolver:
|
|
|
2047
2047
|
) -> int:
|
|
2048
2048
|
...
|
|
2049
2049
|
|
|
2050
|
+
damping: float # double
|
|
2051
|
+
"""Global damping that is added to all the joints.
|
|
2052
|
+
"""
|
|
2053
|
+
|
|
2050
2054
|
dt: float # double
|
|
2051
2055
|
"""Solver dt (seconds)
|
|
2052
2056
|
"""
|
|
@@ -2090,10 +2094,6 @@ class DynamicsSolver:
|
|
|
2090
2094
|
"""Enables the velocity vs torque inequalities."""
|
|
2091
2095
|
...
|
|
2092
2096
|
|
|
2093
|
-
friction: float # double
|
|
2094
|
-
"""Global friction that is added to all the joints.
|
|
2095
|
-
"""
|
|
2096
|
-
|
|
2097
2097
|
def get_contact(
|
|
2098
2098
|
arg1: DynamicsSolver,
|
|
2099
2099
|
arg2: int,
|
|
@@ -2154,50 +2154,28 @@ class DynamicsSolver:
|
|
|
2154
2154
|
:param task: frame task"""
|
|
2155
2155
|
...
|
|
2156
2156
|
|
|
2157
|
-
def reset_joint(
|
|
2158
|
-
self: DynamicsSolver,
|
|
2159
|
-
joint_name: str, # const std::string &
|
|
2160
|
-
|
|
2161
|
-
) -> None:
|
|
2162
|
-
"""Resets a given joint so that its torque is no longer overriden.
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
:param joint_name: the joint"""
|
|
2166
|
-
...
|
|
2167
|
-
|
|
2168
2157
|
robot: RobotWrapper # placo::model::RobotWrapper
|
|
2169
2158
|
|
|
2170
|
-
def
|
|
2159
|
+
def set_kd(
|
|
2171
2160
|
self: DynamicsSolver,
|
|
2172
|
-
|
|
2173
|
-
kp: float = 0., # double
|
|
2174
|
-
kd: float = 0., # double
|
|
2161
|
+
kd: float, # double
|
|
2175
2162
|
|
|
2176
2163
|
) -> None:
|
|
2177
|
-
"""
|
|
2164
|
+
"""Set the kp for all tasks.
|
|
2178
2165
|
|
|
2179
2166
|
|
|
2180
|
-
:param
|
|
2181
|
-
|
|
2182
|
-
:param is_passive: true if the should the joint be passive
|
|
2183
|
-
|
|
2184
|
-
:param kp: kp gain if the joint is a spring (0 by default)
|
|
2185
|
-
|
|
2186
|
-
:param kd: kd gain if the joint is a spring (0 by default)"""
|
|
2167
|
+
:param kpd:"""
|
|
2187
2168
|
...
|
|
2188
2169
|
|
|
2189
|
-
def
|
|
2170
|
+
def set_kp(
|
|
2190
2171
|
self: DynamicsSolver,
|
|
2191
|
-
|
|
2192
|
-
tau: float, # double
|
|
2172
|
+
kp: float, # double
|
|
2193
2173
|
|
|
2194
2174
|
) -> None:
|
|
2195
|
-
"""
|
|
2175
|
+
"""Set the kp for all tasks.
|
|
2196
2176
|
|
|
2197
2177
|
|
|
2198
|
-
:param
|
|
2199
|
-
|
|
2200
|
-
:param tau: torque"""
|
|
2178
|
+
:param kp:"""
|
|
2201
2179
|
...
|
|
2202
2180
|
|
|
2203
2181
|
def solve(
|
|
@@ -2355,10 +2333,23 @@ class DynamicsTorqueTask:
|
|
|
2355
2333
|
"""Object priority.
|
|
2356
2334
|
"""
|
|
2357
2335
|
|
|
2336
|
+
def reset_torque(
|
|
2337
|
+
self: DynamicsTorqueTask,
|
|
2338
|
+
joint: str, # std::string
|
|
2339
|
+
|
|
2340
|
+
) -> None:
|
|
2341
|
+
"""Removes a joint from this task.
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
:param joint: joint namle"""
|
|
2345
|
+
...
|
|
2346
|
+
|
|
2358
2347
|
def set_torque(
|
|
2359
2348
|
self: DynamicsTorqueTask,
|
|
2360
2349
|
joint: str, # std::string
|
|
2361
2350
|
torque: float, # double
|
|
2351
|
+
kp: float = 0.0, # double
|
|
2352
|
+
kd: float = 0.0, # double
|
|
2362
2353
|
|
|
2363
2354
|
) -> None:
|
|
2364
2355
|
"""Sets the target for a given joint.
|
|
@@ -2366,7 +2357,11 @@ class DynamicsTorqueTask:
|
|
|
2366
2357
|
|
|
2367
2358
|
:param joint: joint name
|
|
2368
2359
|
|
|
2369
|
-
:param torque: target torque
|
|
2360
|
+
:param torque: target torque
|
|
2361
|
+
|
|
2362
|
+
:param kp: proportional gain (optional)
|
|
2363
|
+
|
|
2364
|
+
:param kd: derivative gain (optional)"""
|
|
2370
2365
|
...
|
|
2371
2366
|
|
|
2372
2367
|
|
|
@@ -3232,6 +3227,16 @@ class HumanoidRobot:
|
|
|
3232
3227
|
) -> any:
|
|
3233
3228
|
...
|
|
3234
3229
|
|
|
3230
|
+
def centroidal_map(
|
|
3231
|
+
self: HumanoidRobot,
|
|
3232
|
+
|
|
3233
|
+
) -> numpy.ndarray:
|
|
3234
|
+
"""Centroidal map.
|
|
3235
|
+
|
|
3236
|
+
|
|
3237
|
+
:return: jacobian (6 x n matrix)"""
|
|
3238
|
+
...
|
|
3239
|
+
|
|
3235
3240
|
collision_model: any # pinocchio::GeometryModel
|
|
3236
3241
|
"""Pinocchio collision model.
|
|
3237
3242
|
"""
|
|
@@ -5789,6 +5794,16 @@ class RobotWrapper:
|
|
|
5789
5794
|
:param urdf_content: if it is not empty, it will be used as the URDF content instead of loading it from the file"""
|
|
5790
5795
|
...
|
|
5791
5796
|
|
|
5797
|
+
def centroidal_map(
|
|
5798
|
+
self: RobotWrapper,
|
|
5799
|
+
|
|
5800
|
+
) -> numpy.ndarray:
|
|
5801
|
+
"""Centroidal map.
|
|
5802
|
+
|
|
5803
|
+
|
|
5804
|
+
:return: jacobian (6 x n matrix)"""
|
|
5805
|
+
...
|
|
5806
|
+
|
|
5792
5807
|
collision_model: any # pinocchio::GeometryModel
|
|
5793
5808
|
"""Pinocchio collision model.
|
|
5794
5809
|
"""
|
|
@@ -7213,6 +7228,15 @@ class map_string_double:
|
|
|
7213
7228
|
...
|
|
7214
7229
|
|
|
7215
7230
|
|
|
7231
|
+
def optimal_transformation(
|
|
7232
|
+
points_in_A: numpy.ndarray, # Eigen::MatrixXd
|
|
7233
|
+
points_in_B: numpy.ndarray, # Eigen::MatrixXd
|
|
7234
|
+
|
|
7235
|
+
) -> numpy.ndarray:
|
|
7236
|
+
"""Finds the optimal transformation T_a_b that minimizes the sum of squared distances between the (same) points in A and T_a_b * points in B Points are stacked in lines (columns are x, y and z) in the matrices."""
|
|
7237
|
+
...
|
|
7238
|
+
|
|
7239
|
+
|
|
7216
7240
|
def rotation_from_axis(
|
|
7217
7241
|
axis: str, # std::string
|
|
7218
7242
|
vector: numpy.ndarray, # Eigen::Vector3d
|
|
@@ -16,14 +16,14 @@ dependencies = [
|
|
|
16
16
|
"pin >= 2.6.18, < 3",
|
|
17
17
|
"rhoban-cmeel-jsoncpp",
|
|
18
18
|
"meshcat",
|
|
19
|
-
"numpy",
|
|
19
|
+
"numpy<2",
|
|
20
20
|
"ischedule"
|
|
21
21
|
]
|
|
22
22
|
description = "PlaCo: Rhoban Planning and Control"
|
|
23
23
|
license = "MIT"
|
|
24
24
|
name = "placo"
|
|
25
25
|
requires-python = ">= 3.8"
|
|
26
|
-
version = "0.5.
|
|
26
|
+
version = "0.5.6"
|
|
27
27
|
|
|
28
28
|
[project.urls]
|
|
29
29
|
changelog = "https://github.com/rhoban/placo/blob/main/CHANGELOG.md"
|
|
@@ -5,27 +5,6 @@ namespace placo::dynamics
|
|
|
5
5
|
{
|
|
6
6
|
using namespace placo::problem;
|
|
7
7
|
|
|
8
|
-
void DynamicsSolver::set_passive(const std::string& joint_name, double kp, double kd)
|
|
9
|
-
{
|
|
10
|
-
OverrideJoint oj;
|
|
11
|
-
oj.passive = true;
|
|
12
|
-
oj.kp = kp;
|
|
13
|
-
oj.kd = kd;
|
|
14
|
-
override_joints[joint_name] = oj;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
void DynamicsSolver::set_tau(const std::string& joint_name, double tau)
|
|
18
|
-
{
|
|
19
|
-
OverrideJoint oj;
|
|
20
|
-
oj.tau = tau;
|
|
21
|
-
override_joints[joint_name] = oj;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
void DynamicsSolver::reset_joint(const std::string& joint_name)
|
|
25
|
-
{
|
|
26
|
-
override_joints.erase(joint_name);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
8
|
PointContact& DynamicsSolver::add_point_contact(PositionTask& position_task)
|
|
30
9
|
{
|
|
31
10
|
return add_contact(new PointContact(position_task, false));
|
|
@@ -225,12 +204,6 @@ void DynamicsSolver::compute_limits_inequalities(Expression& tau)
|
|
|
225
204
|
throw std::runtime_error("DynamicsSolver::compute_limits_inequalities: dt is not set");
|
|
226
205
|
}
|
|
227
206
|
|
|
228
|
-
std::set<int> override_ids;
|
|
229
|
-
for (auto& override_joint : override_joints)
|
|
230
|
-
{
|
|
231
|
-
override_ids.insert(robot.get_joint_v_offset(override_joint.first));
|
|
232
|
-
}
|
|
233
|
-
|
|
234
207
|
if (torque_limits)
|
|
235
208
|
{
|
|
236
209
|
problem.add_constraint(tau.slice(6) <= robot.model.effortLimit.bottomRows(N - 6));
|
|
@@ -240,11 +213,11 @@ void DynamicsSolver::compute_limits_inequalities(Expression& tau)
|
|
|
240
213
|
int constraints = 0;
|
|
241
214
|
if (joint_limits)
|
|
242
215
|
{
|
|
243
|
-
constraints += 2 * (N - 6
|
|
216
|
+
constraints += 2 * (N - 6);
|
|
244
217
|
}
|
|
245
218
|
if (velocity_limits)
|
|
246
219
|
{
|
|
247
|
-
constraints += 2 * (N - 6
|
|
220
|
+
constraints += 2 * (N - 6);
|
|
248
221
|
}
|
|
249
222
|
|
|
250
223
|
if (constraints > 0)
|
|
@@ -258,10 +231,6 @@ void DynamicsSolver::compute_limits_inequalities(Expression& tau)
|
|
|
258
231
|
// Iterating for each actuated joints
|
|
259
232
|
for (int k = 0; k < N - 6; k++)
|
|
260
233
|
{
|
|
261
|
-
if (override_ids.count(k + 6) > 0)
|
|
262
|
-
{
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
234
|
double q = robot.state.q[k + 7];
|
|
266
235
|
double qd = robot.state.qd[k + 6];
|
|
267
236
|
|
|
@@ -408,29 +377,6 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
408
377
|
problem.clear_constraints();
|
|
409
378
|
problem.clear_variables();
|
|
410
379
|
|
|
411
|
-
// Computing target torque for passive joints
|
|
412
|
-
std::vector<int> override_indices;
|
|
413
|
-
Eigen::VectorXd override_taus = Eigen::VectorXd::Zero(override_joints.size());
|
|
414
|
-
int k = 0;
|
|
415
|
-
for (auto& entry : override_joints)
|
|
416
|
-
{
|
|
417
|
-
std::string joint = entry.first;
|
|
418
|
-
OverrideJoint oj = entry.second;
|
|
419
|
-
double q = robot.get_joint(joint);
|
|
420
|
-
double qd = robot.get_joint_velocity(joint);
|
|
421
|
-
int index = robot.get_joint_v_offset(joint);
|
|
422
|
-
override_indices.push_back(index);
|
|
423
|
-
|
|
424
|
-
if (oj.tau)
|
|
425
|
-
{
|
|
426
|
-
override_taus[k++] = oj.tau;
|
|
427
|
-
}
|
|
428
|
-
else
|
|
429
|
-
{
|
|
430
|
-
override_taus[k++] = -q * oj.kp - qd * oj.kd;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
380
|
Expression qdd;
|
|
435
381
|
Variable& qdd_variable = problem.add_variable(robot.model.nv);
|
|
436
382
|
qdd = qdd_variable.expr();
|
|
@@ -450,7 +396,7 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
450
396
|
// tau = M qdd + b - J^T F
|
|
451
397
|
|
|
452
398
|
// M qdd
|
|
453
|
-
Expression tau = robot.mass_matrix() * qdd + robot.state.qd *
|
|
399
|
+
Expression tau = robot.mass_matrix() * qdd + robot.state.qd * damping;
|
|
454
400
|
|
|
455
401
|
// b
|
|
456
402
|
if (gravity_only)
|
|
@@ -498,7 +444,7 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
498
444
|
|
|
499
445
|
// Now, tau = Ax + b with x = [qdd, f1, f2, ...], we copy J^T to the extended A
|
|
500
446
|
// for forces that are decision variables
|
|
501
|
-
k = N;
|
|
447
|
+
int k = N;
|
|
502
448
|
for (auto& contact : contacts)
|
|
503
449
|
{
|
|
504
450
|
if (contact->active)
|
|
@@ -558,15 +504,6 @@ DynamicsSolver::Result DynamicsSolver::solve(bool integrate)
|
|
|
558
504
|
problem.add_constraint(tau.slice(0, 6) == 0);
|
|
559
505
|
}
|
|
560
506
|
|
|
561
|
-
// Enforce the override torques
|
|
562
|
-
if (override_taus.size() > 0)
|
|
563
|
-
{
|
|
564
|
-
Expression override_tau_expr;
|
|
565
|
-
override_tau_expr.A = tau.A(override_indices, Eigen::all);
|
|
566
|
-
override_tau_expr.b = tau.b(override_indices);
|
|
567
|
-
problem.add_constraint(override_tau_expr == override_taus);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
507
|
// We want to minimize torques
|
|
571
508
|
problem.add_constraint(tau == 0).configure(ProblemConstraint::Soft, torque_cost);
|
|
572
509
|
|
|
@@ -648,6 +585,22 @@ void DynamicsSolver::remove_constraint(Constraint& constraint)
|
|
|
648
585
|
}
|
|
649
586
|
}
|
|
650
587
|
|
|
588
|
+
void DynamicsSolver::set_kp(double kp)
|
|
589
|
+
{
|
|
590
|
+
for (auto& task : tasks)
|
|
591
|
+
{
|
|
592
|
+
task->kp = kp;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
void DynamicsSolver::set_kd(double kd)
|
|
597
|
+
{
|
|
598
|
+
for (auto& task : tasks)
|
|
599
|
+
{
|
|
600
|
+
task->kd = kd;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
651
604
|
void DynamicsSolver::add_task(Task& task)
|
|
652
605
|
{
|
|
653
606
|
task.solver = this;
|
|
@@ -57,49 +57,12 @@ public:
|
|
|
57
57
|
Eigen::VectorXd tau_contacts;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
struct OverrideJoint
|
|
61
|
-
{
|
|
62
|
-
// If passive is true, tau will be computed as a function of kp and kd
|
|
63
|
-
bool passive;
|
|
64
|
-
double kp;
|
|
65
|
-
double kd;
|
|
66
|
-
|
|
67
|
-
// Else, a custom tau will be used
|
|
68
|
-
double tau;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
60
|
DynamicsSolver(model::RobotWrapper& robot);
|
|
72
61
|
virtual ~DynamicsSolver();
|
|
73
62
|
|
|
74
63
|
// Contacts
|
|
75
64
|
std::vector<Contact*> contacts;
|
|
76
65
|
|
|
77
|
-
// Override joints (passive or custom tau)
|
|
78
|
-
std::map<std::string, OverrideJoint> override_joints;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @brief Sets a DoF as passive, the corresponding tau will be fixed in the equation of motion
|
|
82
|
-
* it can be purely passive joint or a spring-like behaviour
|
|
83
|
-
* @param joint_name the joint
|
|
84
|
-
* @param is_passive true if the should the joint be passive
|
|
85
|
-
* @param kp kp gain if the joint is a spring (0 by default)
|
|
86
|
-
* @param kd kd gain if the joint is a spring (0 by default)
|
|
87
|
-
*/
|
|
88
|
-
void set_passive(const std::string& joint_name, double kp = 0., double kd = 0.);
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @brief Sets a custom torque to be applied by a given joint
|
|
92
|
-
* @param joint_name the joint
|
|
93
|
-
* @param tau torque
|
|
94
|
-
*/
|
|
95
|
-
void set_tau(const std::string& joint_name, double tau);
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* @brief Resets a given joint so that its torque is no longer overriden
|
|
99
|
-
* @param joint_name the joint
|
|
100
|
-
*/
|
|
101
|
-
void reset_joint(const std::string& joint_name);
|
|
102
|
-
|
|
103
66
|
/**
|
|
104
67
|
* @brief Adds a position (in the world) task
|
|
105
68
|
* @param frame_index target frame
|
|
@@ -414,9 +377,21 @@ public:
|
|
|
414
377
|
void remove_constraint(Constraint& constraint);
|
|
415
378
|
|
|
416
379
|
/**
|
|
417
|
-
* @brief
|
|
380
|
+
* @brief Set the kp for all tasks
|
|
381
|
+
* @param kp
|
|
382
|
+
*/
|
|
383
|
+
void set_kp(double kp);
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* @brief Set the kp for all tasks
|
|
387
|
+
* @param kpd
|
|
388
|
+
*/
|
|
389
|
+
void set_kd(double kd);
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @brief Global damping that is added to all the joints
|
|
418
393
|
*/
|
|
419
|
-
double
|
|
394
|
+
double damping = 0.;
|
|
420
395
|
|
|
421
396
|
/**
|
|
422
397
|
* @brief Solver dt (seconds)
|
|
@@ -8,9 +8,16 @@ TorqueTask::TorqueTask()
|
|
|
8
8
|
tau_task = true;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
void TorqueTask::set_torque(std::string joint, double torque)
|
|
11
|
+
void TorqueTask::set_torque(std::string joint, double torque, double kp, double kd)
|
|
12
12
|
{
|
|
13
|
-
torques[joint] = torque;
|
|
13
|
+
torques[joint].torque = torque;
|
|
14
|
+
torques[joint].kp = kp;
|
|
15
|
+
torques[joint].kd = kd;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
void TorqueTask::reset_torque(std::string joint)
|
|
19
|
+
{
|
|
20
|
+
torques.erase(joint);
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
void TorqueTask::update()
|
|
@@ -27,8 +34,10 @@ void TorqueTask::update()
|
|
|
27
34
|
int k = 0;
|
|
28
35
|
for (auto& entry : torques)
|
|
29
36
|
{
|
|
37
|
+
TargetTau target = entry.second;
|
|
30
38
|
A(k, solver->robot.get_joint_v_offset(entry.first)) = 1;
|
|
31
|
-
b(k, 0) = entry.
|
|
39
|
+
b(k, 0) = target.torque + target.kp * solver->robot.get_joint(entry.first) -
|
|
40
|
+
target.kd * solver->robot.get_joint_velocity(entry.first);
|
|
32
41
|
k++;
|
|
33
42
|
}
|
|
34
43
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <map>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include "placo/dynamics/task.h"
|
|
6
|
+
#include "placo/model/robot_wrapper.h"
|
|
7
|
+
#include "placo/tools/axises_mask.h"
|
|
8
|
+
|
|
9
|
+
namespace placo::dynamics
|
|
10
|
+
{
|
|
11
|
+
class TorqueTask : public Task
|
|
12
|
+
{
|
|
13
|
+
public:
|
|
14
|
+
struct TargetTau
|
|
15
|
+
{
|
|
16
|
+
/**
|
|
17
|
+
* @brief Torque to apply
|
|
18
|
+
*/
|
|
19
|
+
double torque = 0.0;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @brief Proportional gain
|
|
23
|
+
*/
|
|
24
|
+
double kp = 0.0;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @brief Derivative gain (damping)
|
|
28
|
+
*/
|
|
29
|
+
double kd = 0.0;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @brief see \ref placo::dynamics::DynamicsSolver::add_tau_task
|
|
34
|
+
*/
|
|
35
|
+
TorqueTask();
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief Target torques
|
|
39
|
+
*/
|
|
40
|
+
std::map<std::string, TargetTau> torques;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @brief Sets the target for a given joint
|
|
44
|
+
* @param joint joint name
|
|
45
|
+
* @param torque target torque
|
|
46
|
+
* @param kp proportional gain (optional)
|
|
47
|
+
* @param kd derivative gain (optional)
|
|
48
|
+
*/
|
|
49
|
+
void set_torque(std::string joint, double torque, double kp = 0.0, double kd = 0.0);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @brief Removes a joint from this task
|
|
53
|
+
* @param joint joint namle
|
|
54
|
+
*/
|
|
55
|
+
void reset_torque(std::string joint);
|
|
56
|
+
|
|
57
|
+
void update() override;
|
|
58
|
+
std::string type_name() override;
|
|
59
|
+
std::string error_unit() override;
|
|
60
|
+
};
|
|
61
|
+
} // namespace placo::dynamics
|
|
@@ -11,7 +11,14 @@ HumanoidRobot::HumanoidRobot(std::string model_directory, int flags, std::string
|
|
|
11
11
|
initialize();
|
|
12
12
|
|
|
13
13
|
// Measuring some distances
|
|
14
|
-
|
|
14
|
+
if (model.existFrame("trunk") && model.existFrame("left_hip_yaw"))
|
|
15
|
+
{
|
|
16
|
+
dist_y_trunk_foot = fabs(get_T_a_b("trunk", "left_hip_yaw").translation().y());
|
|
17
|
+
}
|
|
18
|
+
else
|
|
19
|
+
{
|
|
20
|
+
std::cerr << "WARNING: Can't find trunk frames in the model, can't measure leg spacing" << std::endl;
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
if (model.existFrame("head_base") && model.existFrame("head_pitch") && model.existFrame("camera"))
|
|
17
24
|
{
|
|
@@ -140,7 +147,8 @@ Eigen::Vector3d HumanoidRobot::get_com_velocity(Side support, Eigen::Vector3d om
|
|
|
140
147
|
return J_u_C * J_u_pinv * M + (J_a_C - J_u_C * J_u_pinv * J_a) * state.qd.block(6, 0, model.nv - 6, 1);
|
|
141
148
|
}
|
|
142
149
|
|
|
143
|
-
Eigen::VectorXd HumanoidRobot::get_torques(Eigen::VectorXd acc_a, Eigen::VectorXd contact_forces,
|
|
150
|
+
Eigen::VectorXd HumanoidRobot::get_torques(Eigen::VectorXd acc_a, Eigen::VectorXd contact_forces,
|
|
151
|
+
bool use_non_linear_effects)
|
|
144
152
|
{
|
|
145
153
|
// Contact Jacobians
|
|
146
154
|
Eigen::MatrixXd J_c = Eigen::MatrixXd::Zero(model.nv, 8);
|
|
@@ -267,12 +275,13 @@ void HumanoidRobot::read_from_histories(rhoban_utils::HistoryCollection& histori
|
|
|
267
275
|
b << Eigen::Vector3d::Zero(), omega_trunk;
|
|
268
276
|
|
|
269
277
|
Eigen::MatrixXd J(6, model.nv);
|
|
270
|
-
J << frame_jacobian(support_frame(), pinocchio::ReferenceFrame::LOCAL).topRows(3),
|
|
278
|
+
J << frame_jacobian(support_frame(), pinocchio::ReferenceFrame::LOCAL).topRows(3),
|
|
279
|
+
frame_jacobian("trunk", "local").bottomRows(3);
|
|
271
280
|
Eigen::MatrixXd J_bf = J.leftCols(6);
|
|
272
281
|
Eigen::MatrixXd J_a = J.rightCols(model.nv - 6);
|
|
273
282
|
|
|
274
283
|
Eigen::VectorXd qd_bf = J_bf.inverse() * (b - J_a * qd_joints);
|
|
275
|
-
for (int i=0; i<6; i++)
|
|
284
|
+
for (int i = 0; i < 6; i++)
|
|
276
285
|
{
|
|
277
286
|
state.qd[i] = qd_bf[i];
|
|
278
287
|
}
|
|
@@ -10,9 +10,15 @@ CentroidalMomentumTask::CentroidalMomentumTask(Eigen::Vector3d L_world) : L_worl
|
|
|
10
10
|
|
|
11
11
|
void CentroidalMomentumTask::update()
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
Eigen::MatrixXd Ag = solver->robot.centroidal_map();
|
|
14
|
+
Eigen::MatrixXd Ag_angular = Ag.block(3, 0, 3, solver->N);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
if (solver->dt == 0)
|
|
17
|
+
{
|
|
18
|
+
throw std::runtime_error("CentroidalMomentumTask: you should set solver.dt to use this task");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
A = mask.apply(Ag_angular) / solver->dt;
|
|
16
22
|
b = mask.apply(L_world);
|
|
17
23
|
}
|
|
18
24
|
|