Skip to content

Commit

Permalink
Explicitly convert arrays to scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
TyLindberg authored Dec 16, 2023
1 parent dc0d0c5 commit c3d87e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@
" for i in range(n_steps):\n",
" mujoco.mj_step(model, data)\n",
" sim_time[i] = data.time\n",
" angle[i] = data.joint('root').qpos\n",
" angle[i] = data.joint('root').qpos[0]\n",
" energy[i] = data.energy[0] + data.energy[1]\n",
"\n",
" # plot\n",
Expand Down Expand Up @@ -1198,7 +1198,7 @@
" for i in range(n_steps):\n",
" mujoco.mj_step(model, data)\n",
" if data.warning.number.any():\n",
" warning_index = np.nonzero(data.warning.number)[0]\n",
" warning_index = np.nonzero(data.warning.number)[0][0]\n",
" warning = mujoco.mjtWarning(warning_index).name\n",
" print(f'stopped due to divergence ({warning}) at timestep {i}.\\n')\n",
" break\n",
Expand Down

0 comments on commit c3d87e6

Please sign in to comment.