update teh contour plot method

This commit is contained in:
LiuzhengSJ
2026-07-24 10:46:09 +01:00
parent 579abe6b67
commit d0ca4d6115
4 changed files with 16121 additions and 8 deletions
@@ -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)