All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ContactManager.hh
Go to the documentation of this file.
1 /*
2  * Copyright 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 
18 #ifndef _CONTACTMANAGER_HH_
19 #define _CONTACTMANAGER_HH_
20 
21 #include <vector>
22 
24 
27 
28 namespace gazebo
29 {
30  namespace physics
31  {
34 
39  {
41  public: ContactManager();
42 
44  public: virtual ~ContactManager();
45 
51  public: void Init(WorldPtr _world);
52 
65  public: Contact *NewContact(Collision *_collision1,
66  Collision *_collision2,
67  const common::Time &_time);
68 
70  public: unsigned int GetContactCount() const;
71 
76  public: Contact *GetContact(unsigned int _index) const;
77 
83  public: const std::vector<Contact*> &GetContacts() const;
84 
86  public: void Clear();
87 
89  public: void PublishContacts();
90 
92  public: void ResetCount();
93 
94  private: std::vector<Contact*> contacts;
95 
96  private: unsigned int contactIndex;
97 
99  private: transport::NodePtr node;
100 
102  private: transport::PublisherPtr contactPub;
103 
105  private: WorldPtr world;
106  };
108  }
109 }
110 #endif