| 1 |
/* |
| 2 |
* Copyright (c) 2011-2022, The DART development contributors |
| 3 |
* All rights reserved. |
| 4 |
* |
| 5 |
* The list of contributors can be found at: |
| 6 |
* https://github.com/dartsim/dart/blob/master/LICENSE |
| 7 |
* |
| 8 |
* This file is provided under the following "BSD-style" License: |
| 9 |
* Redistribution and use in source and binary forms, with or |
| 10 |
* without modification, are permitted provided that the following |
| 11 |
* conditions are met: |
| 12 |
* * Redistributions of source code must retain the above copyright |
| 13 |
* notice, this list of conditions and the following disclaimer. |
| 14 |
* * Redistributions in binary form must reproduce the above |
| 15 |
* copyright notice, this list of conditions and the following |
| 16 |
* disclaimer in the documentation and/or other materials provided |
| 17 |
* with the distribution. |
| 18 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
| 19 |
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 20 |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 21 |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 22 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
| 23 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 26 |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 27 |
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 28 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 29 |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 30 |
* POSSIBILITY OF SUCH DAMAGE. |
| 31 |
*/ |
| 32 |
|
| 33 |
#include <dart/dart.hpp> |
| 34 |
#include <pybind11/pybind11.h> |
| 35 |
#include <pybind11/stl.h> |
| 36 |
|
| 37 |
#include "eigen_geometry_pybind.h" |
| 38 |
#include "eigen_pybind.h" |
| 39 |
#include "pointers.hpp" |
| 40 |
|
| 41 |
namespace py = pybind11; |
| 42 |
|
| 43 |
#define DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(joint_type) \ |
| 44 |
.def( \ |
| 45 |
"create" #joint_type "AndBodyNodePair", \ |
| 46 |
+[](dart::dynamics::BodyNode* self) \ |
| 47 |
-> std:: \ |
| 48 |
pair<dart::dynamics::joint_type*, dart::dynamics::BodyNode*> { \ |
| 49 |
return self->createChildJointAndBodyNodePair< \ |
| 50 |
dart::dynamics::joint_type, \ |
| 51 |
dart::dynamics::BodyNode>(); \ |
| 52 |
}, \ |
| 53 |
::py::return_value_policy::reference_internal) \ |
| 54 |
.def( \ |
| 55 |
"create" #joint_type "AndBodyNodePair", \ |
| 56 |
+[](dart::dynamics::BodyNode* self, \ |
| 57 |
const dart::dynamics::joint_type::Properties& jointProperties) \ |
| 58 |
-> std::pair< \ |
| 59 |
dart::dynamics::joint_type*, \ |
| 60 |
dart::dynamics::BodyNode*> { \ |
| 61 |
return self->createChildJointAndBodyNodePair< \ |
| 62 |
dart::dynamics::joint_type, \ |
| 63 |
dart::dynamics::BodyNode>(jointProperties); \ |
| 64 |
}, \ |
| 65 |
::py::return_value_policy::reference_internal, \ |
| 66 |
::py::arg("jointProperties")) \ |
| 67 |
.def( \ |
| 68 |
"create" #joint_type "AndBodyNodePair", \ |
| 69 |
+[](dart::dynamics::BodyNode* self, \ |
| 70 |
const dart::dynamics::joint_type::Properties& jointProperties, \ |
| 71 |
const dart::dynamics::BodyNode::Properties& bodyProperties) \ |
| 72 |
-> std::pair< \ |
| 73 |
dart::dynamics::joint_type*, \ |
| 74 |
dart::dynamics::BodyNode*> { \ |
| 75 |
return self->createChildJointAndBodyNodePair< \ |
| 76 |
dart::dynamics::joint_type, \ |
| 77 |
dart::dynamics::BodyNode>(jointProperties, bodyProperties); \ |
| 78 |
}, \ |
| 79 |
::py::return_value_policy::reference_internal, \ |
| 80 |
::py::arg("jointProperties"), \ |
| 81 |
::py::arg("bodyProperties")) |
| 82 |
|
| 83 |
namespace dart { |
| 84 |
namespace python { |
| 85 |
|
| 86 |
void BodyNode(py::module& m) |
| 87 |
{ |
| 88 |
::py::class_<dart::dynamics::detail::BodyNodeAspectProperties>( |
| 89 |
m, "BodyNodeAspectProperties") |
| 90 |
.def(::py::init<>()) |
| 91 |
.def(::py::init<const std::string&>(), ::py::arg("name")) |
| 92 |
.def( |
| 93 |
::py::init<const std::string&, const dart::dynamics::Inertia&>(), |
| 94 |
::py::arg("name"), |
| 95 |
::py::arg("inertia")) |
| 96 |
.def( |
| 97 |
::py:: |
| 98 |
init<const std::string&, const dart::dynamics::Inertia&, bool>(), |
| 99 |
::py::arg("name"), |
| 100 |
::py::arg("inertia"), |
| 101 |
::py::arg("isCollidable")) |
| 102 |
.def( |
| 103 |
::py::init< |
| 104 |
const std::string&, |
| 105 |
const dart::dynamics::Inertia&, |
| 106 |
bool, |
| 107 |
bool>(), |
| 108 |
::py::arg("name"), |
| 109 |
::py::arg("inertia"), |
| 110 |
::py::arg("isCollidable"), |
| 111 |
::py::arg("gravityMode")) |
| 112 |
.def_readwrite( |
| 113 |
"mName", &dart::dynamics::detail::BodyNodeAspectProperties::mName) |
| 114 |
.def_readwrite( |
| 115 |
"mInertia", |
| 116 |
&dart::dynamics::detail::BodyNodeAspectProperties::mInertia) |
| 117 |
.def_readwrite( |
| 118 |
"mIsCollidable", |
| 119 |
&dart::dynamics::detail::BodyNodeAspectProperties::mIsCollidable) |
| 120 |
.def_readwrite( |
| 121 |
"mGravityMode", |
| 122 |
&dart::dynamics::detail::BodyNodeAspectProperties::mGravityMode); |
| 123 |
|
| 124 |
::py::class_<dart::dynamics::BodyNode::Properties>(m, "BodyNodeProperties") |
| 125 |
.def(::py::init<>()) |
| 126 |
.def( |
| 127 |
::py::init<const dart::dynamics::detail::BodyNodeAspectProperties&>(), |
| 128 |
::py::arg("aspectProperties")); |
| 129 |
|
| 130 |
::py::class_< |
| 131 |
dart::dynamics::TemplatedJacobianNode<dart::dynamics::BodyNode>, |
| 132 |
dart::dynamics::JacobianNode, |
| 133 |
std::shared_ptr< |
| 134 |
dart::dynamics::TemplatedJacobianNode<dart::dynamics::BodyNode>>>( |
| 135 |
m, "TemplatedJacobianBodyNode") |
| 136 |
.def( |
| 137 |
"getJacobian", |
| 138 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 139 |
dart::dynamics::BodyNode>* self, |
| 140 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 141 |
-> dart::math::Jacobian { |
| 142 |
return self->getJacobian(_inCoordinatesOf); |
| 143 |
}, |
| 144 |
::py::arg("inCoordinatesOf")) |
| 145 |
.def( |
| 146 |
"getJacobian", |
| 147 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 148 |
dart::dynamics::BodyNode>* self, |
| 149 |
const Eigen::Vector3d& _offset) -> dart::math::Jacobian { |
| 150 |
return self->getJacobian(_offset); |
| 151 |
}, |
| 152 |
::py::arg("offset")) |
| 153 |
.def( |
| 154 |
"getJacobian", |
| 155 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 156 |
dart::dynamics::BodyNode>* self, |
| 157 |
const Eigen::Vector3d& _offset, |
| 158 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 159 |
-> dart::math::Jacobian { |
| 160 |
return self->getJacobian(_offset, _inCoordinatesOf); |
| 161 |
}, |
| 162 |
::py::arg("offset"), |
| 163 |
::py::arg("inCoordinatesOf")) |
| 164 |
.def( |
| 165 |
"getWorldJacobian", |
| 166 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 167 |
dart::dynamics::BodyNode>* self, |
| 168 |
const Eigen::Vector3d& _offset) -> dart::math::Jacobian { |
| 169 |
return self->getWorldJacobian(_offset); |
| 170 |
}, |
| 171 |
::py::arg("offset")) |
| 172 |
.def( |
| 173 |
"getLinearJacobian", |
| 174 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 175 |
dart::dynamics::BodyNode>* self) -> dart::math::LinearJacobian { |
| 176 |
return self->getLinearJacobian(); |
| 177 |
}) |
| 178 |
.def( |
| 179 |
"getLinearJacobian", |
| 180 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 181 |
dart::dynamics::BodyNode>* self, |
| 182 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 183 |
-> dart::math::LinearJacobian { |
| 184 |
return self->getLinearJacobian(_inCoordinatesOf); |
| 185 |
}, |
| 186 |
::py::arg("inCoordinatesOf")) |
| 187 |
.def( |
| 188 |
"getLinearJacobian", |
| 189 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 190 |
dart::dynamics::BodyNode>* self, |
| 191 |
const Eigen::Vector3d& _offset) -> dart::math::LinearJacobian { |
| 192 |
return self->getLinearJacobian(_offset); |
| 193 |
}, |
| 194 |
::py::arg("offset")) |
| 195 |
.def( |
| 196 |
"getLinearJacobian", |
| 197 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 198 |
dart::dynamics::BodyNode>* self, |
| 199 |
const Eigen::Vector3d& _offset, |
| 200 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 201 |
-> dart::math::LinearJacobian { |
| 202 |
return self->getLinearJacobian(_offset, _inCoordinatesOf); |
| 203 |
}, |
| 204 |
::py::arg("offset"), |
| 205 |
::py::arg("inCoordinatesOf")) |
| 206 |
.def( |
| 207 |
"getAngularJacobian", |
| 208 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 209 |
dart::dynamics::BodyNode>* self) -> dart::math::AngularJacobian { |
| 210 |
return self->getAngularJacobian(); |
| 211 |
}) |
| 212 |
.def( |
| 213 |
"getAngularJacobian", |
| 214 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 215 |
dart::dynamics::BodyNode>* self, |
| 216 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 217 |
-> dart::math::AngularJacobian { |
| 218 |
return self->getAngularJacobian(_inCoordinatesOf); |
| 219 |
}, |
| 220 |
::py::arg("inCoordinatesOf")) |
| 221 |
.def( |
| 222 |
"getJacobianSpatialDeriv", |
| 223 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 224 |
dart::dynamics::BodyNode>* self, |
| 225 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 226 |
-> dart::math::Jacobian { |
| 227 |
return self->getJacobianSpatialDeriv(_inCoordinatesOf); |
| 228 |
}, |
| 229 |
::py::arg("inCoordinatesOf")) |
| 230 |
.def( |
| 231 |
"getJacobianSpatialDeriv", |
| 232 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 233 |
dart::dynamics::BodyNode>* self, |
| 234 |
const Eigen::Vector3d& _offset) -> dart::math::Jacobian { |
| 235 |
return self->getJacobianSpatialDeriv(_offset); |
| 236 |
}, |
| 237 |
::py::arg("offset")) |
| 238 |
.def( |
| 239 |
"getJacobianSpatialDeriv", |
| 240 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 241 |
dart::dynamics::BodyNode>* self, |
| 242 |
const Eigen::Vector3d& _offset, |
| 243 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 244 |
-> dart::math::Jacobian { |
| 245 |
return self->getJacobianSpatialDeriv(_offset, _inCoordinatesOf); |
| 246 |
}, |
| 247 |
::py::arg("offset"), |
| 248 |
::py::arg("inCoordinatesOf")) |
| 249 |
.def( |
| 250 |
"getJacobianClassicDeriv", |
| 251 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 252 |
dart::dynamics::BodyNode>* self, |
| 253 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 254 |
-> dart::math::Jacobian { |
| 255 |
return self->getJacobianClassicDeriv(_inCoordinatesOf); |
| 256 |
}, |
| 257 |
::py::arg("inCoordinatesOf")) |
| 258 |
.def( |
| 259 |
"getJacobianClassicDeriv", |
| 260 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 261 |
dart::dynamics::BodyNode>* self, |
| 262 |
const Eigen::Vector3d& _offset) -> dart::math::Jacobian { |
| 263 |
return self->getJacobianClassicDeriv(_offset); |
| 264 |
}, |
| 265 |
::py::arg("offset")) |
| 266 |
.def( |
| 267 |
"getJacobianClassicDeriv", |
| 268 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 269 |
dart::dynamics::BodyNode>* self, |
| 270 |
const Eigen::Vector3d& _offset, |
| 271 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 272 |
-> dart::math::Jacobian { |
| 273 |
return self->getJacobianClassicDeriv(_offset, _inCoordinatesOf); |
| 274 |
}, |
| 275 |
::py::arg("offset"), |
| 276 |
::py::arg("inCoordinatesOf")) |
| 277 |
.def( |
| 278 |
"getLinearJacobianDeriv", |
| 279 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 280 |
dart::dynamics::BodyNode>* self) -> dart::math::LinearJacobian { |
| 281 |
return self->getLinearJacobianDeriv(); |
| 282 |
}) |
| 283 |
.def( |
| 284 |
"getLinearJacobianDeriv", |
| 285 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 286 |
dart::dynamics::BodyNode>* self, |
| 287 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 288 |
-> dart::math::LinearJacobian { |
| 289 |
return self->getLinearJacobianDeriv(_inCoordinatesOf); |
| 290 |
}, |
| 291 |
::py::arg("inCoordinatesOf")) |
| 292 |
.def( |
| 293 |
"getLinearJacobianDeriv", |
| 294 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 295 |
dart::dynamics::BodyNode>* self, |
| 296 |
const Eigen::Vector3d& _offset) -> dart::math::LinearJacobian { |
| 297 |
return self->getLinearJacobianDeriv(_offset); |
| 298 |
}, |
| 299 |
::py::arg("offset")) |
| 300 |
.def( |
| 301 |
"getLinearJacobianDeriv", |
| 302 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 303 |
dart::dynamics::BodyNode>* self, |
| 304 |
const Eigen::Vector3d& _offset, |
| 305 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 306 |
-> dart::math::LinearJacobian { |
| 307 |
return self->getLinearJacobianDeriv(_offset, _inCoordinatesOf); |
| 308 |
}, |
| 309 |
::py::arg("offset"), |
| 310 |
::py::arg("inCoordinatesOf")) |
| 311 |
.def( |
| 312 |
"getAngularJacobianDeriv", |
| 313 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 314 |
dart::dynamics::BodyNode>* self) -> dart::math::AngularJacobian { |
| 315 |
return self->getAngularJacobianDeriv(); |
| 316 |
}) |
| 317 |
.def( |
| 318 |
"getAngularJacobianDeriv", |
| 319 |
+[](const dart::dynamics::TemplatedJacobianNode< |
| 320 |
dart::dynamics::BodyNode>* self, |
| 321 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 322 |
-> dart::math::AngularJacobian { |
| 323 |
return self->getAngularJacobianDeriv(_inCoordinatesOf); |
| 324 |
}, |
| 325 |
::py::arg("inCoordinatesOf")); |
| 326 |
|
| 327 |
::py::class_< |
| 328 |
dart::dynamics::BodyNode, |
| 329 |
dart::dynamics::TemplatedJacobianNode<dart::dynamics::BodyNode>, |
| 330 |
dart::dynamics::Frame, |
| 331 |
dart::dynamics::BodyNodePtr>(m, "BodyNode") |
| 332 |
.def( |
| 333 |
"setAllNodeStates", |
| 334 |
+[](dart::dynamics::BodyNode* self, |
| 335 |
const dart::dynamics::BodyNode::AllNodeStates& states) { |
| 336 |
self->setAllNodeStates(states); |
| 337 |
}, |
| 338 |
::py::arg("states")) |
| 339 |
.def( |
| 340 |
"getAllNodeStates", |
| 341 |
+[](const dart::dynamics::BodyNode* self) |
| 342 |
-> dart::dynamics::BodyNode::AllNodeStates { |
| 343 |
return self->getAllNodeStates(); |
| 344 |
}) |
| 345 |
.def( |
| 346 |
"setAllNodeProperties", |
| 347 |
+[](dart::dynamics::BodyNode* self, |
| 348 |
const dart::dynamics::BodyNode::AllNodeProperties& properties) { |
| 349 |
self->setAllNodeProperties(properties); |
| 350 |
}, |
| 351 |
::py::arg("properties")) |
| 352 |
.def( |
| 353 |
"getAllNodeProperties", |
| 354 |
+[](const dart::dynamics::BodyNode* self) |
| 355 |
-> dart::dynamics::BodyNode::AllNodeProperties { |
| 356 |
return self->getAllNodeProperties(); |
| 357 |
}) |
| 358 |
.def( |
| 359 |
"setProperties", |
| 360 |
+[](dart::dynamics::BodyNode* self, |
| 361 |
const dart::dynamics::BodyNode::CompositeProperties& |
| 362 |
_properties) { self->setProperties(_properties); }, |
| 363 |
::py::arg("properties")) |
| 364 |
.def( |
| 365 |
"setProperties", |
| 366 |
+[](dart::dynamics::BodyNode* self, |
| 367 |
const dart::dynamics::BodyNode::AspectProperties& _properties) { |
| 368 |
self->setProperties(_properties); |
| 369 |
}, |
| 370 |
::py::arg("properties")) |
| 371 |
.def( |
| 372 |
"setAspectState", |
| 373 |
+[](dart::dynamics::BodyNode* self, |
| 374 |
const dart::common::EmbedStateAndPropertiesOnTopOf< |
| 375 |
dart::dynamics::BodyNode, |
| 376 |
dart::dynamics::detail::BodyNodeState, |
| 377 |
dart::dynamics::detail::BodyNodeAspectProperties, |
| 378 |
dart::common::RequiresAspect< |
| 379 |
dart::common::ProxyStateAndPropertiesAspect< |
| 380 |
dart::dynamics::BodyNode, |
| 381 |
dart::common::ProxyCloneable< |
| 382 |
dart::common::Aspect::State, |
| 383 |
dart::dynamics::BodyNode, |
| 384 |
dart::common::CloneableMap<std::map< |
| 385 |
std::type_index, |
| 386 |
std::unique_ptr< |
| 387 |
dart::common::CloneableVector< |
| 388 |
std::unique_ptr< |
| 389 |
dart::dynamics::Node::State, |
| 390 |
std::default_delete< |
| 391 |
dart::dynamics::Node:: |
| 392 |
State>>>, |
| 393 |
std::default_delete< |
| 394 |
dart::common::CloneableVector< |
| 395 |
std::unique_ptr< |
| 396 |
dart::dynamics::Node::State, |
| 397 |
std::default_delete< |
| 398 |
dart::dynamics::Node:: |
| 399 |
State>>>>>, |
| 400 |
std::less<std::type_index>, |
| 401 |
std::allocator<std::pair< |
| 402 |
const std::type_index, |
| 403 |
std::unique_ptr< |
| 404 |
dart::common::CloneableVector< |
| 405 |
std::unique_ptr< |
| 406 |
dart::dynamics::Node::State, |
| 407 |
std::default_delete< |
| 408 |
dart::dynamics::Node:: |
| 409 |
State>>>, |
| 410 |
std::default_delete< |
| 411 |
dart::common::CloneableVector< |
| 412 |
std::unique_ptr< |
| 413 |
dart::dynamics::Node:: |
| 414 |
State, |
| 415 |
std::default_delete< |
| 416 |
dart::dynamics::Node:: |
| 417 |
State>>>>>>>>>, |
| 418 |
&dart::dynamics::detail::setAllNodeStates, |
| 419 |
&dart::dynamics::detail::getAllNodeStates>, |
| 420 |
dart::common::ProxyCloneable< |
| 421 |
dart::common::Aspect::Properties, |
| 422 |
dart::dynamics::BodyNode, |
| 423 |
dart::common::CloneableMap<std::map< |
| 424 |
std::type_index, |
| 425 |
std::unique_ptr< |
| 426 |
dart::common::CloneableVector< |
| 427 |
std::unique_ptr< |
| 428 |
dart::dynamics::Node::Properties, |
| 429 |
std::default_delete< |
| 430 |
dart::dynamics::Node:: |
| 431 |
Properties>>>, |
| 432 |
std::default_delete< |
| 433 |
dart::common::CloneableVector< |
| 434 |
std::unique_ptr< |
| 435 |
dart::dynamics::Node:: |
| 436 |
Properties, |
| 437 |
std::default_delete< |
| 438 |
dart::dynamics::Node:: |
| 439 |
Properties>>>>>, |
| 440 |
std::less<std::type_index>, |
| 441 |
std::allocator<std::pair< |
| 442 |
const std::type_index, |
| 443 |
std::unique_ptr< |
| 444 |
dart::common::CloneableVector< |
| 445 |
std::unique_ptr< |
| 446 |
dart::dynamics::Node:: |
| 447 |
Properties, |
| 448 |
std::default_delete< |
| 449 |
dart::dynamics::Node:: |
| 450 |
Properties>>>, |
| 451 |
std::default_delete< |
| 452 |
dart::common::CloneableVector< |
| 453 |
std::unique_ptr< |
| 454 |
dart::dynamics::Node:: |
| 455 |
Properties, |
| 456 |
std::default_delete< |
| 457 |
dart::dynamics::Node:: |
| 458 |
Properties>>>>>>>>>, |
| 459 |
&dart::dynamics::detail::setAllNodeProperties, |
| 460 |
&dart::dynamics::detail:: |
| 461 |
getAllNodeProperties>>>>::AspectState& |
| 462 |
state) { self->setAspectState(state); }, |
| 463 |
::py::arg("state")) |
| 464 |
.def( |
| 465 |
"setAspectProperties", |
| 466 |
+[](dart::dynamics::BodyNode* self, |
| 467 |
const dart::dynamics::BodyNode::AspectProperties& properties) { |
| 468 |
self->setAspectProperties(properties); |
| 469 |
}, |
| 470 |
::py::arg("properties")) |
| 471 |
.def( |
| 472 |
"getBodyNodeProperties", |
| 473 |
+[](const dart::dynamics::BodyNode* self) |
| 474 |
-> dart::dynamics::BodyNode::Properties { |
| 475 |
return self->getBodyNodeProperties(); |
| 476 |
}) |
| 477 |
.def( |
| 478 |
"copy", |
| 479 |
+[](dart::dynamics::BodyNode* self, |
| 480 |
const dart::dynamics::BodyNode& otherBodyNode) { |
| 481 |
self->copy(otherBodyNode); |
| 482 |
}, |
| 483 |
::py::arg("otherBodyNode")) |
| 484 |
.def( |
| 485 |
"copy", |
| 486 |
+[](dart::dynamics::BodyNode* self, |
| 487 |
const dart::dynamics::BodyNode* otherBodyNode) { |
| 488 |
self->copy(otherBodyNode); |
| 489 |
}, |
| 490 |
::py::arg("otherBodyNode")) |
| 491 |
.def( |
| 492 |
"duplicateNodes", |
| 493 |
+[](dart::dynamics::BodyNode* self, |
| 494 |
const dart::dynamics::BodyNode* otherBodyNode) { |
| 495 |
self->duplicateNodes(otherBodyNode); |
| 496 |
}, |
| 497 |
::py::arg("otherBodyNode")) |
| 498 |
.def( |
| 499 |
"matchNodes", |
| 500 |
+[](dart::dynamics::BodyNode* self, |
| 501 |
const dart::dynamics::BodyNode* otherBodyNode) { |
| 502 |
self->matchNodes(otherBodyNode); |
| 503 |
}, |
| 504 |
::py::arg("otherBodyNode")) |
| 505 |
.def( |
| 506 |
"setName", |
| 507 |
+[](dart::dynamics::BodyNode* self, const std::string& _name) |
| 508 |
-> const std::string& { return self->setName(_name); }, |
| 509 |
::py::return_value_policy::reference_internal, |
| 510 |
::py::arg("name")) |
| 511 |
.def( |
| 512 |
"getName", |
| 513 |
+[](const dart::dynamics::BodyNode* self) -> const std::string& { |
| 514 |
return self->getName(); |
| 515 |
}, |
| 516 |
::py::return_value_policy::reference_internal) |
| 517 |
.def( |
| 518 |
"setGravityMode", |
| 519 |
+[](dart::dynamics::BodyNode* self, bool _gravityMode) { |
| 520 |
self->setGravityMode(_gravityMode); |
| 521 |
}, |
| 522 |
::py::arg("gravityMode")) |
| 523 |
.def( |
| 524 |
"getGravityMode", |
| 525 |
+[](const dart::dynamics::BodyNode* self) |
| 526 |
-> bool { return self->getGravityMode(); }) |
| 527 |
.def( |
| 528 |
"isCollidable", |
| 529 |
+[](const dart::dynamics::BodyNode* self) |
| 530 |
-> bool { return self->isCollidable(); }) |
| 531 |
.def( |
| 532 |
"setCollidable", |
| 533 |
+[](dart::dynamics::BodyNode* self, bool _isCollidable) { |
| 534 |
self->setCollidable(_isCollidable); |
| 535 |
}, |
| 536 |
::py::arg("isCollidable")) |
| 537 |
.def( |
| 538 |
"setMass", |
| 539 |
+[](dart::dynamics::BodyNode* self, |
| 540 |
double mass) { self->setMass(mass); }, |
| 541 |
::py::arg("mass")) |
| 542 |
.def( |
| 543 |
"getMass", |
| 544 |
+[](const dart::dynamics::BodyNode* self) |
| 545 |
-> double { return self->getMass(); }) |
| 546 |
.def( |
| 547 |
"setMomentOfInertia", |
| 548 |
+[](dart::dynamics::BodyNode* self, |
| 549 |
double _Ixx, |
| 550 |
double _Iyy, |
| 551 |
double _Izz) { self->setMomentOfInertia(_Ixx, _Iyy, _Izz); }, |
| 552 |
::py::arg("Ixx"), |
| 553 |
::py::arg("Iyy"), |
| 554 |
::py::arg("Izz")) |
| 555 |
.def( |
| 556 |
"setMomentOfInertia", |
| 557 |
+[](dart::dynamics::BodyNode* self, |
| 558 |
double _Ixx, |
| 559 |
double _Iyy, |
| 560 |
double _Izz, |
| 561 |
double _Ixy) { |
| 562 |
self->setMomentOfInertia(_Ixx, _Iyy, _Izz, _Ixy); |
| 563 |
}, |
| 564 |
::py::arg("Ixx"), |
| 565 |
::py::arg("Iyy"), |
| 566 |
::py::arg("Izz"), |
| 567 |
::py::arg("Ixy")) |
| 568 |
.def( |
| 569 |
"setMomentOfInertia", |
| 570 |
+[](dart::dynamics::BodyNode* self, |
| 571 |
double _Ixx, |
| 572 |
double _Iyy, |
| 573 |
double _Izz, |
| 574 |
double _Ixy, |
| 575 |
double _Ixz) { |
| 576 |
self->setMomentOfInertia(_Ixx, _Iyy, _Izz, _Ixy, _Ixz); |
| 577 |
}, |
| 578 |
::py::arg("Ixx"), |
| 579 |
::py::arg("Iyy"), |
| 580 |
::py::arg("Izz"), |
| 581 |
::py::arg("Ixy"), |
| 582 |
::py::arg("Ixz")) |
| 583 |
.def( |
| 584 |
"setMomentOfInertia", |
| 585 |
+[](dart::dynamics::BodyNode* self, |
| 586 |
double _Ixx, |
| 587 |
double _Iyy, |
| 588 |
double _Izz, |
| 589 |
double _Ixy, |
| 590 |
double _Ixz, |
| 591 |
double _Iyz) { |
| 592 |
self->setMomentOfInertia(_Ixx, _Iyy, _Izz, _Ixy, _Ixz, _Iyz); |
| 593 |
}, |
| 594 |
::py::arg("Ixx"), |
| 595 |
::py::arg("Iyy"), |
| 596 |
::py::arg("Izz"), |
| 597 |
::py::arg("Ixy"), |
| 598 |
::py::arg("Ixz"), |
| 599 |
::py::arg("Iyz")) |
| 600 |
.def( |
| 601 |
"getMomentOfInertia", |
| 602 |
+[](const dart::dynamics::BodyNode* self, |
| 603 |
double& _Ixx, |
| 604 |
double& _Iyy, |
| 605 |
double& _Izz, |
| 606 |
double& _Ixy, |
| 607 |
double& _Ixz, |
| 608 |
double& _Iyz) { |
| 609 |
self->getMomentOfInertia(_Ixx, _Iyy, _Izz, _Ixy, _Ixz, _Iyz); |
| 610 |
}, |
| 611 |
::py::arg("Ixx"), |
| 612 |
::py::arg("Iyy"), |
| 613 |
::py::arg("Izz"), |
| 614 |
::py::arg("Ixy"), |
| 615 |
::py::arg("Ixz"), |
| 616 |
::py::arg("Iyz")) |
| 617 |
.def( |
| 618 |
"setInertia", |
| 619 |
+[](dart::dynamics::BodyNode* self, |
| 620 |
const dart::dynamics::Inertia& inertia) { |
| 621 |
self->setInertia(inertia); |
| 622 |
}, |
| 623 |
::py::arg("inertia")) |
| 624 |
.def( |
| 625 |
"getInertia", |
| 626 |
+[](const dart::dynamics::BodyNode* self) |
| 627 |
-> const dart::dynamics::Inertia& { return self->getInertia(); }, |
| 628 |
::py::return_value_policy::reference_internal) |
| 629 |
.def( |
| 630 |
"setLocalCOM", |
| 631 |
+[](dart::dynamics::BodyNode* self, const Eigen::Vector3d& _com) { |
| 632 |
self->setLocalCOM(_com); |
| 633 |
}, |
| 634 |
::py::arg("com")) |
| 635 |
.def( |
| 636 |
"getLocalCOM", |
| 637 |
+[](const dart::dynamics::BodyNode* self) -> const Eigen::Vector3d& { |
| 638 |
return self->getLocalCOM(); |
| 639 |
}, |
| 640 |
::py::return_value_policy::reference_internal) |
| 641 |
.def( |
| 642 |
"getCOM", |
| 643 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector3d { |
| 644 |
return self->getCOM(); |
| 645 |
}) |
| 646 |
.def( |
| 647 |
"getCOM", |
| 648 |
+[](const dart::dynamics::BodyNode* self, |
| 649 |
const dart::dynamics::Frame* _withRespectTo) -> Eigen::Vector3d { |
| 650 |
return self->getCOM(_withRespectTo); |
| 651 |
}, |
| 652 |
::py::arg("withRespectTo")) |
| 653 |
.def( |
| 654 |
"getCOMLinearVelocity", |
| 655 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector3d { |
| 656 |
return self->getCOMLinearVelocity(); |
| 657 |
}) |
| 658 |
.def( |
| 659 |
"getCOMLinearVelocity", |
| 660 |
+[](const dart::dynamics::BodyNode* self, |
| 661 |
const dart::dynamics::Frame* _relativeTo) -> Eigen::Vector3d { |
| 662 |
return self->getCOMLinearVelocity(_relativeTo); |
| 663 |
}, |
| 664 |
::py::arg("relativeTo")) |
| 665 |
.def( |
| 666 |
"getCOMLinearVelocity", |
| 667 |
+[](const dart::dynamics::BodyNode* self, |
| 668 |
const dart::dynamics::Frame* _relativeTo, |
| 669 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 670 |
-> Eigen::Vector3d { |
| 671 |
return self->getCOMLinearVelocity(_relativeTo, _inCoordinatesOf); |
| 672 |
}, |
| 673 |
::py::arg("relativeTo"), |
| 674 |
::py::arg("inCoordinatesOf")) |
| 675 |
.def( |
| 676 |
"getCOMSpatialVelocity", |
| 677 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector6d { |
| 678 |
return self->getCOMSpatialVelocity(); |
| 679 |
}) |
| 680 |
.def( |
| 681 |
"getCOMSpatialVelocity", |
| 682 |
+[](const dart::dynamics::BodyNode* self, |
| 683 |
const dart::dynamics::Frame* _relativeTo, |
| 684 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 685 |
-> Eigen::Vector6d { |
| 686 |
return self->getCOMSpatialVelocity(_relativeTo, _inCoordinatesOf); |
| 687 |
}, |
| 688 |
::py::arg("relativeTo"), |
| 689 |
::py::arg("inCoordinatesOf")) |
| 690 |
.def( |
| 691 |
"getCOMLinearAcceleration", |
| 692 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector3d { |
| 693 |
return self->getCOMLinearAcceleration(); |
| 694 |
}) |
| 695 |
.def( |
| 696 |
"getCOMLinearAcceleration", |
| 697 |
+[](const dart::dynamics::BodyNode* self, |
| 698 |
const dart::dynamics::Frame* _relativeTo) -> Eigen::Vector3d { |
| 699 |
return self->getCOMLinearAcceleration(_relativeTo); |
| 700 |
}, |
| 701 |
::py::arg("relativeTo")) |
| 702 |
.def( |
| 703 |
"getCOMLinearAcceleration", |
| 704 |
+[](const dart::dynamics::BodyNode* self, |
| 705 |
const dart::dynamics::Frame* _relativeTo, |
| 706 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 707 |
-> Eigen::Vector3d { |
| 708 |
return self->getCOMLinearAcceleration( |
| 709 |
_relativeTo, _inCoordinatesOf); |
| 710 |
}, |
| 711 |
::py::arg("relativeTo"), |
| 712 |
::py::arg("inCoordinatesOf")) |
| 713 |
.def( |
| 714 |
"getCOMSpatialAcceleration", |
| 715 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector6d { |
| 716 |
return self->getCOMSpatialAcceleration(); |
| 717 |
}) |
| 718 |
.def( |
| 719 |
"getCOMSpatialAcceleration", |
| 720 |
+[](const dart::dynamics::BodyNode* self, |
| 721 |
const dart::dynamics::Frame* _relativeTo, |
| 722 |
const dart::dynamics::Frame* _inCoordinatesOf) |
| 723 |
-> Eigen::Vector6d { |
| 724 |
return self->getCOMSpatialAcceleration( |
| 725 |
_relativeTo, _inCoordinatesOf); |
| 726 |
}, |
| 727 |
::py::arg("relativeTo"), |
| 728 |
::py::arg("inCoordinatesOf")) |
| 729 |
.def( |
| 730 |
"getIndexInSkeleton", |
| 731 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 732 |
return self->getIndexInSkeleton(); |
| 733 |
}) |
| 734 |
.def( |
| 735 |
"getIndexInTree", |
| 736 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 737 |
return self->getIndexInTree(); |
| 738 |
}) |
| 739 |
.def( |
| 740 |
"getTreeIndex", |
| 741 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 742 |
return self->getTreeIndex(); |
| 743 |
}) |
| 744 |
.def( |
| 745 |
"remove", |
| 746 |
+[](dart::dynamics::BodyNode* self) -> dart::dynamics::SkeletonPtr { |
| 747 |
return self->remove(); |
| 748 |
}) |
| 749 |
.def( |
| 750 |
"remove", |
| 751 |
+[](dart::dynamics::BodyNode* self, const std::string& _name) |
| 752 |
-> dart::dynamics::SkeletonPtr { return self->remove(_name); }, |
| 753 |
::py::arg("name")) |
| 754 |
.def( |
| 755 |
"moveTo", |
| 756 |
+[](dart::dynamics::BodyNode* self, |
| 757 |
dart::dynamics::BodyNode* _newParent) -> bool { |
| 758 |
return self->moveTo(_newParent); |
| 759 |
}, |
| 760 |
::py::arg("newParent")) |
| 761 |
.def( |
| 762 |
"moveTo", |
| 763 |
+[](dart::dynamics::BodyNode* self, |
| 764 |
const dart::dynamics::SkeletonPtr& _newSkeleton, |
| 765 |
dart::dynamics::BodyNode* _newParent) -> bool { |
| 766 |
return self->moveTo(_newSkeleton, _newParent); |
| 767 |
}, |
| 768 |
::py::arg("newSkeleton"), |
| 769 |
::py::arg("newParent")) |
| 770 |
.def( |
| 771 |
"split", |
| 772 |
+[](dart::dynamics::BodyNode* self, |
| 773 |
const std::string& _skeletonName) -> dart::dynamics::SkeletonPtr { |
| 774 |
return self->split(_skeletonName); |
| 775 |
}, |
| 776 |
::py::arg("skeletonName")) |
| 777 |
.def( |
| 778 |
"copyTo", |
| 779 |
+[](dart::dynamics::BodyNode* self, |
| 780 |
dart::dynamics::BodyNode* _newParent) |
| 781 |
-> std::pair<dart::dynamics::Joint*, dart::dynamics::BodyNode*> { |
| 782 |
return self->copyTo(_newParent); |
| 783 |
}, |
| 784 |
::py::arg("newParent")) |
| 785 |
.def( |
| 786 |
"copyTo", |
| 787 |
+[](dart::dynamics::BodyNode* self, |
| 788 |
dart::dynamics::BodyNode* _newParent, |
| 789 |
bool _recursive) |
| 790 |
-> std::pair<dart::dynamics::Joint*, dart::dynamics::BodyNode*> { |
| 791 |
return self->copyTo(_newParent, _recursive); |
| 792 |
}, |
| 793 |
::py::arg("newParent"), |
| 794 |
::py::arg("recursive")) |
| 795 |
.def( |
| 796 |
"copyTo", |
| 797 |
+[](const dart::dynamics::BodyNode* self, |
| 798 |
const dart::dynamics::SkeletonPtr& _newSkeleton, |
| 799 |
dart::dynamics::BodyNode* _newParent) |
| 800 |
-> std::pair<dart::dynamics::Joint*, dart::dynamics::BodyNode*> { |
| 801 |
return self->copyTo(_newSkeleton, _newParent); |
| 802 |
}, |
| 803 |
::py::arg("newSkeleton"), |
| 804 |
::py::arg("newParent")) |
| 805 |
.def( |
| 806 |
"copyTo", |
| 807 |
+[](const dart::dynamics::BodyNode* self, |
| 808 |
const dart::dynamics::SkeletonPtr& _newSkeleton, |
| 809 |
dart::dynamics::BodyNode* _newParent, |
| 810 |
bool _recursive) |
| 811 |
-> std::pair<dart::dynamics::Joint*, dart::dynamics::BodyNode*> { |
| 812 |
return self->copyTo(_newSkeleton, _newParent, _recursive); |
| 813 |
}, |
| 814 |
::py::arg("newSkeleton"), |
| 815 |
::py::arg("newParent"), |
| 816 |
::py::arg("recursive")) |
| 817 |
.def( |
| 818 |
"copyAs", |
| 819 |
+[](const dart::dynamics::BodyNode* self, |
| 820 |
const std::string& _skeletonName) -> dart::dynamics::SkeletonPtr { |
| 821 |
return self->copyAs(_skeletonName); |
| 822 |
}, |
| 823 |
::py::arg("skeletonName")) |
| 824 |
.def( |
| 825 |
"copyAs", |
| 826 |
+[](const dart::dynamics::BodyNode* self, |
| 827 |
const std::string& _skeletonName, |
| 828 |
bool _recursive) -> dart::dynamics::SkeletonPtr { |
| 829 |
return self->copyAs(_skeletonName, _recursive); |
| 830 |
}, |
| 831 |
::py::arg("skeletonName"), |
| 832 |
::py::arg("recursive")) |
| 833 |
.def( |
| 834 |
"getSkeleton", |
| 835 |
+[](dart::dynamics::BodyNode* self) -> dart::dynamics::SkeletonPtr { |
| 836 |
return self->getSkeleton(); |
| 837 |
}) |
| 838 |
.def( |
| 839 |
"getSkeleton", |
| 840 |
+[](const dart::dynamics::BodyNode* self) |
| 841 |
-> dart::dynamics::ConstSkeletonPtr { |
| 842 |
return self->getSkeleton(); |
| 843 |
}) |
| 844 |
.def( |
| 845 |
"getParentJoint", |
| 846 |
+[](dart::dynamics::BodyNode* self) -> dart::dynamics::Joint* { |
| 847 |
return self->getParentJoint(); |
| 848 |
}, |
| 849 |
::py::return_value_policy::reference_internal) |
| 850 |
.def( |
| 851 |
"getParentBodyNode", |
| 852 |
+[](dart::dynamics::BodyNode* self) -> dart::dynamics::BodyNode* { |
| 853 |
return self->getParentBodyNode(); |
| 854 |
}, |
| 855 |
::py::return_value_policy::reference_internal) |
| 856 |
// clang-format off |
| 857 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(WeldJoint) |
| 858 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(RevoluteJoint) |
| 859 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(PrismaticJoint) |
| 860 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(ScrewJoint) |
| 861 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(UniversalJoint) |
| 862 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(TranslationalJoint2D) |
| 863 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(PlanarJoint) |
| 864 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(EulerJoint) |
| 865 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(BallJoint) |
| 866 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(TranslationalJoint) |
| 867 |
DARTPY_DEFINE_CREATE_CHILD_JOINT_AND_BODY_NODE_PAIR(FreeJoint) |
| 868 |
// clang-format on |
| 869 |
.def( |
| 870 |
"getNumChildBodyNodes", |
| 871 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 872 |
return self->getNumChildBodyNodes(); |
| 873 |
}) |
| 874 |
.def( |
| 875 |
"getChildBodyNode", |
| 876 |
+[](dart::dynamics::BodyNode* self, |
| 877 |
std::size_t index) -> dart::dynamics::BodyNode* { |
| 878 |
return self->getChildBodyNode(index); |
| 879 |
}, |
| 880 |
::py::arg("index"), |
| 881 |
::py::return_value_policy::reference_internal) |
| 882 |
.def( |
| 883 |
"getNumChildJoints", |
| 884 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 885 |
return self->getNumChildJoints(); |
| 886 |
}) |
| 887 |
.def( |
| 888 |
"getChildJoint", |
| 889 |
+[](dart::dynamics::BodyNode* self, std::size_t index) |
| 890 |
-> dart::dynamics::Joint* { return self->getChildJoint(index); }, |
| 891 |
::py::arg("index"), |
| 892 |
::py::return_value_policy::reference_internal) |
| 893 |
.def( |
| 894 |
"getNumShapeNodes", |
| 895 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 896 |
return self->getNumShapeNodes(); |
| 897 |
}) |
| 898 |
.def( |
| 899 |
"getShapeNode", |
| 900 |
+[](dart::dynamics::BodyNode* self, |
| 901 |
std::size_t index) -> dart::dynamics::ShapeNode* { |
| 902 |
return self->getShapeNode(index); |
| 903 |
}, |
| 904 |
::py::return_value_policy::reference_internal, |
| 905 |
::py::arg("index")) |
| 906 |
.def( |
| 907 |
"createShapeNode", |
| 908 |
+[](dart::dynamics::BodyNode* self, |
| 909 |
dart::dynamics::ShapePtr shape) -> dart::dynamics::ShapeNode* { |
| 910 |
return self->createShapeNode(shape); |
| 911 |
}, |
| 912 |
::py::return_value_policy::reference_internal, |
| 913 |
::py::arg("shape")) |
| 914 |
.def( |
| 915 |
"createShapeNode", |
| 916 |
+[](dart::dynamics::BodyNode* self, |
| 917 |
dart::dynamics::ShapePtr shape, |
| 918 |
const std::string& name) -> dart::dynamics::ShapeNode* { |
| 919 |
return self->createShapeNode(shape, name); |
| 920 |
}, |
| 921 |
::py::return_value_policy::reference_internal, |
| 922 |
::py::arg("shape"), |
| 923 |
::py::arg("name")) |
| 924 |
.def( |
| 925 |
"getShapeNodes", |
| 926 |
+[](dart::dynamics::BodyNode* self) |
| 927 |
-> const std::vector<dart::dynamics::ShapeNode*> { |
| 928 |
DART_SUPPRESS_DEPRECATED_BEGIN |
| 929 |
return self->getShapeNodes(); |
| 930 |
DART_SUPPRESS_DEPRECATED_END |
| 931 |
}, |
| 932 |
::py::return_value_policy::reference_internal) |
| 933 |
.def( |
| 934 |
"removeAllShapeNodes", |
| 935 |
+[](dart::dynamics::BodyNode* self) { self->removeAllShapeNodes(); }) |
| 936 |
.def( |
| 937 |
"getNumEndEffectors", |
| 938 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 939 |
return self->getNumEndEffectors(); |
| 940 |
}) |
| 941 |
.def( |
| 942 |
"getNumMarkers", |
| 943 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 944 |
return self->getNumMarkers(); |
| 945 |
}) |
| 946 |
.def( |
| 947 |
"dependsOn", |
| 948 |
+[](const dart::dynamics::BodyNode* self, std::size_t _genCoordIndex) |
| 949 |
-> bool { return self->dependsOn(_genCoordIndex); }, |
| 950 |
::py::arg("genCoordIndex")) |
| 951 |
.def( |
| 952 |
"getNumDependentGenCoords", |
| 953 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 954 |
return self->getNumDependentGenCoords(); |
| 955 |
}) |
| 956 |
.def( |
| 957 |
"getDependentGenCoordIndex", |
| 958 |
+[](const dart::dynamics::BodyNode* self, |
| 959 |
std::size_t _arrayIndex) -> std::size_t { |
| 960 |
return self->getDependentGenCoordIndex(_arrayIndex); |
| 961 |
}, |
| 962 |
::py::arg("arrayIndex")) |
| 963 |
.def( |
| 964 |
"getNumDependentDofs", |
| 965 |
+[](const dart::dynamics::BodyNode* self) -> std::size_t { |
| 966 |
return self->getNumDependentDofs(); |
| 967 |
}) |
| 968 |
.def( |
| 969 |
"getChainDofs", |
| 970 |
+[](const dart::dynamics::BodyNode* self) |
| 971 |
-> const std::vector<const dart::dynamics::DegreeOfFreedom*> { |
| 972 |
return self->getChainDofs(); |
| 973 |
}) |
| 974 |
.def( |
| 975 |
"addExtForce", |
| 976 |
+[](dart::dynamics::BodyNode* self, const Eigen::Vector3d& _force) { |
| 977 |
self->addExtForce(_force); |
| 978 |
}, |
| 979 |
::py::arg("force")) |
| 980 |
.def( |
| 981 |
"addExtForce", |
| 982 |
+[](dart::dynamics::BodyNode* self, |
| 983 |
const Eigen::Vector3d& _force, |
| 984 |
const Eigen::Vector3d& _offset) { |
| 985 |
self->addExtForce(_force, _offset); |
| 986 |
}, |
| 987 |
::py::arg("force"), |
| 988 |
::py::arg("offset")) |
| 989 |
.def( |
| 990 |
"addExtForce", |
| 991 |
+[](dart::dynamics::BodyNode* self, |
| 992 |
const Eigen::Vector3d& _force, |
| 993 |
const Eigen::Vector3d& _offset, |
| 994 |
bool _isForceLocal) { |
| 995 |
self->addExtForce(_force, _offset, _isForceLocal); |
| 996 |
}, |
| 997 |
::py::arg("force"), |
| 998 |
::py::arg("offset"), |
| 999 |
::py::arg("isForceLocal")) |
| 1000 |
.def( |
| 1001 |
"addExtForce", |
| 1002 |
+[](dart::dynamics::BodyNode* self, |
| 1003 |
const Eigen::Vector3d& _force, |
| 1004 |
const Eigen::Vector3d& _offset, |
| 1005 |
bool _isForceLocal, |
| 1006 |
bool _isOffsetLocal) { |
| 1007 |
self->addExtForce(_force, _offset, _isForceLocal, _isOffsetLocal); |
| 1008 |
}, |
| 1009 |
::py::arg("force"), |
| 1010 |
::py::arg("offset"), |
| 1011 |
::py::arg("isForceLocal"), |
| 1012 |
::py::arg("isOffsetLocal")) |
| 1013 |
.def( |
| 1014 |
"setExtForce", |
| 1015 |
+[](dart::dynamics::BodyNode* self, const Eigen::Vector3d& _force) { |
| 1016 |
self->setExtForce(_force); |
| 1017 |
}, |
| 1018 |
::py::arg("force")) |
| 1019 |
.def( |
| 1020 |
"setExtForce", |
| 1021 |
+[](dart::dynamics::BodyNode* self, |
| 1022 |
const Eigen::Vector3d& _force, |
| 1023 |
const Eigen::Vector3d& _offset) { |
| 1024 |
self->setExtForce(_force, _offset); |
| 1025 |
}, |
| 1026 |
::py::arg("force"), |
| 1027 |
::py::arg("offset")) |
| 1028 |
.def( |
| 1029 |
"setExtForce", |
| 1030 |
+[](dart::dynamics::BodyNode* self, |
| 1031 |
const Eigen::Vector3d& _force, |
| 1032 |
const Eigen::Vector3d& _offset, |
| 1033 |
bool _isForceLocal) { |
| 1034 |
self->setExtForce(_force, _offset, _isForceLocal); |
| 1035 |
}, |
| 1036 |
::py::arg("force"), |
| 1037 |
::py::arg("offset"), |
| 1038 |
::py::arg("isForceLocal")) |
| 1039 |
.def( |
| 1040 |
"setExtForce", |
| 1041 |
+[](dart::dynamics::BodyNode* self, |
| 1042 |
const Eigen::Vector3d& _force, |
| 1043 |
const Eigen::Vector3d& _offset, |
| 1044 |
bool _isForceLocal, |
| 1045 |
bool _isOffsetLocal) { |
| 1046 |
self->setExtForce(_force, _offset, _isForceLocal, _isOffsetLocal); |
| 1047 |
}, |
| 1048 |
::py::arg("force"), |
| 1049 |
::py::arg("offset"), |
| 1050 |
::py::arg("isForceLocal"), |
| 1051 |
::py::arg("isOffsetLocal")) |
| 1052 |
.def( |
| 1053 |
"addExtTorque", |
| 1054 |
+[](dart::dynamics::BodyNode* self, const Eigen::Vector3d& _torque) { |
| 1055 |
self->addExtTorque(_torque); |
| 1056 |
}, |
| 1057 |
::py::arg("torque")) |
| 1058 |
.def( |
| 1059 |
"addExtTorque", |
| 1060 |
+[](dart::dynamics::BodyNode* self, |
| 1061 |
const Eigen::Vector3d& _torque, |
| 1062 |
bool _isLocal) { self->addExtTorque(_torque, _isLocal); }, |
| 1063 |
::py::arg("torque"), |
| 1064 |
::py::arg("isLocal")) |
| 1065 |
.def( |
| 1066 |
"setExtTorque", |
| 1067 |
+[](dart::dynamics::BodyNode* self, const Eigen::Vector3d& _torque) { |
| 1068 |
self->setExtTorque(_torque); |
| 1069 |
}, |
| 1070 |
::py::arg("torque")) |
| 1071 |
.def( |
| 1072 |
"setExtTorque", |
| 1073 |
+[](dart::dynamics::BodyNode* self, |
| 1074 |
const Eigen::Vector3d& _torque, |
| 1075 |
bool _isLocal) { self->setExtTorque(_torque, _isLocal); }, |
| 1076 |
::py::arg("torque"), |
| 1077 |
::py::arg("isLocal")) |
| 1078 |
.def( |
| 1079 |
"clearExternalForces", |
| 1080 |
+[](dart::dynamics::BodyNode* self) { self->clearExternalForces(); }) |
| 1081 |
.def( |
| 1082 |
"clearInternalForces", |
| 1083 |
+[](dart::dynamics::BodyNode* self) { self->clearInternalForces(); }) |
| 1084 |
.def( |
| 1085 |
"getExternalForceGlobal", |
| 1086 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector6d { |
| 1087 |
return self->getExternalForceGlobal(); |
| 1088 |
}) |
| 1089 |
.def( |
| 1090 |
"getBodyForce", |
| 1091 |
&dart::dynamics::BodyNode::getBodyForce, |
| 1092 |
"Get spatial body force transmitted from the parent joint. \n\nThe " |
| 1093 |
"spatial body force is transmitted to this BodyNode from the parent " |
| 1094 |
"body through the connecting joint. It is expressed in this " |
| 1095 |
"BodyNode's frame.") |
| 1096 |
.def( |
| 1097 |
"isReactive", |
| 1098 |
+[](const dart::dynamics::BodyNode* self) |
| 1099 |
-> bool { return self->isReactive(); }) |
| 1100 |
.def( |
| 1101 |
"setConstraintImpulse", |
| 1102 |
+[](dart::dynamics::BodyNode* self, |
| 1103 |
const Eigen::Vector6d& _constImp) { |
| 1104 |
self->setConstraintImpulse(_constImp); |
| 1105 |
}, |
| 1106 |
::py::arg("constImp")) |
| 1107 |
.def( |
| 1108 |
"addConstraintImpulse", |
| 1109 |
+[](dart::dynamics::BodyNode* self, |
| 1110 |
const Eigen::Vector6d& _constImp) { |
| 1111 |
self->addConstraintImpulse(_constImp); |
| 1112 |
}, |
| 1113 |
::py::arg("constImp")) |
| 1114 |
.def( |
| 1115 |
"addConstraintImpulse", |
| 1116 |
+[](dart::dynamics::BodyNode* self, |
| 1117 |
const Eigen::Vector3d& _constImp, |
| 1118 |
const Eigen::Vector3d& _offset) { |
| 1119 |
self->addConstraintImpulse(_constImp, _offset); |
| 1120 |
}, |
| 1121 |
::py::arg("constImp"), |
| 1122 |
::py::arg("offset")) |
| 1123 |
.def( |
| 1124 |
"addConstraintImpulse", |
| 1125 |
+[](dart::dynamics::BodyNode* self, |
| 1126 |
const Eigen::Vector3d& _constImp, |
| 1127 |
const Eigen::Vector3d& _offset, |
| 1128 |
bool _isImpulseLocal) { |
| 1129 |
self->addConstraintImpulse(_constImp, _offset, _isImpulseLocal); |
| 1130 |
}, |
| 1131 |
::py::arg("constImp"), |
| 1132 |
::py::arg("offset"), |
| 1133 |
::py::arg("isImpulseLocal")) |
| 1134 |
.def( |
| 1135 |
"addConstraintImpulse", |
| 1136 |
+[](dart::dynamics::BodyNode* self, |
| 1137 |
const Eigen::Vector3d& _constImp, |
| 1138 |
const Eigen::Vector3d& _offset, |
| 1139 |
bool _isImpulseLocal, |
| 1140 |
bool _isOffsetLocal) { |
| 1141 |
self->addConstraintImpulse( |
| 1142 |
_constImp, _offset, _isImpulseLocal, _isOffsetLocal); |
| 1143 |
}, |
| 1144 |
::py::arg("constImp"), |
| 1145 |
::py::arg("offset"), |
| 1146 |
::py::arg("isImpulseLocal"), |
| 1147 |
::py::arg("isOffsetLocal")) |
| 1148 |
.def( |
| 1149 |
"clearConstraintImpulse", |
| 1150 |
+[](dart::dynamics::BodyNode* |
| 1151 |
self) { self->clearConstraintImpulse(); }) |
| 1152 |
.def( |
| 1153 |
"computeLagrangian", |
| 1154 |
+[](const dart::dynamics::BodyNode* self, |
| 1155 |
const Eigen::Vector3d& gravity) -> double { |
| 1156 |
return self->computeLagrangian(gravity); |
| 1157 |
}, |
| 1158 |
::py::arg("gravity")) |
| 1159 |
.def( |
| 1160 |
"computeKineticEnergy", |
| 1161 |
+[](const dart::dynamics::BodyNode* self) -> double { |
| 1162 |
return self->computeKineticEnergy(); |
| 1163 |
}) |
| 1164 |
.def( |
| 1165 |
"computePotentialEnergy", |
| 1166 |
+[](const dart::dynamics::BodyNode* self, |
| 1167 |
const Eigen::Vector3d& gravity) -> double { |
| 1168 |
return self->computePotentialEnergy(gravity); |
| 1169 |
}, |
| 1170 |
::py::arg("gravity")) |
| 1171 |
.def( |
| 1172 |
"getLinearMomentum", |
| 1173 |
+[](const dart::dynamics::BodyNode* self) -> Eigen::Vector3d { |
| 1174 |
return self->getLinearMomentum(); |
| 1175 |
}) |
| 1176 |
.def( |
| 1177 |
"getAngularMomentum", |
| 1178 |
+[](dart::dynamics::BodyNode* self) -> Eigen::Vector3d { |
| 1179 |
return self->getAngularMomentum(); |
| 1180 |
}) |
| 1181 |
.def( |
| 1182 |
"getAngularMomentum", |
| 1183 |
+[](dart::dynamics::BodyNode* self, const Eigen::Vector3d& _pivot) |
| 1184 |
-> Eigen::Vector3d { return self->getAngularMomentum(_pivot); }, |
| 1185 |
::py::arg("pivot")) |
| 1186 |
.def( |
| 1187 |
"dirtyTransform", |
| 1188 |
+[](dart::dynamics::BodyNode* self) { self->dirtyTransform(); }) |
| 1189 |
.def( |
| 1190 |
"dirtyVelocity", |
| 1191 |
+[](dart::dynamics::BodyNode* self) { self->dirtyVelocity(); }) |
| 1192 |
.def( |
| 1193 |
"dirtyAcceleration", |
| 1194 |
+[](dart::dynamics::BodyNode* self) { self->dirtyAcceleration(); }) |
| 1195 |
.def( |
| 1196 |
"dirtyArticulatedInertia", |
| 1197 |
+[](dart::dynamics::BodyNode* |
| 1198 |
self) { self->dirtyArticulatedInertia(); }) |
| 1199 |
.def( |
| 1200 |
"dirtyExternalForces", |
| 1201 |
+[](dart::dynamics::BodyNode* self) { self->dirtyExternalForces(); }) |
| 1202 |
.def( |
| 1203 |
"dirtyCoriolisForces", |
| 1204 |
+[](dart::dynamics::BodyNode* self) { self->dirtyCoriolisForces(); }) |
| 1205 |
.def( |
| 1206 |
"setColor", |
| 1207 |
::py::overload_cast<const Eigen::Vector3d&>( |
| 1208 |
&dynamics::BodyNode::setColor), |
| 1209 |
::py::arg("color")) |
| 1210 |
.def( |
| 1211 |
"setColor", |
| 1212 |
::py::overload_cast<const Eigen::Vector4d&>( |
| 1213 |
&dynamics::BodyNode::setColor), |
| 1214 |
::py::arg("color")) |
| 1215 |
.def("setAlpha", &dynamics::BodyNode::setAlpha, ::py::arg("alpha")); |
| 1216 |
} |
| 1217 |
|
| 1218 |
} // namespace python |
| 1219 |
} // namespace dart |