Gazebo Msgs

API Reference

11.0.1
Plane.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 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#ifndef GZ_MSGS_CONVERT_PLANE_HH_
18#define GZ_MSGS_CONVERT_PLANE_HH_
19
20#include <gz/msgs/config.hh>
23
24// Message Headers
25#include "gz/msgs/planegeom.pb.h"
26
27// Data Headers
28#include <gz/math/Plane.hh>
29
30namespace gz::msgs {
31// Inline bracket to help doxygen filtering.
32inline namespace GZ_MSGS_VERSION_NAMESPACE {
33
35inline void Set(gz::msgs::PlaneGeom *_msg, const gz::math::Planed &_data)
36{
37 Set(_msg->mutable_normal(), _data.Normal());
38 _msg->mutable_size()->set_x(_data.Size().X());
39 _msg->mutable_size()->set_y(_data.Size().Y());
40 _msg->set_d(_data.Offset());
41}
42
43inline void Set(gz::math::Planed *_data, const gz::msgs::PlaneGeom &_msg)
44{
45 _data->Set(
46 Convert(_msg.normal()),
47 Convert(_msg.size()),
48 _msg.d()
49 );
50}
51
52inline gz::msgs::PlaneGeom Convert(const gz::math::Planed &_data)
53{
54 gz::msgs::PlaneGeom ret;
55 Set(&ret, _data);
56 return ret;
57}
58
59inline gz::math::Planed Convert(const gz::msgs::PlaneGeom &_msg)
60{
62 Set(&ret, _msg);
63 return ret;
64}
65} // namespce
66} // namespace gz::msgs
67
68#endif // GZ_MSGS_CONVERT_VECTOR3_HH_