CollisionState.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 /* Desc: A collision state
18  * Author: Nate Koenig
19  */
20 
21 #ifndef GAZEBO_PHYSICS_COLLISIONSTATE_HH_
22 #define GAZEBO_PHYSICS_COLLISIONSTATE_HH_
23 
24 #include <ignition/math/Pose3.hh>
25 
26 #include "gazebo/physics/State.hh"
27 #include "gazebo/math/Pose.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
36 
44  class GZ_PHYSICS_VISIBLE CollisionState : public State
45  {
47  public: CollisionState();
48 
54  public: explicit CollisionState(const CollisionPtr _collision);
55 
60  public: explicit CollisionState(const sdf::ElementPtr _sdf);
61 
63  public: virtual ~CollisionState();
64 
69  public: virtual void Load(const sdf::ElementPtr _elem);
70 
74  public: const math::Pose GetPose() const GAZEBO_DEPRECATED(8.0);
75 
78  public: const ignition::math::Pose3d &Pose() const;
79 
82  public: bool IsZero() const;
83 
86  public: void FillSDF(sdf::ElementPtr _sdf);
87 
91  public: CollisionState &operator=(const CollisionState &_state);
92 
96  public: CollisionState operator-(const CollisionState &_state) const;
97 
101  public: CollisionState operator+(const CollisionState &_state) const;
102 
107  public: inline friend std::ostream &operator<<(std::ostream &_out,
108  const gazebo::physics::CollisionState &_state)
109  {
110  _out << "<collision name='" << _state.name << "'>"
111  << "<pose>" << _state.pose << "</pose>";
112  _out << "</collision>";
113 
114  return _out;
115  }
116 
118  private: ignition::math::Pose3d pose;
119  };
121  }
122 }
123 #endif
std::string name
Name associated with this State.
Definition: State.hh:130
Encapsulates a position and rotation in three space.
Definition: Pose.hh:42
State of an entity.
Definition: State.hh:49
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::CollisionState &_state)
Stream insertion operator.
Definition: CollisionState.hh:107
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
Store state information of a physics::Collision object.
Definition: CollisionState.hh:44
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113