placo 0.8.9__tar.gz → 0.9.0__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.

Files changed (176) hide show
  1. {placo-0.8.9 → placo-0.9.0}/.github/workflows/wheels.yml +2 -0
  2. {placo-0.8.9 → placo-0.9.0}/CMakeLists.txt +2 -0
  3. {placo-0.8.9 → placo-0.9.0}/PKG-INFO +1 -1
  4. {placo-0.8.9 → placo-0.9.0}/bindings/expose-kinematics.cpp +16 -0
  5. {placo-0.8.9 → placo-0.9.0}/pyproject.toml +2 -2
  6. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/walk_pattern_generator.cpp +27 -3
  7. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/walk_pattern_generator.h +20 -11
  8. placo-0.9.0/src/placo/kinematics/distance_constraint.cpp +41 -0
  9. placo-0.9.0/src/placo/kinematics/distance_constraint.h +43 -0
  10. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/kinematics_solver.cpp +24 -0
  11. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/kinematics_solver.h +42 -2
  12. placo-0.9.0/src/placo/kinematics/yaw_constraint.cpp +52 -0
  13. placo-0.9.0/src/placo/kinematics/yaw_constraint.h +42 -0
  14. {placo-0.8.9 → placo-0.9.0}/.clang-format +0 -0
  15. {placo-0.8.9 → placo-0.9.0}/.gitattributes +0 -0
  16. {placo-0.8.9 → placo-0.9.0}/.gitignore +0 -0
  17. {placo-0.8.9 → placo-0.9.0}/.readthedocs.yaml +0 -0
  18. {placo-0.8.9 → placo-0.9.0}/Doxyfile +0 -0
  19. {placo-0.8.9 → placo-0.9.0}/LICENSE +0 -0
  20. {placo-0.8.9 → placo-0.9.0}/README.md +0 -0
  21. {placo-0.8.9 → placo-0.9.0}/bindings/doxystub.h +0 -0
  22. {placo-0.8.9 → placo-0.9.0}/bindings/expose-dynamics.cpp +0 -0
  23. {placo-0.8.9 → placo-0.9.0}/bindings/expose-eigen.cpp +0 -0
  24. {placo-0.8.9 → placo-0.9.0}/bindings/expose-footsteps.cpp +0 -0
  25. {placo-0.8.9 → placo-0.9.0}/bindings/expose-parameters.cpp +0 -0
  26. {placo-0.8.9 → placo-0.9.0}/bindings/expose-problem.cpp +0 -0
  27. {placo-0.8.9 → placo-0.9.0}/bindings/expose-robot-wrapper.cpp +0 -0
  28. {placo-0.8.9 → placo-0.9.0}/bindings/expose-tools.cpp +0 -0
  29. {placo-0.8.9 → placo-0.9.0}/bindings/expose-utils.hpp +0 -0
  30. {placo-0.8.9 → placo-0.9.0}/bindings/expose-walk-pattern-generator.cpp +0 -0
  31. {placo-0.8.9 → placo-0.9.0}/bindings/module.cpp +0 -0
  32. {placo-0.8.9 → placo-0.9.0}/bindings/module.h +0 -0
  33. {placo-0.8.9 → placo-0.9.0}/python/.vscode/settings.json +0 -0
  34. {placo-0.8.9 → placo-0.9.0}/python/Makefile +0 -0
  35. {placo-0.8.9 → placo-0.9.0}/python/placo_utils/__init__.py +0 -0
  36. {placo-0.8.9 → placo-0.9.0}/python/placo_utils/tf.py +0 -0
  37. {placo-0.8.9 → placo-0.9.0}/python/placo_utils/view.py +0 -0
  38. {placo-0.8.9 → placo-0.9.0}/python/placo_utils/visualization.py +0 -0
  39. {placo-0.8.9 → placo-0.9.0}/python/run_tests.sh +0 -0
  40. {placo-0.8.9 → placo-0.9.0}/scripts/requirements.sh +0 -0
  41. {placo-0.8.9 → placo-0.9.0}/scripts/robotpkg.sh +0 -0
  42. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
  43. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
  44. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/com_task.cpp +0 -0
  45. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/com_task.h +0 -0
  46. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/constraint.cpp +0 -0
  47. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/constraint.h +0 -0
  48. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/contacts.cpp +0 -0
  49. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/contacts.h +0 -0
  50. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/dynamics_solver.cpp +0 -0
  51. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/dynamics_solver.h +0 -0
  52. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/frame_task.cpp +0 -0
  53. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/frame_task.h +0 -0
  54. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/gear_task.cpp +0 -0
  55. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/gear_task.h +0 -0
  56. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/joints_task.cpp +0 -0
  57. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/joints_task.h +0 -0
  58. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/orientation_task.cpp +0 -0
  59. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/orientation_task.h +0 -0
  60. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/position_task.cpp +0 -0
  61. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/position_task.h +0 -0
  62. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/relative_frame_task.cpp +0 -0
  63. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/relative_frame_task.h +0 -0
  64. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
  65. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/relative_orientation_task.h +0 -0
  66. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/relative_position_task.cpp +0 -0
  67. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/relative_position_task.h +0 -0
  68. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/task.cpp +0 -0
  69. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/task.h +0 -0
  70. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/torque_task.cpp +0 -0
  71. {placo-0.8.9 → placo-0.9.0}/src/placo/dynamics/torque_task.h +0 -0
  72. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/foot_trajectory.cpp +0 -0
  73. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/foot_trajectory.h +0 -0
  74. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/footsteps_planner.cpp +0 -0
  75. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/footsteps_planner.h +0 -0
  76. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
  77. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
  78. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
  79. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
  80. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
  81. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/humanoid_parameters.h +0 -0
  82. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/humanoid_robot.cpp +0 -0
  83. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/humanoid_robot.h +0 -0
  84. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/kick.cpp +0 -0
  85. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/kick.h +0 -0
  86. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/lipm.cpp +0 -0
  87. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/lipm.h +0 -0
  88. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/swing_foot.cpp +0 -0
  89. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/swing_foot.h +0 -0
  90. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
  91. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/swing_foot_cubic.h +0 -0
  92. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
  93. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/swing_foot_quintic.h +0 -0
  94. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/walk_tasks.cpp +0 -0
  95. {placo-0.8.9 → placo-0.9.0}/src/placo/humanoid/walk_tasks.h +0 -0
  96. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
  97. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
  98. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/axis_align_task.cpp +0 -0
  99. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/axis_align_task.h +0 -0
  100. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/centroidal_momentum_task.cpp +0 -0
  101. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
  102. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/com_polygon_constraint.cpp +0 -0
  103. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/com_polygon_constraint.h +0 -0
  104. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/com_task.cpp +0 -0
  105. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/com_task.h +0 -0
  106. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/cone_constraint.cpp +0 -0
  107. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/cone_constraint.h +0 -0
  108. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/constraint.cpp +0 -0
  109. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/constraint.h +0 -0
  110. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/distance_task.cpp +0 -0
  111. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/distance_task.h +0 -0
  112. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/frame_task.cpp +0 -0
  113. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/frame_task.h +0 -0
  114. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/gear_task.cpp +0 -0
  115. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/gear_task.h +0 -0
  116. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/joint_space_half_spaces_constraint.cpp +0 -0
  117. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/joint_space_half_spaces_constraint.h +0 -0
  118. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/joints_task.cpp +0 -0
  119. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/joints_task.h +0 -0
  120. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
  121. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
  122. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/manipulability_task.cpp +0 -0
  123. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/manipulability_task.h +0 -0
  124. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/orientation_task.cpp +0 -0
  125. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/orientation_task.h +0 -0
  126. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/position_task.cpp +0 -0
  127. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/position_task.h +0 -0
  128. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/regularization_task.cpp +0 -0
  129. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/regularization_task.h +0 -0
  130. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/relative_frame_task.cpp +0 -0
  131. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/relative_frame_task.h +0 -0
  132. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
  133. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/relative_orientation_task.h +0 -0
  134. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/relative_position_task.cpp +0 -0
  135. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/relative_position_task.h +0 -0
  136. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/task.cpp +0 -0
  137. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/task.h +0 -0
  138. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/wheel_task.cpp +0 -0
  139. {placo-0.8.9 → placo-0.9.0}/src/placo/kinematics/wheel_task.h +0 -0
  140. {placo-0.8.9 → placo-0.9.0}/src/placo/model/robot_wrapper.cpp +0 -0
  141. {placo-0.8.9 → placo-0.9.0}/src/placo/model/robot_wrapper.h +0 -0
  142. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/constraint.cpp +0 -0
  143. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/constraint.h +0 -0
  144. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/expression.cpp +0 -0
  145. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/expression.h +0 -0
  146. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/integrator.cpp +0 -0
  147. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/integrator.h +0 -0
  148. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/polygon_constraint.cpp +0 -0
  149. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/polygon_constraint.h +0 -0
  150. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/problem.cpp +0 -0
  151. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/problem.h +0 -0
  152. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/problem_polynom.cpp +0 -0
  153. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/problem_polynom.h +0 -0
  154. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/qp_error.cpp +0 -0
  155. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/qp_error.h +0 -0
  156. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/sparsity.cpp +0 -0
  157. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/sparsity.h +0 -0
  158. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/variable.cpp +0 -0
  159. {placo-0.8.9 → placo-0.9.0}/src/placo/problem/variable.h +0 -0
  160. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/axises_mask.cpp +0 -0
  161. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/axises_mask.h +0 -0
  162. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/cubic_spline.cpp +0 -0
  163. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/cubic_spline.h +0 -0
  164. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/cubic_spline_3d.cpp +0 -0
  165. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/cubic_spline_3d.h +0 -0
  166. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/directions.cpp +0 -0
  167. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/directions.h +0 -0
  168. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/polynom.cpp +0 -0
  169. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/polynom.h +0 -0
  170. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/prioritized.cpp +0 -0
  171. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/prioritized.h +0 -0
  172. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/segment.cpp +0 -0
  173. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/segment.h +0 -0
  174. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/utils.cpp +0 -0
  175. {placo-0.8.9 → placo-0.9.0}/src/placo/tools/utils.h +0 -0
  176. {placo-0.8.9 → placo-0.9.0}/wks.yml +0 -0
@@ -28,6 +28,8 @@ jobs:
28
28
 
29
29
  # Used to host cibuildwheel
30
30
  - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
31
33
 
32
34
  - name: Install cibuildwheel
33
35
  run: python -m pip install cibuildwheel==3.0.0b1
@@ -89,6 +89,8 @@ add_library(libplaco SHARED
89
89
  src/placo/kinematics/com_polygon_constraint.cpp
90
90
  src/placo/kinematics/joint_space_half_spaces_constraint.cpp
91
91
  src/placo/kinematics/cone_constraint.cpp
92
+ src/placo/kinematics/yaw_constraint.cpp
93
+ src/placo/kinematics/distance_constraint.cpp
92
94
  src/placo/kinematics/axis_align_task.cpp
93
95
 
94
96
  # Dynamics QP solver
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: placo
3
- Version: 0.8.9
3
+ Version: 0.9.0
4
4
  Summary: PlaCo: Rhoban Planning and Control
5
5
  Requires-Python: >= 3.9
6
6
  License-Expression: MIT
@@ -101,6 +101,14 @@ void exposeKinematics()
101
101
  .def<ConeConstraint& (KinematicsSolver::*)(std::string, std::string, double)>(
102
102
  "add_cone_constraint", &KinematicsSolver::add_cone_constraint, return_internal_reference<>())
103
103
 
104
+ // Yaw constraint
105
+ .def<YawConstraint& (KinematicsSolver::*)(std::string, std::string, double)>(
106
+ "add_yaw_constraint", &KinematicsSolver::add_yaw_constraint, return_internal_reference<>())
107
+
108
+ // Distance constraint
109
+ .def<DistanceConstraint& (KinematicsSolver::*)(std::string, std::string, double)>(
110
+ "add_distance_constraint", &KinematicsSolver::add_distance_constraint, return_internal_reference<>())
111
+
104
112
  // Masking/unmasking DoFs
105
113
  .def("mask_dof", &KinematicsSolver::mask_dof)
106
114
  .def("unmask_dof", &KinematicsSolver::unmask_dof)
@@ -246,4 +254,12 @@ void exposeKinematics()
246
254
  .def_readwrite("angle_max", &ConeConstraint::angle_max)
247
255
  .def_readwrite("N", &ConeConstraint::N)
248
256
  .def_readwrite("range", &ConeConstraint::range);
257
+
258
+ class__<YawConstraint, bases<Constraint>>(
259
+ "YawConstraint", init<model::RobotWrapper::FrameIndex, model::RobotWrapper::FrameIndex, double>())
260
+ .def_readwrite("angle_max", &YawConstraint::angle_max);
261
+
262
+ class__<DistanceConstraint, bases<Constraint>>(
263
+ "DistanceConstraint", init<model::RobotWrapper::FrameIndex, model::RobotWrapper::FrameIndex, double>())
264
+ .def_readwrite("distance_max", &DistanceConstraint::distance_max);
249
265
  }
@@ -23,7 +23,7 @@ description = "PlaCo: Rhoban Planning and Control"
23
23
  license = "MIT"
24
24
  name = "placo"
25
25
  requires-python = ">= 3.9"
26
- version = "0.8.9"
26
+ version = "0.9.0"
27
27
 
28
28
  [project.urls]
29
29
  changelog = "https://github.com/rhoban/placo/blob/main/CHANGELOG.md"
@@ -44,7 +44,7 @@ run-tests = false
44
44
 
45
45
 
46
46
  [tool.cibuildwheel.macos]
47
- before-all = "brew install doxygen"
47
+ before-all = "brew install --formula doxygen"
48
48
 
49
49
  [tool.cibuildwheel.linux]
50
50
  before-all = "yum install -y doxygen"
@@ -146,6 +146,26 @@ Eigen::Vector3d WalkPatternGenerator::Trajectory::get_v_world_foot(HumanoidRobot
146
146
  return (side == HumanoidRobot::Left) ? get_v_world_left(t) : get_v_world_right(t);
147
147
  }
148
148
 
149
+ double WalkPatternGenerator::Trajectory::get_yaw_world_left(double t)
150
+ {
151
+ return frame_yaw(T.rotation()) + left_foot_yaw.pos(t);
152
+ }
153
+
154
+ double WalkPatternGenerator::Trajectory::get_yaw_world_right(double t)
155
+ {
156
+ return frame_yaw(T.rotation()) + right_foot_yaw.pos(t);
157
+ }
158
+
159
+ double WalkPatternGenerator::Trajectory::get_yaw_world_foot(HumanoidRobot::Side side, double t)
160
+ {
161
+ return (side == HumanoidRobot::Left) ? get_yaw_world_left(t) : get_yaw_world_right(t);
162
+ }
163
+
164
+ double WalkPatternGenerator::Trajectory::get_yaw_world_trunk(double t)
165
+ {
166
+ return frame_yaw(T.rotation()) + trunk_yaw.pos(t);
167
+ }
168
+
149
169
  Eigen::Vector3d WalkPatternGenerator::Trajectory::get_p_world_CoM(double t)
150
170
  {
151
171
  TrajectoryPart& part = _findPart(parts, t);
@@ -316,8 +336,10 @@ void WalkPatternGenerator::plan_sgl_support(Trajectory& trajectory, int part_ind
316
336
  part.t_start, virt_duration, parameters.walk_foot_height, parameters.walk_foot_rise_ratio, start,
317
337
  T_world_end.translation(), part.support.elapsed_ratio, start_vel);
318
338
 
319
- double replan_yaw = old_trajectory->foot_yaw(flying_side).pos(trajectory.t_start);
320
- trajectory.foot_yaw(flying_side).add_point(trajectory.t_start, replan_yaw, 0);
339
+ // Initiate the flying foot yaw spline with the old trajectory foot yaw position and velocity
340
+ trajectory.foot_yaw(flying_side)
341
+ .add_point(trajectory.t_start, old_trajectory->get_yaw_world_foot(flying_side, trajectory.t_start),
342
+ old_trajectory->foot_yaw(flying_side).vel(trajectory.t_start));
321
343
  }
322
344
  else
323
345
  {
@@ -345,11 +367,13 @@ void WalkPatternGenerator::plan_feet_trajectories(Trajectory& trajectory, Trajec
345
367
  trajectory.add_supports(trajectory.t_start, trajectory.parts[0].support);
346
368
  if (old_trajectory == nullptr)
347
369
  {
370
+ // Starting the walk in double support, we set the trunk yaw aligned with the first support
348
371
  trajectory.trunk_yaw.add_point(trajectory.t_start, frame_yaw(trajectory.parts[0].support.frame().rotation()), 0);
349
372
  }
350
373
  else
351
374
  {
352
- trajectory.trunk_yaw.add_point(trajectory.t_start, old_trajectory->trunk_yaw.pos(trajectory.t_start),
375
+ // Initiate the trunk_yaw spline with the old trajectory trunk_yaw position and velocity
376
+ trajectory.trunk_yaw.add_point(trajectory.t_start, old_trajectory->get_yaw_world_trunk(trajectory.t_start),
353
377
  old_trajectory->trunk_yaw.vel(trajectory.t_start));
354
378
  }
355
379
 
@@ -63,6 +63,11 @@ public:
63
63
  Eigen::Vector3d get_v_world_right(double t);
64
64
  Eigen::Vector3d get_v_world_foot(HumanoidRobot::Side side, double t);
65
65
 
66
+ double get_yaw_world_left(double t);
67
+ double get_yaw_world_right(double t);
68
+ double get_yaw_world_foot(HumanoidRobot::Side side, double t);
69
+ double get_yaw_world_trunk(double t);
70
+
66
71
  Eigen::Vector3d get_p_world_CoM(double t);
67
72
  Eigen::Vector3d get_v_world_CoM(double t);
68
73
  Eigen::Vector3d get_a_world_CoM(double t);
@@ -172,36 +177,38 @@ public:
172
177
  /**
173
178
  * @brief Replans the supports for a given trajectory given a footsteps planner.
174
179
  */
175
- std::vector<FootstepsPlanner::Support> replan_supports(FootstepsPlanner& planner, Trajectory& trajectory, double t_replan, double t_last_replan);
180
+ std::vector<FootstepsPlanner::Support> replan_supports(FootstepsPlanner& planner, Trajectory& trajectory,
181
+ double t_replan, double t_last_replan);
176
182
 
177
183
  double last_com_planning_duration = 0.;
178
184
  double last_feet_planning_duration = 0.;
179
185
 
180
186
  /**
181
- * @brief Updates the supports to ensure DCM viability by adjusting the
187
+ * @brief Updates the supports to ensure DCM viability by adjusting the
182
188
  * duration and the target of the current swing trajectory.
183
189
  * @param t Current time
184
190
  * @param supports Planned supports
185
191
  * @param world_target_zmp Target ZMP for the flying foot in world frame
186
192
  * @param world_measured_dcm Measured DCM in world frame
187
193
  */
188
- std::vector<FootstepsPlanner::Support> update_supports(double t, std::vector<FootstepsPlanner::Support> supports,
189
- Eigen::Vector2d world_target_zmp, Eigen::Vector2d world_measured_dcm);
194
+ std::vector<FootstepsPlanner::Support> update_supports(double t, std::vector<FootstepsPlanner::Support> supports,
195
+ Eigen::Vector2d world_target_zmp,
196
+ Eigen::Vector2d world_measured_dcm);
190
197
 
191
198
  /**
192
- * @brief Computes the best ZMP in the support polygon to move de DCM from
199
+ * @brief Computes the best ZMP in the support polygon to move de DCM from
193
200
  * world_dcm_start to world_dcm_end in duration.
194
201
  * @param world_dcm_start Initial DCM position in world frame
195
202
  * @param world_dcm_end Desired final DCM position in world frame
196
203
  * @param duration Duration
197
204
  * @param support Support
198
205
  */
199
- Eigen::Vector2d get_optimal_zmp(Eigen::Vector2d world_dcm_start, Eigen::Vector2d world_dcm_end,
200
- double duration, FootstepsPlanner::Support& support);
206
+ Eigen::Vector2d get_optimal_zmp(Eigen::Vector2d world_dcm_start, Eigen::Vector2d world_dcm_end, double duration,
207
+ FootstepsPlanner::Support& support);
201
208
 
202
209
  int support_default_timesteps(FootstepsPlanner::Support& support);
203
210
  double support_default_duration(FootstepsPlanner::Support& support);
204
-
211
+
205
212
  bool soft = false;
206
213
 
207
214
  protected:
@@ -214,10 +221,12 @@ protected:
214
221
  double omega;
215
222
  double omega_2;
216
223
 
217
- void constrain_lipm(problem::Problem& problem, LIPM& lipm, FootstepsPlanner::Support& support, double omega_2, HumanoidParameters& parameters);
224
+ void constrain_lipm(problem::Problem& problem, LIPM& lipm, FootstepsPlanner::Support& support, double omega_2,
225
+ HumanoidParameters& parameters);
218
226
 
219
- void plan_com(Trajectory& trajectory, std::vector<FootstepsPlanner::Support>& supports, Eigen::Vector2d initial_pos,
220
- Eigen::Vector2d initial_vel = Eigen::Vector2d::Zero(), Eigen::Vector2d initial_acc = Eigen::Vector2d::Zero());
227
+ void plan_com(Trajectory& trajectory, std::vector<FootstepsPlanner::Support>& supports, Eigen::Vector2d initial_pos,
228
+ Eigen::Vector2d initial_vel = Eigen::Vector2d::Zero(),
229
+ Eigen::Vector2d initial_acc = Eigen::Vector2d::Zero());
221
230
 
222
231
  void plan_dbl_support(Trajectory& trajectory, int part_index);
223
232
  void plan_sgl_support(Trajectory& trajectory, int part_index, Trajectory* old_trajectory);
@@ -0,0 +1,41 @@
1
+ #include "placo/kinematics/distance_constraint.h"
2
+ #include "placo/kinematics/kinematics_solver.h"
3
+ #include "placo/problem/polygon_constraint.h"
4
+
5
+ namespace placo::kinematics
6
+ {
7
+ DistanceConstraint::DistanceConstraint(model::RobotWrapper::FrameIndex frame_a, model::RobotWrapper::FrameIndex frame_b,
8
+ double distance_max)
9
+ : frame_a(frame_a), frame_b(frame_b), distance_max(distance_max)
10
+ {
11
+ }
12
+
13
+ void DistanceConstraint::add_constraint(placo::problem::Problem& problem)
14
+ {
15
+ auto T_world_a = solver->robot.get_T_world_frame(frame_a);
16
+ auto T_world_b = solver->robot.get_T_world_frame(frame_b);
17
+
18
+ Eigen::Vector3d ab_world = T_world_b.translation() - T_world_a.translation();
19
+
20
+ double distance = ab_world.norm();
21
+ Eigen::Vector3d direction = ab_world.normalized();
22
+
23
+ Eigen::MatrixXd J_a = solver->robot.frame_jacobian(frame_a, pinocchio::LOCAL_WORLD_ALIGNED);
24
+ Eigen::MatrixXd J_b = solver->robot.frame_jacobian(frame_b, pinocchio::LOCAL_WORLD_ALIGNED);
25
+ Eigen::MatrixXd J_distance = direction.transpose() * (J_b - J_a).block(0, 0, 3, solver->N);
26
+
27
+ // Expression for the angle
28
+ problem::Expression e;
29
+ e.A.resize(1, solver->N);
30
+ e.b.resize(1);
31
+
32
+ e.A.row(0) = J_distance;
33
+ e.b(0) = distance;
34
+
35
+ problem.add_constraint(e <= distance_max)
36
+ .configure(priority == Prioritized::Priority::Hard ? problem::ProblemConstraint::Hard :
37
+ problem::ProblemConstraint::Soft,
38
+ weight);
39
+ }
40
+
41
+ } // namespace placo::kinematics
@@ -0,0 +1,43 @@
1
+ #pragma once
2
+
3
+ #include <vector>
4
+ #include "placo/problem/problem.h"
5
+ #include "placo/kinematics/constraint.h"
6
+
7
+ namespace placo::kinematics
8
+ {
9
+ class KinematicsSolver;
10
+
11
+ /**
12
+ * @brief Constraints the distance betweek two points in the robot
13
+ */
14
+ class DistanceConstraint : public Constraint
15
+ {
16
+ public:
17
+ /**
18
+ * @brief Constraints the distance betweek two points in the robot
19
+ * @param frame_a
20
+ * @param frame_b
21
+ * @param distance_max
22
+ */
23
+ DistanceConstraint(model::RobotWrapper::FrameIndex frame_a, model::RobotWrapper::FrameIndex frame_b,
24
+ double distance_max);
25
+
26
+ /**
27
+ * @brief Frame A
28
+ */
29
+ model::RobotWrapper::FrameIndex frame_a;
30
+
31
+ /**
32
+ * @brief Frame B
33
+ */
34
+ model::RobotWrapper::FrameIndex frame_b;
35
+
36
+ /**
37
+ * @brief Maximum distance allowed between frame A and frame B
38
+ */
39
+ double distance_max;
40
+
41
+ virtual void add_constraint(placo::problem::Problem& problem) override;
42
+ };
43
+ } // namespace placo::kinematics
@@ -226,6 +226,30 @@ ConeConstraint& KinematicsSolver::add_cone_constraint(std::string frame_a, std::
226
226
  return add_cone_constraint(robot.get_frame_index(frame_a), robot.get_frame_index(frame_b), angle_max);
227
227
  }
228
228
 
229
+ YawConstraint& KinematicsSolver::add_yaw_constraint(model::RobotWrapper::FrameIndex frame_a,
230
+ model::RobotWrapper::FrameIndex frame_b, double angle_max)
231
+ {
232
+ return add_constraint(new YawConstraint(frame_a, frame_b, angle_max));
233
+ }
234
+
235
+ YawConstraint& KinematicsSolver::add_yaw_constraint(std::string frame_a, std::string frame_b, double angle_max)
236
+ {
237
+ return add_yaw_constraint(robot.get_frame_index(frame_a), robot.get_frame_index(frame_b), angle_max);
238
+ }
239
+
240
+ DistanceConstraint& KinematicsSolver::add_distance_constraint(model::RobotWrapper::FrameIndex frame_a,
241
+ model::RobotWrapper::FrameIndex frame_b,
242
+ double distance_max)
243
+ {
244
+ return add_constraint(new DistanceConstraint(frame_a, frame_b, distance_max));
245
+ }
246
+
247
+ DistanceConstraint& KinematicsSolver::add_distance_constraint(std::string frame_a, std::string frame_b,
248
+ double distance_max)
249
+ {
250
+ return add_distance_constraint(robot.get_frame_index(frame_a), robot.get_frame_index(frame_b), distance_max);
251
+ }
252
+
229
253
  void KinematicsSolver::mask_dof(std::string dof)
230
254
  {
231
255
  masked_dof.insert(robot.get_joint_v_offset(dof));
@@ -30,6 +30,8 @@
30
30
  #include "placo/kinematics/com_polygon_constraint.h"
31
31
  #include "placo/kinematics/joint_space_half_spaces_constraint.h"
32
32
  #include "placo/kinematics/cone_constraint.h"
33
+ #include "placo/kinematics/yaw_constraint.h"
34
+ #include "placo/kinematics/distance_constraint.h"
33
35
 
34
36
  // Problem formulation
35
37
  #include "placo/problem/problem.h"
@@ -300,7 +302,6 @@ public:
300
302
  * @param frame_a frame A
301
303
  * @param frame_b frame B
302
304
  * @param alpha_max alpha max (in radians) between the frame z-axis and the cone frame zt-axis
303
- * @param T_world_cone cone frame
304
305
  * @return constraint
305
306
  * @pyignore
306
307
  */
@@ -312,11 +313,50 @@ public:
312
313
  * @param frame_a frame A
313
314
  * @param frame_b frame B
314
315
  * @param alpha_max alpha max (in radians) between the frame z-axis and the cone frame zt-axis
315
- * @param T_world_cone cone frame
316
316
  * @return constraint
317
317
  */
318
318
  ConeConstraint& add_cone_constraint(std::string frame_a, std::string frame_b, double alpha_max);
319
319
 
320
+ /**
321
+ * @brief Adds a yaw constraint
322
+ * @param frame_a frame A
323
+ * @param frame_b frame B
324
+ * @param alpha_max angle max for yaw of x-axis in frame b in a
325
+ * @return constraint
326
+ * @pyignore
327
+ */
328
+ YawConstraint& add_yaw_constraint(model::RobotWrapper::FrameIndex frame_a, model::RobotWrapper::FrameIndex frame_b,
329
+ double alpha_max);
330
+
331
+ /**
332
+ * @brief Adds a yaw constraint
333
+ * @param frame_a frame A
334
+ * @param frame_b frame B
335
+ * @param alpha_max angle max for yaw of x-axis in frame b in a
336
+ * @return constraint
337
+ */
338
+ YawConstraint& add_yaw_constraint(std::string frame_a, std::string frame_b, double alpha_max);
339
+
340
+ /**
341
+ * @brief Adds a distance constraint
342
+ * @param frame_a frame A
343
+ * @param frame_b frame B
344
+ * @param distance_max maximum distance between the two frames
345
+ * @return constraint
346
+ * @pyignore
347
+ */
348
+ DistanceConstraint& add_distance_constraint(model::RobotWrapper::FrameIndex frame_a,
349
+ model::RobotWrapper::FrameIndex frame_b, double distance_max);
350
+
351
+ /**
352
+ * @brief Adds a distance constraint
353
+ * @param frame_a frame A
354
+ * @param frame_b frame B
355
+ * @param distance_max maximum distance between the two frames
356
+ * @return constraint
357
+ */
358
+ DistanceConstraint& add_distance_constraint(std::string frame_a, std::string frame_b, double distance_max);
359
+
320
360
  /**
321
361
  * @brief Constructs the QP problem and solves it
322
362
  * @param apply apply the solution to the robot model
@@ -0,0 +1,52 @@
1
+ #include "placo/kinematics/yaw_constraint.h"
2
+ #include "placo/kinematics/kinematics_solver.h"
3
+ #include "placo/problem/polygon_constraint.h"
4
+
5
+ namespace placo::kinematics
6
+ {
7
+ YawConstraint::YawConstraint(model::RobotWrapper::FrameIndex frame_a, model::RobotWrapper::FrameIndex frame_b,
8
+ double angle_max)
9
+ : frame_a(frame_a), frame_b(frame_b), angle_max(angle_max)
10
+ {
11
+ }
12
+
13
+ void YawConstraint::add_constraint(placo::problem::Problem& problem)
14
+ {
15
+ Eigen::Affine3d T_a_b = solver->robot.get_T_a_b(frame_a, frame_b);
16
+
17
+ // Jacobian of the rotational velocity expressed in a
18
+ Eigen::MatrixXd J_relative =
19
+ T_a_b.linear() *
20
+ solver->robot.frame_jacobian(frame_b, pinocchio::ReferenceFrame::LOCAL).block(3, 0, 3, solver->N) -
21
+ solver->robot.frame_jacobian(frame_a, pinocchio::ReferenceFrame::LOCAL).block(3, 0, 3, solver->N);
22
+ ;
23
+
24
+ // B's x axis in A
25
+ Eigen::Vector3d x_axis = T_a_b.linear().block(0, 0, 3, 1);
26
+
27
+ // Current angle
28
+ double alpha = atan2(x_axis.y(), x_axis.x());
29
+
30
+ Eigen::Vector3d perp_axis = Eigen::Vector3d::UnitZ().cross(x_axis).normalized();
31
+ Eigen::Vector3d yaw_axis = x_axis.cross(perp_axis).normalized();
32
+
33
+ Eigen::MatrixXd J_angle = yaw_axis.transpose() * J_relative;
34
+
35
+ // Expression for the angle
36
+ problem::Expression e;
37
+ e.A.resize(2, solver->N);
38
+ e.b.resize(2);
39
+ // First row is angle + J_angle*qd
40
+ e.A.block(0, 0, 1, solver->N) = J_angle;
41
+ e.b(0, 0) = alpha;
42
+ // Second row is -(angle -J_angle*qd)
43
+ e.A.block(1, 0, 1, solver->N) = -J_angle;
44
+ e.b(1, 0) = -alpha;
45
+
46
+ problem.add_constraint(e <= angle_max)
47
+ .configure(priority == Prioritized::Priority::Hard ? problem::ProblemConstraint::Hard :
48
+ problem::ProblemConstraint::Soft,
49
+ weight);
50
+ }
51
+
52
+ } // namespace placo::kinematics
@@ -0,0 +1,42 @@
1
+ #pragma once
2
+
3
+ #include <vector>
4
+ #include "placo/problem/problem.h"
5
+ #include "placo/kinematics/constraint.h"
6
+
7
+ namespace placo::kinematics
8
+ {
9
+ class KinematicsSolver;
10
+
11
+ /**
12
+ * @brief A yaw constraint is a constraint where the x-axis of frame b should have a yaw withing +- angle_max in frame a
13
+ */
14
+ class YawConstraint : public Constraint
15
+ {
16
+ public:
17
+ /**
18
+ * @brief Constrains the yaw of frame b in frame a, such that the x-axis of frame b should remain with +- angle_max
19
+ * @param frame_a
20
+ * @param frame_b
21
+ * @param angle_max
22
+ */
23
+ YawConstraint(model::RobotWrapper::FrameIndex frame_a, model::RobotWrapper::FrameIndex frame_b, double angle_max);
24
+
25
+ /**
26
+ * @brief Frame A
27
+ */
28
+ model::RobotWrapper::FrameIndex frame_a;
29
+
30
+ /**
31
+ * @brief Frame B
32
+ */
33
+ model::RobotWrapper::FrameIndex frame_b;
34
+
35
+ /**
36
+ * @brief Maximum angle allowable by the yaw constraint (yaw is taken for x-axis of b around z-axis in a)
37
+ */
38
+ double angle_max;
39
+
40
+ virtual void add_constraint(placo::problem::Problem& problem) override;
41
+ };
42
+ } // namespace placo::kinematics
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes