Skip to content

Commit 818d614

Browse files
Cleaning up GUI and video CLI args
1 parent 959fba8 commit 818d614

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

mm_run/config/sim/simulation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ simulation:
77
home: [0.0, 0.0, 0, 1.5708, -0.7854, 1.5708, -0.7854, 1.5708, 1.3100] # default
88
tool_vicon_name: ThingContainer
99

10-
pybullet_connection: "DIRECT" # "Direct" or "GUI"
10+
gui: False
1111

1212
static_obstacles:
1313
enabled: False

mm_run/nodes/sim_ros.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def main():
4545
config = parsing.load_config(args.config)
4646

4747
if args.GUI:
48-
config["simulation"]["pybullet_connection"] = "GUI"
48+
config["simulation"]["gui"] = True
49+
4950
if args.logging_sub_folder != "default":
5051
config["logging"]["log_dir"] = os.path.join(
5152
config["logging"]["log_dir"], args.logging_sub_folder

mm_run/scripts/experiments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def main():
9090
)
9191

9292
if args.GUI:
93-
config["simulation"]["pybullet_connection"] = "GUI"
93+
config["simulation"]["gui"] = True
9494

9595
sim_config = config["simulation"]
9696
ctrl_config = config["controller"]

mm_simulator/src/mm_simulator/simulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ def __init__(self, config, timestamp, cli_args=None):
340340
self.timestep = config["timestep"]
341341
self.duration = config["duration"]
342342

343-
if config["pybullet_connection"] == "GUI":
343+
if config["gui"]:
344344
pyb.connect(pyb.GUI, options="--width=1280 --height=720")
345-
elif config["pybullet_connection"] == "DIRECT":
345+
else:
346346
pyb.connect(pyb.DIRECT)
347347

348348
pyb.setGravity(*config["gravity"])
@@ -389,8 +389,8 @@ def __init__(self, config, timestamp, cli_args=None):
389389
debug_frame_world(0.2, list(r_ew_w), orientation=Q_we, line_width=3)
390390

391391
# video recording
392-
video_name = cli_args.video if cli_args is not None else None
393-
if video_name is not None:
392+
if cli_args is not None and "video" in cli_args:
393+
video_name = cli_args.video
394394
self.video_manager = VideoManager.from_config(
395395
video_name=video_name, config=config, timestamp=timestamp, r_ew_w=r_ew_w
396396
)

0 commit comments

Comments
 (0)