Class
List
Hierarchy
Modules
Common
Events
Math
Messages
Physics
Rendering
Sensors
Transport
Links
Gazebo Website
Wiki
Tutorials
Download
Report Documentation Issues
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
gazebo
physics
Contact.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012-2014 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: Specification of a contact
18
* Author: Nate Koenig
19
* Date: 10 Nov 2009
20
*/
21
22
#ifndef _CONTACT_HH_
23
#define _CONTACT_HH_
24
25
#include <vector>
26
#include <string>
27
28
#include "
gazebo/msgs/msgs.hh
"
29
30
#include "
gazebo/physics/PhysicsTypes.hh
"
31
#include "
gazebo/common/Time.hh
"
32
#include "
gazebo/math/Vector3.hh
"
33
#include "
gazebo/physics/JointWrench.hh
"
34
35
// For the sake of efficiency, use fixed size arrays for collision
36
// MAX_COLLIDE_RETURNS limits contact detection, needs to be large
37
// for proper contact dynamics.
38
// MAX_CONTACT_JOINTS truncates <max_contacts> specified in SDF
39
#define MAX_COLLIDE_RETURNS 250
40
#define MAX_CONTACT_JOINTS 32
41
42
namespace
gazebo
43
{
44
namespace
physics
45
{
46
class
Collision;
49
53
class
Contact
54
{
56
public
:
Contact
();
57
60
public
:
Contact
(
const
Contact
&_contact);
61
63
public
:
virtual
~Contact
();
64
68
public
:
Contact
&
operator =
(
const
Contact
&_contact);
69
73
public
:
Contact
&
operator =
(
const
msgs::Contact &_contact);
74
77
public
:
void
FillMsg
(msgs::Contact &_msg)
const
;
78
81
public
: std::string
DebugString
()
const
;
82
84
public
:
void
Reset
();
85
87
public
:
Collision
*
collision1
;
88
90
public
:
Collision
*
collision2
;
91
95
public
:
JointWrench
wrench
[
MAX_CONTACT_JOINTS
];
96
98
public
:
math::Vector3
positions
[
MAX_CONTACT_JOINTS
];
99
101
public
:
math::Vector3
normals
[
MAX_CONTACT_JOINTS
];
102
104
public
:
double
depths
[
MAX_CONTACT_JOINTS
];
105
107
public
:
int
count
;
108
110
public
:
common::Time
time
;
111
113
public
:
WorldPtr
world
;
114
};
116
}
117
}
118
#endif