40 using CentroidalMomentumDerivativeResidual =
42 using CentroidalMomentumDerivativeData =
51 bp::class_<CenterOfMassTranslation, bp::bases<UnaryFunction>>(
52 "CenterOfMassTranslationResidual",
53 "A residual function :math:`r(x) = com(x)` ",
54 bp::init<const int, const int, const PinModel &, const context::Vector3s>(
55 bp::args(
"self",
"ndx",
"nu",
"model",
"p_ref")))
57 .def(
"getReference", &CenterOfMassTranslation::getReference,
58 bp::args(
"self"), bp::return_internal_reference<>(),
59 "Get the target Center Of Mass translation.")
60 .def(
"setReference", &CenterOfMassTranslation::setReference,
61 bp::args(
"self",
"p_new"),
62 "Set the target Center Of Mass translation.")
65 bp::register_ptr_to_python<shared_ptr<CenterOfMassTranslationData>>();
67 bp::class_<CenterOfMassTranslationData, bp::bases<StageFunctionData>>(
68 "CenterOfMassTranslationResidualData",
69 "Data Structure for CenterOfMassTranslation", bp::no_init)
70 .def_readonly(
"pin_data", &CenterOfMassTranslationData::pin_data_,
71 "Pinocchio data struct.");
73 bp::class_<CenterOfMassVelocity, bp::bases<UnaryFunction>>(
74 "CenterOfMassVelocityResidual",
75 "A residual function :math:`r(x) = vcom(x)` ",
76 bp::init<const int, const int, const PinModel &, const context::Vector3s>(
77 bp::args(
"self",
"ndx",
"nu",
"model",
"v_ref")))
80 .def(
"getReference", &CenterOfMassVelocity::getReference,
81 bp::args(
"self"), bp::return_internal_reference<>(),
82 "Get the target Center Of Mass velocity.")
83 .def(
"setReference", &CenterOfMassVelocity::setReference,
84 bp::args(
"self",
"p_new"),
85 "Set the target Center Of Mass velocity.");
87 bp::register_ptr_to_python<shared_ptr<CenterOfMassVelocityData>>();
89 bp::class_<CenterOfMassVelocityData, bp::bases<StageFunctionData>>(
90 "CenterOfMassVelocityResidualData",
91 "Data Structure for CenterOfMassVelocity", bp::no_init)
92 .def_readonly(
"pin_data", &CenterOfMassVelocityData::pin_data_,
93 "Pinocchio data struct.");
95 bp::class_<DCMPosition, bp::bases<UnaryFunction>>(
96 "DCMPositionResidual",
"A residual function :math:`r(x) = dcm(x)` ",
97 bp::init<
const int,
const int,
const PinModel &,
98 const context::Vector3s &,
const double>(
99 bp::args(
"self",
"ndx",
"nu",
"model",
"dcm_ref",
"alpha")))
102 .def(
"getReference", &DCMPosition::getReference, bp::args(
"self"),
103 bp::return_internal_reference<>(),
"Get the target DCM position.")
104 .def(
"setReference", &DCMPosition::setReference,
105 bp::args(
"self",
"new_ref"),
"Set the target DCM position.");
107 bp::register_ptr_to_python<shared_ptr<DCMPositionData>>();
109 bp::class_<DCMPositionData, bp::bases<StageFunctionData>>(
110 "DCMPositionResidualData",
"Data Structure for DCMPosition", bp::no_init)
111 .def_readonly(
"pin_data", &DCMPositionData::pin_data_,
112 "Pinocchio data struct.");
114 bp::class_<CentroidalMomentumDerivativeResidual, bp::bases<StageFunction>>(
115 "CentroidalMomentumDerivativeResidual",
116 "A residual function :math:`r(x) = H_dot` ",
117 bp::init<
const int,
const PinModel &,
const context::Vector3s &,
118 const std::vector<bool> &,
119 const std::vector<pinocchio::FrameIndex> &,
const int>(
120 bp::args(
"self",
"ndx",
"model",
"gravity",
"contact_states",
121 "contact_ids",
"force_size")))
123 .def_readwrite(
"contact_states",
124 &CentroidalMomentumDerivativeResidual::contact_states_);
126 bp::register_ptr_to_python<shared_ptr<CentroidalMomentumDerivativeData>>();
128 bp::class_<CentroidalMomentumDerivativeData, bp::bases<StageFunctionData>>(
129 "CentroidalMomentumDerivativeResidualData",
130 "Data Structure for CentroidalMomentumDerivativeResidual", bp::no_init)
131 .def_readonly(
"pin_data", &CentroidalMomentumDerivativeData::pin_data_,
132 "Pinocchio data struct.");
134 bp::class_<CentroidalMomentumResidual, bp::bases<UnaryFunction>>(
135 "CentroidalMomentumResidual",
"A residual function :math:`r(x) = H` ",
136 bp::init<
const int,
const int,
const PinModel &,
137 const context::Vector6s &>(
138 bp::args(
"self",
"ndx",
"nu",
"model",
"h_ref")))
140 .def(
"getReference", &CentroidalMomentumResidual::getReference,
141 bp::args(
"self"), bp::return_internal_reference<>(),
142 "Get the centroidal target.")
143 .def(
"setReference", &CentroidalMomentumResidual::setReference,
144 bp::args(
"self",
"h_new"),
"Set the centroidal target.");
146 bp::register_ptr_to_python<shared_ptr<CentroidalMomentumData>>();
148 bp::class_<CentroidalMomentumData, bp::bases<StageFunctionData>>(
149 "CentroidalMomentumResidualData",
150 "Data Structure for CentroidalMomentumResidual", bp::no_init)
151 .def_readonly(
"pin_data", &CentroidalMomentumData::pin_data_,
152 "Pinocchio data struct.");
pinocchio::ModelTpl< Scalar, Options > PinModel
StageFunctionTpl< Scalar > StageFunction
UnaryFunctionTpl< Scalar > UnaryFunction
StageFunctionDataTpl< Scalar > StageFunctionData
pinocchio::DataTpl< Scalar, Options > PinData