16 #ifndef SURGSIM_TESTING_VISUALTESTCOMMON_MOVINGSQUAREFORCE_H 17 #define SURGSIM_TESTING_VISUALTESTCOMMON_MOVINGSQUAREFORCE_H 21 #include "SurgSim/Input/InputConsumerInterface.h" 22 #include "SurgSim/Input/OutputProducerInterface.h" 23 #include "SurgSim/DataStructures/DataGroup.h" 25 #include "SurgSim/Framework/LockedContainer.h" 35 MovingSquareForce(
const std::string& toolDeviceName,
const std::string& squareDeviceName);
61 struct SquarePoseVectors
78 const std::string m_toolDeviceName;
80 const std::string m_squareDeviceName;
86 double m_squareHalfSize;
88 double m_surfaceStiffness;
95 double m_squareNormalDirection;
101 #endif // SURGSIM_TESTING_VISUALTESTCOMMON_MOVINGSQUAREFORCE_H
void handleInput(const std::string &device, const SurgSim::DataStructures::DataGroup &inputData) override
Notifies the consumer that the application input coming from the device has been updated.
Definition: MovingSquareForce.cpp:65
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
MovingSquareForce(const std::string &toolDeviceName, const std::string &squareDeviceName)
Constructor.
Definition: MovingSquareForce.cpp:43
bool requestOutput(const std::string &device, SurgSim::DataStructures::DataGroup *outputData) override
Asks the producer to provide output state to the device.
Definition: MovingSquareForce.cpp:116
A simple listener to calculate collision force against a square area for the example application...
Definition: MovingSquareForce.h:31
A collection of NamedData objects.
Definition: DataGroup.h:68
void updateTool(const SurgSim::DataStructures::DataGroup &toolInputData)
Updates the state of the tool as described by toolInputData.
Definition: MovingSquareForce.cpp:81
SurgSim::Math::Vector3d computeForce(const SurgSim::Math::Vector3d &position)
Calculates the force as a function of device tip position.
Definition: MovingSquareForce.cpp:122
void initializeInput(const std::string &device, const SurgSim::DataStructures::DataGroup &inputData) override
Set the initial input data group.
Definition: MovingSquareForce.cpp:61
void updateSquare(const SurgSim::DataStructures::DataGroup &squareInputData)
Updates the state of the square as described by squareInputData.
Definition: MovingSquareForce.cpp:98