placo 0.6.1__tar.gz → 0.6.3__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.6.1 → placo-0.6.3}/CMakeLists.txt +1 -0
- {placo-0.6.1 → placo-0.6.3}/PKG-INFO +1 -1
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-dynamics.cpp +24 -51
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-footsteps.cpp +2 -3
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-kinematics.cpp +8 -16
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-parameters.cpp +1 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-problem.cpp +7 -12
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-robot-wrapper.cpp +7 -17
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-tools.cpp +7 -6
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-walk-pattern-generator.cpp +1 -0
- {placo-0.6.1 → placo-0.6.3}/doxygen_parse.py +2 -1
- {placo-0.6.1 → placo-0.6.3}/placo.pyi +29 -0
- {placo-0.6.1 → placo-0.6.3}/pyproject.toml +1 -1
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/walk_pattern_generator.cpp +18 -9
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/walk_pattern_generator.h +3 -3
- placo-0.6.3/src/placo/tools/directions.cpp +42 -0
- placo-0.6.3/src/placo/tools/directions.h +22 -0
- {placo-0.6.1 → placo-0.6.3}/.clang-format +0 -0
- {placo-0.6.1 → placo-0.6.3}/.gitattributes +0 -0
- {placo-0.6.1 → placo-0.6.3}/.gitignore +0 -0
- {placo-0.6.1 → placo-0.6.3}/.readthedocs.yaml +0 -0
- {placo-0.6.1 → placo-0.6.3}/Doxyfile +0 -0
- {placo-0.6.1 → placo-0.6.3}/LICENSE +0 -0
- {placo-0.6.1 → placo-0.6.3}/Makefile +0 -0
- {placo-0.6.1 → placo-0.6.3}/README.md +0 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-eigen.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/expose-utils.hpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/module.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/module.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/registry.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/bindings/registry.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/.vscode/settings.json +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/Makefile +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/placo_utils/__init__.py +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/placo_utils/tf.py +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/placo_utils/view.py +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/placo_utils/visualization.py +0 -0
- {placo-0.6.1 → placo-0.6.3}/python/run_tests.sh +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/com_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/com_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/contacts.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/contacts.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/dynamics_solver.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/dynamics_solver.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/frame_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/frame_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/gear_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/gear_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/joints_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/joints_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/orientation_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/orientation_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/position_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/position_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/relative_frame_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/relative_frame_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/relative_orientation_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/relative_position_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/relative_position_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/torque_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/dynamics/torque_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/foot_trajectory.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/foot_trajectory.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/footsteps_planner.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/footsteps_planner.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/humanoid_parameters.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/humanoid_robot.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/humanoid_robot.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/kick.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/kick.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/lipm.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/lipm.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/swing_foot.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/swing_foot.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/swing_foot_cubic.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/swing_foot_quintic.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/walk_tasks.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/humanoid/walk_tasks.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/axis_align_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/axis_align_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/centroidal_momentum_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/com_polygon_constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/com_polygon_constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/com_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/com_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/cone_constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/cone_constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/distance_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/distance_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/frame_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/frame_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/gear_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/gear_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/joints_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/joints_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/kinematics_solver.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/kinematics_solver.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/manipulability_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/manipulability_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/orientation_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/orientation_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/position_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/position_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/regularization_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/regularization_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/relative_frame_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/relative_frame_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/relative_orientation_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/relative_position_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/relative_position_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/wheel_task.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/kinematics/wheel_task.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/model/robot_wrapper.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/model/robot_wrapper.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/expression.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/expression.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/integrator.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/integrator.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/polygon_constraint.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/polygon_constraint.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/problem.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/problem.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/qp_error.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/qp_error.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/sparsity.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/sparsity.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/variable.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/problem/variable.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/axises_mask.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/axises_mask.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/cubic_spline.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/cubic_spline.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/cubic_spline_3d.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/cubic_spline_3d.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/prioritized.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/prioritized.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/utils.cpp +0 -0
- {placo-0.6.1 → placo-0.6.3}/src/placo/tools/utils.h +0 -0
- {placo-0.6.1 → placo-0.6.3}/stubs.py +0 -0
- {placo-0.6.1 → placo-0.6.3}/tweak_sdist.sh +0 -0
- {placo-0.6.1 → placo-0.6.3}/wks.yml +0 -0
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#include "placo/dynamics/dynamics_solver.h"
|
|
8
8
|
#include <Eigen/Dense>
|
|
9
9
|
#include <boost/python.hpp>
|
|
10
|
+
#include <eigenpy/eigen-to-python.hpp>
|
|
10
11
|
|
|
11
12
|
using namespace placo;
|
|
12
13
|
using namespace placo::dynamics;
|
|
@@ -22,12 +23,9 @@ void exposeDynamics()
|
|
|
22
23
|
{
|
|
23
24
|
class__<DynamicsSolver::Result>("DynamicsSolverResult")
|
|
24
25
|
.add_property("success", &DynamicsSolver::Result::success)
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
.
|
|
28
|
-
"qdd", +[](const DynamicsSolver::Result& result) { return result.qdd; })
|
|
29
|
-
.add_property(
|
|
30
|
-
"tau_contacts", +[](const DynamicsSolver::Result& result) { return result.tau_contacts; })
|
|
26
|
+
.def_readwrite("tau", &DynamicsSolver::Result::tau)
|
|
27
|
+
.def_readwrite("qdd", &DynamicsSolver::Result::qdd)
|
|
28
|
+
.def_readwrite("tau_contacts", &DynamicsSolver::Result::tau_contacts)
|
|
31
29
|
.def(
|
|
32
30
|
"tau_dict", +[](const DynamicsSolver::Result& result, RobotWrapper& robot) {
|
|
33
31
|
boost::python::dict dict;
|
|
@@ -46,17 +44,14 @@ void exposeDynamics()
|
|
|
46
44
|
.def_readwrite("weight_forces", &Contact::weight_forces)
|
|
47
45
|
.def_readwrite("weight_tangentials", &Contact::weight_tangentials)
|
|
48
46
|
.def_readwrite("weight_moments", &Contact::weight_moments)
|
|
49
|
-
.
|
|
50
|
-
"wrench", +[](Contact& contact) { return contact.wrench; });
|
|
47
|
+
.def_readonly("wrench", &Contact::wrench);
|
|
51
48
|
|
|
52
49
|
class__<PointContact, bases<Contact>>("PointContact", init<PositionTask&, bool>())
|
|
53
50
|
.def(
|
|
54
51
|
"position_task", +[](PointContact& contact) -> PositionTask& { return *contact.position_task; },
|
|
55
52
|
return_internal_reference<>())
|
|
56
53
|
.def_readwrite("unilateral", &PointContact::unilateral)
|
|
57
|
-
.
|
|
58
|
-
"R_world_surface", +[](PointContact& contact) { return contact.R_world_surface; },
|
|
59
|
-
+[](PointContact& contact, Eigen::Matrix3d R) { contact.R_world_surface = R; });
|
|
54
|
+
.def_readwrite("R_world_surface", &PointContact::R_world_surface);
|
|
60
55
|
|
|
61
56
|
class__<Contact6D, bases<Contact>>("Contact6D", init<FrameTask&, bool>())
|
|
62
57
|
.def(
|
|
@@ -86,8 +81,7 @@ void exposeDynamics()
|
|
|
86
81
|
|
|
87
82
|
class__<ExternalWrenchContact, bases<Contact>>("ExternalWrenchContact", init<RobotWrapper::FrameIndex>())
|
|
88
83
|
.add_property("frame_index", &ExternalWrenchContact::frame_index)
|
|
89
|
-
.
|
|
90
|
-
"w_ext", +[](ExternalWrenchContact& contact) { return contact.w_ext; }, &ExternalWrenchContact::w_ext);
|
|
84
|
+
.def_readwrite("w_ext", &ExternalWrenchContact::w_ext);
|
|
91
85
|
|
|
92
86
|
class__<PuppetContact, bases<Contact>>("PuppetContact", init<>());
|
|
93
87
|
|
|
@@ -164,10 +158,8 @@ void exposeDynamics()
|
|
|
164
158
|
&DynamicsSolver::add_frame_task);
|
|
165
159
|
|
|
166
160
|
class__<Task, bases<tools::Prioritized>, boost::noncopyable>("DynamicsTask", no_init)
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
.add_property(
|
|
170
|
-
"b", +[](const Task& task) { return task.b; })
|
|
161
|
+
.def_readwrite("A", &Task::A)
|
|
162
|
+
.def_readwrite("b", &Task::b)
|
|
171
163
|
.add_property("kp", &Task::kp, &Task::kp)
|
|
172
164
|
.add_property("kd", &Task::kd, &Task::kd)
|
|
173
165
|
.add_property("error", &Task::error)
|
|
@@ -175,54 +167,35 @@ void exposeDynamics()
|
|
|
175
167
|
|
|
176
168
|
class__<PositionTask, bases<Task>>("DynamicsPositionTask", init<RobotWrapper::FrameIndex, Eigen::Vector3d>())
|
|
177
169
|
.add_property("frame_index", &PositionTask::frame_index)
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
.
|
|
181
|
-
"dtarget_world", +[](const PositionTask& task) { return task.dtarget_world; }, &PositionTask::dtarget_world)
|
|
182
|
-
.add_property(
|
|
183
|
-
"ddtarget_world", +[](const PositionTask& task) { return task.dtarget_world; }, &PositionTask::ddtarget_world)
|
|
170
|
+
.def_readwrite("target_world", &PositionTask::target_world)
|
|
171
|
+
.def_readwrite("dtarget_world", &PositionTask::dtarget_world)
|
|
172
|
+
.def_readwrite("ddtarget_world", &PositionTask::ddtarget_world)
|
|
184
173
|
.add_property("mask", &PositionTask::mask, &PositionTask::mask);
|
|
185
174
|
|
|
186
175
|
class__<CoMTask, bases<Task>>("DynamicsCoMTask", init<Eigen::Vector3d>())
|
|
187
|
-
.
|
|
188
|
-
|
|
189
|
-
.
|
|
190
|
-
"dtarget_world", +[](const CoMTask& task) { return task.dtarget_world; }, &CoMTask::dtarget_world)
|
|
191
|
-
.add_property(
|
|
192
|
-
"ddtarget_world", +[](const CoMTask& task) { return task.dtarget_world; }, &CoMTask::ddtarget_world)
|
|
176
|
+
.def_readwrite("target_world", &CoMTask::target_world)
|
|
177
|
+
.def_readwrite("dtarget_world", &CoMTask::dtarget_world)
|
|
178
|
+
.def_readwrite("ddtarget_world", &CoMTask::ddtarget_world)
|
|
193
179
|
.add_property("mask", &CoMTask::mask, &CoMTask::mask);
|
|
194
180
|
|
|
195
181
|
class__<RelativePositionTask, bases<Task>>(
|
|
196
182
|
"DynamicsRelativePositionTask", init<RobotWrapper::FrameIndex, RobotWrapper::FrameIndex, Eigen::Vector3d>())
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
.
|
|
200
|
-
"dtarget", +[](const RelativePositionTask& task) { return task.dtarget; }, &RelativePositionTask::dtarget)
|
|
201
|
-
.add_property(
|
|
202
|
-
"ddtarget", +[](const RelativePositionTask& task) { return task.ddtarget; }, &RelativePositionTask::ddtarget)
|
|
183
|
+
.def_readwrite("target", &RelativePositionTask::target)
|
|
184
|
+
.def_readwrite("dtarget", &RelativePositionTask::dtarget)
|
|
185
|
+
.def_readwrite("ddtarget", &RelativePositionTask::ddtarget)
|
|
203
186
|
.add_property("mask", &RelativePositionTask::mask, &RelativePositionTask::mask);
|
|
204
187
|
|
|
205
188
|
class__<RelativeOrientationTask, bases<Task>>(
|
|
206
189
|
"DynamicsRelativeOrientationTask", init<RobotWrapper::FrameIndex, RobotWrapper::FrameIndex, Eigen::Matrix3d>())
|
|
207
|
-
.
|
|
208
|
-
|
|
209
|
-
.
|
|
210
|
-
"omega_a_b", +[](const RelativeOrientationTask& task) { return task.omega_a_b; },
|
|
211
|
-
&RelativeOrientationTask::omega_a_b)
|
|
212
|
-
.add_property(
|
|
213
|
-
"domega_a_b", +[](const RelativeOrientationTask& task) { return task.domega_a_b; },
|
|
214
|
-
&RelativeOrientationTask::domega_a_b)
|
|
190
|
+
.def_readwrite("R_a_b", &RelativeOrientationTask::R_a_b)
|
|
191
|
+
.def_readwrite("omega_a_b", &RelativeOrientationTask::omega_a_b)
|
|
192
|
+
.def_readwrite("domega_a_b", &RelativeOrientationTask::domega_a_b)
|
|
215
193
|
.add_property("mask", &RelativeOrientationTask::mask, &RelativeOrientationTask::mask);
|
|
216
194
|
|
|
217
195
|
class__<OrientationTask, bases<Task>>("DynamicsOrientationTask", init<RobotWrapper::FrameIndex, Eigen::Matrix3d>())
|
|
218
|
-
.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
.add_property(
|
|
222
|
-
"omega_world", +[](const OrientationTask& task) { return task.omega_world; }, &OrientationTask::omega_world)
|
|
223
|
-
.add_property(
|
|
224
|
-
"domega_world", +[](const OrientationTask& task) { return task.domega_world; },
|
|
225
|
-
&OrientationTask::domega_world)
|
|
196
|
+
.def_readwrite("R_world_frame", &OrientationTask::R_world_frame)
|
|
197
|
+
.def_readwrite("omega_world", &OrientationTask::omega_world)
|
|
198
|
+
.def_readwrite("domega_world", &OrientationTask::domega_world)
|
|
226
199
|
.add_property("mask", &OrientationTask::mask, &OrientationTask::mask);
|
|
227
200
|
|
|
228
201
|
class__<FrameTask>("DynamicsFrameTask", init<>())
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#include "placo/humanoid/footsteps_planner_repetitive.h"
|
|
9
9
|
#include <Eigen/Dense>
|
|
10
10
|
#include <boost/python.hpp>
|
|
11
|
+
#include <eigenpy/eigen-to-python.hpp>
|
|
11
12
|
|
|
12
13
|
using namespace boost::python;
|
|
13
14
|
using namespace placo::humanoid;
|
|
@@ -22,9 +23,7 @@ void exposeFootsteps()
|
|
|
22
23
|
class__<FootstepsPlanner::Footstep>("Footstep", init<double, double>())
|
|
23
24
|
.def("support_polygon", &FootstepsPlanner::Footstep::support_polygon)
|
|
24
25
|
.add_property("side", &FootstepsPlanner::Footstep::side, &FootstepsPlanner::Footstep::side)
|
|
25
|
-
.
|
|
26
|
-
"frame", +[](const FootstepsPlanner::Footstep& footstep) { return footstep.frame; },
|
|
27
|
-
&FootstepsPlanner::Footstep::frame)
|
|
26
|
+
.def_readwrite("frame", &FootstepsPlanner::Footstep::frame)
|
|
28
27
|
.add_property("foot_length", &FootstepsPlanner::Footstep::foot_length, &FootstepsPlanner::Footstep::foot_length)
|
|
29
28
|
.add_property("foot_width", &FootstepsPlanner::Footstep::foot_width, &FootstepsPlanner::Footstep::foot_width)
|
|
30
29
|
.def("support_polygon", &FootstepsPlanner::Footstep::support_polygon)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#include <boost/python/return_internal_reference.hpp>
|
|
8
8
|
#include <Eigen/Dense>
|
|
9
9
|
#include <boost/python.hpp>
|
|
10
|
+
#include <eigenpy/eigen-to-python.hpp>
|
|
10
11
|
|
|
11
12
|
using namespace boost::python;
|
|
12
13
|
using namespace placo;
|
|
@@ -117,10 +118,8 @@ void exposeKinematics()
|
|
|
117
118
|
.def("solve", &KinematicsSolver::solve);
|
|
118
119
|
|
|
119
120
|
class__<Task, bases<tools::Prioritized>, boost::noncopyable>("Task", no_init)
|
|
120
|
-
.
|
|
121
|
-
|
|
122
|
-
.add_property(
|
|
123
|
-
"b", +[](const Task& task) { return task.b; })
|
|
121
|
+
.def_readonly("A", &Task::A)
|
|
122
|
+
.def_readonly("b", &Task::b)
|
|
124
123
|
.def("error", &Task::error)
|
|
125
124
|
.def("error_norm", &Task::error_norm)
|
|
126
125
|
.def("update", &Task::update);
|
|
@@ -135,8 +134,7 @@ void exposeKinematics()
|
|
|
135
134
|
"RelativePositionTask", init<RobotWrapper::FrameIndex, RobotWrapper::FrameIndex, Eigen::Vector3d>())
|
|
136
135
|
.add_property("frame_a", &RelativePositionTask::frame_a)
|
|
137
136
|
.add_property("frame_b", &RelativePositionTask::frame_b)
|
|
138
|
-
.
|
|
139
|
-
"target", +[](const RelativePositionTask& task) { return task.target; }, &RelativePositionTask::target)
|
|
137
|
+
.def_readwrite("target", &RelativePositionTask::target)
|
|
140
138
|
.add_property("mask", &RelativePositionTask::mask, &RelativePositionTask::mask);
|
|
141
139
|
|
|
142
140
|
class__<CoMTask, bases<Task>>("CoMTask", init<Eigen::Vector3d>())
|
|
@@ -146,17 +144,14 @@ void exposeKinematics()
|
|
|
146
144
|
|
|
147
145
|
class__<OrientationTask, bases<Task>>("OrientationTask", init<RobotWrapper::FrameIndex, Eigen::Matrix3d>())
|
|
148
146
|
.add_property("frame_index", &OrientationTask::frame_index)
|
|
149
|
-
.
|
|
150
|
-
"R_world_frame", +[](const OrientationTask& task) { return task.R_world_frame; },
|
|
151
|
-
&OrientationTask::R_world_frame)
|
|
147
|
+
.def_readwrite("R_world_frame", &OrientationTask::R_world_frame)
|
|
152
148
|
.add_property("mask", &OrientationTask::mask, &OrientationTask::mask);
|
|
153
149
|
|
|
154
150
|
class__<RelativeOrientationTask, bases<Task>>(
|
|
155
151
|
"RelativeOrientationTask", init<RobotWrapper::FrameIndex, RobotWrapper::FrameIndex, Eigen::Matrix3d>())
|
|
156
152
|
.add_property("frame_a", &RelativeOrientationTask::frame_a)
|
|
157
153
|
.add_property("frame_b", &RelativeOrientationTask::frame_b)
|
|
158
|
-
.
|
|
159
|
-
"R_a_b", +[](const RelativeOrientationTask& task) { return task.R_a_b; }, &RelativeOrientationTask::R_a_b)
|
|
154
|
+
.def_readwrite("R_a_b", &RelativeOrientationTask::R_a_b)
|
|
160
155
|
.add_property("mask", &RelativeOrientationTask::mask, &RelativeOrientationTask::mask);
|
|
161
156
|
|
|
162
157
|
class__<FrameTask>("FrameTask", init<>())
|
|
@@ -186,9 +181,7 @@ void exposeKinematics()
|
|
|
186
181
|
.add_property("frame_index", &AxisAlignTask::frame_index)
|
|
187
182
|
.add_property(
|
|
188
183
|
"axis_frame", +[](const AxisAlignTask& task) { return task.axis_frame; }, &AxisAlignTask::axis_frame)
|
|
189
|
-
.
|
|
190
|
-
"targetAxis_world", +[](const AxisAlignTask& task) { return task.targetAxis_world; },
|
|
191
|
-
&AxisAlignTask::targetAxis_world);
|
|
184
|
+
.def_readwrite("targetAxis_world", &AxisAlignTask::targetAxis_world);
|
|
192
185
|
|
|
193
186
|
class__<JointsTask, bases<Task>>("JointsTask", init<>())
|
|
194
187
|
.def("set_joint", &JointsTask::set_joint)
|
|
@@ -206,8 +199,7 @@ void exposeKinematics()
|
|
|
206
199
|
.add_property("joint", &WheelTask::joint)
|
|
207
200
|
.add_property("radius", &WheelTask::radius)
|
|
208
201
|
.add_property("omniwheel", &WheelTask::omniwheel)
|
|
209
|
-
.
|
|
210
|
-
"T_world_surface", +[](const WheelTask& task) { return task.T_world_surface; }, &WheelTask::T_world_surface);
|
|
202
|
+
.def_readwrite("T_world_surface", &WheelTask::T_world_surface);
|
|
211
203
|
|
|
212
204
|
class__<DistanceTask, bases<Task>>("DistanceTask", init<RobotWrapper::FrameIndex, RobotWrapper::FrameIndex, double>())
|
|
213
205
|
.add_property("frame_a", &DistanceTask::frame_a)
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
#include "placo/problem/qp_error.h"
|
|
17
17
|
#include <Eigen/Dense>
|
|
18
18
|
#include <boost/python.hpp>
|
|
19
|
+
#include <eigenpy/eigen-to-python.hpp>
|
|
19
20
|
|
|
20
21
|
using namespace boost::python;
|
|
21
22
|
using namespace placo;
|
|
@@ -84,14 +85,10 @@ void exposeProblem()
|
|
|
84
85
|
.def("upper_shift_matrix", &Integrator::upper_shift_matrix)
|
|
85
86
|
.staticmethod("upper_shift_matrix")
|
|
86
87
|
.add_property("t_start", &Integrator::t_start, &Integrator::t_start)
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
.add_property(
|
|
92
|
-
"B", +[](const Integrator& i) { return i.B; })
|
|
93
|
-
.add_property(
|
|
94
|
-
"final_transition_matrix", +[](const Integrator& i) { return i.final_transition_matrix; })
|
|
88
|
+
.def_readonly("M", &Integrator::M)
|
|
89
|
+
.def_readonly("A", &Integrator::A)
|
|
90
|
+
.def_readonly("B", &Integrator::B)
|
|
91
|
+
.def_readonly("final_transition_matrix", &Integrator::final_transition_matrix)
|
|
95
92
|
.def("expr", &Integrator::expr, integrator_expr_overloads())
|
|
96
93
|
.def("expr_t", &Integrator::expr_t)
|
|
97
94
|
.def("value", &Integrator::value)
|
|
@@ -129,10 +126,8 @@ void exposeProblem()
|
|
|
129
126
|
.def("expr", &Variable::expr, expr_overloads());
|
|
130
127
|
|
|
131
128
|
class__<Expression>("Expression")
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
.add_property(
|
|
135
|
-
"b", +[](Expression& e) { return e.b; })
|
|
129
|
+
.def_readwrite("A", &Expression::A)
|
|
130
|
+
.def_readwrite("b", &Expression::b)
|
|
136
131
|
.def("__len__", &Expression::rows)
|
|
137
132
|
.def("is_scalar", &Expression::is_scalar)
|
|
138
133
|
.def("is_constant", &Expression::is_constant)
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#include "placo/kinematics/kinematics_solver.h"
|
|
9
9
|
#include <Eigen/Dense>
|
|
10
10
|
#include <boost/python.hpp>
|
|
11
|
+
#include <eigenpy/eigen-to-python.hpp>
|
|
11
12
|
|
|
12
13
|
using namespace boost::python;
|
|
13
14
|
using namespace placo;
|
|
@@ -138,16 +139,9 @@ void exposeRobotWrapper()
|
|
|
138
139
|
.value("ignore_collisions", RobotWrapper::Flags::IGNORE_COLLISIONS);
|
|
139
140
|
|
|
140
141
|
class__<RobotWrapper::State>("RobotWrapper_State")
|
|
141
|
-
.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
.add_property(
|
|
145
|
-
"qd", +[](const RobotWrapper::State& state) { return state.qd; },
|
|
146
|
-
+[](RobotWrapper::State& state, const Eigen::VectorXd& qd) { state.qd = qd; })
|
|
147
|
-
.add_property(
|
|
148
|
-
"qdd", +[](const RobotWrapper::State& state) { return state.qdd; },
|
|
149
|
-
+[](RobotWrapper::State& state, const Eigen::VectorXd& qdd) { state.qdd = qdd; });
|
|
150
|
-
;
|
|
142
|
+
.def_readwrite("q", &RobotWrapper::State::q)
|
|
143
|
+
.def_readwrite("qd", &RobotWrapper::State::qd)
|
|
144
|
+
.def_readwrite("qdd", &RobotWrapper::State::qdd);
|
|
151
145
|
|
|
152
146
|
class__<RobotWrapper::Collision>("Collision")
|
|
153
147
|
.add_property("objA", &RobotWrapper::Collision::objA)
|
|
@@ -164,10 +158,8 @@ void exposeRobotWrapper()
|
|
|
164
158
|
.add_property("objB", &RobotWrapper::Distance::objB)
|
|
165
159
|
.add_property("parentA", &RobotWrapper::Distance::parentA)
|
|
166
160
|
.add_property("parentB", &RobotWrapper::Distance::parentB)
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
.add_property(
|
|
170
|
-
"pointB", +[](RobotWrapper::Distance& distance) { return distance.pointB; })
|
|
161
|
+
.def_readwrite("pointA", &RobotWrapper::Distance::pointA)
|
|
162
|
+
.def_readwrite("pointB", &RobotWrapper::Distance::pointB)
|
|
171
163
|
.add_property("min_distance", &RobotWrapper::Distance::min_distance);
|
|
172
164
|
|
|
173
165
|
class_<RobotWrapper> robotWrapper =
|
|
@@ -210,9 +202,7 @@ void exposeRobotWrapper()
|
|
|
210
202
|
.def(
|
|
211
203
|
"get_support_side", +[](const HumanoidRobot& robot) { return robot.support_side; })
|
|
212
204
|
.add_property("support_is_both", &HumanoidRobot::support_is_both, &HumanoidRobot::support_is_both)
|
|
213
|
-
.
|
|
214
|
-
"T_world_support", +[](HumanoidRobot& robot) { return robot.T_world_support; },
|
|
215
|
-
+[](HumanoidRobot& robot, Eigen::Affine3d T_world_support_) { robot.T_world_support = T_world_support_; });
|
|
205
|
+
.def_readwrite("T_world_support", &HumanoidRobot::T_world_support);
|
|
216
206
|
|
|
217
207
|
exposeStdVector<RobotWrapper::Collision>("vector_Collision");
|
|
218
208
|
exposeStdVector<RobotWrapper::Distance>("vector_Distance");
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
#include "placo/tools/cubic_spline_3d.h"
|
|
10
10
|
#include "placo/tools/axises_mask.h"
|
|
11
11
|
#include "placo/tools/prioritized.h"
|
|
12
|
+
#include "placo/tools/directions.h"
|
|
12
13
|
#include "expose-utils.hpp"
|
|
13
14
|
#ifdef HAVE_RHOBAN_UTILS
|
|
14
15
|
#include "rhoban_utils/history/history.h"
|
|
15
16
|
#endif
|
|
17
|
+
#include <eigenpy/eigen-to-python.hpp>
|
|
16
18
|
|
|
17
19
|
using namespace boost::python;
|
|
18
20
|
using namespace placo::tools;
|
|
@@ -23,6 +25,7 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(loadReplays_overloads, loadReplays, 1, 2)
|
|
|
23
25
|
|
|
24
26
|
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(set_axises_overloads, set_axises, 1, 2);
|
|
25
27
|
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(configure_overloads, configure, 2, 3);
|
|
28
|
+
BOOST_PYTHON_FUNCTION_OVERLOADS(directions_3d_overloads, directions_3d, 1, 2);
|
|
26
29
|
|
|
27
30
|
void exposeTools()
|
|
28
31
|
{
|
|
@@ -32,6 +35,8 @@ void exposeTools()
|
|
|
32
35
|
def("frame_yaw", &frame_yaw);
|
|
33
36
|
def("flatten_on_floor", &flatten_on_floor);
|
|
34
37
|
def("optimal_transformation", &optimal_transformation);
|
|
38
|
+
def("directions_2d", &directions_2d);
|
|
39
|
+
def("directions_3d", &directions_3d, directions_3d_overloads());
|
|
35
40
|
|
|
36
41
|
exposeStdVector<int>("vector_int");
|
|
37
42
|
exposeStdVector<double>("vector_double");
|
|
@@ -45,12 +50,8 @@ void exposeTools()
|
|
|
45
50
|
class__<AxisesMask>("AxisesMask", init<>())
|
|
46
51
|
.def<void (AxisesMask::*)(std::string, std::string)>("set_axises", &AxisesMask::set_axises,
|
|
47
52
|
set_axises_overloads())
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
+[](AxisesMask& mask, Eigen::Matrix3d R) { mask.R_local_world = R; })
|
|
51
|
-
.add_property(
|
|
52
|
-
"R_custom_world", +[](AxisesMask& mask) { return mask.R_custom_world; },
|
|
53
|
-
+[](AxisesMask& mask, Eigen::Matrix3d R) { mask.R_custom_world = R; })
|
|
53
|
+
.def_readwrite("R_local_world", &AxisesMask::R_local_world)
|
|
54
|
+
.def_readwrite("R_custom_world", &AxisesMask::R_custom_world)
|
|
54
55
|
.def("apply", &AxisesMask::apply);
|
|
55
56
|
|
|
56
57
|
class__<Prioritized, boost::noncopyable>("Prioritized", no_init)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import glob
|
|
2
2
|
import re
|
|
3
|
+
from typing import Union
|
|
3
4
|
import xml.etree.ElementTree as ET
|
|
4
5
|
|
|
5
6
|
# Mapping member definitions (id) to all informations
|
|
@@ -148,7 +149,7 @@ def parse_xml(xml_file: str):
|
|
|
148
149
|
parse_compound(compounddef_node)
|
|
149
150
|
|
|
150
151
|
|
|
151
|
-
def resolve_doxygen_id(id: list
|
|
152
|
+
def resolve_doxygen_id(id: Union[list,str]):
|
|
152
153
|
if type(id) == list:
|
|
153
154
|
tpl = resolve_doxygen_id(id[0])
|
|
154
155
|
typ = resolve_doxygen_id(id[1])
|
|
@@ -7236,6 +7236,35 @@ class WheelTask:
|
|
|
7236
7236
|
...
|
|
7237
7237
|
|
|
7238
7238
|
|
|
7239
|
+
def directions_2d(
|
|
7240
|
+
n: int, # int
|
|
7241
|
+
|
|
7242
|
+
) -> numpy.ndarray:
|
|
7243
|
+
"""Generates a set of directions in 2D.
|
|
7244
|
+
|
|
7245
|
+
|
|
7246
|
+
:param n: the number of directions
|
|
7247
|
+
|
|
7248
|
+
:return: matrix of size n x 2"""
|
|
7249
|
+
...
|
|
7250
|
+
|
|
7251
|
+
|
|
7252
|
+
def directions_3d(
|
|
7253
|
+
n: int, # int
|
|
7254
|
+
epsilon: float = 0.5, # double
|
|
7255
|
+
|
|
7256
|
+
) -> numpy.ndarray:
|
|
7257
|
+
"""Generates a set of directions in 3D, using Fibonacci lattice.
|
|
7258
|
+
|
|
7259
|
+
|
|
7260
|
+
:param n: the number of directions
|
|
7261
|
+
|
|
7262
|
+
:param epsilon: the epsilon parameter for the Fibonacci lattice
|
|
7263
|
+
|
|
7264
|
+
:return: matrix of size n x 3"""
|
|
7265
|
+
...
|
|
7266
|
+
|
|
7267
|
+
|
|
7239
7268
|
def flatten_on_floor(
|
|
7240
7269
|
transformation: numpy.ndarray, # const Eigen::Affine3d &
|
|
7241
7270
|
|
|
@@ -342,8 +342,7 @@ void WalkPatternGenerator::planCoM(Trajectory& trajectory, Eigen::Vector2d initi
|
|
|
342
342
|
for (int timestep = 1; timestep < kept_timesteps; timestep++)
|
|
343
343
|
{
|
|
344
344
|
Eigen::Vector2d jerk = old_trajectory->get_j_world_CoM(trajectory.t_start + timestep * parameters.dt()).head(2);
|
|
345
|
-
problem.add_constraint(lipm.jerk(timestep) == jerk)
|
|
346
|
-
.configure(ProblemConstraint::Soft, 1e-4);
|
|
345
|
+
problem.add_constraint(lipm.jerk(timestep) == jerk).configure(ProblemConstraint::Soft, 1e-4);
|
|
347
346
|
}
|
|
348
347
|
}
|
|
349
348
|
|
|
@@ -355,7 +354,8 @@ void WalkPatternGenerator::planCoM(Trajectory& trajectory, Eigen::Vector2d initi
|
|
|
355
354
|
current_support = trajectory.supports[i];
|
|
356
355
|
int step_timesteps = support_timesteps(current_support);
|
|
357
356
|
|
|
358
|
-
for (int timestep = constrained_timesteps; timestep < fmin(timesteps, constrained_timesteps + step_timesteps);
|
|
357
|
+
for (int timestep = constrained_timesteps; timestep < fmin(timesteps, constrained_timesteps + step_timesteps);
|
|
358
|
+
timestep++)
|
|
359
359
|
{
|
|
360
360
|
// Ensuring ZMP remains in the support polygon
|
|
361
361
|
if (timestep > kept_timesteps)
|
|
@@ -363,7 +363,7 @@ void WalkPatternGenerator::planCoM(Trajectory& trajectory, Eigen::Vector2d initi
|
|
|
363
363
|
problem.add_constraint(PolygonConstraint::in_polygon_xy(
|
|
364
364
|
lipm.zmp(timestep, omega_2), current_support.support_polygon(), parameters.zmp_margin));
|
|
365
365
|
}
|
|
366
|
-
|
|
366
|
+
|
|
367
367
|
// ZMP reference trajectory : aiming for the center of single supports
|
|
368
368
|
if (!current_support.is_both() || current_support.start || current_support.end)
|
|
369
369
|
{
|
|
@@ -509,7 +509,10 @@ void WalkPatternGenerator::planSingleSupportTrajectory(TrajectoryPart& part, Tra
|
|
|
509
509
|
trajectory.yaw(flying_side).add_point(t, frame_yaw(T_world_flyingTarget.rotation()), 0);
|
|
510
510
|
|
|
511
511
|
// The trunk orientation follow the steps orientation
|
|
512
|
-
|
|
512
|
+
if (!parameters.has_double_support())
|
|
513
|
+
{
|
|
514
|
+
trajectory.trunk_yaw.add_point(t, frame_yaw(T_world_flyingTarget.rotation()), 0);
|
|
515
|
+
}
|
|
513
516
|
|
|
514
517
|
// Support foot remaining steady
|
|
515
518
|
trajectory.add_supports(t, part.support);
|
|
@@ -522,7 +525,14 @@ void WalkPatternGenerator::planFeetTrajectories(Trajectory& trajectory, Trajecto
|
|
|
522
525
|
// Add the initial position to the trajectory
|
|
523
526
|
trajectory.add_supports(t, trajectory.supports[0]);
|
|
524
527
|
|
|
525
|
-
|
|
528
|
+
if (old_trajectory == nullptr)
|
|
529
|
+
{
|
|
530
|
+
trajectory.trunk_yaw.add_point(t, frame_yaw(trajectory.supports[0].frame().rotation()), 0);
|
|
531
|
+
}
|
|
532
|
+
else
|
|
533
|
+
{
|
|
534
|
+
trajectory.trunk_yaw.add_point(t, old_trajectory->trunk_yaw.pos(t), old_trajectory->trunk_yaw.vel(t));
|
|
535
|
+
}
|
|
526
536
|
|
|
527
537
|
if (!trajectory.supports[0].is_both())
|
|
528
538
|
{
|
|
@@ -556,7 +566,6 @@ void WalkPatternGenerator::planFeetTrajectories(Trajectory& trajectory, Trajecto
|
|
|
556
566
|
planSingleSupportTrajectory(part, trajectory, step, t, old_trajectory, t_replan);
|
|
557
567
|
}
|
|
558
568
|
}
|
|
559
|
-
|
|
560
569
|
// Double support
|
|
561
570
|
else
|
|
562
571
|
{
|
|
@@ -625,7 +634,7 @@ WalkPatternGenerator::Trajectory WalkPatternGenerator::replan(std::vector<Footst
|
|
|
625
634
|
bool WalkPatternGenerator::can_replan_supports(Trajectory& trajectory, double t_replan)
|
|
626
635
|
{
|
|
627
636
|
// We can't replan from an "end", a "start" or a "kick"
|
|
628
|
-
if (trajectory.get_support(t_replan).end || trajectory.get_support(t_replan).start ||
|
|
637
|
+
if (trajectory.get_support(t_replan).end || trajectory.get_support(t_replan).start ||
|
|
629
638
|
trajectory.get_next_support(t_replan).end || trajectory.get_support(t_replan).kick())
|
|
630
639
|
{
|
|
631
640
|
return false;
|
|
@@ -673,7 +682,7 @@ std::vector<FootstepsPlanner::Support> WalkPatternGenerator::replan_supports(Foo
|
|
|
673
682
|
|
|
674
683
|
std::vector<FootstepsPlanner::Support> supports;
|
|
675
684
|
supports = FootstepsPlanner::make_supports(footsteps, false, parameters.has_double_support(), true);
|
|
676
|
-
|
|
685
|
+
|
|
677
686
|
if (current_support.is_both())
|
|
678
687
|
{
|
|
679
688
|
supports.erase(supports.begin());
|
|
@@ -65,18 +65,18 @@ public:
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* @brief Returns the support corresponding to the given time in the trajectory
|
|
68
|
-
|
|
68
|
+
*/
|
|
69
69
|
FootstepsPlanner::Support get_support(double t);
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @brief Returns the nth next support corresponding to the given time in the trajectory
|
|
73
73
|
*/
|
|
74
|
-
FootstepsPlanner::Support get_next_support(double t, int n=1);
|
|
74
|
+
FootstepsPlanner::Support get_next_support(double t, int n = 1);
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @brief Returns the nth previous support corresponding to the given time in the trajectory
|
|
78
78
|
*/
|
|
79
|
-
FootstepsPlanner::Support get_prev_support(double t, int n=1);
|
|
79
|
+
FootstepsPlanner::Support get_prev_support(double t, int n = 1);
|
|
80
80
|
|
|
81
81
|
std::vector<FootstepsPlanner::Support> get_supports();
|
|
82
82
|
int remaining_supports(double t);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#include "directions.h"
|
|
2
|
+
|
|
3
|
+
namespace placo::tools
|
|
4
|
+
{
|
|
5
|
+
Eigen::MatrixXd directions_2d(int n)
|
|
6
|
+
{
|
|
7
|
+
Eigen::MatrixXd directions(n, 2);
|
|
8
|
+
|
|
9
|
+
for (int i = 0; i < n; i++)
|
|
10
|
+
{
|
|
11
|
+
double angle = 2 * M_PI * i / n;
|
|
12
|
+
directions(i, 0) = cos(angle);
|
|
13
|
+
directions(i, 1) = sin(angle);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return directions;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Eigen::MatrixXd directions_3d(int n, double epsilon)
|
|
20
|
+
{
|
|
21
|
+
Eigen::MatrixXd directions(n, 3);
|
|
22
|
+
|
|
23
|
+
// Golden ratio
|
|
24
|
+
double phi = (1 + sqrt(5)) / 2;
|
|
25
|
+
|
|
26
|
+
for (int i = 0; i < n; i++)
|
|
27
|
+
{
|
|
28
|
+
double x = fmod(i / phi, 1);
|
|
29
|
+
double y = (i + epsilon) / (n - 1 + 2 * epsilon);
|
|
30
|
+
|
|
31
|
+
double alpha = 2 * M_PI * x;
|
|
32
|
+
double beta = acos(1 - 2 * y);
|
|
33
|
+
|
|
34
|
+
directions(i, 0) = sin(beta) * cos(alpha);
|
|
35
|
+
directions(i, 1) = sin(beta) * sin(alpha);
|
|
36
|
+
directions(i, 2) = cos(beta);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return directions;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
} // namespace placo::tools
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <Eigen/Dense>
|
|
5
|
+
|
|
6
|
+
namespace placo::tools
|
|
7
|
+
{
|
|
8
|
+
/**
|
|
9
|
+
* @brief Generates a set of directions in 2D
|
|
10
|
+
* @param n the number of directions
|
|
11
|
+
* @return matrix of size n x 2
|
|
12
|
+
*/
|
|
13
|
+
Eigen::MatrixXd directions_2d(int n);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @brief Generates a set of directions in 3D, using Fibonacci lattice
|
|
17
|
+
* @param n the number of directions
|
|
18
|
+
* @param epsilon the epsilon parameter for the Fibonacci lattice
|
|
19
|
+
* @return matrix of size n x 3
|
|
20
|
+
*/
|
|
21
|
+
Eigen::MatrixXd directions_3d(int n, double epsilon = 0.5);
|
|
22
|
+
} // namespace placo::tools
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|