Gazebo Sim
API Reference
8.9.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-sim
include
gz
sim
components
RaycastData.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2024 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 GZ_SIM_COMPONENTS_RAYCASTDATA_HH_
19
#define GZ_SIM_COMPONENTS_RAYCASTDATA_HH_
20
21
#include <gz/math/Vector3.hh>
22
#include <
gz/sim/components/Factory.hh
>
23
#include <
gz/sim/components/Component.hh
>
24
#include <
gz/sim/components/Serialization.hh
>
25
#include <gz/sim/config.hh>
26
27
#include <istream>
28
#include <ostream>
29
#include <vector>
30
31
namespace
gz
32
{
33
namespace
sim
34
{
35
// Inline bracket to help doxygen filtering.
36
inline
namespace
GZ_SIM_VERSION_NAMESPACE {
37
namespace
components
38
{
40
struct
RayInfo
41
{
43
gz::math::Vector3d
start
;
44
46
gz::math::Vector3d
end
;
47
};
48
50
struct
RaycastResultInfo
51
{
53
gz::math::Vector3d
point
;
54
56
double
fraction
;
57
59
gz::math::Vector3d
normal
;
60
};
61
63
struct
RaycastDataInfo
64
{
66
std::vector<RayInfo>
rays
;
67
69
std::vector<RaycastResultInfo>
results
;
70
};
71
}
72
73
namespace
serializers
74
{
76
template
<>
class
DefaultSerializer
<components::RaycastDataInfo>
77
{
78
public
:
static
std::ostream
&
Serialize
(
79
std::ostream
&_out,
const
components::RaycastDataInfo
&)
80
{
81
return
_out;
82
}
83
84
public
:
static
std::istream
&
Deserialize
(
85
std::istream
&_in,
components::RaycastDataInfo
&)
86
{
87
return
_in;
88
}
89
};
90
}
91
92
namespace
components
93
{
100
using
RaycastData
=
Component
<
RaycastDataInfo
,
class
RaycastDataTag,
101
serializers::DefaultSerializer<RaycastDataInfo>>;
102
103
GZ_SIM_REGISTER_COMPONENT
("gz_sim_components.RaycastData", RaycastData)
104
}
105
}
106
}
107
}
108
#endif
// GZ_SIM_COMPONENTS_RAYCASTDATA_HH_