placo 0.6.5__tar.gz → 0.7.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 (179) hide show
  1. {placo-0.6.5 → placo-0.7.0}/CMakeLists.txt +5 -5
  2. {placo-0.6.5 → placo-0.7.0}/PKG-INFO +4 -6
  3. placo-0.7.0/bindings/doxystub/README.md +15 -0
  4. placo-0.7.0/bindings/doxystub/config.py +5 -0
  5. {placo-0.6.5 → placo-0.7.0/bindings/doxystub}/stubs.py +13 -12
  6. placo-0.7.0/bindings/doxystub/stubs.sh +5 -0
  7. {placo-0.6.5 → placo-0.7.0}/bindings/expose-dynamics.cpp +2 -1
  8. {placo-0.6.5 → placo-0.7.0}/bindings/expose-footsteps.cpp +4 -3
  9. {placo-0.6.5 → placo-0.7.0}/bindings/expose-kinematics.cpp +1 -1
  10. {placo-0.6.5 → placo-0.7.0}/bindings/expose-parameters.cpp +11 -5
  11. {placo-0.6.5 → placo-0.7.0}/bindings/expose-problem.cpp +1 -1
  12. {placo-0.6.5 → placo-0.7.0}/bindings/expose-robot-wrapper.cpp +1 -1
  13. {placo-0.6.5 → placo-0.7.0}/bindings/expose-tools.cpp +10 -5
  14. {placo-0.6.5 → placo-0.7.0}/bindings/expose-utils.hpp +14 -2
  15. {placo-0.6.5 → placo-0.7.0}/bindings/expose-walk-pattern-generator.cpp +7 -3
  16. placo-0.7.0/build_wheel.sh +11 -0
  17. {placo-0.6.5 → placo-0.7.0}/pyproject.toml +6 -8
  18. {placo-0.6.5 → placo-0.7.0}/python/placo_utils/visualization.py +3 -2
  19. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/humanoid_parameters.h +3 -1
  20. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/walk_pattern_generator.cpp +87 -34
  21. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/walk_pattern_generator.h +28 -16
  22. {placo-0.6.5 → placo-0.7.0}/src/placo/model/robot_wrapper.cpp +4 -5
  23. placo-0.6.5/placo.pyi +0 -7897
  24. {placo-0.6.5 → placo-0.7.0}/.clang-format +0 -0
  25. {placo-0.6.5 → placo-0.7.0}/.gitattributes +0 -0
  26. {placo-0.6.5 → placo-0.7.0}/.gitignore +0 -0
  27. {placo-0.6.5 → placo-0.7.0}/.readthedocs.yaml +0 -0
  28. {placo-0.6.5 → placo-0.7.0}/Doxyfile +0 -0
  29. {placo-0.6.5 → placo-0.7.0}/LICENSE +0 -0
  30. {placo-0.6.5 → placo-0.7.0}/Makefile +0 -0
  31. {placo-0.6.5 → placo-0.7.0}/README.md +0 -0
  32. {placo-0.6.5 → placo-0.7.0/bindings/doxystub}/doxygen_parse.py +0 -0
  33. {placo-0.6.5/bindings → placo-0.7.0/bindings/doxystub}/registry.cpp +0 -0
  34. {placo-0.6.5/bindings → placo-0.7.0/bindings/doxystub}/registry.h +0 -0
  35. {placo-0.6.5 → placo-0.7.0}/bindings/expose-eigen.cpp +0 -0
  36. {placo-0.6.5 → placo-0.7.0}/bindings/module.cpp +0 -0
  37. {placo-0.6.5 → placo-0.7.0}/bindings/module.h +0 -0
  38. {placo-0.6.5 → placo-0.7.0}/python/.vscode/settings.json +0 -0
  39. {placo-0.6.5 → placo-0.7.0}/python/Makefile +0 -0
  40. {placo-0.6.5 → placo-0.7.0}/python/placo_utils/__init__.py +0 -0
  41. {placo-0.6.5 → placo-0.7.0}/python/placo_utils/tf.py +0 -0
  42. {placo-0.6.5 → placo-0.7.0}/python/placo_utils/view.py +0 -0
  43. {placo-0.6.5 → placo-0.7.0}/python/run_tests.sh +0 -0
  44. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
  45. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
  46. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/com_task.cpp +0 -0
  47. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/com_task.h +0 -0
  48. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/constraint.cpp +0 -0
  49. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/constraint.h +0 -0
  50. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/contacts.cpp +0 -0
  51. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/contacts.h +0 -0
  52. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/dynamics_solver.cpp +0 -0
  53. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/dynamics_solver.h +0 -0
  54. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/frame_task.cpp +0 -0
  55. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/frame_task.h +0 -0
  56. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/gear_task.cpp +0 -0
  57. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/gear_task.h +0 -0
  58. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/joints_task.cpp +0 -0
  59. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/joints_task.h +0 -0
  60. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/orientation_task.cpp +0 -0
  61. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/orientation_task.h +0 -0
  62. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/position_task.cpp +0 -0
  63. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/position_task.h +0 -0
  64. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/relative_frame_task.cpp +0 -0
  65. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/relative_frame_task.h +0 -0
  66. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
  67. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/relative_orientation_task.h +0 -0
  68. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/relative_position_task.cpp +0 -0
  69. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/relative_position_task.h +0 -0
  70. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/task.cpp +0 -0
  71. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/task.h +0 -0
  72. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/torque_task.cpp +0 -0
  73. {placo-0.6.5 → placo-0.7.0}/src/placo/dynamics/torque_task.h +0 -0
  74. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/foot_trajectory.cpp +0 -0
  75. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/foot_trajectory.h +0 -0
  76. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/footsteps_planner.cpp +0 -0
  77. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/footsteps_planner.h +0 -0
  78. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
  79. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
  80. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
  81. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
  82. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
  83. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/humanoid_robot.cpp +0 -0
  84. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/humanoid_robot.h +0 -0
  85. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/kick.cpp +0 -0
  86. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/kick.h +0 -0
  87. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/lipm.cpp +0 -0
  88. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/lipm.h +0 -0
  89. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/swing_foot.cpp +0 -0
  90. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/swing_foot.h +0 -0
  91. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
  92. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/swing_foot_cubic.h +0 -0
  93. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
  94. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/swing_foot_quintic.h +0 -0
  95. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/walk_tasks.cpp +0 -0
  96. {placo-0.6.5 → placo-0.7.0}/src/placo/humanoid/walk_tasks.h +0 -0
  97. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
  98. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
  99. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/axis_align_task.cpp +0 -0
  100. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/axis_align_task.h +0 -0
  101. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/centroidal_momentum_task.cpp +0 -0
  102. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
  103. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/com_polygon_constraint.cpp +0 -0
  104. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/com_polygon_constraint.h +0 -0
  105. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/com_task.cpp +0 -0
  106. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/com_task.h +0 -0
  107. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/cone_constraint.cpp +0 -0
  108. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/cone_constraint.h +0 -0
  109. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/constraint.cpp +0 -0
  110. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/constraint.h +0 -0
  111. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/distance_task.cpp +0 -0
  112. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/distance_task.h +0 -0
  113. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/frame_task.cpp +0 -0
  114. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/frame_task.h +0 -0
  115. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/gear_task.cpp +0 -0
  116. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/gear_task.h +0 -0
  117. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/joint_space_half_spaces_constraint.cpp +0 -0
  118. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/joint_space_half_spaces_constraint.h +0 -0
  119. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/joints_task.cpp +0 -0
  120. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/joints_task.h +0 -0
  121. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/kinematics_solver.cpp +0 -0
  122. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/kinematics_solver.h +0 -0
  123. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
  124. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
  125. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/manipulability_task.cpp +0 -0
  126. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/manipulability_task.h +0 -0
  127. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/orientation_task.cpp +0 -0
  128. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/orientation_task.h +0 -0
  129. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/position_task.cpp +0 -0
  130. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/position_task.h +0 -0
  131. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/regularization_task.cpp +0 -0
  132. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/regularization_task.h +0 -0
  133. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/relative_frame_task.cpp +0 -0
  134. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/relative_frame_task.h +0 -0
  135. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
  136. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/relative_orientation_task.h +0 -0
  137. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/relative_position_task.cpp +0 -0
  138. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/relative_position_task.h +0 -0
  139. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/task.cpp +0 -0
  140. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/task.h +0 -0
  141. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/wheel_task.cpp +0 -0
  142. {placo-0.6.5 → placo-0.7.0}/src/placo/kinematics/wheel_task.h +0 -0
  143. {placo-0.6.5 → placo-0.7.0}/src/placo/model/robot_wrapper.h +0 -0
  144. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/constraint.cpp +0 -0
  145. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/constraint.h +0 -0
  146. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/expression.cpp +0 -0
  147. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/expression.h +0 -0
  148. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/integrator.cpp +0 -0
  149. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/integrator.h +0 -0
  150. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/polygon_constraint.cpp +0 -0
  151. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/polygon_constraint.h +0 -0
  152. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/problem.cpp +0 -0
  153. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/problem.h +0 -0
  154. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/problem_polynom.cpp +0 -0
  155. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/problem_polynom.h +0 -0
  156. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/qp_error.cpp +0 -0
  157. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/qp_error.h +0 -0
  158. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/sparsity.cpp +0 -0
  159. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/sparsity.h +0 -0
  160. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/variable.cpp +0 -0
  161. {placo-0.6.5 → placo-0.7.0}/src/placo/problem/variable.h +0 -0
  162. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/axises_mask.cpp +0 -0
  163. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/axises_mask.h +0 -0
  164. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/cubic_spline.cpp +0 -0
  165. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/cubic_spline.h +0 -0
  166. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/cubic_spline_3d.cpp +0 -0
  167. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/cubic_spline_3d.h +0 -0
  168. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/directions.cpp +0 -0
  169. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/directions.h +0 -0
  170. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/polynom.cpp +0 -0
  171. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/polynom.h +0 -0
  172. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/prioritized.cpp +0 -0
  173. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/prioritized.h +0 -0
  174. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/segment.cpp +0 -0
  175. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/segment.h +0 -0
  176. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/utils.cpp +0 -0
  177. {placo-0.6.5 → placo-0.7.0}/src/placo/tools/utils.h +0 -0
  178. {placo-0.6.5 → placo-0.7.0}/tweak_sdist.sh +0 -0
  179. {placo-0.6.5 → placo-0.7.0}/wks.yml +0 -0
@@ -127,7 +127,7 @@ target_link_libraries(libplaco PUBLIC
127
127
  ${PROTOBUF_LIBRARIES}
128
128
  ${PROTOBUF_LIBRARIES}
129
129
  )
130
- target_compile_definitions(libplaco PUBLIC -DPINOCCHIO_WITH_HPP_FCL)
130
+ target_compile_definitions(libplaco PUBLIC)
131
131
 
132
132
  if(TARGET rhoban_utils)
133
133
  message("Placo: Rhoban utils is present, enabling it")
@@ -151,7 +151,7 @@ add_library(placo MODULE
151
151
  bindings/expose-walk-pattern-generator.cpp
152
152
  bindings/expose-dynamics.cpp
153
153
  bindings/module.cpp
154
- bindings/registry.cpp
154
+ bindings/doxystub/registry.cpp
155
155
  )
156
156
  set_target_properties(placo PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB})
157
157
 
@@ -159,8 +159,8 @@ target_link_libraries(placo ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} libplaco)
159
159
  target_include_directories(placo PRIVATE ${PYTHON_INCLUDE_DIRS})
160
160
 
161
161
  add_custom_command(TARGET placo POST_BUILD
162
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/stubs.py > placo.pyi
163
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}
162
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bindings/doxystub/stubs.sh "${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}" > "${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo.pyi"
163
+ WORKING DIRECTORY "/"
164
164
  COMMENT "Generating stubs..."
165
165
  )
166
166
 
@@ -175,4 +175,4 @@ set_target_properties(libplaco PROPERTIES INSTALL_RPATH "\$ORIGIN")
175
175
  install(TARGETS libplaco DESTINATION lib)
176
176
  install(TARGETS placo DESTINATION ${PYTHON_SITELIB})
177
177
  install(FILES ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo.pyi DESTINATION ${PYTHON_SITELIB})
178
- install(DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo_utils DESTINATION ${PYTHON_SITELIB})
178
+ install(DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo_utils DESTINATION ${PYTHON_SITELIB})
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: placo
3
- Version: 0.6.5
3
+ Version: 0.7.0
4
4
  Summary: PlaCo: Rhoban Planning and Control
5
- Requires-Python: >= 3.8
5
+ Requires-Python: >= 3.9
6
6
  License-Expression: MIT
7
7
  Author-email: Rhoban team <team@rhoban.com>
8
8
  Project-URL: Changelog, https://github.com/rhoban/placo/blob/main/CHANGELOG.md
@@ -10,14 +10,12 @@ Home-page: https://placo.readthedocs.io/en/latest/
10
10
  Project-URL: Repository, https://github.com/rhoban/placo.git
11
11
  Requires-Dist: cmeel
12
12
  Requires-Dist: eiquadprog >= 1.2.6, < 2
13
- Requires-Dist: pin >= 2.6.18, < 3
13
+ Requires-Dist: pin >= 3
14
14
  Requires-Dist: rhoban-cmeel-jsoncpp
15
15
  Requires-Dist: meshcat
16
- Requires-Dist: numpy<2
17
16
  Requires-Dist: ischedule
18
17
  Provides-Extra: build
19
- Requires-Dist: pin[build] >= 2.6.18, < 3 ; extra == "build"
20
- Requires-Dist: cmeel-urdfdom[build] ; extra == "build"
18
+ Requires-Dist: pin[build] >= 3 ; extra == "build"
21
19
  Description-Content-Type: text/markdown
22
20
 
23
21
  <img width="400" src="https://placo.readthedocs.io/en/latest/_static/placo.png" />
@@ -0,0 +1,15 @@
1
+ # Generate Doxygen stubs
2
+
3
+ This code allow to generate a `module.pyi` file containing useful auto-completion stubs, based on Doxygen and introspection.
4
+
5
+ ## Step1: configure your project
6
+
7
+ In `config.py`, set the name of the module and the path to the source directory (where the `Doxyfile` is)
8
+
9
+ ## Step2: expose through registry
10
+
11
+ Include `registry.h` in your Python bindings, and use `class__` instead of `class_`, so that the registered classes will be wrapped in the registry
12
+
13
+ ## Step3: call `stubs.py` after compilation
14
+
15
+ Execute the `stubs.py` script after compilation, it will output the `pyi` file.
@@ -0,0 +1,5 @@
1
+ # Module name to document
2
+ module_name = "placo"
3
+
4
+ # Path for the doxygen generation, relative to this script
5
+ doxygen_path = "../../"
@@ -1,27 +1,28 @@
1
- #!/usr/bin/env python
1
+ #!/usr/bin/env python3
2
2
  import re
3
3
  import inspect
4
4
  import sys
5
5
  import os
6
6
  import argparse
7
+ from config import module_name, doxygen_path
7
8
 
8
9
  # Current script directory:
9
- repo_directory = os.path.dirname(os.path.realpath(__file__))
10
+ repo_directory = os.path.dirname(os.path.realpath(__file__ + "/" + doxygen_path))
10
11
 
11
- # If placo.pyi file already exists next to stubs.py, we read it directly. This is a way to
12
- # avoid running Doxygen when building placo sdist release.
13
- if os.path.exists(f"{repo_directory}/placo.pyi"):
14
- with open(f"{repo_directory}/placo.pyi", "r") as f:
12
+ # If .pyi file already exists next to stubs.py, we read it directly. This is a way to
13
+ # avoid running Doxygen when building sdist release.
14
+ if os.path.exists(f"{repo_directory}/{module_name}.pyi"):
15
+ with open(f"{repo_directory}/{module_name}.pyi", "r") as f:
15
16
  print(f.read())
16
17
  exit(0)
17
18
 
18
19
  # Prepending current directory to PYTHONPATH
19
20
  sys.path = ["."] + sys.path
20
21
 
21
- import placo
22
+ exec(f"import {module_name}")
22
23
  from doxygen_parse import parse_directory, get_members, get_metadata
23
24
 
24
- module: str = "placo"
25
+ module = eval(f"{module_name}")
25
26
 
26
27
  # Ensure Doxygen is run
27
28
  if not os.path.exists(f"/usr/bin/doxygen"):
@@ -53,7 +54,7 @@ rewrite_types: dict = {
53
54
  }
54
55
 
55
56
  # Building registry and reverse registry for class names
56
- cxx_registry = placo.get_classes_registry()
57
+ cxx_registry = module.get_classes_registry()
57
58
  py_registry = {"root": "root"}
58
59
  for entry in cxx_registry:
59
60
  rewrite_types[entry] = cxx_registry[entry]
@@ -219,18 +220,18 @@ def print_class_method(class_name: str, method_name: str, doc: str, prefix: str
219
220
  else:
220
221
  print_def(method_name, doc, prefix)
221
222
 
222
-
223
+ print("# Doxygen stubs generation")
223
224
  print("import numpy")
224
225
  print("import typing")
225
226
 
226
- for name, object in inspect.getmembers(placo):
227
+ for name, object in inspect.getmembers(module):
227
228
  if isinstance(object, type):
228
229
  class_name = object.__name__
229
230
  print(f'{class_name} = typing.NewType("{class_name}", None)')
230
231
 
231
232
  groups = {}
232
233
 
233
- for name, object in inspect.getmembers(placo):
234
+ for name, object in inspect.getmembers(module):
234
235
  if isinstance(object, type):
235
236
  class_name = object.__name__
236
237
  print(f"class {class_name}:")
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4
+ export PYTHONPATH="$1:$PYTHONPATH"
5
+ $SCRIPT_DIR/stubs.py
@@ -2,7 +2,8 @@
2
2
 
3
3
  #include "expose-utils.hpp"
4
4
  #include "module.h"
5
- #include "registry.h"
5
+
6
+ #include "doxystub/registry.h"
6
7
  #include "placo/model/robot_wrapper.h"
7
8
  #include "placo/dynamics/dynamics_solver.h"
8
9
  #include <Eigen/Dense>
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "expose-utils.hpp"
4
4
  #include "module.h"
5
- #include "registry.h"
5
+ #include "doxystub/registry.h"
6
6
  #include "placo/humanoid/footsteps_planner.h"
7
7
  #include "placo/humanoid/footsteps_planner_naive.h"
8
8
  #include "placo/humanoid/footsteps_planner_repetitive.h"
@@ -41,9 +41,10 @@ void exposeFootsteps()
41
41
  "set_start", +[](FootstepsPlanner::Support& support, bool b) { support.start = b; })
42
42
  .def(
43
43
  "set_end", +[](FootstepsPlanner::Support& support, bool b) { support.end = b; })
44
- .add_property("footsteps", &FootstepsPlanner::Support::footsteps)
44
+ .add_property("footsteps", &FootstepsPlanner::Support::footsteps, &FootstepsPlanner::Support::footsteps)
45
45
  .add_property("t_start", &FootstepsPlanner::Support::t_start, &FootstepsPlanner::Support::t_start)
46
- .add_property("elapsed_ratio", &FootstepsPlanner::Support::elapsed_ratio, &FootstepsPlanner::Support::elapsed_ratio)
46
+ .add_property("elapsed_ratio", &FootstepsPlanner::Support::elapsed_ratio,
47
+ &FootstepsPlanner::Support::elapsed_ratio)
47
48
  .add_property("time_ratio", &FootstepsPlanner::Support::time_ratio, &FootstepsPlanner::Support::time_ratio)
48
49
  .add_property("start", &FootstepsPlanner::Support::start, &FootstepsPlanner::Support::start)
49
50
  .add_property("end", &FootstepsPlanner::Support::end, &FootstepsPlanner::Support::end)
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "expose-utils.hpp"
4
4
  #include "module.h"
5
- #include "registry.h"
5
+ #include "doxystub/registry.h"
6
6
  #include "placo/kinematics/kinematics_solver.h"
7
7
  #include <boost/python/return_internal_reference.hpp>
8
8
  #include <Eigen/Dense>
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "expose-utils.hpp"
4
4
  #include "module.h"
5
- #include "registry.h"
5
+ #include "doxystub/registry.h"
6
6
  #include "placo/model/robot_wrapper.h"
7
7
  #include "placo/humanoid/humanoid_robot.h"
8
8
  #include "placo/humanoid/humanoid_parameters.h"
@@ -18,10 +18,14 @@ using namespace placo::humanoid;
18
18
  void exposeParameters()
19
19
  {
20
20
  class__<HumanoidParameters>("HumanoidParameters")
21
- .add_property("single_support_duration", &HumanoidParameters::single_support_duration, &HumanoidParameters::single_support_duration)
22
- .add_property("single_support_timesteps", &HumanoidParameters::single_support_timesteps, &HumanoidParameters::single_support_timesteps)
23
- .add_property("double_support_ratio", &HumanoidParameters::double_support_ratio, &HumanoidParameters::double_support_ratio)
24
- .add_property("startend_double_support_ratio", &HumanoidParameters::startend_double_support_ratio, &HumanoidParameters::startend_double_support_ratio)
21
+ .add_property("single_support_duration", &HumanoidParameters::single_support_duration,
22
+ &HumanoidParameters::single_support_duration)
23
+ .add_property("single_support_timesteps", &HumanoidParameters::single_support_timesteps,
24
+ &HumanoidParameters::single_support_timesteps)
25
+ .add_property("double_support_ratio", &HumanoidParameters::double_support_ratio,
26
+ &HumanoidParameters::double_support_ratio)
27
+ .add_property("startend_double_support_ratio", &HumanoidParameters::startend_double_support_ratio,
28
+ &HumanoidParameters::startend_double_support_ratio)
25
29
  .add_property("planned_timesteps", &HumanoidParameters::planned_timesteps, &HumanoidParameters::planned_timesteps)
26
30
  .add_property("replan_timesteps", &HumanoidParameters::replan_timesteps, &HumanoidParameters::replan_timesteps)
27
31
  .add_property("zmp_margin", &HumanoidParameters::zmp_margin, &HumanoidParameters::zmp_margin)
@@ -45,6 +49,8 @@ void exposeParameters()
45
49
  .add_property("walk_max_dtheta", &HumanoidParameters::walk_max_dtheta, &HumanoidParameters::walk_max_dtheta)
46
50
  .add_property("walk_dtheta_spacing", &HumanoidParameters::walk_dtheta_spacing,
47
51
  &HumanoidParameters::walk_dtheta_spacing)
52
+ .add_property("op_space_polygon", &HumanoidParameters::op_space_polygon, &HumanoidParameters::op_space_polygon)
53
+ .add_property("dcm_offset_polygon", &HumanoidParameters::dcm_offset_polygon, &HumanoidParameters::dcm_offset_polygon)
48
54
  .def("dt", &HumanoidParameters::dt)
49
55
  .def("double_support_timesteps", &HumanoidParameters::double_support_timesteps)
50
56
  .def("startend_double_support_timesteps", &HumanoidParameters::startend_double_support_timesteps)
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include "expose-utils.hpp"
7
7
  #include "module.h"
8
- #include "registry.h"
8
+ #include "doxystub/registry.h"
9
9
  #include "placo/problem/problem.h"
10
10
  #include "placo/problem/variable.h"
11
11
  #include "placo/problem/expression.h"
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "expose-utils.hpp"
4
4
  #include "module.h"
5
- #include "registry.h"
5
+ #include "doxystub/registry.h"
6
6
  #include "placo/model/robot_wrapper.h"
7
7
  #include "placo/humanoid/humanoid_robot.h"
8
8
  #include "placo/kinematics/kinematics_solver.h"
@@ -3,7 +3,7 @@
3
3
  #include <Eigen/Dense>
4
4
  #include <boost/python.hpp>
5
5
  #include "module.h"
6
- #include "registry.h"
6
+ #include "doxystub/registry.h"
7
7
  #include "placo/tools/utils.h"
8
8
  #include "placo/tools/cubic_spline.h"
9
9
  #include "placo/tools/cubic_spline_3d.h"
@@ -89,10 +89,14 @@ void exposeTools()
89
89
  class__<Segment>("Segment", init<Eigen::Vector2d, Eigen::Vector2d>())
90
90
  .add_property("start", &Segment::start, &Segment::start)
91
91
  .add_property("end", &Segment::end, &Segment::start)
92
- .def("is_parallel", +[](Segment& s1, const Segment& s2) { return s1.is_parallel(s2); })
93
- .def("is_point_aligned", +[](Segment& s, const Eigen::Vector2d& point) { return s.is_point_aligned(point); })
94
- .def("is_collinear", +[](Segment& s1, const Segment& s2) { return s1.is_collinear(s2); })
95
- .def("is_point_in_segment", +[](Segment& s, const Eigen::Vector2d& point) { return s.is_point_in_segment(point); })
92
+ .def(
93
+ "is_parallel", +[](Segment& s1, const Segment& s2) { return s1.is_parallel(s2); })
94
+ .def(
95
+ "is_point_aligned", +[](Segment& s, const Eigen::Vector2d& point) { return s.is_point_aligned(point); })
96
+ .def(
97
+ "is_collinear", +[](Segment& s1, const Segment& s2) { return s1.is_collinear(s2); })
98
+ .def(
99
+ "is_point_in_segment", +[](Segment& s, const Eigen::Vector2d& point) { return s.is_point_in_segment(point); })
96
100
  .def("intersects", &Segment::intersects)
97
101
  .def("line_pass_through", &Segment::line_pass_through)
98
102
  .def("half_line_pass_through", &Segment::half_line_pass_through)
@@ -104,6 +108,7 @@ void exposeTools()
104
108
  // History collection
105
109
  class__<HistoryCollection>("HistoryCollection")
106
110
  .def("loadReplays", &HistoryCollection::loadReplays, loadReplays_overloads())
111
+ .def("exportToCSV", &HistoryCollection::exportToCSV)
107
112
  .def("smallestTimestamp", &HistoryCollection::smallestTimestamp)
108
113
  .def("biggestTimestamp", &HistoryCollection::biggestTimestamp)
109
114
  .def("startNamedLog", &HistoryCollection::startNamedLog)
@@ -40,6 +40,15 @@ struct custom_vector_from_seq
40
40
  }
41
41
  };
42
42
 
43
+ template <typename T>
44
+ bool is_registered()
45
+ {
46
+ boost::python::type_info info = boost::python::type_id<T>();
47
+ const boost::python::converter::registration* reg = boost::python::converter::registry::query(info);
48
+
49
+ return reg == NULL || (*reg).m_to_python == NULL;
50
+ }
51
+
43
52
  /**
44
53
  * @brief Exposes a given type for std::vector
45
54
  * @tparam T type
@@ -50,9 +59,12 @@ void exposeStdVector(const std::string& class_name)
50
59
  {
51
60
  typedef typename std::vector<T> vector_T;
52
61
 
53
- class_<vector_T>(class_name.c_str()).def(vector_indexing_suite<vector_T>());
62
+ if (!is_registered<T>())
63
+ {
64
+ class_<vector_T>(class_name.c_str()).def(vector_indexing_suite<vector_T>());
54
65
 
55
- custom_vector_from_seq<T>();
66
+ custom_vector_from_seq<T>();
67
+ }
56
68
  }
57
69
 
58
70
  template <typename K, typename V>
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "expose-utils.hpp"
4
4
  #include "module.h"
5
- #include "registry.h"
5
+ #include "doxystub/registry.h"
6
6
  #include "placo/humanoid/walk_pattern_generator.h"
7
7
  #include "placo/kinematics/kinematics_solver.h"
8
8
  #include "placo/humanoid/footsteps_planner.h"
@@ -51,7 +51,9 @@ void exposeWalkPatternGenerator()
51
51
  .def("get_support", &WalkPatternGenerator::Trajectory::get_support)
52
52
  .def("get_next_support", &WalkPatternGenerator::Trajectory::get_next_support)
53
53
  .def("get_prev_support", &WalkPatternGenerator::Trajectory::get_prev_support)
54
+ .def("get_part_t_end", &WalkPatternGenerator::Trajectory::get_part_t_end)
54
55
  .def("get_part_t_start", &WalkPatternGenerator::Trajectory::get_part_t_start)
56
+ .def("get_part_end_dcm", &WalkPatternGenerator::Trajectory::get_part_end_dcm)
55
57
  .def("apply_transform", &WalkPatternGenerator::Trajectory::apply_transform)
56
58
  .def("print_parts_timings", &WalkPatternGenerator::Trajectory::print_parts_timings);
57
59
 
@@ -60,7 +62,8 @@ void exposeWalkPatternGenerator()
60
62
  .def("replan", &WalkPatternGenerator::replan)
61
63
  .def("can_replan_supports", &WalkPatternGenerator::can_replan_supports)
62
64
  .def("replan_supports", &WalkPatternGenerator::replan_supports)
63
- .def("compute_next_support", &WalkPatternGenerator::compute_next_support);
65
+ .def("update_supports", &WalkPatternGenerator::update_supports)
66
+ .def("get_optimal_zmp", &WalkPatternGenerator::get_optimal_zmp);
64
67
 
65
68
  class__<SwingFoot>("SwingFoot", init<>())
66
69
  .def("make_trajectory", &SwingFoot::make_trajectory)
@@ -137,7 +140,8 @@ void exposeWalkPatternGenerator()
137
140
  .def("dzmp", &LIPM::Trajectory::dzmp)
138
141
  .def("dcm", &LIPM::Trajectory::dcm);
139
142
 
140
- class__<LIPM>("LIPM", init<problem::Problem&, double, int, double, Eigen::Vector2d, Eigen::Vector2d, Eigen::Vector2d>())
143
+ class__<LIPM>("LIPM",
144
+ init<problem::Problem&, double, int, double, Eigen::Vector2d, Eigen::Vector2d, Eigen::Vector2d>())
141
145
  .def("compute_omega", &LIPM::compute_omega)
142
146
  .def("get_trajectory", &LIPM::get_trajectory)
143
147
  .def("pos", &LIPM::pos)
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ export PYTHONPATH="."
4
+ export PATH=$(getconf PATH)
5
+ export PKG_CONFIG_PATH=$(getconf PKG_CONFIG_PATH)
6
+ export LD_LIBRARY_PATH=$(getconf LD_LIBRARY_PATH)
7
+ export PYTHONPATH=$(getconf PYTHONPATH)
8
+ export CMAKE_PREFIX_PATH=$(getconf CMAKE_PREFIX_PATH)
9
+
10
+ make
11
+
@@ -3,9 +3,8 @@ build-backend = "cmeel"
3
3
  requires = [
4
4
  "cmeel[build]",
5
5
  "eiquadprog >= 1.2.6, < 2",
6
- "pin[build] >= 2.6.18, < 3",
7
- "rhoban-cmeel-jsoncpp",
8
- "cmeel-urdfdom[build]",
6
+ "pin[build] >= 3",
7
+ "rhoban-cmeel-jsoncpp"
9
8
  ]
10
9
 
11
10
  [project]
@@ -13,17 +12,16 @@ authors = [{ email = "team@rhoban.com", name = "Rhoban team" }]
13
12
  classifiers = []
14
13
  dependencies = [
15
14
  "eiquadprog >= 1.2.6, < 2",
16
- "pin >= 2.6.18, < 3",
15
+ "pin >= 3",
17
16
  "rhoban-cmeel-jsoncpp",
18
17
  "meshcat",
19
- "numpy<2",
20
18
  "ischedule"
21
19
  ]
22
20
  description = "PlaCo: Rhoban Planning and Control"
23
21
  license = "MIT"
24
22
  name = "placo"
25
- requires-python = ">= 3.8"
26
- version = "0.6.5"
23
+ requires-python = ">= 3.9"
24
+ version = "0.7.0"
27
25
 
28
26
  [project.urls]
29
27
  changelog = "https://github.com/rhoban/placo/blob/main/CHANGELOG.md"
@@ -34,7 +32,7 @@ repository = "https://github.com/rhoban/placo.git"
34
32
  profile = "black"
35
33
 
36
34
  [tool.ruff]
37
- target-version = "py38"
35
+ target-version = "py39"
38
36
 
39
37
  [tool.tomlsort]
40
38
  all = true
@@ -1,5 +1,6 @@
1
1
  import meshcat
2
2
  import pinocchio as pin
3
+ import pinocchio.visualize as pin_viz
3
4
  import numpy as np
4
5
  import meshcat.geometry as g
5
6
  import meshcat.transformations as tf
@@ -26,7 +27,7 @@ def get_viewer() -> meshcat.Visualizer:
26
27
 
27
28
  def robot_viz(
28
29
  robot: placo.RobotWrapper, name: str = "robot"
29
- ) -> pin.visualize.MeshcatVisualizer:
30
+ ) -> pin_viz.MeshcatVisualizer:
30
31
  """
31
32
  Builds an instance of pinocchio MeshcatVisualizer, which allows to push the model to the meshcat
32
33
  visualizer passed as parameter
@@ -38,7 +39,7 @@ def robot_viz(
38
39
  global robot_names
39
40
 
40
41
  robot_names[robot] = name
41
- viz = pin.visualize.MeshcatVisualizer(
42
+ viz = pin_viz.MeshcatVisualizer(
42
43
  robot.model, robot.collision_model, robot.visual_model
43
44
  )
44
45
  viz.initViewer(viewer=get_viewer())
@@ -155,7 +155,6 @@ public:
155
155
  double zmp_reference_weight = 1e-1;
156
156
 
157
157
  // TODO: use this operational space with the FootstepsPlanners
158
-
159
158
  // Operational space of the flying foot (half-ellipse)
160
159
  double op_space_y_offset = 0.1;
161
160
  double op_space_x_radius = 0.35;
@@ -164,6 +163,9 @@ public:
164
163
  // Operational space of the flying foot (polygon)
165
164
  std::vector<Eigen::Vector2d> op_space_polygon;
166
165
 
166
+ // DCM offset bounds (polygon)
167
+ std::vector<Eigen::Vector2d> dcm_offset_polygon;
168
+
167
169
  /**
168
170
  * @brief Applies the ellipsoid clipping to a given step size (dx, dy, dtheta)
169
171
  */
@@ -279,6 +279,12 @@ double WalkPatternGenerator::Trajectory::get_part_t_end(double t)
279
279
  return part.t_end;
280
280
  }
281
281
 
282
+ Eigen::Vector2d WalkPatternGenerator::Trajectory::get_part_end_dcm(double t, double omega)
283
+ {
284
+ TrajectoryPart& part = _findPart(parts, t);
285
+ return get_p_world_DCM(part.t_end, omega);
286
+ }
287
+
282
288
  void WalkPatternGenerator::Trajectory::add_supports(double t, FootstepsPlanner::Support& support)
283
289
  {
284
290
  for (auto footstep : support.footsteps)
@@ -311,6 +317,9 @@ void WalkPatternGenerator::plan_sgl_support(Trajectory& trajectory, int part_ind
311
317
  Eigen::Vector3d start_vel = old_trajectory->get_v_world_foot(flying_side, t_replan);
312
318
  part.swing_trajectory = SwingFootCubic::make_trajectory(part.t_start, virt_duration, parameters.walk_foot_height,
313
319
  parameters.walk_foot_rise_ratio, start, T_world_end.translation(), part.support.elapsed_ratio, start_vel);
320
+
321
+ double replan_yaw = old_trajectory->foot_yaw(flying_side).pos(t_replan);
322
+ trajectory.foot_yaw(flying_side).add_point(t_replan, replan_yaw, 0);
314
323
  }
315
324
  else
316
325
  {
@@ -569,74 +578,118 @@ void WalkPatternGenerator::Trajectory::print_parts_timings()
569
578
  }
570
579
  }
571
580
 
572
- std::pair<Eigen::Vector2d, double> WalkPatternGenerator::compute_next_support(double t, FootstepsPlanner::Support& current_support,
573
- FootstepsPlanner::Support& next_support, Eigen::Vector2d world_measured_dcm, Eigen::Vector2d world_initial_dcm)
581
+ std::vector<FootstepsPlanner::Support> WalkPatternGenerator::update_supports(double t, std::vector<FootstepsPlanner::Support> supports,
582
+ Eigen::Vector2d world_measured_dcm, Eigen::Vector2d world_end_dcm)
574
583
  {
584
+ FootstepsPlanner::Support current_support = supports[0];
585
+ FootstepsPlanner::Support next_support = supports[1];
586
+
575
587
  if (current_support.is_both())
576
588
  {
577
589
  throw std::runtime_error("Can't modify flying target and step duration if the current support is both");
578
590
  }
591
+ if (next_support.is_both())
592
+ {
593
+ throw std::runtime_error("Next support is both, not supported for now");
594
+ }
579
595
 
580
596
  placo::problem::Problem problem;
581
- double w1 = 1;
582
- double w2 = 5;
597
+ double w1 = 5;
598
+ double w2 = 100;
583
599
  double w3 = 1000;
584
600
  double w_viability = 1e6;
585
601
 
586
- // Decision variables
587
- placo::problem::Variable support_next_zmp = problem.add_variable(2); // ZMP of the next support expressed in the current support frame
588
- placo::problem::Variable tau = problem.add_variable(1); // exp(omega * T) where T is the end of the current support
589
- placo::problem::Variable support_dcm_offset = problem.add_variable(2); // Offset of the DCM from the ZMP in the current support frame
590
-
591
- // LIPM Dynamics (expressed in the current support frame)
592
- Eigen::Matrix3d R_world_support = current_support.frame().rotation();
602
+ double elapsed_time = t - current_support.t_start;
603
+ Eigen::Matrix2d R_world_support = current_support.frame().rotation().topLeftCorner(2, 2);
593
604
  Eigen::Vector2d p_world_support = current_support.frame().translation().head(2);
594
- Eigen::Vector2d support_measured_dcm = p_world_support + R_world_support.topRightCorner(2, 2) * world_measured_dcm;
595
- problem.add_constraint(support_next_zmp.expr() + support_dcm_offset.expr() == support_measured_dcm * exp(-omega * t) * tau.expr()).configure(ProblemConstraint::Hard);
596
605
 
597
- // ----------------- Objective functions: -----------------
598
- // ZMP Reference (expressed in the world frame)
599
- Expression world_next_zmp_expr = p_world_support + R_world_support.topRightCorner(2, 2) * support_next_zmp.expr();
600
- problem.add_constraint(world_next_zmp_expr == next_support.frame().translation().head(2)).configure(ProblemConstraint::Soft, w1);
606
+ // Decision variables
607
+ placo::problem::Variable* support_next_zmp = &problem.add_variable(2); // ZMP of the next support expressed in the current support frame
608
+ placo::problem::Variable* tau = &problem.add_variable(1); // exp(omega * T) where T is the end of the current support
609
+ placo::problem::Variable* support_dcm_offset = &problem.add_variable(2); // Offset of the DCM from the ZMP in the current support frame
601
610
 
611
+ // ----------------- Objective functions: -----------------
602
612
  // Time reference
603
613
  double T = support_default_duration(current_support);
604
- problem.add_constraint(tau.expr() == exp(omega * T)).configure(ProblemConstraint::Soft, w2);
614
+ problem.add_constraint(tau->expr() == exp(omega * T)).configure(ProblemConstraint::Soft, w1);
615
+
616
+ // ZMP Reference (expressed in the world frame)
617
+ Expression world_next_zmp_expr = p_world_support + R_world_support * support_next_zmp->expr();
618
+ problem.add_constraint(world_next_zmp_expr == next_support.frame().translation().head(2)).configure(ProblemConstraint::Soft, w2);
605
619
 
606
620
  // DCM offset reference (expressed in the world frame)
607
- Eigen::Vector2d world_target_dcm_offset = (world_initial_dcm - p_world_support) * exp(omega * T) + p_world_support - next_support.frame().translation().head(2);
608
- Expression world_dcm_offset_expr = R_world_support.topRightCorner(2, 2) * support_dcm_offset.expr();
621
+ Eigen::Vector2d world_target_dcm_offset = world_end_dcm - next_support.frame().translation().head(2);
622
+ Expression world_dcm_offset_expr = R_world_support * support_dcm_offset->expr();
609
623
  problem.add_constraint(world_dcm_offset_expr == world_target_dcm_offset).configure(ProblemConstraint::Soft, w3);
610
624
 
611
625
  // --------------------- Constraints: ---------------------
612
- // ZMP constraints - operationnal space of the flying foot (expressed in the current support frame)
626
+ // Time constraints
627
+ double T_min = std::max(0.15, elapsed_time); // Should probably add an offset to elapsed_time
628
+ double T_max = std::max(3., elapsed_time); // Arbitrary value of 3s
629
+ problem.add_constraint(tau->expr() >= exp(omega * (T_min))).configure(ProblemConstraint::Hard);
630
+ problem.add_constraint(tau->expr() <= exp(omega * (T_max))).configure(ProblemConstraint::Hard);
631
+
632
+ // ZMP and DCM offset constraints (expressed in the current support frame)
613
633
  if (current_support.side() == HumanoidRobot::Side::Right)
614
634
  {
615
- problem.add_constraint(PolygonConstraint::in_polygon_xy(support_next_zmp.expr(), parameters.op_space_polygon)).configure(ProblemConstraint::Hard);
635
+ problem.add_constraint(PolygonConstraint::in_polygon_xy(support_next_zmp->expr(), parameters.op_space_polygon)).configure(ProblemConstraint::Hard);
636
+
637
+ std::vector<Eigen::Vector2d> dcm_offset_polygon = parameters.dcm_offset_polygon;
638
+ for (auto& point : dcm_offset_polygon)
639
+ {
640
+ point(0) = -point(0);
641
+ point(1) = -point(1);
642
+ }
643
+ problem.add_constraint(PolygonConstraint::in_polygon_xy(support_dcm_offset->expr(), parameters.dcm_offset_polygon)).configure(ProblemConstraint::Soft, w_viability);
616
644
  }
617
645
  else
618
646
  {
619
647
  std::vector<Eigen::Vector2d> op_space_polygon = parameters.op_space_polygon;
620
648
  for (auto& point : op_space_polygon)
621
649
  {
650
+ point(0) = -point(0);
622
651
  point(1) = -point(1);
623
652
  }
624
- problem.add_constraint(PolygonConstraint::in_polygon_xy(support_next_zmp.expr(), op_space_polygon)).configure(ProblemConstraint::Hard);
653
+ problem.add_constraint(PolygonConstraint::in_polygon_xy(support_next_zmp->expr(), op_space_polygon)).configure(ProblemConstraint::Hard);
654
+
655
+ problem.add_constraint(PolygonConstraint::in_polygon_xy(support_dcm_offset->expr(), parameters.dcm_offset_polygon)).configure(ProblemConstraint::Soft, w_viability);
625
656
  }
626
657
 
627
- // Time constraints
628
- double T_min = std::max(0.15, t); // Should probably add an offset to t
629
- double T_max = 3; // Arbitrary value of 3s
630
- problem.add_constraint(tau.expr() >= exp(omega * (T_min))).configure(ProblemConstraint::Hard);
631
- problem.add_constraint(tau.expr() <= exp(omega * (T_max))).configure(ProblemConstraint::Hard);
632
-
633
- // DCM offset constraints - viability constraint (expressed in the current support frame)
634
- // TODO
658
+ // LIPM Dynamics (expressed in the world frame)
659
+ double duration = std::max(0., T - elapsed_time);
660
+ Eigen::Vector2d world_virtual_zmp = get_optimal_zmp(world_measured_dcm, world_end_dcm, duration, current_support);
661
+ problem.add_constraint(world_next_zmp_expr + world_dcm_offset_expr == (world_measured_dcm - world_virtual_zmp) * exp(-omega * elapsed_time) * tau->expr() + world_virtual_zmp).configure(ProblemConstraint::Hard);
635
662
 
636
663
  problem.solve();
637
- Eigen::Vector2d world_next_zmp_val = p_world_support + R_world_support.topRightCorner(2, 2) * support_next_zmp.value;
638
- double support_t_end = current_support.t_start + log(tau.value(0)) / omega;
639
664
 
640
- return std::make_pair(world_next_zmp_val, support_t_end);
665
+ // Updating next support position
666
+ Eigen::Vector2d world_next_zmp_val = p_world_support + R_world_support * support_next_zmp->value;
667
+ supports[1].footsteps[0].frame.translation().x() = world_next_zmp_val(0);
668
+ supports[1].footsteps[0].frame.translation().y() = world_next_zmp_val(1);
669
+
670
+ // Updating current support remaining duration
671
+ double support_remaining_time = log(tau->value(0)) / omega - elapsed_time;
672
+ supports[0].time_ratio = support_remaining_time / (support_default_duration(current_support) * (1 - current_support.elapsed_ratio));
673
+
674
+ return supports;
675
+ }
676
+
677
+ Eigen::Vector2d WalkPatternGenerator::get_optimal_zmp(Eigen::Vector2d world_dcm_start,
678
+ Eigen::Vector2d world_dcm_end, double duration, FootstepsPlanner::Support& support)
679
+ {
680
+ placo::problem::Problem problem;
681
+
682
+ // Decision variables
683
+ placo::problem::Variable* world_zmp = &problem.add_variable(2);
684
+
685
+ // LIPM Dynamics
686
+ // problem.add_constraint(world_dcm_end == (world_dcm_start - world_zmp->expr()) * exp(omega * duration) + world_zmp->expr()).configure(ProblemConstraint::Soft, 1);
687
+ problem.add_constraint(world_zmp->expr() == (world_dcm_end - world_dcm_start * exp(omega * duration)) / (1 - exp(omega * duration))).configure(ProblemConstraint::Soft, 1);
688
+
689
+ // ZMP constrained to stay in the support polygon
690
+ problem.add_constraint(PolygonConstraint::in_polygon_xy(world_zmp->expr(), support.support_polygon(), parameters.zmp_margin)).configure(ProblemConstraint::Hard);
691
+
692
+ problem.solve();
693
+ return world_zmp->value;
641
694
  }
642
695
  } // namespace placo::humanoid