Gazebo Gazebo

API Reference

6.16.0
JointMonitor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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 /*
19  * \author Nick Lamprianidis <nlamprian@gmail.com>
20  * \date January 2021
21  */
22 
23 #ifndef GZ_GAZEBO_SYSTEMS_JOINT_MONITOR_HH_
24 #define GZ_GAZEBO_SYSTEMS_JOINT_MONITOR_HH_
25 
26 #include <functional>
27 #include <memory>
28 
29 #include <gz/sim/System.hh>
30 
31 namespace ignition
32 {
33 namespace gazebo
34 {
35 // Inline bracket to help doxygen filtering
36 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
37 namespace systems
38 {
39 // Data forward declaration
40 class JointMonitorPrivate;
41 
46 {
48  public: JointMonitor();
49 
51  public: ~JointMonitor();
52 
60  public: void Configure(
61  Entity _joint, double _target, double _posEps, double _velEps,
62  const std::function<void()> &_jointTargetReachedCallback);
63 
67  public: void Update(const EntityComponentManager &_ecm);
68 
70  private: std::unique_ptr<JointMonitorPrivate> dataPtr;
71 };
72 
73 } // namespace systems
74 } // namespace IGNITION_GAZEBO_VERSION_NAMESPACE
75 } // namespace gazebo
76 } // namespace ignition
77 
78 #endif // GZ_GAZEBO_SYSTEMS_JOINT_MONITOR_HH_
Monitor that checks the state of a joint. When the joint reaches the configured target,...
Definition: JointMonitor.hh:45
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.
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:66
void Update(const EntityComponentManager &_ecm)
Checks whether the position and velocity of the joint are within the configured tolerances.
void Configure(Entity _joint, double _target, double _posEps, double _velEps, const std::function< void()> &_jointTargetReachedCallback)
Starts monitoring of the position and velocity of the given joint.