-
Notifications
You must be signed in to change notification settings - Fork 105
Setup behavior tree scene. #1065
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
cb58819
Removed scene graph from autonomy process. WIP.
calvertdw 946214a
Create BehaviorTreeScene.
calvertdw 9fbd31f
Some stuff.
calvertdw 35396ff
Getting the boilerplate for the BehaviorTreeScene in place.
calvertdw 0fccf09
A lot more boilerplate setup for the behavior tree scene.
calvertdw ee831ab
Uncomment code in door and ai2r and connect it to scene.
calvertdw a4c4ff7
Add TODO.
calvertdw 2166614
Pass in foundationPose.
calvertdw 06833c2
Fix NPE. Add scene panel.
calvertdw a51b3b9
Delete ReferenceFrameLibrary.
calvertdw 48d0dcd
Add PersistentDetection.
calvertdw 635875b
Add mustard.
calvertdw 6fcdd4e
Place unplace mustard on RDX side.
calvertdw dd8a33a
Use IsaacROSFoundationPoseCommunicatorMap.
calvertdw a785a38
Simplify logic.
calvertdw 60c6a84
Setup scene sync messages.
calvertdw bccd17f
Implement behavior scene object synchronization.
calvertdw 55f88c5
Get mustard relative behavior going.
calvertdw 243b7af
Fix add/remove mustard UI.
calvertdw 16660bf
Checkbox to toggle object selection.
calvertdw 7e10d74
ArrayList -> List
calvertdw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| import imgui.ImGui; | ||
| import imgui.flag.ImGuiCol; | ||
| import org.apache.commons.lang3.ArrayUtils; | ||
| import us.ihmc.robotics.referenceFrames.ReferenceFrameLibrary; | ||
|
|
||
| import java.util.SortedSet; | ||
| import java.util.TreeSet; | ||
|
|
@@ -14,12 +13,14 @@ | |
| * Used to select between the reference frames in a library by human readable names. | ||
| * It also includes any values that the user already might have and keeps those around | ||
| * even if deselected. Also, this is done immediate mode style. | ||
| * | ||
| * TODO: Fix up with new design. Probably rename to be less general, like RDXBehaviorSceneFrameSelector... | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tbh, this class does work pretty well. Maybe will leave it alone for now |
||
| */ | ||
| public class ImGuiReferenceFrameLibraryCombo | ||
| { | ||
| private final ImGuiUniqueLabelMap labels = new ImGuiUniqueLabelMap(getClass()); | ||
| private final String comboName; | ||
| private final ReferenceFrameLibrary referenceFrameLibrary; | ||
| private final Consumer<Consumer<String>> frameSupplier; | ||
| private final Supplier<String> currentFrameNameGetter; | ||
| private final Consumer<String> currentFrameNameSetter; | ||
| private final SortedSet<String> referenceFrameLibraryNames = new TreeSet<>(); | ||
|
|
@@ -29,20 +30,20 @@ public class ImGuiReferenceFrameLibraryCombo | |
| private transient String[] selectableReferenceFrameNameArray = new String[0]; | ||
|
|
||
| public ImGuiReferenceFrameLibraryCombo(String comboName, | ||
| ReferenceFrameLibrary referenceFrameLibrary, | ||
| Consumer<Consumer<String>> frameSupplier, | ||
| Supplier<String> currentFrameNameGetter, | ||
| Consumer<String> currentFrameNameSetter) | ||
| { | ||
| this.comboName = comboName; | ||
| this.referenceFrameLibrary = referenceFrameLibrary; | ||
| this.frameSupplier = frameSupplier; | ||
| this.currentFrameNameGetter = currentFrameNameGetter; | ||
| this.currentFrameNameSetter = currentFrameNameSetter; | ||
| } | ||
|
|
||
| public void render() | ||
| { | ||
| referenceFrameLibraryNames.clear(); | ||
| referenceFrameLibrary.getAllFrameNames(referenceFrameLibraryNames::add); | ||
| frameSupplier.accept(referenceFrameLibraryNames::add); | ||
|
|
||
| selectableReferenceFrameNames.add(currentFrameNameGetter.get()); | ||
| selectableReferenceFrameNames.addAll(referenceFrameLibraryNames); | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ | |
| import us.ihmc.rdx.mesh.RDXMeshBuilder; | ||
| import us.ihmc.rdx.mesh.RDXMeshDataInterpreter; | ||
| import us.ihmc.rdx.mesh.RDXMultiColorMeshBuilder; | ||
| import us.ihmc.rdx.sceneManager.RDXRenderableAdapter; | ||
| import us.ihmc.rdx.sceneManager.RDXSceneLevel; | ||
| import us.ihmc.rdx.tools.LibGDXTools; | ||
| import us.ihmc.rdx.ui.RDX3DPanel; | ||
|
|
@@ -51,7 +52,7 @@ | |
| import us.ihmc.robotics.referenceFrames.ReferenceFrameMissingTools; | ||
| import us.ihmc.robotics.robotSide.RobotSide; | ||
|
|
||
| import java.util.Random; | ||
| import java.util.function.Consumer; | ||
|
|
||
| import static us.ihmc.rdx.ui.gizmo.RDXGizmoTools.AXIS_COLORS; | ||
| import static us.ihmc.rdx.ui.gizmo.RDXGizmoTools.AXIS_SELECTED_COLORS; | ||
|
|
@@ -121,6 +122,10 @@ public class RDXPose3DGizmo implements RenderableProvider | |
| private boolean queuePopupToOpen = false; | ||
| private boolean proportionsNeedUpdate = false; | ||
| private FrameBasedGizmoModification frameBasedGizmoModification; | ||
| private Runnable overlayAddition; | ||
| private Consumer<ImGui3DViewInput> pickCalculator; | ||
| private Consumer<ImGui3DViewInput> inputProcessor; | ||
| private RDXRenderableAdapter renderableAdapter; | ||
|
|
||
| /** Maintains it's own frame in World. */ | ||
| public RDXPose3DGizmo() | ||
|
|
@@ -225,16 +230,33 @@ public void changeParentFrameWithoutMoving(ReferenceFrame newParentFrame) | |
| public void createAndSetupDefault(RDX3DPanel panel3D) | ||
| { | ||
| create(panel3D); | ||
| panel3D.addImGui3DViewPickCalculator(this::calculate3DViewPick); | ||
| panel3D.addImGui3DViewInputProcessor(this::process3DViewInput); | ||
| panel3D.getScene().addRenderableProvider(this, RDXSceneLevel.VIRTUAL); | ||
| pickCalculator = this::calculate3DViewPick; | ||
| panel3D.addImGui3DViewPickCalculator(pickCalculator); | ||
| inputProcessor = this::process3DViewInput; | ||
| panel3D.addImGui3DViewInputProcessor(inputProcessor); | ||
| renderableAdapter = panel3D.getScene().addRenderableProvider(this, RDXSceneLevel.VIRTUAL); | ||
| } | ||
|
|
||
| public void destroyDefault(RDX3DPanel panel3D) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added destroy to gizmo. |
||
| { | ||
| panel3D.removeImGui3DViewInputProcessor(inputProcessor); | ||
| panel3D.removeImGui3DViewPickCalculator(pickCalculator); | ||
| panel3D.getScene().removeRenderableAdapter(renderableAdapter); | ||
| panel3D.removeImGuiOverlayAddition(overlayAddition); | ||
|
|
||
| centerSphereModel.dispose(); | ||
| for (int i = 0; i < arrowModels.length; i++) | ||
| arrowModels[i].dispose(); | ||
| for (int i = 0; i < torusModels.length; i++) | ||
| torusModels[i].dispose(); | ||
| } | ||
|
|
||
| public void create(RDX3DPanel panel3D) | ||
| { | ||
| camera3D = panel3D.getCamera3D(); | ||
| frameBasedGizmoModification = new FrameBasedGizmoModification(this::getGizmoFrame, () -> gizmoFrame.getParent(), camera3D); | ||
| panel3D.addImGuiOverlayAddition(this::renderTooltipAndContextMenu); | ||
| overlayAddition = this::renderTooltipAndContextMenu; | ||
| panel3D.addImGuiOverlayAddition(overlayAddition); | ||
|
|
||
| centerSphereModel.setMesh(meshBuilder -> meshBuilder.addSphere(centerSphereRadius.get(), RDXGizmoTools.CENTER_DEFAULT_COLOR)); | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Deleted ReferenceFrameLibrary, had to use functions in a few places to keep things working.