Skip to content
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

Feature/side stepping ch #697

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f4cb234
Added an example of how to create a 3d matrix
PotatoPeeler3000 Feb 11, 2025
a8294a6
Remove unused code for testing
PotatoPeeler3000 Feb 11, 2025
7f03cda
Fixed 3d cuda example and return the average to the cpu
PotatoPeeler3000 Feb 11, 2025
c5b1f13
Using cudaMalloc3D
TomaszTB Feb 11, 2025
06c1006
Started writing a test to have this example be used in a class
PotatoPeeler3000 Feb 11, 2025
94dac47
Fixed FilteredRapidHeightMapExtractor to compute the average of the h…
PotatoPeeler3000 Feb 11, 2025
29920f7
Updated the kernel to compute the height estimate based on a moving a…
PotatoPeeler3000 Feb 12, 2025
ab8ee1a
Alpha filter (ish) is working on the height map, UI button to turn th…
PotatoPeeler3000 Feb 12, 2025
8c0cd8e
Tuned filter a little bit
PotatoPeeler3000 Feb 13, 2025
03f2c43
Merge branch 'refs/heads/develop' into feature/3d-kernel-example
PotatoPeeler3000 Feb 15, 2025
582910a
Update environments for the UI
PotatoPeeler3000 Feb 15, 2025
da4c67b
Switched from ROS2Helper to ROS2Node for StoredPropertySets and switc…
PotatoPeeler3000 Feb 19, 2025
f2d2dd8
Using createSubscription2 where applicable (#679)
TomaszTB Feb 19, 2025
7210f10
Merge branch 'develop' into feature/one-ui
PotatoPeeler3000 Feb 20, 2025
c51203a
Switch height map to use ros2Node to remove ros2Helper
PotatoPeeler3000 Feb 20, 2025
4f5fdd7
Implemented square up and walk to goal as a message within CH
PotatoPeeler3000 Feb 22, 2025
b5b09e3
Fix translation for when robot isn't facing forward
PotatoPeeler3000 Feb 22, 2025
6221b64
Cleanup UI look so there is less scrolling involved
PotatoPeeler3000 Feb 22, 2025
bdd6eb4
Moved the RapidHeightMapManager into the perception package to reduce…
PotatoPeeler3000 Feb 24, 2025
b98358d
Add reset method for visuals
PotatoPeeler3000 Feb 24, 2025
d1205fa
Merge branch 'feature/3d-kernel-example' into feature/new-ch-messages
PotatoPeeler3000 Feb 24, 2025
3109bc8
Cleanup files and remove testing lines
PotatoPeeler3000 Feb 24, 2025
a78af41
Moved publisher to constructor
PotatoPeeler3000 Feb 24, 2025
539411a
Merge branch 'develop' into feature/new-ch-messages
PotatoPeeler3000 Feb 24, 2025
5431014
Change planar region to use ros2helper still, merge conflict
PotatoPeeler3000 Feb 24, 2025
9bec35b
Cleanup code mainly for height map filter
PotatoPeeler3000 Feb 24, 2025
8b3c9f9
Added the options to side step with Continuous Hiking
PotatoPeeler3000 Feb 25, 2025
5a691e9
Add the options to side step while facing the same direction.
PotatoPeeler3000 Feb 26, 2025
df399a3
Changed the way turning in place works to add to a queue and move mor…
PotatoPeeler3000 Feb 27, 2025
513583c
Merge branch 'develop' into feature/side-stepping-ch
PotatoPeeler3000 Feb 27, 2025
40db058
More merge conflicts
PotatoPeeler3000 Feb 27, 2025
b0ab361
More merge conflicts part 2 :)
PotatoPeeler3000 Feb 27, 2025
cc28682
Remove unused stuff
PotatoPeeler3000 Feb 27, 2025
1d856fb
Cleanup hardware UI
Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import behavior_msgs.msg.dds.ContinuousWalkingStatusMessage;
import controller_msgs.msg.dds.FootstepDataListMessage;
import ihmc_common_msgs.msg.dds.PoseListMessage;
import std_msgs.msg.dds.Float32;
import std_msgs.msg.dds.Empty;
import us.ihmc.communication.property.StoredPropertySetROS2TopicPair;
import us.ihmc.ros2.ROS2Topic;
Expand All @@ -20,6 +21,7 @@ public class ContinuousHikingAPI
public static final ROS2Topic<Empty> CLEAR_GOAL_FOOTSTEPS = IHMC_ROOT.withModule(moduleName).withType(Empty.class).withSuffix("clear_goal_footsteps");
public static final ROS2Topic<PoseListMessage> PLACED_GOAL_FOOTSTEPS = IHMC_ROOT.withModule(moduleName).withType(PoseListMessage.class).withSuffix("placed_goal_footsteps");
public static final ROS2Topic<PoseListMessage> ROTATE_GOAL_FOOTSTEPS = IHMC_ROOT.withModule(moduleName).withType(PoseListMessage.class).withSuffix("rotate_goal_footsteps");
public static final ROS2Topic<Float32> ROTATE_90_DEGREES = IHMC_ROOT.withModule(moduleName).withType(Float32.class).withSuffix("rotate_90_degrees");
public static final ROS2Topic<Empty> SQUARE_UP_STEP = IHMC_ROOT.withModule(moduleName).withType(Empty.class).withSuffix("rotate_goal_footsteps");

// Statuses supported from the Continuous Hiking Process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.badlogic.gdx.graphics.g3d.RenderableProvider;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Pool;
import com.studiohartman.jamepad.ControllerButton;
import controller_msgs.msg.dds.FootstepDataListMessage;
import controller_msgs.msg.dds.FootstepStatusMessage;
import controller_msgs.msg.dds.PlanOffsetStatus;
Expand All @@ -15,6 +16,7 @@
import imgui.ImGui;
import imgui.type.ImBoolean;
import std_msgs.msg.dds.Empty;
import std_msgs.msg.dds.Float32;
import us.ihmc.avatar.drcRobot.DRCRobotModel;
import us.ihmc.avatar.drcRobot.ROS2SyncedRobotModel;
import us.ihmc.behaviors.activeMapping.ContinuousHikingLogger;
Expand Down Expand Up @@ -42,7 +44,6 @@
import us.ihmc.footstepPlanning.swing.SwingPlannerParametersBasics;
import us.ihmc.footstepPlanning.tools.SwingPlannerTools;
import us.ihmc.log.LogTools;
import us.ihmc.mecano.frames.MovingReferenceFrame;
import us.ihmc.perception.gpuHeightMap.RapidHeightMapManager;
import us.ihmc.perception.comms.PerceptionComms;
import us.ihmc.perception.heightMap.TerrainMapData;
Expand Down Expand Up @@ -107,7 +108,10 @@ public class RDXContinuousHikingPanel extends RDXPanel implements RenderableProv
private boolean publishAndSubscribe;
private double simulatedDriftInMeters = -0.1;

private final ROS2Publisher<PoseListMessage> turningPublisher;
private final ROS2Publisher<Float32> turn90DegreesPublisher;
private boolean previousRightBumper;
private boolean previousLeftBumper;
private boolean previousYButton;

public RDXContinuousHikingPanel(RDXBaseUI baseUI, ROS2Node ros2Node, DRCRobotModel robotModel, ROS2SyncedRobotModel syncedRobotModel)
{
Expand All @@ -122,6 +126,14 @@ public RDXContinuousHikingPanel(RDXBaseUI baseUI, ROS2Node ros2Node, DRCRobotMod
planOffsetStatusPublisher = ros2Node.createPublisher(getTopic(PlanOffsetStatus.class, robotModel.getSimpleRobotName()));
clearGoalFootstepsPublisher = ros2Node.createPublisher(ContinuousHikingAPI.CLEAR_GOAL_FOOTSTEPS);

MonteCarloFootstepPlannerParameters monteCarloPlannerParameters = new MonteCarloFootstepPlannerParameters();
terrainPlanningDebugger = new RDXTerrainPlanningDebugger(ros2Node,
monteCarloPlannerParameters,
robotModel.getContactPointParameters().getControllerFootGroundContactPoints());

ros2Node.createSubscription(HumanoidControllerAPI.getTopic(WalkingControllerFailureStatusMessage.class, robotModel.getSimpleRobotName()),
(s) -> terrainPlanningDebugger.reset());

ros2Node.createSubscription2(ContinuousHikingAPI.START_AND_GOAL_FOOTSTEPS, this::onStartAndGoalPosesReceived);
ros2Node.createSubscription2(ContinuousHikingAPI.PLANNED_FOOTSTEPS, this::onPlannedFootstepsReceived);
ros2Node.createSubscription2(ContinuousHikingAPI.MONTE_CARLO_FOOTSTEP_PLAN, this::onMonteCarloPlanReceived);
Expand All @@ -139,24 +151,16 @@ public RDXContinuousHikingPanel(RDXBaseUI baseUI, ROS2Node ros2Node, DRCRobotMod
defaultContactPoints.put(robotSide, defaultFoothold);
}

turningPublisher = ros2Node.createPublisher(ContinuousHikingAPI.ROTATE_GOAL_FOOTSTEPS);
turn90DegreesPublisher = ros2Node.createPublisher(ContinuousHikingAPI.ROTATE_90_DEGREES);

StancePoseCalculator stancePoseCalculator = new StancePoseCalculator(defaultContactPoints);
stancePoseSelectionPanel = new RDXStancePoseSelectionPanel(baseUI, ros2Node, stancePoseCalculator);
addChild(stancePoseSelectionPanel);

MonteCarloFootstepPlannerParameters monteCarloPlannerParameters = new MonteCarloFootstepPlannerParameters();
DefaultFootstepPlannerParametersBasics footstepPlannerParameters = robotModel.getFootstepPlannerParameters("ForContinuousWalking");
SwingPlannerParametersBasics swingPlannerParameters = robotModel.getSwingPlannerParameters();
this.swingTrajectoryParameters = robotModel.getWalkingControllerParameters().getSwingTrajectoryParameters();

terrainPlanningDebugger = new RDXTerrainPlanningDebugger(ros2Node,
monteCarloPlannerParameters,
robotModel.getContactPointParameters().getControllerFootGroundContactPoints());

ros2Node.createSubscription(HumanoidControllerAPI.getTopic(WalkingControllerFailureStatusMessage.class, robotModel.getSimpleRobotName()),
(s) -> terrainPlanningDebugger.reset());

hostStoredPropertySets = new ImGuiRemoteROS2StoredPropertySetGroup(ros2Node);
continuousHikingParameters = new ContinuousHikingParameters();
createParametersPanel(continuousHikingParameters,
Expand Down Expand Up @@ -292,13 +296,13 @@ public void renderImGuiWidgets()

if (ImGui.button("Turn Left 90°"))
{
turnRobot(Math.PI / 2.0);
turnRobot((float) (Math.PI / 2.0));
}
ImGui.sameLine();

if (ImGui.button("Turn Right 90°"))
{
turnRobot(-Math.PI / 2.0);
turnRobot((float) (-Math.PI / 2.0));
}

if (ImGui.collapsingHeader("Continuous Hiking Parameters"))
Expand Down Expand Up @@ -363,17 +367,13 @@ public void renderImGuiWidgets()
{
publishContinuousHikingCommandWithEnabled();
}
else if ((ImGui.isKeyDown(ImGuiTools.getLeftArrowKey()) || ImGui.isKeyDown(ImGuiTools.getRightArrowKey())) && ImGui.getIO().getKeyShift())
{
publishContinuousHikingCommandSideStepEnabled(ImGui.isKeyDown(ImGuiTools.getLeftArrowKey()));
}
else if (controllerConnected)
{
if (joystickController.getButton(joystickController.getMapping().buttonA))
{
publishJoystickStatus(joystickController);
}

if (joystickController.getButton(joystickController.getMapping().buttonX))
{
publishStopContinuousHiking();
}
performJoystickControllerAction(joystickController);
}

// Pressing this key will stop Continuous Hiking
Expand All @@ -388,6 +388,46 @@ else if (ImGui.isKeyPressed(ImGuiTools.getEscapeKey()))
}
}

private void performJoystickControllerAction(Controller joystickController)
{
boolean currentYButtonPressed = joystickController.getButton(ControllerButton.Y.ordinal());
boolean currentLeftBumper = joystickController.getButton(ControllerButton.LEFTBUMPER.ordinal());
boolean currentRightBumper = joystickController.getButton(ControllerButton.RIGHTBUMPER.ordinal());

if (previousYButton && !currentYButtonPressed)
{
squareUpPublisher.publish(new Empty());
}

if (previousLeftBumper && !currentLeftBumper)
{
turnRobot((float) (Math.PI / 2.0));
}

if (previousRightBumper && !currentRightBumper)
{
turnRobot((float) (-Math.PI / 2.0));
}

if (joystickController.getButton(joystickController.getMapping().buttonA))
{
publishJoystickStatus(joystickController);
}

if (joystickController.getButton(joystickController.getMapping().buttonX) && joystickController.getButton(ControllerButton.DPAD_DOWN.ordinal()))
{
publishStopContinuousHikingGracefully();
}
else if (joystickController.getButton(joystickController.getMapping().buttonX))
{
publishStopContinuousHiking();
}

previousYButton = joystickController.getButton(ControllerButton.Y.ordinal());
previousLeftBumper = joystickController.getButton(ControllerButton.LEFTBUMPER.ordinal());
previousRightBumper = joystickController.getButton(ControllerButton.RIGHTBUMPER.ordinal());
}

public void processImGui3DViewInput(ImGui3DViewInput input)
{
stancePoseSelectionPanel.processImGui3DViewInput(input);
Expand All @@ -405,30 +445,11 @@ public void clearPlannedFootsteps()
clearGoalFootstepsPublisher.publish(new Empty());
}

public void turnRobot(double rotationRadians)
public void turnRobot(float rotationRadians)
{
MovingReferenceFrame midFeetZUpFrame = syncedRobotModel.getReferenceFrames().getMidFeetZUpFrame();
FramePose3D midFeetZUpPose = new FramePose3D(midFeetZUpFrame, midFeetZUpFrame.getTransformToWorldFrame());
SideDependentList<FramePose3D> goalPoses = new SideDependentList<>(new FramePose3D(syncedRobotModel.getReferenceFrames().getMidFeetZUpFrame()),
new FramePose3D(syncedRobotModel.getReferenceFrames().getMidFeetZUpFrame()));

midFeetZUpPose.appendYawRotation(rotationRadians);
goalPoses.get(RobotSide.RIGHT).set(midFeetZUpPose);
goalPoses.get(RobotSide.RIGHT).changeFrame(syncedRobotModel.getReferenceFrames().getMidFeetZUpFrame());
goalPoses.get(RobotSide.RIGHT).appendTranslation(0, -0.15, 0);

goalPoses.get(RobotSide.LEFT).set(midFeetZUpPose);
goalPoses.get(RobotSide.LEFT).changeFrame(syncedRobotModel.getReferenceFrames().getMidFeetZUpFrame());
goalPoses.get(RobotSide.LEFT).appendTranslation(0, 0.15, 0);

List<Pose3D> poses = new ArrayList<>();
poses.add(new Pose3D(goalPoses.get(RobotSide.LEFT)));
poses.add(new Pose3D(goalPoses.get(RobotSide.RIGHT)));

PoseListMessage poseListMessage = new PoseListMessage();
MessageTools.packPoseListMessage(poses, poseListMessage);

turningPublisher.publish(poseListMessage);
std_msgs.msg.dds.Float32 rotationInRadians = new Float32();
rotationInRadians.setData(rotationRadians);
turn90DegreesPublisher.publish(rotationInRadians);
}

/**
Expand Down Expand Up @@ -529,6 +550,30 @@ private void publishContinuousHikingCommandWithEnabled()
commandMessage.setEnableContinuousHiking(true);
commandMessage.setStepsBeforeSafetyStop((int) stepsBeforeSafetyStop.getDoubleValue());
commandMessage.setWalkForwards(true);
commandMessage.setSideStep(false);
commandMessage.setLeftDirection(false);
commandMessage.setSquareUpToGoal(squareUpToGoal.get());
commandMessage.setUseAstarFootstepPlanner(useAStarFootstepPlanner.get());
commandMessage.setUseMonteCarloFootstepPlanner(useMonteCarloFootstepPlanner.get());
commandMessage.setUseMonteCarloPlanAsReference(useMonteCarloReference.get());
commandMessage.setUsePreviousPlanAsReference(!useMonteCarloReference.get());

commandMessage.setUseJoystickController(false);
commandMessage.setForwardValue(0.0);
commandMessage.setWalkBackwards(false);
commandMessage.setLateralValue(0.0);
commandMessage.setTurningValue(0.0);

commandPublisher.publish(commandMessage);
}

private void publishContinuousHikingCommandSideStepEnabled(boolean leftDirection)
{
commandMessage.setEnableContinuousHiking(true);
commandMessage.setStepsBeforeSafetyStop((int) stepsBeforeSafetyStop.getDoubleValue());
commandMessage.setWalkForwards(true);
commandMessage.setSideStep(true);
commandMessage.setLeftDirection(leftDirection);
commandMessage.setSquareUpToGoal(squareUpToGoal.get());
commandMessage.setUseAstarFootstepPlanner(useAStarFootstepPlanner.get());
commandMessage.setUseMonteCarloFootstepPlanner(useMonteCarloFootstepPlanner.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class ContinuousHikingParameters extends StoredPropertySet implements Con
public static final DoubleStoredPropertyKey goalPoseForwardDistance = keys.addDoubleKey("Goal pose forward distance");
public static final DoubleStoredPropertyKey goalPoseUpDistance = keys.addDoubleKey("Goal pose up distance");
public static final DoubleStoredPropertyKey goalPoseBackwardDistance = keys.addDoubleKey("Goal pose backward distance");
public static final DoubleStoredPropertyKey goalPoseSidewaysDistance = keys.addDoubleKey("Goal pose sideways distance");
public static final DoubleStoredPropertyKey swingTime = keys.addDoubleKey("Swing time");
public static final DoubleStoredPropertyKey transferTime = keys.addDoubleKey("Transfer time");
public static final DoubleStoredPropertyKey planningTimeoutAsAFractionOfTheStepDuration = keys.addDoubleKey("Planning timeout as a fraction of the step duration");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ default void setGoalPoseBackwardDistance(double goalPoseBackwardDistance)
set(ContinuousHikingParameters.goalPoseBackwardDistance, goalPoseBackwardDistance);
}

default void setGoalPoseSidewaysDistance(double goalPoseSidewaysDistance)
{
set(ContinuousHikingParameters.goalPoseSidewaysDistance, goalPoseSidewaysDistance);
}

default void setSwingTime(double swingTime)
{
set(ContinuousHikingParameters.swingTime, swingTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ default double getGoalPoseBackwardDistance()
return get(goalPoseBackwardDistance);
}

default double getGoalPoseSidewaysDistance()
{
return get(goalPoseSidewaysDistance);
}

default double getSwingTime()
{
return get(swingTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import controller_msgs.msg.dds.QueuedFootstepStatusMessage;
import ihmc_common_msgs.msg.dds.PoseListMessage;
import ihmc_common_msgs.msg.dds.QueueableMessage;
import org.apache.regexp.RE;
import org.jetbrains.annotations.NotNull;
import std_msgs.msg.dds.Float32;
import us.ihmc.avatar.drcRobot.DRCRobotModel;
import us.ihmc.avatar.drcRobot.ROS2SyncedRobotModel;
import us.ihmc.avatar.networkProcessor.footstepPlanningModule.FootstepPlanningModuleLauncher;
Expand Down Expand Up @@ -36,10 +38,12 @@
import us.ihmc.mecano.frames.MovingReferenceFrame;
import us.ihmc.perception.heightMap.TerrainMapData;
import us.ihmc.robotics.robotSide.RobotSide;
import us.ihmc.robotics.robotSide.SideDependentList;
import us.ihmc.robotics.stateMachine.core.State;
import us.ihmc.ros2.ROS2Topic;
import us.ihmc.sensorProcessing.heightMap.HeightMapData;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
Expand Down Expand Up @@ -95,6 +99,7 @@ public JustWaitState(DRCRobotModel robotModel,
controllerFootstepDataTopic = HumanoidControllerAPI.getTopic(FootstepDataListMessage.class, "Nadia");
ros2Helper.createPublisher(controllerFootstepDataTopic);

ros2Helper.subscribeViaCallback(ContinuousHikingAPI.ROTATE_90_DEGREES, this::rotate90Degrees);
ros2Helper.subscribeViaCallback(ContinuousHikingAPI.ROTATE_GOAL_FOOTSTEPS, this::planToGoal);
ros2Helper.subscribeViaCallback(ContinuousHikingAPI.SQUARE_UP_STEP, this::squareUpStep);
}
Expand Down Expand Up @@ -133,6 +138,56 @@ public boolean isDone(double timeInState)
return isDone;
}

public void rotate90Degrees(Float32 float32Message)
{
float rotationRadians = float32Message.getData();

MovingReferenceFrame midFeetZUpFrame = syncedRobot.getReferenceFrames().getMidFeetZUpFrame();
FramePose3D midFeetZUpPose = new FramePose3D(midFeetZUpFrame, midFeetZUpFrame.getTransformToWorldFrame());
SideDependentList<FramePose3D> goalPoses = new SideDependentList<>(new FramePose3D(syncedRobot.getReferenceFrames().getMidFeetZUpFrame()),
new FramePose3D(syncedRobot.getReferenceFrames().getMidFeetZUpFrame()));

if (!controllerQueueMonitor.getControllerFootstepQueue().isEmpty())
{
FramePose3DReadOnly lastFootstepInQueue = controllerQueueMonitor.getLastFootstepInQueue();
RobotSide lastFootstepSide = RobotSide.fromByte(controllerQueueMonitor.getControllerFootstepQueue()
.get(controllerQueueMonitor.getControllerFootstepQueue().size() - 1)
.getRobotSide());

FramePose3D tempMidFeetPose = new FramePose3D();
tempMidFeetPose.set(lastFootstepInQueue);

if (lastFootstepSide == RobotSide.LEFT)
{
tempMidFeetPose.appendTranslation(0, -0.12, 0);
}
else
{
tempMidFeetPose.appendTranslation(0, 0.12, 0);
}

midFeetZUpPose.set(midFeetZUpFrame, tempMidFeetPose);
}

midFeetZUpPose.appendYawRotation(rotationRadians);
goalPoses.get(RobotSide.RIGHT).set(midFeetZUpPose);
goalPoses.get(RobotSide.RIGHT).changeFrame(syncedRobot.getReferenceFrames().getMidFeetZUpFrame());
goalPoses.get(RobotSide.RIGHT).appendTranslation(0, -0.15, 0);

goalPoses.get(RobotSide.LEFT).set(midFeetZUpPose);
goalPoses.get(RobotSide.LEFT).changeFrame(syncedRobot.getReferenceFrames().getMidFeetZUpFrame());
goalPoses.get(RobotSide.LEFT).appendTranslation(0, 0.15, 0);

List<Pose3D> poses = new ArrayList<>();
poses.add(new Pose3D(goalPoses.get(RobotSide.LEFT)));
poses.add(new Pose3D(goalPoses.get(RobotSide.RIGHT)));

PoseListMessage poseListMessage = new PoseListMessage();
MessageTools.packPoseListMessage(poses, poseListMessage);

planToGoal(poseListMessage);
}

public void planToGoal(PoseListMessage poseListMessage)
{
ThreadTools.startAThread(() ->
Expand Down Expand Up @@ -191,12 +246,10 @@ public void planToGoal(PoseListMessage poseListMessage)

FootstepPlannerOutput plannerOutput = footstepPlanner.handleRequest(footstepPlannerRequest);

FootstepPlan newestFootstepPlan = null;
if (plannerOutput == null)
return;

if (plannerOutput != null)
{
newestFootstepPlan = plannerOutput.getFootstepPlan();
}
FootstepPlan newestFootstepPlan = plannerOutput.getFootstepPlan();

FootstepDataListMessage footstepDataListMessage = new FootstepDataListMessage();
footstepDataListMessage.setDefaultSwingDuration(0.8);
Expand All @@ -205,7 +258,6 @@ public void planToGoal(PoseListMessage poseListMessage)

for (int i = 0; i < footstepPlanner.getOutput().getFootstepPlan().getNumberOfSteps(); i++)
{
assert newestFootstepPlan != null;
PlannedFootstep footstep = newestFootstepPlan.getFootstep(i);
footstep.limitFootholdVertices();
footstepDataListMessage.getFootstepDataList().add().set(footstep.getAsMessage());
Expand Down
Loading
Loading