-
Notifications
You must be signed in to change notification settings - Fork 105
Integrate FoundationPose into Behaviors #1096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
1f762db to
d6afb77
Compare
9dc284c to
e9ada27
Compare
d6afb77 to
64e46af
Compare
e9ada27 to
103107e
Compare
c8498f6 to
00d91cc
Compare
…ing to execute them.
… sequence execution.
|
|
||
| public void pushNotification(int additionalStackTraceHeight, String text, boolean log) | ||
| { | ||
| if (log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the behavior intraprocess test app I didn't want things printing twice.
| for (int i = 0; i < armMultiBodyGraphic.getJoints().length; i++) | ||
| double solutionQuality = state.getSolutionQuality(); | ||
| if (solutionQuality < ArmIKSolver.GOOD_QUALITY_MAX || lowQualityRenderThrottler.run(0.5)) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes the UI not look buggy for low quality solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote the proximity node so it works better and is more general.
| if (message.getDetectionTypeAsString().equals(YOLOv8InstantDetection.class.getSimpleName())) | ||
| type = "(YOLOv8)"; | ||
| String text = "%s %s %.2f Hz Size: %d ID.%s".formatted(type, | ||
| message.getObjectClassAsString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| if (ImGui.button(labels.get(grip.name()))) | ||
| executeGrip = grip; | ||
| if (grip != Grip.values[5] && grip != Grip.values[7] && grip != Grip.values[Grip.values.length - 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ImGui.getWindowDrawList().addLine(lineStartX, offsetY, offsetX - ImGui.getFontSize(), offsetY, color, 1); | ||
| ImGui.dummy(0.0f, frameHeight); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| case XY -> Math.hypot(vectorBToA.getX(), vectorBToA.getY()); | ||
| case Z -> Math.abs(vectorBToA.getZ()); | ||
| }; | ||
| ImGui.text("Distance for Type: %.3f".formatted(distance)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| enableWiggleOnFailureWidget.renderImGuiWidget(); | ||
| if (definition.getEnableWiggleOnFailure()) | ||
| timeToWiggleWidget.renderImGuiWidget(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a major rewrite of the concurrent action sequence execution with support for try-catch fallbacks. It is a lot more condensed and solid now.
| public class LeafNodeState<D extends LeafNodeDefinition> extends BehaviorTreeNodeState<D> | ||
| { | ||
| private final CRDTStatusBoolean isNextForExecution; | ||
| private final CRDTStatusInteger concurrencyRank; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concurrency rank has been completely removed. It was a bad idea
| private final CRDTBidirectionalFloat sufficientCumulativeJointMovement; | ||
| private final CRDTBidirectionalBoolean enableWiggleOnFailure; | ||
| private final CRDTBidirectionalFloat timeToWiggle; | ||
| private final CRDTBidirectionalFloat ultimateTimeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added as much as I could to play with the Ability hands, to try and get them to be more robust. This still needs to be tested on hardware.
| float position = definition.getGoalPositions().getValueReadOnly(i); | ||
| float wiggleAmplitude = 7.0f; | ||
| float wiggleFrequency = 2.0f; | ||
| command.getGoalPositions()[i] = position + wiggleAmplitude * (float) Math.sin(wiggleFrequency * 2 * Math.PI * timer.getElapsedTime()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully we don't need the wiggle thing, but when the fingers go unresponsive, I don't know another option or if wiggling works.
| } | ||
| if (rootNode.getState().getOrderedLeaves().get(i) instanceof ChestOrientationActionState chestOrientationAction) | ||
| concurrentChestOrientationAction = chestOrientationAction; | ||
| if (rootNode.getState().getOrderedLeaves().get(i) instanceof PelvisHeightOrientationActionState pelvisHeightPitchAction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler algorithm for concurrent whole body preview. The prior impl was all that concurrency rank was used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this handles more cases.
| private final CRDTBidirectionalBoolean useFoundationPose; | ||
| private final CRDTBidirectionalStringList enabledYoloModels; | ||
| private final CRDTBidirectionalIntegerList ignoredYoloClassIndices; | ||
| private final CRDTBidirectionalEnumList<IsaacROSFoundationPoseObject> enabledFoundationPoseModels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a ton of potentially useful fields to the scene action node. We still need to implement the RDX and executor for some of this.
|
|
||
| continue; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above I fixed major bugs. I tested this on real robot and it works perfectly now.
| PROXIMITY; | ||
| PROXIMITY, | ||
| ALWAYS_FAIL, | ||
| ALWAYS_SUCCEED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added always succeed and fail conditions, which are useful for testing and workarounds.
| private final LLMConditionState llm; | ||
| private final ProximityConditionState proximityCheck; | ||
| private final CRDTStatusBoolean conditionMet; | ||
| private final CRDTStatusBoolean evaluatingCondition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Luigi's hacks from when I broke my knee and couldn't review it 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put as much of the fallback specific execution logic in here as I could.
| IsaacROSFoundationPoseCommunicator mustardCommunicator = foundationPose.get(IsaacROSFoundationPoseObject.MUSTARD); | ||
| mustardCommunicator.enable(true); | ||
| mustardCommunicator.addResultCallback(detection -> instantDetectionQueue.add(List.of(detection))); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FP support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested spatial mapping support.




No description provided.