Skip to content

Commit

Permalink
tools: updated plot acc jerk.
Browse files Browse the repository at this point in the history
  • Loading branch information
yifeijiang authored and ycool committed Aug 28, 2019
1 parent bdfbfe8 commit d4877cc
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions modules/tools/plot_planning/plot_acc_jerk.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@
###############################################################################

import math
import sys
import matplotlib.pyplot as plt
import numpy as np
from os import listdir
from os.path import isfile, join

from record_reader import RecordItemReader
from imu_speed_jerk import ImuSpeedJerk
from imu_speed_acc import ImuSpeedAcc


if __name__ == "__main__":
import sys
import matplotlib.pyplot as plt
import numpy as np
from os import listdir
from os.path import isfile, join
def grid(data_list, shift):
data_grid = []
for data in data_list:
data_grid.append(round(data) + shift/10.0)
return data_grid


if __name__ == "__main__":
folders = sys.argv[1:]
fig, ax = plt.subplots(1, 1)
colors = ["g", "b", "r", "m", "y"]
Expand All @@ -54,9 +60,9 @@
acc_processor.add(pose_data)
jerk_processor.add(pose_data)

data_x = acc_processor.get_acc_list()
data_y = jerk_processor.get_jerk_list()
data_x = data_x[-1* len(data_y):]
data_x = grid(acc_processor.get_acc_list(), i + 1)
data_y = grid(jerk_processor.get_jerk_list(), i + 1)
data_x = data_x[-1 * len(data_y):]
x.extend(data_x)
y.extend(data_y)

Expand Down

0 comments on commit d4877cc

Please sign in to comment.