Inaccurate force readings using the touch and force sensors

Discussion in 'Modeling' started by Michael West, May 10, 2019.

  1. Hello,

    I have been trying to use the touch and force sensors in simulation with both a 1 and two link manipulator coming into contact with an object. However, when I compare the sensor contact force to the expected force values based on knowledge of the applied torque and Jacobian (computed using the actual positions of the manipulator) these values are consistently off by a scaling factor.

    From my understanding the contact force sensor outputs the sum of the norm of all points of contact of the site it is attached to. Is this correct? I believe it is, because when it is compared to the Force values of a sensor attached to the rod the norm of those force values are equivalent.

    Has anyone else noticed some scaling issues with their implemented force values?

    For context I have used this XML code to define the body and the attached sensors:

    <body name="proximalPhalanx" pos="0 0 2">
    <!--Proximal Phalanx-->
    <geom name="proximalPhalanx" type="cylinder" size="0.1886" fromto="0 0 0 6.08 0 0" mass="0.001" rgba=".5 .1 .1 1"/>
    <site name="proximalPhalanxTouchSite" type="cylinder" size="0.1886" fromto="0 0 0 6.08 0 0" rgba=".5 .1 .1 1"/>
    <joint name="MCP" limited="true" range="-22 83" ref = "0"/>
    <site name="MCPSite" pos="0 0 0" euler="0 0 0"/>
    <site name="middleSite" pos="0 0 3.04" euler="0 0 0"/>
    <site name="PIPSite" pos="0 0 6.08" euler="0 0 0"/>
    </body>

    <sensor>
    MCP
    <torque name="MCPTorqueSite" site="MCPSite"/>
    <gyro name="MCPgyro" site="MCPSite"/>
    <accelerometer name="MCPaccelerometer" site="MCPSite"/>
    <force name="MCPForceSite" site="MCPSite"/>
    </sensor>

    And I am using this C++ code to get the values of the sensors:

    int MCPTorqueSensorAddress = m->sensor_adr[MCPJointTorqueSensorID];
    int MCPTorqueSensorDimension = m->sensor_dim[MCPJointTorqueSensorID];
    mju_copy(MCPTorqueSensorData, &d->sensordata[MCPTorqueSensorAddress], m->sensor_dim[MCPTorqueSensorDimension]);

    int proximalPhalanxTouchSensorAddress = m->sensor_adr[proximalPhalanxTouchSensorID];
    int proximalPhalanxTouchSensorDimension = m->sensor_dim[proximalPhalanxTouchSensorID];
    // THIS IS THE SINGLE POINT CONTACT FORCE
    mju_copy(proximalPhalanxTouchSensorData, &d->sensordata[proximalPhalanxTouchSensorAddress], m->sensor_dim[proximalPhalanxTouchSensorDimension]);
     
  2. Anyone has a good answer ? I'm struggling with a similar problem.