PoseIntegrator.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013-2015, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
#define SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
#include <memory>
#include <string>
#include "SurgSim/DataStructures/OptionalValue.h"
#include "SurgSim/Devices/DeviceFilters/DeviceFilter.h"
#include "SurgSim/Math/RigidTransform.h"
#include "SurgSim/Framework/Timer.h"
namespace SurgSim
{
namespace DataStructures
{
class DataGroupCopier;
};
namespace Devices
{
SURGSIM_STATIC_REGISTRATION(PoseIntegrator);
class PoseIntegrator : public DeviceFilter
{
public:
typedef Math::RigidTransform3d PoseType;
explicit PoseIntegrator(const std::string& name);
SURGSIM_CLASSNAME(SurgSim::Devices::PoseIntegrator);
const PoseType& integrate(const PoseType& pose);
void initializeInput(const std::string& device, const DataStructures::DataGroup& inputData) override;
void handleInput(const std::string& device, const DataStructures::DataGroup& inputData) override;
void setReset(const std::string& name);
private:
PoseType m_poseResult;
Framework::Timer m_timer;
std::shared_ptr<DataStructures::DataGroupCopier> m_copier;
std::string m_resetName;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_DEVICEFILTERS_POSEINTEGRATOR_H
SurgSim::Devices::PoseIntegrator::PoseType
Math::RigidTransform3d PoseType
The type used for poses.
Definition: PoseIntegrator.h:48
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
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::DeviceFilter
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
SurgSim::Devices::PoseIntegrator::m_resetName
std::string m_resetName
The name of the reset boolean (if any).
Definition: PoseIntegrator.h:89
Timer.h
SurgSim::Framework::Timer
Timer class, measures execution times.
Definition: Timer.h:30
SURGSIM_CLASSNAME
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SurgSim::Devices::PoseIntegrator::m_copier
std::shared_ptr< DataStructures::DataGroupCopier > m_copier
A copier into the input DataGroup, if needed.
Definition: PoseIntegrator.h:86
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
OptionalValue.h
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::m_poseResult
PoseType m_poseResult
The result of integrating the input poses.
Definition: PoseIntegrator.h:80
DeviceFilter.h