Ejemplo n.º 1
0
def run_a_star_algo():
    is_input_valid, init_pos, target_pos, orientation, clearance_req = receive_inputs(
    )

    if is_input_valid:
        init_pos = init_pos[0], init_pos[1]
        target_pos = target_pos[0], target_pos[1]

        # parameters of the turtle_bot referred from turtle bot's data sheet
        #t_bot = TurtleBot(radius=(0.354/2), clearance=clearance_req, wheel_rad=(0.076/2), dist_bet_wheels=0.354)
        t_bot = TurtleBot(radius=(0.105),
                          clearance=clearance_req,
                          wheel_rad=(0.033),
                          dist_bet_wheels=0.16)

        c_space = ConfigurationSpace(x_limit=(-5, 5),
                                     y_limit=(-5, 5),
                                     radius_of_bot=t_bot.radius,
                                     clearance=clearance_req)

        path_explorer = PathExplorer()
        path_params = path_explorer.start_path_planning(
            init_pos, target_pos, orientation, t_bot, c_space, EUCL_HEURISTIC)
        return path_params
Ejemplo n.º 2
0
import math
import numpy as np
from input_receiver import receive_inputs
from pathexplorer import PathExplorer
from configurationspace import ConfigurationSpace
from heuristics import EUCL_HEURISTIC, MANHTN_HEURISTIC


if __name__ == "__main__":

    is_input_valid, init_pos, target_pos, robot_radius, clearance_req = receive_inputs(is_robot_rigid = False)

    if is_input_valid:
        init_pos = init_pos[1], init_pos[0]
        target_pos = target_pos[1], target_pos[0]

        c_space = ConfigurationSpace(height=200, width=300)
        c_space_map = c_space.get_cspace_map()

        path_explorer = PathExplorer()
        path_explorer.find_path(init_pos, target_pos, c_space_map, MANHTN_HEURISTIC)

        

     

Ejemplo n.º 3
0
import math
import numpy as np
from input_receiver import receive_inputs
from pathexplorer import PathExplorer
from configurationspace import ConfigurationSpace
from heuristics import EUCL_HEURISTIC, MANHTN_HEURISTIC

if __name__ == "__main__":

    is_input_valid, init_pos, target_pos, orientation, robot_radius, clearance_req, step_size = receive_inputs(
        is_robot_rigid=True)

    if is_input_valid:
        init_pos = init_pos[1], init_pos[0]
        target_pos = target_pos[1], target_pos[0]

        c_space = ConfigurationSpace(height=200,
                                     width=300,
                                     radius_of_bot=robot_radius,
                                     clearance=clearance_req)
        c_space_map = c_space.get_cspace_map()

        path_explorer = PathExplorer()
        path_explorer.find_path(init_pos, target_pos, orientation, step_size,
                                c_space, c_space_map, EUCL_HEURISTIC)
Ejemplo n.º 4
0
    def is_edge_intersecting(self, p1, p2, obstacle_list):
        for obstacle in obstacle_list:
            if oc.is_line_circle_intersecting(p1, p2, obstacle[1],
                                              obstacle[0]):
                return True
        return False


if __name__ == "__main__":
    t_bot = TurtleBot(radius=(0.105),
                      clearance=0.4,
                      wheel_rad=(0.033),
                      dist_bet_wheels=0.16)
    c_space = ConfigurationSpace(x_limit=(-5, 5),
                                 y_limit=(-5, 5),
                                 radius_of_bot=t_bot.radius,
                                 clearance=0.45)
    plotter = CSpacePlotter(c_space)

    fig, ax = plt.subplots()
    plt.xlim(c_space.x_limit[0] - 0.1, c_space.x_limit[1] + 0.1)
    plt.ylim(c_space.y_limit[0] - 0.1, c_space.y_limit[1] + 0.1)
    plt.grid()
    ax.set_aspect('equal')

    plotter.plotMap(fig, ax)
    plt.savefig("c_space.png")

    fig.show()
    plt.draw()
    plt.show()