PoseComponent.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, 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_FRAMEWORK_POSECOMPONENT_H
17 #define SURGSIM_FRAMEWORK_POSECOMPONENT_H
18 
19 #include <memory>
20 
24 
25 namespace SurgSim
26 {
27 
28 namespace Framework
29 {
30 SURGSIM_STATIC_REGISTRATION(PoseComponent);
31 
34 class PoseComponent : public Component
35 {
36 public:
39  explicit PoseComponent(const std::string& name);
40 
42 
45  void setPose(const SurgSim::Math::RigidTransform3d& pose);
46 
50 
51 protected:
56  virtual std::shared_ptr<PoseComponent> getPoseComponent() override;
57 
62  virtual std::shared_ptr<const PoseComponent> getPoseComponent() const override;
63 
64 private:
65  virtual bool doInitialize() override;
66  virtual bool doWakeUp() override;
67 
69 };
70 
71 }; // namespace Framework
72 }; // namespace SurgSim
73 
74 #endif // SURGSIM_FRAMEWORK_POSECOMPONENT_H
Definition: DriveElementFromInputBehavior.cpp:27
const SurgSim::Math::RigidTransform3d & getPose() const
Get the pose of the PoseComponent.
Definition: PoseComponent.cpp:36
virtual std::shared_ptr< PoseComponent > getPoseComponent() override
Get the PoseComponent for this component A PoseComponent cannot have a PoseComponent, so this will return nullptr.
Definition: PoseComponent.cpp:46
void setPose(const SurgSim::Math::RigidTransform3d &pose)
Set the Pose of the PoseComponent.
Definition: PoseComponent.cpp:31
virtual bool doInitialize() override
Interface to be implemented by derived classes.
Definition: PoseComponent.cpp:51
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:43
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
The PoseComponent holds a pose.
Definition: PoseComponent.h:34
PoseComponent(const std::string &name)
Constructor.
Definition: PoseComponent.cpp:26
SURGSIM_CLASSNAME(SurgSim::Framework::PoseComponent)
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
virtual bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: PoseComponent.cpp:56
SURGSIM_STATIC_REGISTRATION(PoseComponent)
SurgSim::Math::RigidTransform3d m_pose
Definition: PoseComponent.h:68