Gazebo Msgs

API Reference

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