forked from ihmcrobotics/ihmc-open-robotics-software
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://stash.ihmc.us/scm/rob/ihmc-open-rob…
…otics-software into develop
- Loading branch information
Showing
24 changed files
with
335 additions
and
81 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...hmc/quadrupedRobotics/estimator/stateEstimator/QuadrupedFootContactableBodiesFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package us.ihmc.quadrupedRobotics.estimator.stateEstimator; | ||
|
||
import us.ihmc.SdfLoader.SDFFullQuadrupedRobotModel; | ||
import us.ihmc.commonWalkingControlModules.bipedSupportPolygons.ListOfPointsContactablePlaneBody; | ||
import us.ihmc.humanoidRobotics.bipedSupportPolygons.ContactablePlaneBody; | ||
import us.ihmc.quadrupedRobotics.estimator.referenceFrames.CommonQuadrupedReferenceFrames; | ||
import us.ihmc.quadrupedRobotics.model.QuadrupedPhysicalProperties; | ||
import us.ihmc.robotics.robotSide.QuadrantDependentList; | ||
import us.ihmc.robotics.robotSide.RobotQuadrant; | ||
import us.ihmc.robotics.screwTheory.RigidBody; | ||
import us.ihmc.tools.factories.FactoryTools; | ||
import us.ihmc.tools.factories.RequiredFactoryField; | ||
|
||
public class QuadrupedFootContactableBodiesFactory | ||
{ | ||
private final RequiredFactoryField<SDFFullQuadrupedRobotModel> fullRobotModel = new RequiredFactoryField<>("fullRobotModel"); | ||
private final RequiredFactoryField<CommonQuadrupedReferenceFrames> referenceFrames = new RequiredFactoryField<>("referenceFrames"); | ||
private final RequiredFactoryField<QuadrupedPhysicalProperties> physicalProperties = new RequiredFactoryField<>("physicalProperties"); | ||
|
||
public QuadrantDependentList<ContactablePlaneBody> createFootContactableBodies() | ||
{ | ||
FactoryTools.checkAllRequiredFactoryFieldsAreSet(this); | ||
|
||
QuadrantDependentList<ContactablePlaneBody> footContactableBodies = new QuadrantDependentList<ContactablePlaneBody>(); | ||
|
||
for (RobotQuadrant robotQuadrant : RobotQuadrant.values) | ||
{ | ||
RigidBody foot = fullRobotModel.get().getFoot(robotQuadrant); | ||
ListOfPointsContactablePlaneBody footContactableBody = new ListOfPointsContactablePlaneBody(foot, referenceFrames.get().getFootFrame(robotQuadrant), | ||
physicalProperties.get() | ||
.getFootGroundContactPoints(robotQuadrant)); | ||
footContactableBodies.set(robotQuadrant, footContactableBody); | ||
} | ||
|
||
return footContactableBodies; | ||
} | ||
|
||
public void setFullRobotModel(SDFFullQuadrupedRobotModel fullRobotModel) | ||
{ | ||
this.fullRobotModel.set(fullRobotModel); | ||
} | ||
|
||
public void setReferenceFrames(CommonQuadrupedReferenceFrames referenceFrames) | ||
{ | ||
this.referenceFrames.set(referenceFrames); | ||
} | ||
|
||
public void setPhysicalProperties(QuadrupedPhysicalProperties physicalProperties) | ||
{ | ||
this.physicalProperties.set(physicalProperties); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...cs/src/us/ihmc/quadrupedRobotics/estimator/stateEstimator/QuadrupedFootSwitchFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package us.ihmc.quadrupedRobotics.estimator.stateEstimator; | ||
|
||
import us.ihmc.SdfLoader.SDFFullRobotModel; | ||
import us.ihmc.commonWalkingControlModules.sensors.footSwitch.FootSwitchInterface; | ||
import us.ihmc.commonWalkingControlModules.sensors.footSwitch.SettableFootSwitch; | ||
import us.ihmc.humanoidRobotics.bipedSupportPolygons.ContactablePlaneBody; | ||
import us.ihmc.robotics.dataStructures.registry.YoVariableRegistry; | ||
import us.ihmc.robotics.robotSide.QuadrantDependentList; | ||
import us.ihmc.robotics.robotSide.RobotQuadrant; | ||
import us.ihmc.robotics.screwTheory.TotalMassCalculator; | ||
import us.ihmc.tools.factories.FactoryTools; | ||
import us.ihmc.tools.factories.RequiredFactoryField; | ||
|
||
public class QuadrupedFootSwitchFactory | ||
{ | ||
private final RequiredFactoryField<Double> gravity = new RequiredFactoryField<>("gravity"); | ||
private final RequiredFactoryField<YoVariableRegistry> yoVariableRegistry = new RequiredFactoryField<>("yoVariableRegistry"); | ||
private final RequiredFactoryField<QuadrantDependentList<ContactablePlaneBody>> footContactableBodies = new RequiredFactoryField<>("footContactableBodies"); | ||
private final RequiredFactoryField<SDFFullRobotModel> fullRobotModel = new RequiredFactoryField<>("fullRobotModel"); | ||
|
||
public QuadrantDependentList<FootSwitchInterface> createFootSwitches() | ||
{ | ||
FactoryTools.checkAllRequiredFactoryFieldsAreSet(this); | ||
|
||
QuadrantDependentList<FootSwitchInterface> footSwitches = new QuadrantDependentList<FootSwitchInterface>(); | ||
double gravityMagnitude = Math.abs(gravity.get()); | ||
double totalRobotWeight = TotalMassCalculator.computeSubTreeMass(fullRobotModel.get().getElevator()) * gravityMagnitude; | ||
|
||
for (RobotQuadrant robotQuadrant : RobotQuadrant.values) | ||
{ | ||
SettableFootSwitch footSwitch = new SettableFootSwitch(footContactableBodies.get().get(robotQuadrant), robotQuadrant, totalRobotWeight, yoVariableRegistry.get()); | ||
// KinematicsBasedFootSwitch footSwitch = new KinematicsBasedFootSwitch(namePrefix, footContactableBodies.get(), switchZThreshold, totalRobotWeight, robotQuadrant, yoVariableRegistry.get()); | ||
footSwitches.set(robotQuadrant, footSwitch); | ||
} | ||
|
||
return footSwitches; | ||
} | ||
|
||
public void setGravity(double gravity) | ||
{ | ||
this.gravity.set(gravity); | ||
} | ||
|
||
public void setYoVariableRegistry(YoVariableRegistry yoVariableRegistry) | ||
{ | ||
this.yoVariableRegistry.set(yoVariableRegistry); | ||
} | ||
|
||
public void setFootContactableBodies(QuadrantDependentList<ContactablePlaneBody> footContactableBodies) | ||
{ | ||
this.footContactableBodies.set(footContactableBodies); | ||
} | ||
|
||
public void setFullRobotModel(SDFFullRobotModel fullRobotModel) | ||
{ | ||
this.fullRobotModel.set(fullRobotModel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.