forked from ZhengLiu-cart/IK_qp
update teh contour plot method
This commit is contained in:
@@ -8,7 +8,7 @@ import pandas as pd
|
||||
# --------------------------------------------------
|
||||
# 1. Load the data
|
||||
# --------------------------------------------------
|
||||
file_name = "rm75b_comfort_workspace_collision_minisci.csv"
|
||||
file_name = "workspace minisci collision.csv"
|
||||
csv_path = Path(file_name)
|
||||
|
||||
# The file has no column names, so header=None is important.
|
||||
@@ -16,13 +16,21 @@ df_csv = pd.read_csv(
|
||||
csv_path,
|
||||
)
|
||||
rate_res = df_csv.iloc[:, :4]
|
||||
rate_res_sort = rate_res.sort_values('z').reset_index(drop=True)
|
||||
try:
|
||||
rate_res_sort = rate_res.sort_values('z').reset_index(drop=True)
|
||||
except:
|
||||
rate_res_sort = rate_res
|
||||
|
||||
DECIMALS = 4
|
||||
|
||||
x_unique = np.round(rate_res_sort['x'], DECIMALS).unique()
|
||||
y_unique = np.round(rate_res_sort['y'], DECIMALS).unique()
|
||||
z_unique = np.round(rate_res_sort['z'], DECIMALS).unique()
|
||||
try:
|
||||
x_unique = np.round(rate_res_sort['x'], DECIMALS).unique()
|
||||
y_unique = np.round(rate_res_sort['y'], DECIMALS).unique()
|
||||
z_unique = np.round(rate_res_sort['z'], DECIMALS).unique()
|
||||
except:
|
||||
x_unique = np.round(rate_res_sort.iloc[:,0], DECIMALS).unique()
|
||||
y_unique = np.round(rate_res_sort.iloc[:, 1], DECIMALS).unique()
|
||||
z_unique = np.round(rate_res_sort.iloc[:, 2], DECIMALS).unique()
|
||||
|
||||
nx, ny, nz = len(x_unique), len(y_unique), len(z_unique)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user