Gazebo Gazebo

API Reference

6.16.0
include/gz/sim/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 GZ_GAZEBO_COMPONENTS_DETACHABLE_JOINT_HH_
18 #define GZ_GAZEBO_COMPONENTS_DETACHABLE_JOINT_HH_
19 
20 #include <string>
21 #include <gz/sim/Entity.hh>
24 #include <gz/sim/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 {
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 
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:58
This library is part of the Gazebo project.
STL class.
bool operator==(const DetachableJointInfo &_info) const
Definition: include/gz/sim/components/DetachableJoint.hh:45
#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname)
Static component registration macro.
Definition: gz/sim/components/Factory.hh:509
static std::istream & Deserialize(std::istream &_in, components::DetachableJointInfo &_info)
Deserialization for std::set<std::string>.
Definition: include/gz/sim/components/DetachableJoint.hh:81
bool operator!=(const DetachableJointInfo &_info) const
Definition: include/gz/sim/components/DetachableJoint.hh:52
std::string jointType
Definition: include/gz/sim/components/DetachableJoint.hh:43
Entity parentLink
Entity of the parent link.
Definition: include/gz/sim/components/DetachableJoint.hh:39
Data structure to hold information about the parent and child links connected by a detachable joint.
Definition: include/gz/sim/components/DetachableJoint.hh:36
static std::ostream & Serialize(std::ostream &_out, const components::DetachableJointInfo &_info)
Serialization for DetachableJointInfo.
Definition: include/gz/sim/components/DetachableJoint.hh:68
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/gz/sim/components/DetachableJoint.hh:96
STL class.
IGN_GAZEBO_REGISTER_COMPONENT("ign_gazebo_components.Actor", Actor) using AnimationTime
Time in seconds within animation being currently played.
Serializer for DetachableJointInfo object.
Definition: include/gz/sim/components/DetachableJoint.hh:62
STL class.
Entity childLink
Entity of the echild link.
Definition: include/gz/sim/components/DetachableJoint.hh:41