Skip to content

Commit 904342d

Browse files
committed
add more option in custom scene loader
1 parent 4305934 commit 904342d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

ihmc-high-level-behaviors/src/libgdx/java/us/ihmc/rdx/simulation/environment/RDXCustomSceneLoader.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import us.ihmc.euclid.transform.RigidBodyTransform;
99
import us.ihmc.euclid.tuple3D.Point3D;
1010
import us.ihmc.euclid.yawPitchRoll.YawPitchRoll;
11+
import us.ihmc.log.LogTools;
1112
import us.ihmc.perception.sceneGraph.SceneNode;
1213
import us.ihmc.perception.sceneGraph.modification.SceneGraphNodeAddition;
1314
import us.ihmc.rdx.perception.sceneGraph.RDXPredefinedRigidBodySceneNode;
@@ -23,6 +24,8 @@ public class RDXCustomSceneLoader
2324
{
2425
public enum RDXDemoScene
2526
{
27+
FLAT_GROUND,
28+
ROUGH_TERRAIN,
2629
EXPLOSIVE_BREACHING_A,
2730
EXPLOSIVE_BREACHING_B,
2831
EXPLOSIVE_BREACHING_C,
@@ -191,7 +194,7 @@ public void loadCustomScene(RDXDemoScene demoScene)
191194
break;
192195

193196
default:
194-
throw new IllegalArgumentException("Unknown demo scene: " + demoScene);
197+
break;
195198
}
196199
}
197200

@@ -224,6 +227,7 @@ public String getEnvironmentName(RDXDemoScene demoScene)
224227
{
225228
case EXPLOSIVE_BREACHING_A -> "BreachingDemoA.json";
226229
case EXPLOSIVE_BREACHING_B -> "BreachingDemoB.json";
230+
case ROUGH_TERRAIN -> "HarderTerrain.json";
227231
default -> "FlatGround.json";
228232
};
229233
}
@@ -237,7 +241,15 @@ public void trackEnvironment(ArrayList<RDXEnvironmentObject> objects)
237241
SceneNode sceneNode = sceneNodesMap.get(object.getName() + nodeIndex);
238242
if (sceneNode != null)
239243
{
240-
object.setTransformToWorld(sceneNode.getNodeFrame().getTransformToWorldFrame());
244+
try
245+
{
246+
object.setTransformToWorld(sceneNode.getNodeFrame().getTransformToWorldFrame());
247+
}
248+
catch (Exception e)
249+
{
250+
// Exception is caught and ignored. We still get some "is not a Rotation matrix" errors
251+
LogTools.warn("Not a Rotation Matrix tolerance not met");
252+
}
241253
}
242254
}
243255
}
@@ -259,6 +271,7 @@ public void moveManipulatedObject()
259271
catch (Exception e)
260272
{
261273
// Exception is caught and ignored. We still get some "is not a Rotation matrix" errors
274+
LogTools.warn("Not a Rotation Matrix tolerance not met");
262275
}
263276
}
264277
});

0 commit comments

Comments
 (0)