placo 0.8.10__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.
- {placo-0.8.10 → placo-0.9.0}/CMakeLists.txt +2 -0
- {placo-0.8.10 → placo-0.9.0}/PKG-INFO +1 -1
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-kinematics.cpp +16 -0
- {placo-0.8.10 → placo-0.9.0}/pyproject.toml +1 -1
- placo-0.9.0/src/placo/kinematics/distance_constraint.cpp +41 -0
- placo-0.9.0/src/placo/kinematics/distance_constraint.h +43 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/kinematics_solver.cpp +24 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/kinematics_solver.h +42 -2
- placo-0.9.0/src/placo/kinematics/yaw_constraint.cpp +52 -0
- placo-0.9.0/src/placo/kinematics/yaw_constraint.h +42 -0
- {placo-0.8.10 → placo-0.9.0}/.clang-format +0 -0
- {placo-0.8.10 → placo-0.9.0}/.gitattributes +0 -0
- {placo-0.8.10 → placo-0.9.0}/.github/workflows/wheels.yml +0 -0
- {placo-0.8.10 → placo-0.9.0}/.gitignore +0 -0
- {placo-0.8.10 → placo-0.9.0}/.readthedocs.yaml +0 -0
- {placo-0.8.10 → placo-0.9.0}/Doxyfile +0 -0
- {placo-0.8.10 → placo-0.9.0}/LICENSE +0 -0
- {placo-0.8.10 → placo-0.9.0}/README.md +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/doxystub.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-dynamics.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-eigen.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-footsteps.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-parameters.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-problem.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-robot-wrapper.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-tools.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-utils.hpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/expose-walk-pattern-generator.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/module.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/bindings/module.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/.vscode/settings.json +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/Makefile +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/placo_utils/__init__.py +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/placo_utils/tf.py +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/placo_utils/view.py +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/placo_utils/visualization.py +0 -0
- {placo-0.8.10 → placo-0.9.0}/python/run_tests.sh +0 -0
- {placo-0.8.10 → placo-0.9.0}/scripts/requirements.sh +0 -0
- {placo-0.8.10 → placo-0.9.0}/scripts/robotpkg.sh +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/com_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/com_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/contacts.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/contacts.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/dynamics_solver.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/dynamics_solver.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/frame_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/frame_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/gear_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/gear_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/joints_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/joints_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/orientation_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/orientation_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/position_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/position_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/relative_frame_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/relative_frame_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/relative_orientation_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/relative_position_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/relative_position_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/torque_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/dynamics/torque_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/foot_trajectory.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/foot_trajectory.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/footsteps_planner.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/footsteps_planner.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/humanoid_parameters.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/humanoid_robot.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/humanoid_robot.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/kick.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/kick.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/lipm.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/lipm.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/swing_foot.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/swing_foot.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/swing_foot_cubic.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/swing_foot_quintic.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/walk_pattern_generator.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/walk_pattern_generator.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/walk_tasks.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/humanoid/walk_tasks.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/axis_align_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/axis_align_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/centroidal_momentum_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/com_polygon_constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/com_polygon_constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/com_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/com_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/cone_constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/cone_constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/distance_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/distance_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/frame_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/frame_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/gear_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/gear_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/joint_space_half_spaces_constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/joint_space_half_spaces_constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/joints_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/joints_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/manipulability_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/manipulability_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/orientation_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/orientation_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/position_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/position_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/regularization_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/regularization_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/relative_frame_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/relative_frame_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/relative_orientation_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/relative_position_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/relative_position_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/wheel_task.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/kinematics/wheel_task.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/model/robot_wrapper.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/model/robot_wrapper.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/expression.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/expression.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/integrator.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/integrator.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/polygon_constraint.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/polygon_constraint.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/problem.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/problem.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/problem_polynom.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/problem_polynom.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/qp_error.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/qp_error.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/sparsity.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/sparsity.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/variable.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/problem/variable.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/axises_mask.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/axises_mask.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/cubic_spline.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/cubic_spline.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/cubic_spline_3d.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/cubic_spline_3d.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/directions.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/directions.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/polynom.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/polynom.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/prioritized.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/prioritized.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/segment.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/segment.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/utils.cpp +0 -0
- {placo-0.8.10 → placo-0.9.0}/src/placo/tools/utils.h +0 -0
- {placo-0.8.10 → placo-0.9.0}/wks.yml +0 -0
|
@@ -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
|
|
@@ -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
|
}
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|