Gazebo Gazebo

API Reference

3.15.1
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 {
38 namespace systems
39 {
40 // Data forward declaration
41 class JointMonitorPrivate;
42 
47 {
49  public: JointMonitor();
50 
52  public: ~JointMonitor();
53 
61  public: void Configure(
62  Entity _joint, double _target, double _posEps, double _velEps,
63  const std::function<void()> &_jointTargetReachedCallback);
64 
68  public: void Update(const EntityComponentManager &_ecm);
69 
71  private: std::unique_ptr<JointMonitorPrivate> dataPtr;
72 };
73 
74 } // namespace systems
75 } // namespace IGNITION_GAZEBO_VERSION_NAMESPACE
76 } // namespace gazebo
77 } // namespace ignition
78 
79 #endif // GZ_GAZEBO_SYSTEMS_JOINT_MONITOR_HH_
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:59
This library is part of the Ignition Robotics project.
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:65
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.
void Update(const EntityComponentManager &_ecm)
Checks whether the position and velocity of the joint are within the configured tolerances.
Monitor that checks the state of a joint. When the joint reaches the configured target,...
Definition: JointMonitor.hh:46