Go to the documentation of this file.
16 #ifndef SURGSIM_BLOCKS_POSEINTERPOLATOR_H
17 #define SURGSIM_BLOCKS_POSEINTERPOLATOR_H
62 void setTarget(std::shared_ptr<SurgSim::Framework::SceneElement> target);
87 void update(
double dt)
override;
101 std::shared_ptr<SurgSim::Framework::SceneElement>
m_target;
double m_currentTime
How far through the interpolation we are.
Definition: PoseInterpolator.h:107
std::shared_ptr< SurgSim::Framework::SceneElement > m_target
Target for the interpolated RigidTransform.
Definition: PoseInterpolator.h:101
SurgSim::DataStructures::OptionalValue< SurgSim::Math::RigidTransform3d > m_optionalStartPose
Optional value to take the from rigid transform.
Definition: PoseInterpolator.h:92
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: PoseInterpolator.cpp:75
void setTarget(std::shared_ptr< SurgSim::Framework::SceneElement > target)
Set the target of the interpolation, this is where the interpolated transform will be applied to.
Definition: PoseInterpolator.cpp:54
SurgSim::Math::RigidTransform3d m_endingPose
Start of the interpolation.
Definition: PoseInterpolator.h:98
void update(double dt) override
Update the behavior.
Definition: PoseInterpolator.cpp:100
double m_duration
Duration of the interpolation.
Definition: PoseInterpolator.h:104
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
Behaviors perform actions.
Definition: Behavior.h:41
void setPingPong(bool val)
Sets the interpolation to ping pong back and forth between the starting and ending poses.
Definition: PoseInterpolator.cpp:143
Definition: CompoundShapeToGraphics.cpp:30
bool m_loop
Whether to loop.
Definition: PoseInterpolator.h:113
PoseInterpolator(const std::string &name)
Constructor.
Definition: PoseInterpolator.cpp:28
SurgSim::Math::RigidTransform3d m_startingPose
Target of the interpolation.
Definition: PoseInterpolator.h:95
bool isPingPong() const
Definition: PoseInterpolator.cpp:152
bool isLoop() const
Definition: PoseInterpolator.cpp:138
void doRetire() override
Interface to be implemented by derived classes Has a default implementation, does nothing.
Definition: PoseInterpolator.cpp:80
void setLoop(bool val)
Sets the interpolation to looping, pingpong and loop cannot be used together.
Definition: PoseInterpolator.cpp:129
Perform linear interpolation on two poses.
Definition: PoseInterpolator.h:42
void setStartingPose(const SurgSim::Math::RigidTransform3d &transform)
Set the starting pose.
Definition: PoseInterpolator.cpp:38
bool m_pingpong
Whether to pingpong.
Definition: PoseInterpolator.h:110
void setEndingPose(const SurgSim::Math::RigidTransform3d &transform)
Set the end pose.
Definition: PoseInterpolator.cpp:46
double getDuration() const
Get the duration.
Definition: PoseInterpolator.cpp:70
void setDuration(double t)
Set the duration of the interpolation.
Definition: PoseInterpolator.cpp:62
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: PoseInterpolator.cpp:85
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38