Go to the documentation of this file.
17 #ifndef GAZEBO_PHYSICS_COLLISION_HH_
18 #define GAZEBO_PHYSICS_COLLISION_HH_
48 public:
virtual void Fini()
override;
52 public:
virtual void Load(sdf::ElementPtr _sdf)
override;
55 public:
virtual void Init()
override;
59 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf)
override;
64 public:
void SetCollision(
bool _placeable);
68 public:
void SetPlaceable(
const bool _placeable);
73 public:
bool IsPlaceable()
const;
77 public:
virtual void SetCategoryBits(
unsigned int _bits) = 0;
81 public:
virtual void SetCollideBits(
unsigned int _bits) = 0;
85 public:
void SetLaserRetro(
float _retro);
89 public:
float GetLaserRetro()
const;
93 public:
LinkPtr GetLink()
const;
101 public:
virtual ignition::math::AxisAlignedBox BoundingBox()
const
107 public:
unsigned int GetShapeType()
const;
111 public:
void SetShape(
ShapePtr _shape);
119 public:
void SetScale(
const ignition::math::Vector3d &_scale);
123 public:
virtual ignition::math::Vector3d RelativeLinearVel()
const
129 public:
virtual ignition::math::Vector3d WorldLinearVel()
const
134 public:
virtual ignition::math::Vector3d RelativeAngularVel()
const
139 public:
virtual ignition::math::Vector3d WorldAngularVel()
const
144 public:
virtual ignition::math::Vector3d RelativeLinearAccel()
const
150 public:
virtual ignition::math::Vector3d WorldLinearAccel()
const
155 public:
virtual ignition::math::Vector3d RelativeAngularAccel()
const
161 public:
virtual ignition::math::Vector3d WorldAngularAccel()
const
174 public:
void FillMsg(msgs::Collision &_msg);
178 public:
void ProcessMsg(
const msgs::Collision &_msg);
183 {
return this->surface;}
188 public:
virtual void SetMaxContacts(
unsigned int _maxContacts);
193 public:
virtual unsigned int GetMaxContacts();
198 public:
void SetWorldPoseDirty();
201 public:
virtual const ignition::math::Pose3d &WorldPose()
const
205 public:
virtual std::optional<sdf::SemanticPose> SDFSemanticPose()
210 private: msgs::Visual CreateCollisionVisual();
225 private:
float laserRetro = 0.0;
231 private:
unsigned int maxContacts;
234 private: uint32_t collisionVisualId;
237 private:
mutable bool worldPoseDirty;
240 private:
const sdf::Collision *collisionSDFDom =
nullptr;
virtual unsigned int GetMaxContacts()
returns number of contacts allowed for this collision.
void SetCollision(bool _placeable)
Set the encapsulated collision object.
LinkPtr GetLink() const
Get the link this collision belongs to.
void SetShape(ShapePtr _shape)
Set the shape for this collision.
ShapePtr GetShape() const
Get the collision shape.
Base class for all collision entities.
Definition: Collision.hh:38
Forward declarations for the common classes.
Definition: Animation.hh:26
virtual void Init() override
Initialize the collision.
CollisionState GetState()
Get the collision state.
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:94
SurfaceParamsPtr surface
The surface parameters.
Definition: Collision.hh:222
bool placeable
Flag for placeable.
Definition: Collision.hh:216
virtual std::optional< sdf::SemanticPose > SDFSemanticPose() const override
Get the SDF SemanticPose object associated with the pose of this object.
SurfaceParamsPtr GetSurface() const
Get the surface parameters.
Definition: Collision.hh:182
Collision(LinkPtr _link)
Constructor.
LinkPtr link
The link this collision belongs to.
Definition: Collision.hh:213
virtual void SetMaxContacts(unsigned int _maxContacts)
Number of contacts allowed for this collision.
virtual ~Collision()
Destructor.
virtual ignition::math::Vector3d RelativeLinearAccel() const override
Get the linear acceleration of the collision.
virtual const ignition::math::Pose3d & WorldPose() const override
Get the absolute pose of the entity.
virtual ignition::math::Vector3d RelativeAngularVel() const override
Get the angular velocity of the collision.
virtual ignition::math::AxisAlignedBox BoundingBox() const override=0
Get the bounding box for this collision.
void SetWorldPoseDirty()
Indicate that the world pose should be recalculated.
void SetState(const CollisionState &_state)
Set the current collision state.
default namespace for gazebo
Store state information of a physics::Collision object.
Definition: CollisionState.hh:43
float GetLaserRetro() const
Get the laser retro reflectiveness.
virtual ignition::math::Vector3d WorldLinearAccel() const override
Get the linear acceleration of the collision in the world frame.
virtual ignition::math::Vector3d RelativeAngularAccel() const override
Get the angular acceleration of the collision.
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:142
virtual ignition::math::Vector3d WorldAngularVel() const override
Get the angular velocity of the collision in the world frame.
virtual ignition::math::Vector3d WorldLinearVel() const override
Get the linear velocity of the collision in the world frame.
void SetLaserRetro(float _retro)
Set the laser retro reflectiveness.
void SetPlaceable(const bool _placeable)
Set if this object is moveable.
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:110
void ProcessMsg(const msgs::Collision &_msg)
Update parameters from a message.
Base class for all physics objects in Gazebo.
Definition: Entity.hh:52
ModelPtr GetModel() const
Get the model this collision belongs to.
void FillMsg(msgs::Collision &_msg)
Fill a collision message.
virtual void SetCollideBits(unsigned int _bits)=0
Set the collide bits, used during collision detection.
boost::shared_ptr< SurfaceParams > SurfaceParamsPtr
Definition: PhysicsTypes.hh:170
virtual void Load(sdf::ElementPtr _sdf) override
Load the collision.
ShapePtr shape
Pointer to physics::Shape.
Definition: Collision.hh:219
virtual void UpdateParameters(sdf::ElementPtr _sdf) override
Update the parameters using new sdf values.
unsigned int GetShapeType() const
Get the shape type.
virtual void SetCategoryBits(unsigned int _bits)=0
Set the category bits, used during collision detection.
virtual ignition::math::Vector3d RelativeLinearVel() const override
Get the linear velocity of the collision.
virtual void Fini() override
Finalize the collision.
bool IsPlaceable() const
Return whether this collision is movable.
void SetScale(const ignition::math::Vector3d &_scale)
Set the scale of the collision.
virtual ignition::math::Vector3d WorldAngularAccel() const override
Get the angular acceleration of the collision in the world frame.