Skip to content

Commit

Permalink
remove stopAllHapticFeedback method and m_desiredHapticValues - chang…
Browse files Browse the repository at this point in the history
…e setFingertipHapticFeedbackReferences to send***
  • Loading branch information
Ehsan Ranjbari committed Jun 19, 2024
1 parent b1e05b8 commit 45af978
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
9 changes: 1 addition & 8 deletions modules/HapticGlove_module/include/GloveControlHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class HapticGlove::GloveControlHelper

bool m_isRightHand; /**< true if the glove is the right hand*/

std::vector<int> m_desiredHapticValues; /**< Desired haptic feedback values; range: [0, 100]. */
std::vector<int> m_desiredForceValues; /**< Desired force feedback values; range: [0, 100]. */
std::vector<int>
m_desiredVibrotactileValues; /**< Desired vibrotactile feedback values; range: [0, 100] */
Expand Down Expand Up @@ -98,7 +97,7 @@ class HapticGlove::GloveControlHelper
* Set the desired haptic feedback reference to the user fingertip
* @return true/false in case of success/failure
*/
bool setFingertipHapticFeedbackReferences();
bool sendFingertipHapticFeedbackReferences();

/**
* Set the desired force feedback reference to the user fingertip
Expand All @@ -122,12 +121,6 @@ class HapticGlove::GloveControlHelper
*/
bool setPalmVibrotactileFeedbackReference(const int& desiredValue);

/**
* stop the haptics feedback (force feedback, fingertip vibrotactile feedback) to the user
* @return true/false in case of success/failure
*/
bool stopAllHapticFeedback();

/**
* stop the haptic feedback (force feedback, fingertip vibrotactile feedback, palm vibrotactile
* feedback) to the user
Expand Down
16 changes: 2 additions & 14 deletions modules/HapticGlove_module/src/GloveControlHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ bool GloveControlHelper::configure(const yarp::os::Searchable& config,

m_desiredVibrotactileValues.resize(m_numVibrotactileFeedback, 0);
m_desiredForceValues.resize(m_numForceFeedback, 0);
m_desiredHapticValues.resize(m_numForceFeedback + m_numVibrotactileFeedback, 0);

m_JointsValues.resize(m_numHandJoints, 0.0);

Expand Down Expand Up @@ -203,7 +202,7 @@ bool GloveControlHelper::setFingertipVibrotactileFeedbackReferences(
return true;
}

bool GloveControlHelper::setFingertipHapticFeedbackReferences()
bool GloveControlHelper::sendFingertipHapticFeedbackReferences()
{
return m_pImp->setFingertipHapticFeedbackValues(m_desiredForceValues, m_desiredVibrotactileValues);
}
Expand All @@ -227,12 +226,6 @@ bool GloveControlHelper::stopForceFeedback()
return true;
}

bool GloveControlHelper::stopAllHapticFeedback()
{
std::fill(m_desiredHapticValues.begin(), m_desiredHapticValues.end(), 0.0);
return m_pImp->setFingertipHapticFeedbackValues(m_desiredForceValues, m_desiredVibrotactileValues);
}

bool GloveControlHelper::stopHapticFeedback()
{

Expand All @@ -252,11 +245,6 @@ bool GloveControlHelper::stopHapticFeedback()
"vibrotactile feedback";
return false;
}
if (!stopAllHapticFeedback())
{
yError() << m_logPrefix << "Cannot turn off the fingertip haptics feedback";
return false;
}
return true;
}

Expand Down Expand Up @@ -379,7 +367,7 @@ bool GloveControlHelper::findHumanMotionRange()

std::vector<double> desiredValue(m_numVibrotactileFeedback, 35);
this->setFingertipVibrotactileFeedbackReferences(desiredValue);
this->setFingertipHapticFeedbackReferences();
this->sendFingertipHapticFeedbackReferences();
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/HapticGlove_module/src/Teleoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ bool Teleoperation::run()
m_robotController->move();
m_humanGlove->setFingertipForceFeedbackReferences(m_data.humanForceFeedbacks);
m_humanGlove->setFingertipVibrotactileFeedbackReferences(m_data.humanVibrotactileFeedbacks);
m_humanGlove->setFingertipHapticFeedbackReferences();
m_humanGlove->sendFingertipHapticFeedbackReferences();
}

if (m_enableLogger)
Expand Down

0 comments on commit 45af978

Please sign in to comment.