前提・実現したいこと
ロボットの経路生成をしています.様々な計算の関数を作成し,リストで返し,extendでひとつにまとめ,まとめたリスト内の要素に回転移動の計算(x' = xcosθ - ysinθ,y' = xsinθ + ycosθ)を適応したいと思っています.
実行すると以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
TypeError: 'NoneType' object is not iterable
該当のソースコード
python
1def calc_path1(複数の引数): 2 result_x = 式 3 result_y = 式 4 return result_x, result_y 5 6def calc_path2(複数の引数): 7 xx = [] 8 yy = [] 9 result_x = 式 10 result_y = 式 11 xx.append(result_x) 12 yy.append(result_y) 13 14 return xx, yy 15 16def calc_rotation_x(x,y): 17 rt_x = x*math.cos(np.radians(theta)) - y*math.sin(np.radians(theta)) 18 return rt_x 19 20def calc_rotation_y(x,y): 21 rt_y = x*math.sin(np.radians(theta)) + y*math.cos(np.radians(theta)) 22 return rt_y 23 24X = [] 25Y = [] 26 27A_x, A_y = calc_path1(複数の引数) 28X.extend(A_x) 29Y.extend(A_y) 30 31B_x, B_y = calc_path2(複数の引数) 32X.extend(B_x) 33Y.extend(B_y) 34 35rotation_X = list(map(calc_rotation_x, X, Y)) 36rotation_Y = list(map(calc_rotation_y, X, Y)) 37 38plot(rotation_X, rotation_Y) 39plt.show() 40
rotation_x, rotation_yの中身をprintで見ると,計算はされているようです.
おそらくplot()の部分でエラーが発生しています.
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。