18 #ifndef _GAZEBO_DARTCYLINDERSHAPE_HH_
19 #define _GAZEBO_DARTCYLINDERSHAPE_HH_
43 public:
void SetSize(
double _radius,
double _length)
47 gzerr <<
"Cylinder shape does not support negative radius\n";
53 gzerr <<
"Cylinder shape does not support negative length\n";
62 gzwarn <<
"Setting cylinder shape's radius to zero not supported "
63 <<
"in DART, using 1e-4.\n";
69 gzwarn <<
"Setting cylinder shape's length to zero not supported "
70 <<
"in DART, using 1e-4.\n";
77 boost::dynamic_pointer_cast<
DARTCollision>(this->collisionParent);
79 if (dartCollisionParent->GetDARTCollisionShape() ==
NULL)
81 dart::dynamics::BodyNode *dtBodyNode =
83 dart::dynamics::CylinderShape *dtCylinderShape =
84 new dart::dynamics::CylinderShape(_radius, _length);
85 dtBodyNode->addCollisionShape(dtCylinderShape);
86 dartCollisionParent->SetDARTCollisionShape(dtCylinderShape);
90 dart::dynamics::CylinderShape *dtCylinderShape =
91 dynamic_cast<dart::dynamics::CylinderShape*
>(
92 dartCollisionParent->GetDARTCollisionShape());
93 dtCylinderShape->setRadius(_radius);
94 dtCylinderShape->setHeight(_length);
Cylinder collision.
Definition: CylinderShape.hh:37
virtual void SetSize(double _radius, double _length)
Set the size of the cylinder.
#define gzwarn
Output a warning message.
Definition: Console.hh:46
DARTCylinderShape(CollisionPtr _parent)
Constructor.
Definition: DARTCylinderShape.hh:36
#define gzerr
Output an error message.
Definition: Console.hh:49
bool equal(const T &_a, const T &_b, const T &_epsilon=1e-6)
check if two values are equal, within a tolerance
Definition: Helpers.hh:168
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:94
void SetSize(double _radius, double _length)
Set the size of the cylinder.
Definition: DARTCylinderShape.hh:43
Base class for all DART collisions.
Definition: DARTCollision.hh:34
DART cylinder shape.
Definition: DARTCylinderShape.hh:32
dart::dynamics::BodyNode * GetDARTBodyNode() const
Get DART body node.
virtual ~DARTCylinderShape()
Destructor.
Definition: DARTCylinderShape.hh:40
#define NULL
Definition: CommonTypes.hh:30
boost::shared_ptr< DARTCollision > DARTCollisionPtr
Definition: DARTTypes.hh:45
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48