Skip to content

Commit fd24f61

Browse files
authored
open file in binary mode
1 parent a339cb3 commit fd24f61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

joint_control/learn_posture.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"\n",
2525
"* the dateset are in *robot_pose_data* folder\n",
2626
"* each file contains the data belongs to this posture, e.g. the data in *Back* file are collected when robot was in \"Back\" posture\n",
27-
"* the data file can be load by ```pickle```, e.g. ```pickle.load(open('Back'))```, the data is a list of feature data\n",
27+
"* the data file can be load by ```pickle```, e.g. ```pickle.load(open('Back', 'rb'))```, the data is a list of feature data\n",
2828
"* the features (e.g. each row of the data) are ['LHipYawPitch', 'LHipRoll', 'LHipPitch', 'LKneePitch', 'RHipYawPitch', 'RHipRoll', 'RHipPitch', 'RKneePitch', 'AngleX', 'AngleY'], where 'AngleX' and 'AngleY' are body angle (e.g. ```Perception.imu```) and others are joint angles."
2929
]
3030
},
@@ -103,7 +103,7 @@
103103
" # YOUR CODE HERE\n",
104104
" \n",
105105
" filename = path.join(ROBOT_POSE_DATA_DIR, classes[i])\n",
106-
" data = pickle.load(open(filename))\n",
106+
" data = pickle.load(open(filename, 'rb'))\n",
107107
" target = [i] * len(data)\n",
108108
" return data, target"
109109
]
@@ -370,7 +370,7 @@
370370
"source": [
371371
"import pickle\n",
372372
"ROBOT_POSE_CLF = 'robot_pose.pkl'\n",
373-
"pickle.dump(clf, open(ROBOT_POSE_CLF, 'w'))"
373+
"pickle.dump(clf, open(ROBOT_POSE_CLF, 'wb'))"
374374
]
375375
},
376376
{

0 commit comments

Comments
 (0)