| 323 | }; |
| 324 | |
| 325 | void setGeometry(const BodyNodePtr& bn) |
| 326 | { |
| 327 | // Create a BoxShape to be used for both visualization and collision checking |
| 328 | std::shared_ptr<BoxShape> box(new BoxShape( |
| 329 | Eigen::Vector3d(default_width, default_depth, default_height))); |
| 330 | |
| 331 | // Create a shape node for visualization and collision checking |
| 332 | auto shapeNode |
| 333 | = bn->createShapeNodeWith<VisualAspect, CollisionAspect, DynamicsAspect>( |
| 334 | box); |
| 335 | shapeNode->getVisualAspect()->setColor(dart::Color::Blue()); |
| 336 | |
| 337 | // Set the location of the shape node |
| 338 | Eigen::Isometry3d box_tf(Eigen::Isometry3d::Identity()); |
| 339 | Eigen::Vector3d center = Eigen::Vector3d(0, 0, default_height / 2.0); |
| 340 | box_tf.translation() = center; |
| 341 | shapeNode->setRelativeTransform(box_tf); |
| 342 | |
| 343 | // Move the center of mass to the center of the object |
| 344 | bn->setLocalCOM(center); |
| 345 | } |
| 346 | |
| 347 | BodyNode* makeRootBody(const SkeletonPtr& pendulum, const std::string& name) |
| 348 | { |
no test coverage detected