def main(): """Use this function if you'd like to test without ROS. If you're testing at home, you might have to do additional setup to get matlab engine stuff. Look up how to install the matlab engine api in python. """ start = np.array([1, 1, 0, 0]) goal = np.array([9, 9, 0, 0]) xy_low = [0, 0] xy_high = [10, 10] phi_max = 0.6 u1_max = 2 u2_max = 3 obstacles = [[6, 3.5, 1.5], [3.5, 6.5, 1]] config = BicycleConfigurationSpace( xy_low + [-1000, -phi_max], xy_high + [1000, phi_max], [-u1_max, -u2_max], [u1_max, u2_max], obstacles, 0.15) engine = matlab.engine.start_matlab() # Start a matlab instance. planner = OptimizationPlanner(config, engine) plan = planner.plan_to_pose(start, goal) planner.plot_execution()
def main(): """Use this function if you'd like to test without ROS. If you're testing at home without ROS, you might want to get rid of the rospy.is_shutdown check in the main planner loop (and the corresponding rospy import). """ start = np.array([1, 1, 0, 0]) goal = np.array([9, 9, 0, 0]) xy_low = [0, 0] xy_high = [10, 10] phi_max = 0.6 u1_max = 2 u2_max = 3 obstacles = [[6, 3.5, 1.5], [3.5, 6.5, 1]] config = BicycleConfigurationSpace( xy_low + [-1000, -phi_max], xy_high + [1000, phi_max], [-u1_max, -u2_max], [u1_max, u2_max], obstacles, 0.15) planner = RRTPlanner(config, max_iter=10000, expand_dist=0.8) plan = planner.plan_to_pose(start, goal) planner.plot_execution()
def main(): """Use this function if you'd like to test without ROS. """ start = np.array([1, 1, 0, 0]) goal = np.array([1, 1.3, 0, 0]) xy_low = [0, 0] xy_high = [5, 5] phi_max = 0.6 u1_max = 2 u2_max = 3 obstacles = [] config = BicycleConfigurationSpace( xy_low + [-1000, -phi_max], xy_high + [1000, phi_max], [-u1_max, -u2_max], [u1_max, u2_max], obstacles, 0.15) planner = SinusoidPlanner(config) plan = planner.plan_to_pose(start, goal, 0.01, 2.0) planner.plot_execution()