Skip to content

Commit

Permalink
remove numpy dependency
Browse files Browse the repository at this point in the history
Signed-off-by: yamasaki <[email protected]>
  • Loading branch information
ymski committed Aug 23, 2023
1 parent 31d19a3 commit 9adefd1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ros2caret/verb/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import math
import os

from typing import Optional

from caret_msgs.msg import End, Start, Status

import numpy as np

import rclpy
from rclpy import qos
from rclpy.node import Node
Expand Down Expand Up @@ -191,15 +190,15 @@ def main(self, *, args):
and args.subbuffer_size_ust != 8*4096:
raise ValueError('the --subbuffer-size-ust option is '
'available in iron or rolling')
if not np.log2(args.subbuffer_size_ust).is_integer():
if not math.log2(args.subbuffer_size_ust).is_integer():
raise ValueError('--subbuffer-size-ust value must be power of two.')
init_args['subbuffer_size_ust'] = args.subbuffer_size_ust

if os.environ['ROS_DISTRO'] not in ['iron', 'rolling'] \
and args.subbuffer_size_kernel != 32*4096:
raise ValueError('the --subbuffer-size-kernel option is '
'available in iron or rolling')
if not np.log2(args.subbuffer_size_kernel).is_integer():
if not math.log2(args.subbuffer_size_kernel).is_integer():
raise ValueError('--subbuffer-size-kernel value must be power of two.')
init_args['subbuffer_size_kernel'] = args.subbuffer_size_kernel
init(**init_args)
Expand Down

0 comments on commit 9adefd1

Please sign in to comment.