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 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: 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/common/Time.hh
"
31
#include "
gazebo/math/Vector3.hh
"
32
#include "
gazebo/physics/JointWrench.hh
"
33
34
// For the sake of efficiency, use fixed size arrays for collision
35
// MAX_COLLIDE_RETURNS limits contact detection, needs to be large
36
// for proper contact dynamics.
37
// MAX_CONTACT_JOINTS truncates <max_contacts> specified in SDF
38
#define MAX_COLLIDE_RETURNS 250
39
#define MAX_CONTACT_JOINTS 32
40
41
namespace
gazebo
42
{
43
namespace
physics
44
{
47
51
class
Contact
52
{
54
public
:
Contact
();
55
58
public
:
Contact
(
const
Contact
&_contact);
59
61
public
:
virtual
~Contact
();
62
66
public
:
Contact
&
operator =
(
const
Contact
&_contact);
67
71
public
:
Contact
&
operator =
(
const
msgs::Contact &_contact);
72
75
public
:
void
FillMsg
(msgs::Contact &_msg)
const
;
76
79
public
: std::string
DebugString
()
const
;
80
82
public
:
void
Reset
();
83
85
public
: std::string
collision1
;
86
88
public
: std::string
collision2
;
89
93
public
:
JointWrench
wrench
[
MAX_CONTACT_JOINTS
];
94
96
public
:
math::Vector3
positions
[
MAX_CONTACT_JOINTS
];
97
99
public
:
math::Vector3
normals
[
MAX_CONTACT_JOINTS
];
100
102
public
:
double
depths
[
MAX_CONTACT_JOINTS
];
103
105
public
:
int
count
;
106
108
public
:
common::Time
time
;
109
};
111
}
112
}
113
#endif