diff --git a/demos/README.md b/demos/README.md index a9f8c2bf..674a7f5c 100644 --- a/demos/README.md +++ b/demos/README.md @@ -50,6 +50,7 @@ You can see the valid command line args for a demo with: The parameters general to all demos are listed here: + --world (str): (Optional) World to use for demo (Bullet or Real). If not defined, spec from config yaml file is used. --ctrl_type (str): Controller type for the demo. --demo_type (str): Type of demo to perform. --test_fn (str): RobotInterface function environment will use to perform actions. Specific to controller type. diff --git a/demos/demo.py b/demos/demo.py index ee7d8311..f428d338 100644 --- a/demos/demo.py +++ b/demos/demo.py @@ -42,6 +42,9 @@ def __init__(self, # Overwrite config file controlType self.config = YamlConfig(self.config_file) self.config['world']['controlType'] = self.ctrl_type + # Use command line argument over the config spec. + if kwargs['world'] is not None: + self.config['world']['type'] = kwargs['world'] self.demo_type = demo_type self.test_fn = test_fn diff --git a/demos/run_gc_demo.py b/demos/run_gc_demo.py index 5e7142c0..a42e9f4c 100644 --- a/demos/run_gc_demo.py +++ b/demos/run_gc_demo.py @@ -8,7 +8,8 @@ parser = argparse.ArgumentParser( description="Test controllers and measure errors.") - +parser.add_argument('--world', default=None, + help='World type for the demo, uses config file if not specified', choices=['Bullet', 'Real']) parser.add_argument('--num_steps', default=500, type=int, help="max steps for demo.") parser.add_argument('--plot_pos', action="store_true", diff --git a/demos/run_jointimp_demo.py b/demos/run_jointimp_demo.py index 41b9a3c3..895326b0 100644 --- a/demos/run_jointimp_demo.py +++ b/demos/run_jointimp_demo.py @@ -5,6 +5,8 @@ parser = argparse.ArgumentParser( description="Test controllers and measure errors.") +parser.add_argument('--world', default=None, help='World type for the demo, uses config file if not specified', choices=['Bullet', 'Real']) + parser.add_argument('--delta_val', default=0.01, type=float, help="Max step size (m or rad) to take for demo.") diff --git a/demos/run_osc_line_demo.py b/demos/run_osc_line_demo.py index f66232d1..89fcc16a 100644 --- a/demos/run_osc_line_demo.py +++ b/demos/run_osc_line_demo.py @@ -7,6 +7,7 @@ parser = argparse.ArgumentParser( description="Run OpSpace Line Demo in XYZ directions") +parser.add_argument('--world', default=None, help='World type for the demo, uses config file if not specified', choices=['Bullet', 'Real']) parser.add_argument('--ctrl_type', default="EEImpedance", help='Type of controller to test', diff --git a/demos/run_osc_rot_demo.py b/demos/run_osc_rot_demo.py index 1c628c3e..7499e1fc 100644 --- a/demos/run_osc_rot_demo.py +++ b/demos/run_osc_rot_demo.py @@ -7,6 +7,8 @@ parser = argparse.ArgumentParser( description="Run OpSpace Line Demo in XYZ directions") +parser.add_argument('--world', default=None, help='World type for the demo, uses config file if not specified', choices=['Bullet', 'Real']) + parser.add_argument('--ctrl_type', default="EEImpedance", help='Type of controller to test', diff --git a/demos/run_osc_square_demo.py b/demos/run_osc_square_demo.py index 02f5b693..760b7696 100644 --- a/demos/run_osc_square_demo.py +++ b/demos/run_osc_square_demo.py @@ -6,6 +6,9 @@ parser = argparse.ArgumentParser( description="Run OpSpace Square Demo ") +parser.add_argument('--world', default=None, + help='World type for the demo, uses config file if not specified', choices=['Bullet', 'Real']) + parser.add_argument('--ctrl_type', default="EEImpedance", help='Type of controller to test',