| 257 | }; |
| 258 | |
| 259 | void setGeometry(const BodyNodePtr& bn) |
| 260 | { |
| 261 | // Create a BoxShape to be used for both visualization and collision checking |
| 262 | std::shared_ptr<BoxShape> box(new BoxShape( |
| 263 | Eigen::Vector3d(default_width, default_depth, default_height))); |
| 264 | |
| 265 | // Create a shape node for visualization and collision checking |
| 266 | auto shapeNode |
| 267 | = bn->createShapeNodeWith<VisualAspect, CollisionAspect, DynamicsAspect>( |
| 268 | box); |
| 269 | shapeNode->getVisualAspect()->setColor(dart::Color::Blue()); |
| 270 | |
| 271 | // Set the location of the shape node |
| 272 | Eigen::Isometry3d box_tf(Eigen::Isometry3d::Identity()); |
| 273 | Eigen::Vector3d center = Eigen::Vector3d(0, 0, default_height / 2.0); |
| 274 | box_tf.translation() = center; |
| 275 | shapeNode->setRelativeTransform(box_tf); |
| 276 | |
| 277 | // Move the center of mass to the center of the object |
| 278 | bn->setLocalCOM(center); |
| 279 | } |
| 280 | |
| 281 | BodyNode* makeRootBody(const SkeletonPtr& pendulum, const std::string& name) |
| 282 | { |
no test coverage detected