Skip to content

Commit

Permalink
refactor:Makefileの修正, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kawanoichi committed Nov 9, 2023
1 parent 3f20ceb commit 2238b6d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
16 changes: 5 additions & 11 deletions rear_camera_py/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ help:
@echo " $$ make test"
@echo "フォーマットを実行する"
@echo " $$ make format"
@echo "スタイルチェックを実行する"
@echo " $$ make check_style"
@echo "フォーマットとスタイルチェックを実行する"
@echo "フォーマットとチェックを実行する"
@echo " $$ make format-check"
@echo "ソースコードチェックとテストを実行する"
@echo " $$ make all-check"
Expand Down Expand Up @@ -65,21 +63,17 @@ test:
python -m unittest

format:
autopep8 --in-place --recursive src/
autopep8 --in-place --recursive src/ tests/
python -m autopep8 -i -r src/ tests/

check_style:
python -m pycodestyle src/ tests/
python -m pydocstyle src/ tests/

format-check:
@${make} format
@${make} check_style
python -m pycodestyle src/ tests/
python -m pydocstyle src/ tests/

all-check:
@${make} format
@${make} test
@${make} check_style
@${make} format-check

debug:
python -m src --debug
Expand Down
14 changes: 13 additions & 1 deletion rear_camera_py/src/block_de_treasure_hunter.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
"""ブロックdeトレジャーハンター攻略クラス.
@author: miyashita64 YKhm20020
@author: miyashita64 YKhm20020 kawanoichi
"""

import sys
import numpy as np
import os

from block_area_map import BlockAreaMap
from navigator import Navigator
from robot import Robot, Direction
from motion import Motion
from get_area_info import GetAreaInfo

script_dir = os.path.dirname(os.path.abspath(__file__)) # /src
PROJECT_DIR_PATH = os.path.dirname(script_dir) # /rear_camera_py


class BlockDeTreasureHunter:
Expand All @@ -30,6 +36,12 @@ def hunt(self, is_left_course):
block_map[y][x] = 1
block_map[treasure_block_coord[0], treasure_block_coord[1]] = 2
# TODO: ここまで、マージする際に差し替える

# ブロックエリア情報の取得
image_name = "BlockDeTreasure.png"
image_dir_path = os.path.join(PROJECT_DIR_PATH, "image_data")
area_info = GetAreaInfo(image_name=image_name, image_dir_path=image_dir_path)
block_map = area_info.get_area_info(isL=is_left_course)
print(block_map)

# ブロックエリアのマップ初期化
Expand Down
4 changes: 1 addition & 3 deletions rear_camera_py/src/get_area_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self,
self.block_coordi_red = np.zeros(4)
self.block_coordi_blue1 = np.zeros(4)
self.block_coordi_blue2 = np.zeros(4)
self.course_info_block = np.zeros((4,4))
self.course_info_block = np.zeros((4, 4))

# サークル関連
self.course_info_coordinate = np.zeros((4, 4, 4))
Expand Down Expand Up @@ -290,7 +290,6 @@ def check_coordi_about(self,
if np.all(mask_coordi == 0):
return None

# if self.develop:
if self.develop and develop_img is not None:
# マスクの大きさを表す線
develop_img[mask_height, :] = Color.BLACK.value
Expand Down Expand Up @@ -1457,7 +1456,6 @@ def get_area_info(self, isL=True) -> None:
self.course_info_block[row, column] = 2
self.block_count_blue += 1


# 終了
return self.course_info_block

Expand Down

0 comments on commit 2238b6d

Please sign in to comment.