PoseIntegrator.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-2015, SimQuest Solutions Inc.
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 #ifndef SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
17 #define SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
18 
19 #include <memory>
20 #include <string>
21 
26 
27 namespace SurgSim
28 {
29 namespace DataStructures
30 {
31 class DataGroupCopier;
32 };
33 
34 namespace Devices
35 {
36 
37 SURGSIM_STATIC_REGISTRATION(PoseIntegrator);
38 
45 {
46 public:
49 
52  explicit PoseIntegrator(const std::string& name);
53 
55 
59  const PoseType& integrate(const PoseType& pose);
60 
61  void initializeInput(const std::string& device, const DataStructures::DataGroup& inputData) override;
62 
68  void handleInput(const std::string& device, const DataStructures::DataGroup& inputData) override;
69 
76  void setReset(const std::string& name);
77 
78 private:
80  PoseType m_poseResult;
81 
84 
86  std::shared_ptr<DataStructures::DataGroupCopier> m_copier;
87 
89  std::string m_resetName;
90 };
91 
92 
93 }; // namespace Devices
94 }; // namespace SurgSim
95 
96 #endif // SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
Math::RigidTransform3d PoseType
The type used for poses.
Definition: PoseIntegrator.h:48
Definition: CompoundShapeToGraphics.cpp:29
Framework::Timer m_timer
A timer for the update rate needed for calculating velocity.
Definition: PoseIntegrator.h:83
A device filter can be connected between a device and the InputConsumerInterface (e.g., InputComponent) and/or the OutputProducerInterface (e.g., OutputComponent), and can alter the data being passed from/to the device.
Definition: DeviceFilter.h:37
std::string m_resetName
The name of the reset boolean (if any).
Definition: PoseIntegrator.h:89
Timer class, measures execution times.
Definition: Timer.h:30
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
A collection of NamedData objects.
Definition: DataGroup.h:68
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
std::shared_ptr< DataStructures::DataGroupCopier > m_copier
A copier into the input DataGroup, if needed.
Definition: PoseIntegrator.h:86
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
A device filter that integrates the pose, turning a relative device into an absolute one...
Definition: PoseIntegrator.h:44
PoseType m_poseResult
The result of integrating the input poses.
Definition: PoseIntegrator.h:80