Ejemplo n.º 1
0
def irRight():
    """Returns state of Right IR Obstacle sensor."""
    irrx = sim_x + SIM_AXLE / 2 * sin(sim_direction) + SIM_FRONT * cos(sim_direction)
    irry = sim_y - SIM_AXLE / 2 * cos(sim_direction) + SIM_FRONT * sin(sim_direction)
    return sim_course.sim_atblock(irrx, irry)
Ejemplo n.º 2
0
def irLeft():
    """Returns state of Left IR Obstacle sensor."""
    irlx = sim_x - SIM_AXLE / 2 * sin(sim_direction) + SIM_FRONT * cos(sim_direction)
    irly = sim_y + SIM_AXLE / 2 * cos(sim_direction) + SIM_FRONT * sin(sim_direction)
    return sim_course.sim_atblock(irlx, irly)