예제 #1
0
def test_experiments():
    '''
    Test that all experiments configs are working
    '''
    for name, config in standard_experiments.iteritems():
        print("Running %s..." % name)
        config = config.copy()
        config['number_of_iterations'] = 100
        config['display_type'] = None
        config['debug_period'] = 50
        run_config(config)
def run_standard_experiment(experiment_name, visualization=True):
    '''
    A helper to run an experiment from standard_experiments dict
    :param experiment_name: a key into standard_experiments
    :param visualization: whether to run visualization
    '''
    try:
        config = standard_experiments[experiment_name].copy()
    except KeyError:
        raise KeyError("There is no %s experiment. Available keys: %s" % (experiment_name, standard_experiments.keys()))
    if not visualization:
        config['display_type'] = None
    run_config(config)
예제 #3
0
from sparse_rrt.experiments.experiment_utils import run_config

# config for experiments with Car
base_car_config = dict(start_state=[0., 0., 0.],
                       goal_state=[9., 9., 0.],
                       goal_radius=0.5,
                       random_seed=0,
                       sst_delta_near=0.6,
                       sst_delta_drain=0.2,
                       integration_step=0.002,
                       min_time_steps=20,
                       max_time_steps=200,
                       debug_period=1000,
                       number_of_iterations=300000,
                       display_type='tree')

# different configs for cpp and py implementations of the system
cpp_car_config = dict(system='car', **base_car_config)
py_car_config = dict(system='py_car', **base_car_config)

# different configs with different planners
rrt_car_config = dict(planner='rrt', **cpp_car_config)
sst_car_config = dict(planner='sst', **cpp_car_config)
rrt_py_car_config = dict(planner='rrt', **py_car_config)
sst_py_car_config = dict(planner='sst', **py_car_config)

if __name__ == '__main__':
    run_config(rrt_car_config)
예제 #4
0
from sparse_rrt.experiments.experiment_utils import run_config

# config for experiments with CartPole
cart_pole_config = dict(
    system='cart_pole',
    start_state=[-20, 0, 3.14, 0],
    goal_state=[20, 0, 3.14, 0],
    goal_radius=1.5,
    random_seed=0,
    sst_delta_near=2.,
    sst_delta_drain=1.2,
    integration_step=0.02,
    min_time_steps=10,
    max_time_steps=50,
    number_of_iterations=300000,
    display_type='tree'
)


# different configs with different planners
rrt_cart_pole_config = dict(planner='rrt', **cart_pole_config)
sst_cart_pole_config = dict(planner='sst', **cart_pole_config)


if __name__ == '__main__':
    run_config(sst_cart_pole_config)
예제 #5
0
                         goal_state=[9., 9.],
                         goal_radius=0.5,
                         random_seed=0,
                         sst_delta_near=0.4,
                         sst_delta_drain=0.2,
                         integration_step=0.002,
                         min_time_steps=20,
                         max_time_steps=200,
                         number_of_iterations=300000,
                         display_type='tree')

# different configs for cpp and py implementations of the system
cpp_point_config = dict(system='point', **base_point_config)
py_point_config = dict(system='py_point', **base_point_config)
# a point without any obstacles
free_point_config = dict(
    system=standard_cpp_systems.Point(number_of_obstacles=0),
    **base_point_config)

# different configs with different planners
rrt_point_config = dict(planner='rrt', **cpp_point_config)
sst_point_config = dict(planner='sst', **cpp_point_config)
rrt_py_point_config = dict(planner='rrt', **py_point_config)
sst_py_point_config = dict(planner='sst', **py_point_config)

rrt_free_point_config = dict(planner='rrt', **free_point_config)
sst_free_point_config = dict(planner='sst', **free_point_config)

if __name__ == '__main__':
    run_config(rrt_point_config)
예제 #6
0
from sparse_rrt.experiments.experiment_utils import run_config

# experiments with Acrobot
base_acrobot_config = dict(start_state=[0., 0., 0., 0],
                           goal_state=[3.14, 0., 0., 0.],
                           goal_radius=2.0,
                           random_seed=0,
                           sst_delta_near=1.,
                           sst_delta_drain=0.5,
                           integration_step=0.02,
                           min_time_steps=10,
                           max_time_steps=50,
                           number_of_iterations=300000,
                           display_type='nodes')

# different configs for cpp and py implementations of the system
cpp_acrobot_config = dict(system='two_link_acrobot', **base_acrobot_config)
py_acrobot_config = dict(system='py_acrobot', **base_acrobot_config)

# different configs with different planners
rrt_acrobot_config = dict(planner='rrt', **cpp_acrobot_config)
sst_acrobot_config = dict(planner='sst', **cpp_acrobot_config)
rrt_py_acrobot_config = dict(planner='rrt', **py_acrobot_config)
sst_py_acrobot_config = dict(planner='sst', **py_acrobot_config)

if __name__ == '__main__':
    run_config(sst_py_acrobot_config)
예제 #7
0
from sparse_rrt.experiments.experiment_utils import run_config

# experiments with single-joint Pendulum
base_pendulum_config = dict(start_state=[0., 0.],
                            goal_state=[1.57, 0.],
                            goal_radius=0.1,
                            random_seed=0,
                            sst_delta_near=0.3,
                            sst_delta_drain=0.1,
                            integration_step=0.002,
                            min_time_steps=20,
                            max_time_steps=200,
                            number_of_iterations=300000,
                            display_type='tree')

# different configs for cpp and py implementations of the system
cpp_pendulum_config = dict(system='pendulum', **base_pendulum_config)
py_pendulum_config = dict(system='py_pendulum', **base_pendulum_config)

# different configs with different planners
rrt_pendulum_config = dict(planner='rrt', **cpp_pendulum_config)
sst_pendulum_config = dict(planner='sst', **cpp_pendulum_config)
rrt_py_pendulum_config = dict(planner='rrt', **py_pendulum_config)
sst_py_pendulum_config = dict(planner='sst', **py_pendulum_config)

if __name__ == '__main__':
    run_config(rrt_pendulum_config)
예제 #8
0
from sparse_rrt.experiments.experiment_utils import run_config

# experiments with a 6 dimensional rally car
rally_car_config = dict(system='rally_car',
                        start_state=[18., -30, 0, 16, 1.57, 0, 0, 0],
                        goal_state=[-18., -30, 0, -16, -1.57, 0, 0, 0],
                        goal_radius=5,
                        random_seed=0,
                        sst_delta_near=.5,
                        sst_delta_drain=.3,
                        integration_step=0.002,
                        min_time_steps=20,
                        max_time_steps=200,
                        number_of_iterations=300000,
                        display_type='tree')

# different configs with different planners
rrt_rally_car_config = dict(planner='rrt', **rally_car_config)
sst_rally_car_config = dict(planner='sst', **rally_car_config)

if __name__ == '__main__':
    run_config(sst_rally_car_config)