#!/usr/bin/env python
from time import sleep
from drive import RosAriaDriver

from math import sin, cos

robot=RosAriaDriver('/PIONIER3')
skan=robot.ReadLaser()

### zapis i odczyt w formacie json
#import json
## wypisanie do stdout
#print(json.dumps(skan))
##wczytanie danych z pliku
#json_data = open('skan.json')
#data = json.load(json_data)


import matplotlib.pyplot as plt
import numpy as np

x = np.arange(0,512)
theta = (np.pi/512 )*x  # kat w radianach

fig1 = plt.figure()
ax1 = fig1.add_axes([0.1,0.1,0.8,0.8],polar=True)
line, = ax1.plot(theta,skan,lw=2.5)
ax1.set_ylim(0,2)  # zakres odleglosci
plt.show()

