Skip to content

Commit

Permalink
Set contact points based on prox measurements.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmurooka committed Aug 16, 2024
1 parent edb5136 commit c810c8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/McRtcTactileSensorPlugin/TactileSensorPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct TactileSensorPlugin : public mc_control::GlobalPlugin

//! Force threshold for determining contact in each cell [N]
double contactForceThre = 3.0;

//! Proximity threshold for determining contact in each cell
double contactProxThre = 1.0;
};

/** \brief Sensor data. */
Expand Down
3 changes: 2 additions & 1 deletion src/TactileSensorPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void TactileSensorPlugin::init(mc_control::MCGlobalController & gc, const mc_rtc

sensorConfig("forceScale", sensorInfo.forceScale);
sensorConfig("contactForceThre", sensorInfo.contactForceThre);
sensorConfig("contactProxThre", sensorInfo.contactProxThre);

sensorInfoList_.push_back(sensorInfo);
}
Expand Down Expand Up @@ -266,7 +267,7 @@ void TactileSensorPlugin::eskinSensorCallback(const eskin_ros_utils::PatchData::
sensorData->wrench.force() += force;
sensorData->wrench.moment() += moment;

if(force.z() > sensorInfo.contactForceThre)
if(force.z() > sensorInfo.contactForceThre || cellMsg.prox > sensorInfo.contactProxThre)
{
contactPoints.push_back(position);
}
Expand Down

0 comments on commit c810c8c

Please sign in to comment.