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:
81 
84 
86  std::shared_ptr<DataStructures::DataGroupCopier> m_copier;
87 
90 };
91 
92 
93 }; // namespace Devices
94 }; // namespace SurgSim
95 
96 #endif // SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
SurgSim::Devices::PoseIntegrator::PoseIntegrator
PoseIntegrator(const std::string &name)
Constructor.
Definition: PoseIntegrator.cpp:35
SurgSim::Framework::Timer
Timer class, measures execution times.
Definition: Timer.h:30
SurgSim::Devices::PoseIntegrator::setReset
void setReset(const std::string &name)
Sets the string name of the boolean entry that will reset the pose to its initial value.
Definition: PoseIntegrator.cpp:131
SurgSim::Devices::PoseIntegrator::integrate
const PoseType & integrate(const PoseType &pose)
Integrates the pose.
Definition: PoseIntegrator.cpp:41
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Devices::DeviceFilter
A device filter can be connected between a device and the InputConsumerInterface (e....
Definition: DeviceFilter.h:37
SurgSim::Devices::PoseIntegrator
A device filter that integrates the pose, turning a relative device into an absolute one.
Definition: PoseIntegrator.h:44
SurgSim::Devices::PoseIntegrator::PoseType
Math::RigidTransform3d PoseType
The type used for poses.
Definition: PoseIntegrator.h:48
OptionalValue.h
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
Timer.h
SurgSim::Devices::PoseIntegrator::initializeInput
void initializeInput(const std::string &device, const DataStructures::DataGroup &inputData) override
Set the initial input data group.
Definition: PoseIntegrator.cpp:49
SurgSim::Devices::PoseIntegrator::handleInput
void handleInput(const std::string &device, const DataStructures::DataGroup &inputData) override
Notifies the consumer that the application input coming from the device has been updated.
Definition: PoseIntegrator.cpp:81
RigidTransform.h
SurgSim::Devices::PoseIntegrator::m_timer
Framework::Timer m_timer
A timer for the update rate needed for calculating velocity.
Definition: PoseIntegrator.h:83
SurgSim::Devices::PoseIntegrator::m_resetName
std::string m_resetName
The name of the reset boolean (if any).
Definition: PoseIntegrator.h:89
SurgSim::Devices::PoseIntegrator::m_poseResult
PoseType m_poseResult
The result of integrating the input poses.
Definition: PoseIntegrator.h:80
SurgSim::Devices::PoseIntegrator::m_copier
std::shared_ptr< DataStructures::DataGroupCopier > m_copier
A copier into the input DataGroup, if needed.
Definition: PoseIntegrator.h:86
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Devices::PoseIntegrator::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::PoseIntegrator)
DeviceFilter.h