Skip to content

Commit

Permalink
add comment about fix deprecation warning: conversion of an array wit…
Browse files Browse the repository at this point in the history
…h ndim > 0 to a scalar
  • Loading branch information
ShisatoYano committed Mar 28, 2024
1 parent ac2385e commit c8c249a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/state/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def motion_model(state, input, time_s):
time_s: Time interval per cycle[sec]
"""

yaw_rad = state.item(2)
# to fix DeprecationWarning: Conversion of an array with ndim > 0
# to a scalar is deprecated, and will error in future.
# Ensure you extract a single element from your array
# before performing this operation. (Deprecated NumPy 1.25.)
yaw_rad = state.item(2) # do not extract an element like state[2]

A = np.array([[1, 0, 0, cos(yaw_rad) * time_s],
[0, 1, 0, sin(yaw_rad) * time_s],
Expand Down

0 comments on commit c8c249a

Please sign in to comment.