Ignition Gazebo

API Reference

6.0.0~pre1
include/ignition/gazebo/components/DetachableJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 IGNITION_GAZEBO_COMPONENTS_DETACHABLE_JOINT_HH_
18 #define IGNITION_GAZEBO_COMPONENTS_DETACHABLE_JOINT_HH_
19 
20 #include <string>
24 #include <ignition/gazebo/config.hh>
25 
26 namespace ignition
27 {
28 namespace gazebo
29 {
30 // Inline bracket to help doxygen filtering.
31 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
32 namespace components
33 {
36  struct DetachableJointInfo
37  {
42  // \brief Type of joint. Only the "fixed" joint type is currently supported.
43  std::string jointType = {"fixed"};
44 
45  public: bool operator==(const DetachableJointInfo &_info) const
46  {
47  return (this->parentLink == _info.parentLink) &&
48  (this->childLink == _info.childLink) &&
49  (this->jointType == _info.jointType);
50  }
51 
52  public: bool operator!=(const DetachableJointInfo &_info) const
53  {
54  return !(*this == _info);
55  }
56  };
57 }
58 
59 namespace serializers
60 {
63  {
68  public: static std::ostream &Serialize(
69  std::ostream &_out,
71  {
72  _out << _info.parentLink << " " << _info.childLink << " "
73  << _info.jointType;
74  return _out;
75  }
76 
81  public: static std::istream &Deserialize(
83  {
84  _in >> _info.parentLink >> _info.childLink >> _info.jointType;
85  return _in;
86  }
87  };
88 }
89 
90 namespace components
91 {
94  using DetachableJoint =
95  Component<DetachableJointInfo, class DetachableJointTag,
96  serializers::DetachableJointInfoSerializer>;
97  IGN_GAZEBO_REGISTER_COMPONENT("ign_gazebo_components.DetachableJoint",
98  DetachableJoint)
99 }
100 }
101 }
102 }
103 
104 #endif
105 
Entity childLink
Entity of the echild link.
Definition: include/ignition/gazebo/components/DetachableJoint.hh:41
bool operator!=(const DetachableJointInfo &_info) const
Definition: include/ignition/gazebo/components/DetachableJoint.hh:52
Entity parentLink
Entity of the parent link.
Definition: include/ignition/gazebo/components/DetachableJoint.hh:39
Data structure to hold information about the parent and child links connected by a detachable joint...
Definition: include/ignition/gazebo/components/DetachableJoint.hh:36
static std::ostream & Serialize(std::ostream &_out, const components::DetachableJointInfo &_info)
Serialization for DetachableJointInfo.
Definition: include/ignition/gazebo/components/DetachableJoint.hh:68
bool operator==(const DetachableJointInfo &_info) const
Definition: include/ignition/gazebo/components/DetachableJoint.hh:45
STL class.
STL class.
static std::istream & Deserialize(std::istream &_in, components::DetachableJointInfo &_info)
Deserialization for std::set<std::string>.
Definition: include/ignition/gazebo/components/DetachableJoint.hh:81
#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname)
Static component registration macro.
Definition: Factory.hh:373
Component< DetachableJointInfo, class DetachableJointTag, serializers::DetachableJointInfoSerializer > DetachableJoint
A component that identifies an entity as being a detachable joint. It also contains additional inform...
Definition: include/ignition/gazebo/components/DetachableJoint.hh:96
Serializer for DetachableJointInfo object.
Definition: include/ignition/gazebo/components/DetachableJoint.hh:62
std::string jointType
Definition: include/ignition/gazebo/components/DetachableJoint.hh:43
This library is part of the Ignition Robotics project.
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light. At its core, an Entity is just an identifier.
Definition: Entity.hh:59
STL class.