17 #ifndef _GAZEBO_DARTSPHERESHAPE_HH_
18 #define _GAZEBO_DARTSPHERESHAPE_HH_
46 gzerr <<
"Sphere shape does not support negative radius.\n";
54 gzwarn <<
"Setting sphere shape's radius to zero is not supported "
55 <<
"in DART, using 1e-4.\n";
62 boost::dynamic_pointer_cast<
DARTCollision>(this->collisionParent);
64 if (dartCollisionParent->GetDARTCollisionShape() ==
NULL)
66 dart::dynamics::BodyNode *dtBodyNode =
68 dart::dynamics::EllipsoidShape *dtEllisoidShape =
69 new dart::dynamics::EllipsoidShape(Eigen::Vector3d(_radius*2.0,
72 dtBodyNode->addCollisionShape(dtEllisoidShape);
73 dartCollisionParent->SetDARTCollisionShape(dtEllisoidShape);
77 dart::dynamics::EllipsoidShape *dtEllipsoidShape =
78 dynamic_cast<dart::dynamics::EllipsoidShape*
>(
79 dartCollisionParent->GetDARTCollisionShape());
80 dtEllipsoidShape->setSize(Eigen::Vector3d(_radius*2.0,
#define gzwarn
Output a warning message.
Definition: Console.hh:46
#define gzerr
Output an error message.
Definition: Console.hh:49
default namespace for gazebo
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
Base class for all DART collisions.
Definition: DARTCollision.hh:34
dart::dynamics::BodyNode * GetDARTBodyNode() const
Get DART body node.
virtual void SetRadius(double _radius)
Set the size.
Definition: DARTSphereShape.hh:42
#define NULL
Definition: CommonTypes.hh:30
virtual ~DARTSphereShape()
Destructor.
Definition: DARTSphereShape.hh:39
DARTSphereShape(DARTCollisionPtr _parent)
Constructor.
Definition: DARTSphereShape.hh:35
boost::shared_ptr< DARTCollision > DARTCollisionPtr
Definition: DARTTypes.hh:45
virtual void SetRadius(double _radius)
Set the size.
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
A DART sphere shape.
Definition: DARTSphereShape.hh:31
Sphere collision shape.
Definition: SphereShape.hh:38