Skip to content

Commit

Permalink
Merge pull request WPI-AIM#10 from ajlewis02/master
Browse files Browse the repository at this point in the history
Replaced Point with PointArray where necessary. closes WPI-AIM#12
  • Loading branch information
nag92 authored Jul 17, 2020
2 parents 04ad6df + 78c7b2f commit c39448c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Vicon/Devices/Accel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
# //==============================================================================

from . import Devices
from GaitCore.Core import Point
from GaitCore.Core import PointArray


class Accel(Devices.Devices):

def __init__(self, name, sensor):
accel = Point.Point(sensor["ACCX"]["data"],
accel = PointArray.PointArray(sensor["ACCX"]["data"],
sensor["ACCY"]["data"],
sensor["ACCZ"]["data"])
super(Accel, self).__init__(name, accel, "Accel")
Expand Down
4 changes: 2 additions & 2 deletions Vicon/Devices/EMG.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
# //==============================================================================

from . import Devices
from GaitCore.Core import Point
from GaitCore.Core import PointArray

class EMG(Devices.Devices):

def __init__(self, name, sensor):
emg = Point.Point(sensor["data"],sensor["data"],sensor["data"])
emg = PointArray.PointArray(sensor["data"],sensor["data"],sensor["data"])
super(EMG, self).__init__(name, emg, "EMG")


Expand Down
8 changes: 4 additions & 4 deletions Vicon/Devices/ForcePlate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@


from . import Devices
from GaitCore.Core import Point
from GaitCore.Core import PointArray
from GaitCore.Core import Newton

class ForcePlate(Devices.Devices):

def __init__(self, name, forces, moments, CoP):
self.force = Point.Point(forces["Fx"]["data"], forces["Fy"]["data"], forces["Fz"]["data"])
self.moment = Point.Point(moments["Mx"]["data"], moments["My"]["data"], moments["Mz"]["data"])
self.CoP = Point.Point(CoP["Cx"]["data"], CoP["Cy"]["data"], CoP["Cz"]["data"])
self.force = PointArray.PointArray(forces["Fx"]["data"], forces["Fy"]["data"], forces["Fz"]["data"])
self.moment = PointArray.PointArray(moments["Mx"]["data"], moments["My"]["data"], moments["Mz"]["data"])
self.CoP = PointArray.PointArray(CoP["Cx"]["data"], CoP["Cy"]["data"], CoP["Cz"]["data"])
sensor = Newton.Newton(self.CoP, self.force, self.moment, None)
super(ForcePlate, self).__init__(name, sensor, "IMU")

Expand Down
4 changes: 2 additions & 2 deletions Vicon/Devices/Gyro.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
# //==============================================================================

from . import Devices
from GaitCore.Core import Point
from GaitCore.Core import PointArray


class Gyro(Devices.Devices):

def __init__(self, name, sensor):
gyro = Point.Point(sensor["GYROX"]["data"],
gyro = PointArray.PointArray(sensor["GYROX"]["data"],
sensor["GYROY"]["data"],
sensor["GYROZ"]["data"])
super(Gyro, self).__init__(name, gyro, "Gyro")
Expand Down
7 changes: 3 additions & 4 deletions Vicon/Devices/IMU.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@
# //==============================================================================

from . import Devices
from GaitCore.Core import Point
from GaitCore.Core import PointArray

class IMU(Devices.Devices):

def __init__(self, name, sensor):

self._accel = Point.Point(sensor["ACCX"]["data"],
self._accel = PointArray.PointArray(sensor["ACCX"]["data"],
sensor["ACCY"]["data"],
sensor["ACCZ"]["data"])
self._gyro = Point.Point(sensor["GYROX"]["data"],
self._gyro = PointArray.PointArray(sensor["GYROX"]["data"],
sensor["GYROY"]["data"],
sensor["GYROZ"]["data"])

Expand Down
8 changes: 4 additions & 4 deletions Vicon/Markers/ModelOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ def __init__(self, data, joint_name):
moment = None
force = None
if side + output + "Angles" in data.keys():
angle = core.Point.Point(data[side + output + "Angles"]["X"]["data"],
angle = core.PointArray.PointArray(data[side + output + "Angles"]["X"]["data"],
data[side + output + "Angles"]["Y"]["data"],
data[side + output + "Angles"]["Z"]["data"])
if side + output + "Force" in data.keys():
force = core.Point.Point(data[side + output + "Force"]["X"]["data"],
force = core.PointArray.PointArray(data[side + output + "Force"]["X"]["data"],
data[side + output + "Force"]["Y"]["data"],
data[side + output + "Force"]["Z"]["data"])
if side + output + "Moment" in data.keys():
moment = core.Point.Point(data[side + output + "Moment"]["X"]["data"],
moment = core.PointArray.PointArray(data[side + output + "Moment"]["X"]["data"],
data[side + output + "Moment"]["Y"]["data"],
data[side + output + "Moment"]["Z"]["data"])
if side + output + "Power" in data.keys():
power = core.Point.Point(data[side + output + "Power"]["X"]["data"],
power = core.PointArray.PointArray(data[side + output + "Power"]["X"]["data"],
data[side + output + "Power"]["Y"]["data"],
data[side + output + "Power"]["Z"]["data"])

Expand Down
1 change: 1 addition & 0 deletions Vicon/Vicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from .Markers import ModelOutput as modeloutput
from .Markers import Markers as markers
from .Devices import EMG, IMU, Accel, ForcePlate
import matplotlib.pyplot as plt
from Vicon import Markers


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GaitCore>=1.1
GaitCore>=1.3
numpy
scipy
matplotlib
Expand Down

0 comments on commit c39448c

Please sign in to comment.