Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some wrap up stuff #50

Merged
merged 8 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
folder organized
pmu refined
  • Loading branch information
LechengKong committed Jul 13, 2018
commit a28f3af371cab0b7aabda42534835e58d4f5c6ed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 29 additions & 27 deletions src/pi/IMU_Lidar/devices_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def filenames(alive,duration,cameraFreq,beginTime):
startTime = time.time()
lastTime = time.time()
current = time.time()
while current-startTime<duration and not alive.is_set():
while current - startTime < duration and not alive.is_set():
current = time.time()
if current-lastTime>cameraFreq:
if current - lastTime > cameraFreq:
#name = time.time()
name = beginTime+'/camera/'+str(current)+'.jpg'
lastTime = time.time()
Expand Down Expand Up @@ -65,28 +65,8 @@ def whoAmI(self):
"""
A function that could be called to tell what device it is
"""
print("My name is {}, I am a {} device".format(self.name,self.type))
print("My name is {}, I am a {} device".format(self.name, self.type))

class pmucounter(device):
"""
PMU reader
"""
def __init__(self, name = "P"):
self.name = name
self.type = "counter"
self.__conn = counter

def getValue(self):
return self.__conn.ccnt_read()

def getFieldSize(self):
return 1

def getHeader(self):
return ("PMUreading")

def detect(self):
return True

class sensor(device):
"""
Expand Down Expand Up @@ -137,6 +117,26 @@ def detect(self):
print("I am virtual")
return False

class pmucounter(sensor):
"""
PMU (Performance Monitoring Unit) reader
"""
def __init__(self, name = "P"):
self.name = name
self.type = "counter"
self.__conn = counter

def getValue(self):
return self.__conn.ccnt_read()

def getFieldSize(self):
return 1

def getHeader(self):
return ("PMUreading")

def detect(self):
return True

class IMU(sensor):
"""
Expand Down Expand Up @@ -383,7 +383,8 @@ def getSensor(alive,rowList,duration,precision,datafile,timers):



def getSensorAndCamera(host='192.168.1.121',port=6000,save=False,duration=5,endless=False,trAccRate=6,trGyroRate=6,trMagRate=7,accScale=2,gyroScale=245,magScale=4,cameraFreq=5,imuRate=50,lidarRate=50,precision=0.001):
def getSensorAndCamera(host='192.168.1.121',port=6000,save=False,duration=5,endless=False,trAccRate=6,trGyroRate=6,
trMagRate=7,accScale=2,gyroScale=245,magScale=4,cameraFreq=5,imuRate=50,lidarRate=50,precision=0.001,tm=[]):
"""
A easy to use logging version supporting camera data logging, IMU reading, Lidar reading
"""
Expand All @@ -402,10 +403,11 @@ def getSensorAndCamera(host='192.168.1.121',port=6000,save=False,duration=5,endl
imu.calibrate()
lidar = LiDar()
pc = pmucounter()
imu_timer = Timer(imu,imuRate)
lidar_timer = Timer(lidar,lidarRate)
pc_timer = Timer(pc, 0.02)
imu_timer = Timer(imu, imuRate)
lidar_timer = Timer(lidar, lidarRate)
a = [None]
timers = [pc,lidar_timer,imu_timer]
timers = [pc_timer,lidar_timer,imu_timer]+tm[0:]
for timer in timers:
a+=timer.kit.getHeader()[0:]
rowList.append(a)
Expand Down
Binary file removed src/pi/comm_scripts/config/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/config/settings.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/contrib/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/contrib/incoming_message.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/contrib/message.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/contrib/outgoing_message.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/core/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/core/network.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/experiments/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/experiments/driver/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/experiments/driver/driver.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/helpers/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/helpers/helpers.pyc
Binary file not shown.
Binary file removed src/pi/comm_scripts/tests/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file removed src/pi/comm_scripts/tests/travel_time/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions src/pi/comm_scripts/timing_output.log

This file was deleted.

Binary file not shown.