##

SimbodyCylinderShape.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _SIMBODY_CYLINDERSHAPE_HH_
#define _SIMBODY_CYLINDERSHAPE_HH_
#include "gazebo/physics/simbody/SimbodyPhysics.hh"
#include "gazebo/physics/CylinderShape.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class GZ_PHYSICS_VISIBLE SimbodyCylinderShape : public CylinderShape
{
public: explicit SimbodyCylinderShape(CollisionPtr _parent)
: CylinderShape(_parent) {}
public: virtual ~SimbodyCylinderShape() {}
// Documentation inherited
public: void SetSize(double _radius, double _length)
{
if (_radius < 0)
{
gzerr << "Cylinder shape does not support negative radius\n";
return;
}
if (_length < 0)
{
gzerr << "Cylinder shape does not support negative length\n";
return;
}
if (ignition::math::equal(_radius, 0.0))
{
// Warn user, but still create shape with very small value
// otherwise later resize operations using setLocalScaling
// will not be possible
gzwarn << "Setting cylinder shape's radius to zero \n";
_radius = 1e-4;
}
if (ignition::math::equal(_length, 0.0))
{
gzwarn << "Setting cylinder shape's length to zero \n";
_length = 1e-4;
}
CylinderShape::SetSize(_radius, _length);
SimbodyCollisionPtr bParent;
bParent = boost::dynamic_pointer_cast<SimbodyCollision>(
this->collisionParent);
// set collision shape
}
};
}
}
#endif
gazebo::physics::CylinderShape::SetSize
virtual void SetSize(double _radius, double _length)
Set the size of the cylinder.
gazebo::physics::SimbodyCylinderShape::SimbodyCylinderShape
SimbodyCylinderShape(CollisionPtr _parent)
Constructor.
Definition: SimbodyCylinderShape.hh:37
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::CylinderShape
Cylinder collision.
Definition: CylinderShape.hh:32
gzwarn
#define gzwarn
Output a warning message.
Definition: Console.hh:47
system.hh
gazebo::physics::SimbodyCylinderShape::~SimbodyCylinderShape
virtual ~SimbodyCylinderShape()
Destructor.
Definition: SimbodyCylinderShape.hh:41
gzerr
#define gzerr
Output an error message.
Definition: Console.hh:50
gazebo::physics::SimbodyCylinderShape::SetSize
void SetSize(double _radius, double _length)
Set the size of the cylinder.
Definition: SimbodyCylinderShape.hh:44
gazebo::physics::Shape::collisionParent
CollisionPtr collisionParent
This shape's collision parent.
Definition: Shape.hh:73
CylinderShape.hh
gazebo::physics::SimbodyCollisionPtr
boost::shared_ptr< SimbodyCollision > SimbodyCollisionPtr
Definition: SimbodyTypes.hh:44
gazebo::physics::CollisionPtr
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
gazebo::physics::SimbodyCylinderShape
Cylinder collision.
Definition: SimbodyCylinderShape.hh:34
SimbodyPhysics.hh