Gazebo Sim
API Reference
10.4.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
src
systems
joint_state_publisher
JointStatePublisher.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
18
#ifndef GZ_SIM_SYSTEMS_STATE_PUBLISHER_HH_
19
#define GZ_SIM_SYSTEMS_STATE_PUBLISHER_HH_
20
21
#include <google/protobuf/arena.h>
22
23
#include <memory>
24
#include <set>
25
#include <string>
26
#include <chrono>
27
#include <
gz/sim/Model.hh
>
28
#include <
gz/transport/Node.hh
>
29
#include <
gz/sim/System.hh
>
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
systems
38
{
60
class
JointStatePublisher
61
:
public
System
,
62
public
ISystemConfigure
,
63
public
ISystemPostUpdate
64
{
66
public
:
JointStatePublisher
();
67
69
public
:
~JointStatePublisher
()
override
=
default
;
70
71
// Documentation inherited
72
public
:
void
Configure
(
const
Entity
&_entity,
73
const
std::shared_ptr<const sdf::Element>
&,
74
EntityComponentManager
&_ecm,
EventManager
&)
override
;
75
76
// Documentation inherited
77
public
:
void
PostUpdate
(
const
UpdateInfo
&_info,
78
const
EntityComponentManager
&_ecm)
final
;
79
83
private
:
void
CreateComponents(
EntityComponentManager
&_ecm,
84
sim::Entity
_joint);
85
87
private
:
Model
model;
88
90
private
:
transport::Node
node;
91
93
private
:
std::unique_ptr<transport::Node::Publisher>
modelPub;
94
96
private
:
std::set<Entity>
joints;
97
99
private
:
std::string
topic;
100
102
private
: std::chrono::steady_clock::duration updatePeriod{0};
103
105
private
: std::chrono::steady_clock::duration lastUpdateTime{0};
106
110
private
: google::protobuf::Arena arena;
111
};
112
}
113
}
114
}
115
}
116
117
#endif