diff --git a/extern/lang/en.js b/extern/lang/en.js index 62a807bb9c..8754aa2e58 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -5230,7 +5230,7 @@ Lang.Msgs = { 'It is a collection of blocks that can read text in a variety of voice using the Clova.', hardware_need_update_title: 'Entry HW update', hardware_need_update_content: - "Please update to the latest version,\nif you are using below version.\nEntry website only supported v1.9.51 or later.\nPlease remove the web browser cache,\nif any block doesn't appear after updating.", + "Please update to the latest version,\nif you are using below version.\nEntry website only supported v1.9.64 or later.\nPlease remove the web browser cache,\nif any block doesn't appear after updating.", ai_utilize_audio_description: 'It is a collection of blocks that recognize speech using microphone.', ai_utilize_video_description: diff --git a/extern/lang/ko.js b/extern/lang/ko.js index d6ae09b05c..e5a88ea327 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -5601,7 +5601,7 @@ Lang.Msgs = { 'nVoice 음성합성 기술로 다양한 목소리로 문장을 읽는 블록모음 입니다. (한국어 엔진 지원)', hardware_need_update_title: '업데이트 안내', hardware_need_update_content: - '보안 업데이트로 인해 하드웨어 연결 프로그램은\n1.9.51 버전 이상만 사용할 수 있습니다.\n더 낮은 버전이라면 최신 버전을 다운로드 받아 주세요.', + '보안 업데이트로 인해 하드웨어 연결 프로그램은\n1.9.64 버전 이상만 사용할 수 있습니다.\n더 낮은 버전이라면 최신 버전을 다운로드 받아 주세요.', ai_utilize_video_description: '카메라를 이용하여 사람(신체), 얼굴, 사물 등을 인식하는 블록들의 모음입니다. (IE 및 iOS 미지원)', lecture_header_restart_msg: '처음부터 다시 시작하시겠습니까?', diff --git a/extern/util/static_mini.js b/extern/util/static_mini.js index 66518459ef..7801caf863 100644 --- a/extern/util/static_mini.js +++ b/extern/util/static_mini.js @@ -162,6 +162,7 @@ EntryStatic.getAllBlocks = function () { '_if', 'if_else', 'wait_until_true', + 'stop_object', ], }, { diff --git a/src/playground/blocks/hardware/block_robotisRBKoala.js b/src/playground/blocks/hardware/block_robotisRBKoala.js index 9b71c7acc5..c6e223587b 100644 --- a/src/playground/blocks/hardware/block_robotisRBKoala.js +++ b/src/playground/blocks/hardware/block_robotisRBKoala.js @@ -26,15 +26,7 @@ Entry.Robotis_rb_koala = { Entry.hw.sendQueue['setZero'] = null; Entry.Robotis_carCont.update(); Entry.Robotis_carCont.setRobotisData([ - [Entry.Robotis_rb.INSTRUCTION.WRITE, 21, 2, 20], - [Entry.Robotis_rb.INSTRUCTION.WRITE, 40, 2, 0], - [Entry.Robotis_rb.INSTRUCTION.WRITE, 66, 2, 0], - [Entry.Robotis_rb.INSTRUCTION.WRITE, 5200, 1, 0], - [Entry.Robotis_rb.INSTRUCTION.WRITE, 710, 2, 0], - [Entry.Robotis_rb.INSTRUCTION.WRITE, 19, 1, 1], // bypass 모드 켜기 - [Entry.Robotis_rb.INSTRUCTION.WRITE, 4250, 1, 1], // huskylens 텍스트 지우기 - [Entry.Robotis_rb.INSTRUCTION.BYPASS_WRITE, 64, 1, 0xFE, 0], // torque off - [Entry.Robotis_rb.INSTRUCTION.WRITE, 23, 1, 1], // auto report 모드 켜기 + [Entry.Robotis_rb.INSTRUCTION.WRITE, 2100, 1, 2], // 값 2는 코알라 얼굴이 뜨도록(펌웨어는 v1.15.4부터) ]); Entry.Robotis_carCont.update(); }, @@ -107,6 +99,7 @@ Entry.Robotis_rb_koala.blockMenuBlocks = [ 'robotis_RCar_icon_screen_animal_human', 'robotis_RCar_icon_screen_object_tool', 'robotis_RCar_icon_screen_vehicle_number', + 'robotis_RCar_icon_screen_game_character', 'robotis_RCar_text_screen', 'robotis_RCar_text_screen_redraw', 'robotis_RCar_pixel', @@ -118,22 +111,22 @@ Entry.Robotis_rb_koala.blockMenuBlocks = [ 'robotis_RCar_cm_led_pattern', // AI 카메라 값 블록 - 'robotis_RCar_huskylens_connection_status', - 'robotis_RCar_huskylens_if_detected', + 'robotis_RCar_ai_camera_connection_status', + 'robotis_RCar_ai_camera_if_detected', - 'robotis_RCar_huskylens_block_value_closest_to_center', - 'robotis_RCar_huskylens_arrow_value_closest_to_center', - 'robotis_RCar_huskylens_number_of_learned_id', - 'robotis_RCar_huskylens_block_value_of_id', - 'robotis_RCar_huskylens_arrow_value_of_id', + 'robotis_RCar_ai_camera_block_value_closest_to_center', + 'robotis_RCar_ai_camera_arrow_value_closest_to_center', + 'robotis_RCar_ai_camera_number_of_learned_id', + 'robotis_RCar_ai_camera_block_value_of_id', + 'robotis_RCar_ai_camera_arrow_value_of_id', - 'robotis_RCar_huskylens_if_learned_id', - 'robotis_RCar_huskylens_if_detected_id_type', + 'robotis_RCar_ai_camera_if_learned_id', + 'robotis_RCar_ai_camera_if_detected_id_type', // AI 카메라 제어 - 'robotis_RCar_huskylens_set_mode', - 'robotis_RCar_huskylens_print_custom_text', - 'robotis_RCar_huskylens_clear_custom_text', + 'robotis_RCar_ai_camera_set_mode', + 'robotis_RCar_ai_camera_print_custom_text', + 'robotis_RCar_ai_camera_clear_custom_text', ]; Entry.Robotis_rb_koala.setLanguage = function() { @@ -188,6 +181,7 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_icon_screen_animal_human: "화면에 [동물/사람]중 %1 (%2, %3)위치에 %4 크기로 표시 %5", robotis_RCar_icon_screen_object_tool: "화면에 [물건/도구]중 %1 (%2, %3)위치에 %4 크기로 표시 %5", robotis_RCar_icon_screen_vehicle_number: "화면에 [탈것/숫자]중 %1 (%2, %3)위치에 %4 크기로 표시 %5", + robotis_RCar_icon_screen_game_character: "화면에 [게임/캐릭터]중 %1를 (%2, %3)위치에 %4 크기로 표시 %5", robotis_RCar_text_screen: "화면에 %1 (%2, %3)위치에 %4 로 %5으로 표시 %6", robotis_RCar_text_screen_redraw: "화면에 %1 (%2, %3)위치에 %4으로 새로 표시 %5", robotis_RCar_pixel: "화면 (%1, %2)위치에 %3 색 점 표시 %4", @@ -200,22 +194,22 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_cm_led_pattern: "LED %1 %2로 깜박이기 %3", // AI Camera 값 블록 - robotis_RCar_huskylens_connection_status: "AI 카메라 %1이면", - robotis_RCar_huskylens_if_detected: "AI 카메라 %1 이/가 표시되면", + robotis_RCar_ai_camera_connection_status: "AI 카메라 %1이면", + robotis_RCar_ai_camera_if_detected: "AI 카메라 %1 이/가 표시되면", - robotis_RCar_huskylens_block_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 사각형의 %1", - robotis_RCar_huskylens_arrow_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 화살표의 %1", - robotis_RCar_huskylens_number_of_learned_id: "AI 카메라 학습한 ID의 갯수", - robotis_RCar_huskylens_block_value_of_id: "AI 카메라 감지된 ID가 %1인 사각형의 %2", - robotis_RCar_huskylens_arrow_value_of_id: "AI 카메라 감지된 ID가 %1인 화살표의 %2", + robotis_RCar_ai_camera_block_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 사각형의 %1", + robotis_RCar_ai_camera_arrow_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 화살표의 %1", + robotis_RCar_ai_camera_number_of_learned_id: "AI 카메라 학습한 ID의 갯수", + robotis_RCar_ai_camera_block_value_of_id: "AI 카메라 감지된 ID가 %1인 사각형의 %2", + robotis_RCar_ai_camera_arrow_value_of_id: "AI 카메라 감지된 ID가 %1인 화살표의 %2", - robotis_RCar_huskylens_if_learned_id: "AI 카메라 ID가 %1인 데이터를 학습하였으면", - robotis_RCar_huskylens_if_detected_id_type: "AI 카메라 ID가 %1인 %2데이터를 인식하였으면", + robotis_RCar_ai_camera_if_learned_id: "AI 카메라 ID가 %1인 데이터를 학습하였으면", + robotis_RCar_ai_camera_if_detected_id_type: "AI 카메라 ID가 %1인 %2데이터를 인식하였으면", // AI 카메라 제어 - robotis_RCar_huskylens_set_mode: "AI 카메라 모드를 %1(으)로 설정 %2", - robotis_RCar_huskylens_print_custom_text: "AI 카메라 화면 위치 (%1,%2)에 %3를 보여주기%4", - robotis_RCar_huskylens_clear_custom_text: "AI 카메라 화면의 글 지우기 %1", + robotis_RCar_ai_camera_set_mode: "AI 카메라 모드를 %1(으)로 설정 %2", + robotis_RCar_ai_camera_print_custom_text: "AI 카메라 화면 위치 (%1,%2)에 %3를 보여주기%4", + robotis_RCar_ai_camera_clear_custom_text: "AI 카메라 화면의 글 지우기 %1", }, Helper: { @@ -266,6 +260,7 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_icon_screen_animal_human: "화면에 [동물/사람]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_RCar_icon_screen_object_tool: "화면에 [물건/도구]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_RCar_icon_screen_vehicle_number: "화면에 [탈것/숫자]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", + robotis_RCar_icon_screen_game_character: "화면에 [게임/캐릭터]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_RCar_text_screen: "화면에 지정한 문구를 표시할 위치와 폰트크기, 색상을 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", robotis_RCar_text_screen_redraw: "화면에 지정한 문구를 새롭게(문구의 배경 지움) 표시할 위치와 색상을 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_RCar_pixel: "화면에 표시할 점의 위치와 색상을 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", @@ -277,22 +272,22 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_cm_led_pattern: "제어기의 LED의 깜박임 패턴 설정", // AI Camera 값 블록 - robotis_RCar_huskylens_connection_status: "AI 카메라가 연결된 상태이면 '참', 아니면 '거짓'으로 판단합니다.", - robotis_RCar_huskylens_if_detected: "AI 카메라의 LCD화면에 선택한 기호(사각형/화살표)가 표시되면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_RCar_ai_camera_connection_status: "AI 카메라가 연결된 상태이면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_RCar_ai_camera_if_detected: "AI 카메라의 LCD화면에 선택한 기호(사각형/화살표)가 표시되면 '참', 아니면 '거짓'으로 판단합니다.", - robotis_RCar_huskylens_block_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 사각형의 X좌표/Y좌표/너비/높이/학습ID", - robotis_RCar_huskylens_arrow_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표/학습ID", - robotis_RCar_huskylens_number_of_learned_id: "AI 카메라가 학습한 ID의 갯수", - robotis_RCar_huskylens_block_value_of_id: "AI 카메라가 감지한 사각형중 지정한 ID의 사각형의 X좌표/Y좌표/너비/높이", - robotis_RCar_huskylens_arrow_value_of_id: "AI 카메라가 감지한 화살표중 지정한 ID의 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표", + robotis_RCar_ai_camera_block_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 사각형의 X좌표/Y좌표/너비/높이/학습ID", + robotis_RCar_ai_camera_arrow_value_closest_to_center: "AI 카메라 화면 중앙과 가장 가까운 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표/학습ID", + robotis_RCar_ai_camera_number_of_learned_id: "AI 카메라가 학습한 ID의 갯수", + robotis_RCar_ai_camera_block_value_of_id: "AI 카메라가 감지한 사각형중 지정한 ID의 사각형의 X좌표/Y좌표/너비/높이", + robotis_RCar_ai_camera_arrow_value_of_id: "AI 카메라가 감지한 화살표중 지정한 ID의 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표", - robotis_RCar_huskylens_if_learned_id: "AI 카메라가 지정한 ID인 데이터를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", - robotis_RCar_huskylens_if_detected_id_type: "AI 카메라가 지정한 ID인 지정한 데이터(사각형/화살표)를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_RCar_ai_camera_if_learned_id: "AI 카메라가 지정한 ID인 데이터를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_RCar_ai_camera_if_detected_id_type: "AI 카메라가 지정한 ID인 지정한 데이터(사각형/화살표)를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", // AI 카메라 제어 - robotis_RCar_huskylens_set_mode: "AI 카메라의 모드를 설정", - robotis_RCar_huskylens_print_custom_text: "AI 카메라 화면의 지정한 위치에 지정한 문구 출력\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", - robotis_RCar_huskylens_clear_custom_text: "AI 카메라 화면에 표시한 모든 문구 지우기", + robotis_RCar_ai_camera_set_mode: "AI 카메라의 모드를 설정", + robotis_RCar_ai_camera_print_custom_text: "AI 카메라 화면의 지정한 위치에 지정한 문구 출력\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", + robotis_RCar_ai_camera_clear_custom_text: "AI 카메라 화면에 표시한 모든 문구 지우기", }, Blocks: { robotis_red: "빨강", @@ -578,7 +573,7 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_icon_vehicle_number_11: "로켓", robotis_icon_vehicle_number_12: "어선", robotis_icon_vehicle_number_13: "여객선", - robotis_icon_vehicle_number_14: "잠수항(왼쪽)", + robotis_icon_vehicle_number_14: "잠수함(왼쪽)", robotis_icon_vehicle_number_15: "잠수함(오른쪽)", robotis_icon_vehicle_number_16: "비행기(왼쪽)", robotis_icon_vehicle_number_17: "비행기(오른쪽)", @@ -603,6 +598,50 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_icon_vehicle_number_36: "8", robotis_icon_vehicle_number_37: "9", robotis_icon_vehicle_number_38: "10", + robotis_icon_game_character_1: '알쥐(정면)', + robotis_icon_game_character_2: '알쥐(왼쪽)', + robotis_icon_game_character_3: '알쥐(오른쪽)', + robotis_icon_game_character_4: '알라(정면)', + robotis_icon_game_character_5: '알라(왼쪽))', + robotis_icon_game_character_6: '알라(오른쪽)', + robotis_icon_game_character_7: '유령', + robotis_icon_game_character_8: '괴물', + robotis_icon_game_character_9: '바이러스', + robotis_icon_game_character_10: '세균', + robotis_icon_game_character_11: '나는 알쥐(왼쪽)', + robotis_icon_game_character_12: '나는 알쥐(오른쪽)', + robotis_icon_game_character_13: '나는 알쥐(정면)', + robotis_icon_game_character_14: '메달', + robotis_icon_game_character_15: '돈(G)', + robotis_icon_game_character_16: '돈($)', + robotis_icon_game_character_17: '하트', + robotis_icon_game_character_18: '폭탄', + robotis_icon_game_character_19: '불', + robotis_icon_game_character_20: '구름1', + robotis_icon_game_character_21: '구름2', + robotis_icon_game_character_22: '포탄1', + robotis_icon_game_character_23: '포탄2', + robotis_icon_game_character_24: '대포(수평)', + robotis_icon_game_character_25: '대포(수직)', + robotis_icon_game_character_26: '레이저(수직)', + robotis_icon_game_character_27: '게이저(수평)', + robotis_icon_game_character_28: '화살(수평)', + robotis_icon_game_character_29: '화살(수직)', + robotis_icon_game_character_30: '미사일(U)', + robotis_icon_game_character_31: '미사일(D)', + robotis_icon_game_character_32: '미사일(L)', + robotis_icon_game_character_33: '미사일(R)', + robotis_icon_game_character_34: '낙하산', + robotis_icon_game_character_35: '폭발1', + robotis_icon_game_character_36: '폭발2', + robotis_icon_game_character_37: '조준경', + robotis_icon_game_character_38: '가위', + robotis_icon_game_character_39: '바위', + robotis_icon_game_character_40: '보', + robotis_icon_game_character_41: '걷는 사람1', + robotis_icon_game_character_42: '걷는 사람2', + robotis_icon_game_character_43: '뛰는 사람1', + robotis_icon_game_character_44: '뛰는 사람2', robotis_speed_fast: "빠른 속도", robotis_speed_midium: "중간 속도", robotis_speed_slow: "느린 속도", @@ -655,24 +694,24 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_connected: "연결", robotis_disconnected: "없음", - robotis_huskylens_mode_face_recognition: "얼굴인식", - robotis_huskylens_mode_object_tracking: "물체추적", - robotis_huskylens_mode_object_recognition: "물체인식", - robotis_huskylens_mode_line_tracking: "라인인식", - robotis_huskylens_mode_color_recognition: "색상인식", - robotis_huskylens_mode_tag_recognition: "태그인식", - robotis_huskylens_mode_object_classification: "물체분류", - robotis_huskylens_block: "사각형", - robotis_huskylens_arrow: "화살표", - robotis_huskylens_center_block_center_x: "중심 X좌표", - robotis_huskylens_center_block_center_y: "중심 Y좌표", - robotis_huskylens_center_block_width: "너비", - robotis_huskylens_center_block_height: "높이", - robotis_huskylens_center_leared_id: "학습ID", - robotis_huskylens_center_arrow_origin_x: "시작점 X좌표", - robotis_huskylens_center_arrow_origin_y: "시작점 Y좌표", - robotis_huskylens_center_arrow_target_x: "끝점 X좌표", - robotis_huskylens_center_arrow_target_y: "끝점 Y좌표", + robotis_ai_camera_mode_face_recognition: "얼굴인식", + robotis_ai_camera_mode_object_tracking: "물체추적", + robotis_ai_camera_mode_object_recognition: "물체인식", + robotis_ai_camera_mode_line_tracking: "라인인식", + robotis_ai_camera_mode_color_recognition: "색상인식", + robotis_ai_camera_mode_tag_recognition: "태그인식", + robotis_ai_camera_mode_object_classification: "물체분류", + robotis_ai_camera_block: "사각형", + robotis_ai_camera_arrow: "화살표", + robotis_ai_camera_center_block_center_x: "중심 X좌표", + robotis_ai_camera_center_block_center_y: "중심 Y좌표", + robotis_ai_camera_center_block_width: "너비", + robotis_ai_camera_center_block_height: "높이", + robotis_ai_camera_center_leared_id: "학습ID", + robotis_ai_camera_center_arrow_origin_x: "시작점 X좌표", + robotis_ai_camera_center_arrow_origin_y: "시작점 Y좌표", + robotis_ai_camera_center_arrow_target_x: "끝점 X좌표", + robotis_ai_camera_center_arrow_target_y: "끝점 Y좌표", }, }, en: { @@ -725,6 +764,7 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_icon_screen_animal_human: "Display %1 from [Animal/Human] at position (%2, %3) in size %4 %5", robotis_RCar_icon_screen_object_tool: "Display %1 from [Object/Tool] at position (%2, %3) in size %4 %5", robotis_RCar_icon_screen_vehicle_number: "Display %1 from [Vehicle/Number] at position (%2, %3) in size %4 %5", + robotis_RCar_icon_screen_game_character: "Display %1 from [Game/Character] at position (%2, %3) in size %4 %5", robotis_RCar_text_screen: "Display %1 in %5 in %4 at (%2, %3) on the screen %6", robotis_RCar_text_screen_redraw: "Newly display %1 in %4 at (%2, %3) %5", robotis_RCar_pixel: "Display %3 colored dot at (%1, %2) %4", @@ -737,22 +777,22 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_cm_led_pattern: "LED %1 blinks at a %2 speed %3", // AI Camera 값 블록 - robotis_RCar_huskylens_connection_status: "AI Camera: If %1", - robotis_RCar_huskylens_if_detected: "AI Camera: If %1 is displayed", + robotis_RCar_ai_camera_connection_status: "AI Camera: If %1", + robotis_RCar_ai_camera_if_detected: "AI Camera: If %1 is displayed", - robotis_RCar_huskylens_block_value_closest_to_center: "AI Camera: %1 of the rectangle closest to the center of the screen", - robotis_RCar_huskylens_arrow_value_closest_to_center: "AI Camera: %1 of the arrow closest to the center of the screen", - robotis_RCar_huskylens_number_of_learned_id: "AI Camera: the number of learned ID", - robotis_RCar_huskylens_block_value_of_id: "AI Camera: %2 of rectangle with detected ID %1", - robotis_RCar_huskylens_arrow_value_of_id: "AI Camera: %2 of arrow with detected ID %1", + robotis_RCar_ai_camera_block_value_closest_to_center: "AI Camera: %1 of the rectangle closest to the center of the screen", + robotis_RCar_ai_camera_arrow_value_closest_to_center: "AI Camera: %1 of the arrow closest to the center of the screen", + robotis_RCar_ai_camera_number_of_learned_id: "AI Camera: the number of learned ID", + robotis_RCar_ai_camera_block_value_of_id: "AI Camera: %2 of rectangle with detected ID %1", + robotis_RCar_ai_camera_arrow_value_of_id: "AI Camera: %2 of arrow with detected ID %1", - robotis_RCar_huskylens_if_learned_id: "AI Camera: If learned data with ID %1", - robotis_RCar_huskylens_if_detected_id_type: "AI Camera: If learned %2 data with ID %1", + robotis_RCar_ai_camera_if_learned_id: "AI Camera: If learned data with ID %1", + robotis_RCar_ai_camera_if_detected_id_type: "AI Camera: If learned %2 data with ID %1", // AI 카메라 제어 - robotis_RCar_huskylens_set_mode: "AI Camera: Set mode to %1 %2", - robotis_RCar_huskylens_print_custom_text: "AI Camera: Display %3 at screen position (%1, %2) %4", - robotis_RCar_huskylens_clear_custom_text: "AI Camera: Clear screen text %1", + robotis_RCar_ai_camera_set_mode: "AI Camera: Set mode to %1 %2", + robotis_RCar_ai_camera_print_custom_text: "AI Camera: Display %3 at screen position (%1, %2) %4", + robotis_RCar_ai_camera_clear_custom_text: "AI Camera: Clear screen text %1", }, Helper: { // Driving Control @@ -800,6 +840,7 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_icon_screen_animal_human: "Set the position and size of a specific icon in [animal/human] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_RCar_icon_screen_object_tool: "Set the position and size of a specific icon in [object/tool] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_RCar_icon_screen_vehicle_number: "Set the position and size of a specific icon in [vehicle/number] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", + robotis_RCar_icon_screen_game_character: "Set the position and size of a specific icon in [game/character] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_RCar_text_screen: "Set the position, font size, and color of the specified text on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", robotis_RCar_text_screen_redraw: "Set the position and color of the specified text to be newly displayed (clearing the background of the text) on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_RCar_pixel: "Set the position and color of the dot to be displayed on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", @@ -811,22 +852,22 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_RCar_cm_led_pattern: "Set the blinking pattern of LEDs of the controller", // AI Camera Value Blocks - robotis_RCar_huskylens_connection_status: "If the AI camera is connected, it is determined as 'true'; otherwise, 'false'.", - robotis_RCar_huskylens_if_detected: "If the selected symbol (rectangle/arrow) is displayed on the LCD screen of the AI camera, it is determined as 'true'; otherwise, 'false'.", + robotis_RCar_ai_camera_connection_status: "If the AI camera is connected, it is determined as 'true'; otherwise, 'false'.", + robotis_RCar_ai_camera_if_detected: "If the selected symbol (rectangle/arrow) is displayed on the LCD screen of the AI camera, it is determined as 'true'; otherwise, 'false'.", - robotis_RCar_huskylens_block_value_closest_to_center: "X coordinate/Y coordinate/width/height/learning ID of the rectangle closest to the center of the AI camera screen", - robotis_RCar_huskylens_arrow_value_closest_to_center: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate/learning ID of the arrow closest to the center of the AI camera screen", - robotis_RCar_huskylens_number_of_learned_id: "Number of IDs learned by the AI camera", - robotis_RCar_huskylens_block_value_of_id: "X coordinate/Y coordinate/width/height of the rectangle with the specified ID detected by the AI camera", - robotis_RCar_huskylens_arrow_value_of_id: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate of the arrow with the specified ID detected by the AI camera", + robotis_RCar_ai_camera_block_value_closest_to_center: "X coordinate/Y coordinate/width/height/learning ID of the rectangle closest to the center of the AI camera screen", + robotis_RCar_ai_camera_arrow_value_closest_to_center: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate/learning ID of the arrow closest to the center of the AI camera screen", + robotis_RCar_ai_camera_number_of_learned_id: "Number of IDs learned by the AI camera", + robotis_RCar_ai_camera_block_value_of_id: "X coordinate/Y coordinate/width/height of the rectangle with the specified ID detected by the AI camera", + robotis_RCar_ai_camera_arrow_value_of_id: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate of the arrow with the specified ID detected by the AI camera", - robotis_RCar_huskylens_if_learned_id: "If the AI camera has learned data with the specified ID, it is determined as 'true'; otherwise, 'false'.", - robotis_RCar_huskylens_if_detected_id_type: "If the AI camera has learned the specified data (rectangle/arrow) with the specified ID, it is determined as 'true'; otherwise, 'false'.", + robotis_RCar_ai_camera_if_learned_id: "If the AI camera has learned data with the specified ID, it is determined as 'true'; otherwise, 'false'.", + robotis_RCar_ai_camera_if_detected_id_type: "If the AI camera has learned the specified data (rectangle/arrow) with the specified ID, it is determined as 'true'; otherwise, 'false'.", // AI Camera Control - robotis_RCar_huskylens_set_mode: "Set the mode of the AI camera", - robotis_RCar_huskylens_print_custom_text: "Print the specified text at the specified position on the AI camera screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", - robotis_RCar_huskylens_clear_custom_text: "Clear all texts displayed on the AI camera screen", + robotis_RCar_ai_camera_set_mode: "Set the mode of the AI camera", + robotis_RCar_ai_camera_print_custom_text: "Print the specified text at the specified position on the AI camera screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", + robotis_RCar_ai_camera_clear_custom_text: "Clear all texts displayed on the AI camera screen", }, Blocks: { robotis_red: "Red", @@ -1136,6 +1177,50 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_icon_vehicle_number_36: "8", robotis_icon_vehicle_number_37: "9", robotis_icon_vehicle_number_38: "10", + robotis_icon_game_character_1: 'R-GEE(F)', + robotis_icon_game_character_2: 'R-GEE(L)', + robotis_icon_game_character_3: 'R-GEE(R)', + robotis_icon_game_character_4: 'KODALA(F)', + robotis_icon_game_character_5: 'KODALA(L))', + robotis_icon_game_character_6: 'KODALA(R)', + robotis_icon_game_character_7: 'Ghost', + robotis_icon_game_character_8: 'Monster', + robotis_icon_game_character_9: 'Virus', + robotis_icon_game_character_10: 'Bacteria', + robotis_icon_game_character_11: 'Flying R-GEE (L)', + robotis_icon_game_character_12: 'Flying R-GEE (R)', + robotis_icon_game_character_13: 'Flying R-GEE (F)', + robotis_icon_game_character_14: 'Medal', + robotis_icon_game_character_15: 'Money (G)', + robotis_icon_game_character_16: 'Money ($)', + robotis_icon_game_character_17: 'Heart', + robotis_icon_game_character_18: 'Bomb', + robotis_icon_game_character_19: 'Fire', + robotis_icon_game_character_20: 'Cloud 1', + robotis_icon_game_character_21: 'Cloud 2', + robotis_icon_game_character_22: 'Shell 1', + robotis_icon_game_character_23: 'Shell 2', + robotis_icon_game_character_24: 'Cannon (Horizontal)', + robotis_icon_game_character_25: 'Cannon (Vertical)', + robotis_icon_game_character_26: 'Laser (Vertical)', + robotis_icon_game_character_27: 'Laser (Horizontal)', + robotis_icon_game_character_28: 'Arrow (Horizontal)', + robotis_icon_game_character_29: 'Arrow (Vertical)', + robotis_icon_game_character_30: 'Missile (Up)', + robotis_icon_game_character_31: 'Missile (Down)', + robotis_icon_game_character_32: 'Missile (Left)', + robotis_icon_game_character_33: 'Missile (Right)', + robotis_icon_game_character_34: 'Parachute', + robotis_icon_game_character_35: 'Explosion 1', + robotis_icon_game_character_36: 'Explosion 2', + robotis_icon_game_character_37: 'Scope', + robotis_icon_game_character_38: 'Scissors', + robotis_icon_game_character_39: 'Rock', + robotis_icon_game_character_40: 'Paper', + robotis_icon_game_character_41: 'Walking Person 1', + robotis_icon_game_character_42: 'Walking Person 2', + robotis_icon_game_character_43: 'Running Person 1', + robotis_icon_game_character_44: 'Running Person 2', robotis_speed_fast: "Fast Speed", robotis_speed_midium: "Medium Speed", robotis_speed_slow: "Slow Speed", @@ -1186,24 +1271,24 @@ Entry.Robotis_rb_koala.setLanguage = function() { robotis_line_cross_type_12: "︙", robotis_connected: "Connected", robotis_disconnected: "Not connected", - robotis_huskylens_mode_face_recognition: "Face Recognition", - robotis_huskylens_mode_object_tracking: "Object Tracking", - robotis_huskylens_mode_object_recognition: "Object Recognition", - robotis_huskylens_mode_line_tracking: "Line Tracking", - robotis_huskylens_mode_color_recognition: "Color Recognition", - robotis_huskylens_mode_tag_recognition: "Tag Recognition", - robotis_huskylens_mode_object_classification: "Object Classification", - robotis_huskylens_block: "Block", - robotis_huskylens_arrow: "Arrow", - robotis_huskylens_center_block_center_x: "Center X Coordinate", - robotis_huskylens_center_block_center_y: "Center Y Coordinate", - robotis_huskylens_center_block_width: "Width", - robotis_huskylens_center_block_height: "Height", - robotis_huskylens_center_leared_id: "Learned ID", - robotis_huskylens_center_arrow_origin_x: "Start X Coordinate", - robotis_huskylens_center_arrow_origin_y: "Start Y Coordinate", - robotis_huskylens_center_arrow_target_x: "End X Coordinate", - robotis_huskylens_center_arrow_target_y: "End Y Coordinate", + robotis_ai_camera_mode_face_recognition: "Face Recognition", + robotis_ai_camera_mode_object_tracking: "Object Tracking", + robotis_ai_camera_mode_object_recognition: "Object Recognition", + robotis_ai_camera_mode_line_tracking: "Line Tracking", + robotis_ai_camera_mode_color_recognition: "Color Recognition", + robotis_ai_camera_mode_tag_recognition: "Tag Recognition", + robotis_ai_camera_mode_object_classification: "Object Classification", + robotis_ai_camera_block: "Block", + robotis_ai_camera_arrow: "Arrow", + robotis_ai_camera_center_block_center_x: "Center X Coordinate", + robotis_ai_camera_center_block_center_y: "Center Y Coordinate", + robotis_ai_camera_center_block_width: "Width", + robotis_ai_camera_center_block_height: "Height", + robotis_ai_camera_center_leared_id: "Learned ID", + robotis_ai_camera_center_arrow_origin_x: "Start X Coordinate", + robotis_ai_camera_center_arrow_origin_y: "Start Y Coordinate", + robotis_ai_camera_center_arrow_target_x: "End X Coordinate", + robotis_ai_camera_center_arrow_target_y: "End Y Coordinate", }, } } @@ -3898,6 +3983,159 @@ Entry.Robotis_rb_koala.getBlocks = function() { py: ['Robotis.RB100_icon_screen_vehicle_number(%1,%2,%3,%4)'], }, }, + robotis_RCar_icon_screen_game_character: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_icon_game_character_1, '11520'], // 알쥐(정면) + [Lang.Blocks.robotis_icon_game_character_2, '11521'], // 알쥐(왼쪽) + [Lang.Blocks.robotis_icon_game_character_3, '11522'], // 알쥐(오른쪽) + [Lang.Blocks.robotis_icon_game_character_4, '11523'], // 알라(정면) + [Lang.Blocks.robotis_icon_game_character_5, '11524'], // 알라(왼쪽) + [Lang.Blocks.robotis_icon_game_character_6, '11525'], // 알라(오른쪽) + [Lang.Blocks.robotis_icon_game_character_7, '11526'], // 유령 + [Lang.Blocks.robotis_icon_game_character_8, '11527'], // 괴물 + [Lang.Blocks.robotis_icon_game_character_9, '11528'], // 바이러스 + [Lang.Blocks.robotis_icon_game_character_10, '11529'], // 세균 + [Lang.Blocks.robotis_icon_game_character_11, '11784'], // 나는 알쥐(L) + [Lang.Blocks.robotis_icon_game_character_12, '11785'], // 나는 알쥐(R) + [Lang.Blocks.robotis_icon_game_character_13, '11786'], // 나는 알쥐(U) + [Lang.Blocks.robotis_icon_game_character_14, '11530'], // 메달 + [Lang.Blocks.robotis_icon_game_character_15, '11531'], // 돈(G) + [Lang.Blocks.robotis_icon_game_character_16, '11532'], // 돈($) + [Lang.Blocks.robotis_icon_game_character_17, '11533'], // 하트 + [Lang.Blocks.robotis_icon_game_character_18, '11534'], // 포탄 + [Lang.Blocks.robotis_icon_game_character_19, '11535'], // 불 + [Lang.Blocks.robotis_icon_game_character_20, '11803'], // 구름1 + [Lang.Blocks.robotis_icon_game_character_21, '11804'], // 구름2 + [Lang.Blocks.robotis_icon_game_character_22, '11536'], // 포탄1 + [Lang.Blocks.robotis_icon_game_character_23, '11791'], // 포탄2 + [Lang.Blocks.robotis_icon_game_character_24, '11537'], // 대포(수평) + [Lang.Blocks.robotis_icon_game_character_25, '11538'], // 대포(수직) + [Lang.Blocks.robotis_icon_game_character_27, '11540'], // 레이저(수평) + [Lang.Blocks.robotis_icon_game_character_26, '11539'], // 레이저(수직) + [Lang.Blocks.robotis_icon_game_character_28, '11541'], // 화살(수평) + [Lang.Blocks.robotis_icon_game_character_29, '11542'], // 화살(수직) + [Lang.Blocks.robotis_icon_game_character_30, '11792'], // 미사일(U) + [Lang.Blocks.robotis_icon_game_character_31, '11793'], // 미사일(D) + [Lang.Blocks.robotis_icon_game_character_32, '11794'], // 미사일(L) + [Lang.Blocks.robotis_icon_game_character_33, '11795'], // 미사일(R) + [Lang.Blocks.robotis_icon_game_character_34, '11796'], // 낙하산 + [Lang.Blocks.robotis_icon_game_character_35, '11543'], // 폭발1 + [Lang.Blocks.robotis_icon_game_character_36, '11544'], // 폭발2 + [Lang.Blocks.robotis_icon_game_character_37, '11810'], // 조준경 + [Lang.Blocks.robotis_icon_game_character_38, '11545'], // 가위 + [Lang.Blocks.robotis_icon_game_character_39, '11546'], // 바위 + [Lang.Blocks.robotis_icon_game_character_40, '11547'], // 보 + [Lang.Blocks.robotis_icon_game_character_41, '11797'], // 걷는 사람1 + [Lang.Blocks.robotis_icon_game_character_42, '11798'], // 걷는 사람2 + [Lang.Blocks.robotis_icon_game_character_43, '11799'], // 뛰는 사람1 + [Lang.Blocks.robotis_icon_game_character_44, '11800'], // 뛰는 사람2 + ], + value: '11520', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [ + null, + { + type: 'number', + params: ['0'], + }, + { + type: 'number', + params: ['0'], + }, + 50, + null, + ], + type: 'robotis_RCar_icon_screen_game_character', + }, + paramsKeyMap: { + ICON: 0, + X: 1, + Y: 2, + SIZE: 3, + }, + class: 'robotis_rb100_lcd', + isNotFor: ['Robotis_rb_koala'], + func(sprite, script) { + // instruction / address / length / value / default length + let iconNum = script.getField('ICON', script); + let x = script.getNumberValue('X', script); + let y = script.getNumberValue('Y', script); + let size = script.getNumberValue('SIZE', script) * 2; + + let data_instruction = Entry.Robotis_rb.INSTRUCTION.WRITE; + let data_address = 166; + let data_length = 2; + let data_value = 10496; + + if (x < -160) { + x = -160; + } else if (x > 160) { + x = 160; + } + + if (y < -120) { + y = -120; + } else if (y > 120) { + y = 120; + } + + if (size < 0) { + size = 0; + } else if (size > 400) { + size = 400; + } + + data_value = iconNum; + + let data_sendqueue = [ + [Entry.Robotis_rb.INSTRUCTION.WRITE, 130, 2, x], + [Entry.Robotis_rb.INSTRUCTION.WRITE, 132, 2, y], + [Entry.Robotis_rb.INSTRUCTION.WRITE, 149, 2, size], + [data_instruction, data_address, data_length, data_value], + [Entry.Robotis_rb.INSTRUCTION.WRITE, 162, 1, 1], + ]; + + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + 200 + ); + }, + syntax: { + js: [], + py: ['Robotis.RB100_icon_screen_game_and_character(%1,%2,%3,%4)'], + }, + }, robotis_RCar_text_screen: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, @@ -5444,7 +5682,7 @@ Entry.Robotis_rb_koala.getBlocks = function() { - robotis_RCar_huskylens_block_value_closest_to_center: { + robotis_RCar_ai_camera_block_value_closest_to_center: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5454,11 +5692,11 @@ Entry.Robotis_rb_koala.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_block_center_x, '0'], - [Lang.Blocks.robotis_huskylens_center_block_center_y, '1'], - [Lang.Blocks.robotis_huskylens_center_block_width, '2'], - [Lang.Blocks.robotis_huskylens_center_block_height, '3'], - [Lang.Blocks.robotis_huskylens_center_leared_id, '4'], + [Lang.Blocks.robotis_ai_camera_center_block_center_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_block_center_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_block_width, '2'], + [Lang.Blocks.robotis_ai_camera_center_block_height, '3'], + [Lang.Blocks.robotis_ai_camera_center_leared_id, '4'], ], value: '0', fontSize: 11, @@ -5471,12 +5709,12 @@ Entry.Robotis_rb_koala.getBlocks = function() { params: [ null, ], - type: 'robotis_RCar_huskylens_block_value_closest_to_center', + type: 'robotis_RCar_ai_camera_block_value_closest_to_center', }, paramsKeyMap: { DATA_TYPE: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5492,10 +5730,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_block_value_closest_to_center(%1)'], + py: ['Robotis.robotis_ai_camera_block_value_closest_to_center(%1)'], }, }, - robotis_RCar_huskylens_arrow_value_closest_to_center: { + robotis_RCar_ai_camera_arrow_value_closest_to_center: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5505,11 +5743,11 @@ Entry.Robotis_rb_koala.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_arrow_origin_x, '0'], - [Lang.Blocks.robotis_huskylens_center_arrow_origin_y, '1'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_x, '2'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_y, '3'], - [Lang.Blocks.robotis_huskylens_center_leared_id, '4'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_x, '2'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_y, '3'], + [Lang.Blocks.robotis_ai_camera_center_leared_id, '4'], ], value: '0', fontSize: 11, @@ -5522,12 +5760,12 @@ Entry.Robotis_rb_koala.getBlocks = function() { params: [ null, ], - type: 'robotis_RCar_huskylens_arrow_value_closest_to_center', + type: 'robotis_RCar_ai_camera_arrow_value_closest_to_center', }, paramsKeyMap: { DATA_TYPE: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5544,10 +5782,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_arrow_value_closest_to_center(%1)'], + py: ['Robotis.robotis_ai_camera_arrow_value_closest_to_center(%1)'], }, }, - robotis_RCar_huskylens_number_of_learned_id: { + robotis_RCar_ai_camera_number_of_learned_id: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5559,11 +5797,11 @@ Entry.Robotis_rb_koala.getBlocks = function() { def: { params: [ ], - type: 'robotis_RCar_huskylens_number_of_learned_id', + type: 'robotis_RCar_ai_camera_number_of_learned_id', }, paramsKeyMap: { }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5577,10 +5815,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_number_of_learned_id()'], + py: ['Robotis.robotis_ai_camera_number_of_learned_id()'], }, }, - robotis_RCar_huskylens_block_value_of_id: { + robotis_RCar_ai_camera_block_value_of_id: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5607,10 +5845,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_block_center_x, '0'], - [Lang.Blocks.robotis_huskylens_center_block_center_y, '1'], - [Lang.Blocks.robotis_huskylens_center_block_width, '2'], - [Lang.Blocks.robotis_huskylens_center_block_height, '3'], + [Lang.Blocks.robotis_ai_camera_center_block_center_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_block_center_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_block_width, '2'], + [Lang.Blocks.robotis_ai_camera_center_block_height, '3'], ], value: '0', fontSize: 11, @@ -5624,13 +5862,13 @@ Entry.Robotis_rb_koala.getBlocks = function() { null, null, ], - type: 'robotis_RCar_huskylens_block_value_of_id', + type: 'robotis_RCar_ai_camera_block_value_of_id', }, paramsKeyMap: { ID: 0, TYPE: 1, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5670,10 +5908,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_block_value_of_id(%1, %2)'], + py: ['Robotis.robotis_ai_camera_block_value_of_id(%1, %2)'], }, }, - robotis_RCar_huskylens_arrow_value_of_id: { + robotis_RCar_ai_camera_arrow_value_of_id: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5700,10 +5938,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_arrow_origin_x, '0'], - [Lang.Blocks.robotis_huskylens_center_arrow_origin_y, '1'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_x, '2'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_y, '3'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_x, '2'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_y, '3'], ], value: '0', fontSize: 11, @@ -5717,13 +5955,13 @@ Entry.Robotis_rb_koala.getBlocks = function() { null, null, ], - type: 'robotis_RCar_huskylens_arrow_value_of_id', + type: 'robotis_RCar_ai_camera_arrow_value_of_id', }, paramsKeyMap: { ID: 0, TYPE: 1, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5762,10 +6000,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_arrow_value_of_id(%1, %2)'], + py: ['Robotis.robotis_ai_camera_arrow_value_of_id(%1, %2)'], }, }, - robotis_RCar_huskylens_connection_status: { + robotis_RCar_ai_camera_connection_status: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5789,12 +6027,12 @@ Entry.Robotis_rb_koala.getBlocks = function() { params: [ null, ], - type: 'robotis_RCar_huskylens_connection_status', + type: 'robotis_RCar_ai_camera_connection_status', }, paramsKeyMap: { STATUS: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5811,10 +6049,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_connection_status(%1)'], + py: ['Robotis.robotis_ai_camera_connection_status(%1)'], }, }, - robotis_RCar_huskylens_if_detected: { + robotis_RCar_ai_camera_if_detected: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -5824,8 +6062,8 @@ Entry.Robotis_rb_koala.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_block, '0'], - [Lang.Blocks.robotis_huskylens_arrow, '1'], + [Lang.Blocks.robotis_ai_camera_block, '0'], + [Lang.Blocks.robotis_ai_camera_arrow, '1'], ], value: '0', fontSize: 11, @@ -5838,12 +6076,12 @@ Entry.Robotis_rb_koala.getBlocks = function() { params: [ null, ], - type: 'robotis_RCar_huskylens_if_detected', + type: 'robotis_RCar_ai_camera_if_detected', }, paramsKeyMap: { DETECT_TYPE: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { var scope = script.executor.scope; @@ -5863,10 +6101,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_if_detected(%1)'], + py: ['Robotis.robotis_ai_camera_if_detected(%1)'], }, }, - robotis_RCar_huskylens_set_mode: { + robotis_RCar_ai_camera_set_mode: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', @@ -5875,13 +6113,13 @@ Entry.Robotis_rb_koala.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_mode_face_recognition, '0'], - [Lang.Blocks.robotis_huskylens_mode_object_tracking, '1'], - [Lang.Blocks.robotis_huskylens_mode_object_recognition, '2'], - [Lang.Blocks.robotis_huskylens_mode_line_tracking, '3'], - [Lang.Blocks.robotis_huskylens_mode_color_recognition, '4'], - [Lang.Blocks.robotis_huskylens_mode_tag_recognition, '5'], - [Lang.Blocks.robotis_huskylens_mode_object_classification, '6'], + [Lang.Blocks.robotis_ai_camera_mode_face_recognition, '0'], + [Lang.Blocks.robotis_ai_camera_mode_object_tracking, '1'], + [Lang.Blocks.robotis_ai_camera_mode_object_recognition, '2'], + [Lang.Blocks.robotis_ai_camera_mode_line_tracking, '3'], + [Lang.Blocks.robotis_ai_camera_mode_color_recognition, '4'], + [Lang.Blocks.robotis_ai_camera_mode_tag_recognition, '5'], + [Lang.Blocks.robotis_ai_camera_mode_object_classification, '6'], ], value: '0', fontSize: 11, @@ -5899,16 +6137,16 @@ Entry.Robotis_rb_koala.getBlocks = function() { params: [ null, ], - type: 'robotis_RCar_huskylens_set_mode', + type: 'robotis_RCar_ai_camera_set_mode', }, paramsKeyMap: { - HUSKYLENS_MODE: 0, + AI_CAMERA_MODE: 0, }, class: 'robotis_openCM70_cm', isNotFor: ['Robotis_rb_koala'], func: function (sprite, script) { // instruction / address / length / value / default length - var huskylens_mode = script.getField('HUSKYLENS_MODE', script); + var ai_camera_mode = script.getField('AI_CAMERA_MODE', script); var data_instruction = Entry.Robotis_rb.INSTRUCTION.WRITE; var data_address = 4001; @@ -5919,7 +6157,7 @@ Entry.Robotis_rb_koala.getBlocks = function() { data_instruction, data_address, data_length, - huskylens_mode, + ai_camera_mode, ], ]; @@ -5931,10 +6169,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.set_huskylens_mode(%1)'], + py: ['Robotis.set_ai_camera_mode(%1)'], }, }, - robotis_RCar_huskylens_print_custom_text: { + robotis_RCar_ai_camera_print_custom_text: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', @@ -5971,7 +6209,7 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, "Hello!" ], - type: 'robotis_RCar_huskylens_print_custom_text', + type: 'robotis_RCar_ai_camera_print_custom_text', }, paramsKeyMap: { X: 0, @@ -6037,10 +6275,10 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_print_custom_text(%1,%2,%3)'], + py: ['Robotis.robotis_ai_camera_print_custom_text(%1,%2,%3)'], }, }, - robotis_RCar_huskylens_clear_custom_text: { + robotis_RCar_ai_camera_clear_custom_text: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', @@ -6056,7 +6294,7 @@ Entry.Robotis_rb_koala.getBlocks = function() { def: { params: [ ], - type: 'robotis_RCar_huskylens_clear_custom_text', + type: 'robotis_RCar_ai_camera_clear_custom_text', }, paramsKeyMap: { }, @@ -6086,7 +6324,7 @@ Entry.Robotis_rb_koala.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_clear_custom_text()'], + py: ['Robotis.robotis_ai_camera_clear_custom_text()'], }, }, }; diff --git a/src/playground/blocks/hardware/block_robotisRBPracticalAssembly.js b/src/playground/blocks/hardware/block_robotisRBPracticalAssembly.js index 986c53b887..ae4b82c131 100644 --- a/src/playground/blocks/hardware/block_robotisRBPracticalAssembly.js +++ b/src/playground/blocks/hardware/block_robotisRBPracticalAssembly.js @@ -120,6 +120,7 @@ Entry.Robotis_rb_P_Assembly.blockMenuBlocks = [ 'robotis_Practice_icon_screen_animal_human', 'robotis_Practice_icon_screen_object_tool', 'robotis_Practice_icon_screen_vehicle_number', + 'robotis_Practice_icon_screen_game_character', 'robotis_Practice_text_screen', 'robotis_Practice_text_screen_redraw', 'robotis_Practice_pixel', @@ -139,22 +140,22 @@ Entry.Robotis_rb_P_Assembly.blockMenuBlocks = [ 'robotis_Practice_dxl_set_multiturn_round', // 인공지능 카메라 값 블록 - 'robotis_Practice_huskylens_connection_status', - 'robotis_Practice_huskylens_if_detected', + 'robotis_Practice_ai_camera_connection_status', + 'robotis_Practice_ai_camera_if_detected', - 'robotis_Practice_huskylens_block_value_closest_to_center', - 'robotis_Practice_huskylens_arrow_value_closest_to_center', - 'robotis_Practice_huskylens_number_of_learned_id', - 'robotis_Practice_huskylens_block_value_of_id', - 'robotis_Practice_huskylens_arrow_value_of_id', + 'robotis_Practice_ai_camera_block_value_closest_to_center', + 'robotis_Practice_ai_camera_arrow_value_closest_to_center', + 'robotis_Practice_ai_camera_number_of_learned_id', + 'robotis_Practice_ai_camera_block_value_of_id', + 'robotis_Practice_ai_camera_arrow_value_of_id', - 'robotis_Practice_huskylens_if_learned_id', - 'robotis_Practice_huskylens_if_detected_id_type', + 'robotis_Practice_ai_camera_if_learned_id', + 'robotis_Practice_ai_camera_if_detected_id_type', // AI Camera 제어 - 'robotis_Practice_huskylens_set_mode', - 'robotis_Practice_huskylens_print_custom_text', - 'robotis_Practice_huskylens_clear_custom_text', + 'robotis_Practice_ai_camera_set_mode', + 'robotis_Practice_ai_camera_print_custom_text', + 'robotis_Practice_ai_camera_clear_custom_text', ]; function sleepBlocking(milliseconds) { @@ -233,6 +234,7 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_Practice_icon_screen_animal_human: "화면에 [동물/사람]중 %1를 (%2, %3)위치에 %4 크기로 표시 %5", robotis_Practice_icon_screen_object_tool: "화면에 [물건/도구]중 %1를 (%2, %3)위치에 %4 크기로 표시 %5", robotis_Practice_icon_screen_vehicle_number: "화면에 [탈것/숫자]중 %1를 (%2, %3)위치에 %4 크기로 표시 %5", + robotis_Practice_icon_screen_game_character: "화면에 [게임/캐릭터]중 %1를 (%2, %3)위치에 %4 크기로 표시 %5", robotis_Practice_text_screen: "화면에 %1를 (%2, %3)위치에 %4 로 %5으로 표시 %6", robotis_Practice_pixel: "화면 (%1, %2)위치에 %3 색 점 표시 %4", robotis_Practice_text_screen_redraw: "화면에 %1를 (%2, %3)위치에 %4으로 새로 표시 %5", @@ -256,23 +258,23 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { // 인공지능 카메라 값 블록 - robotis_Practice_huskylens_connection_status: "인공지능 카메라가 %1이면", - robotis_Practice_huskylens_if_detected: "인공지능 카메라에 %1 이/가 표시되면", + robotis_Practice_ai_camera_connection_status: "인공지능 카메라가 %1이면", + robotis_Practice_ai_camera_if_detected: "인공지능 카메라에 %1 이/가 표시되면", - robotis_Practice_huskylens_block_value_closest_to_center: "인공지능 카메라가 인식한 %1의 %2", - robotis_Practice_huskylens_arrow_value_closest_to_center: "인공지능 카메라가 인식한 화살표의 %1", - robotis_Practice_huskylens_number_of_learned_id: "인공지능 카메라가 학습한 클래스의 갯수", - robotis_Practice_huskylens_block_value_of_id: "인공지능 카메라가 감지한 클래스가 %1인 %2의 %3", - robotis_Practice_huskylens_arrow_value_of_id: "인공지능 카메라가 감지한 클래스가 %1인 화살표의 %2", + robotis_Practice_ai_camera_block_value_closest_to_center: "인공지능 카메라가 인식한 %1의 %2", + robotis_Practice_ai_camera_arrow_value_closest_to_center: "인공지능 카메라가 인식한 화살표의 %1", + robotis_Practice_ai_camera_number_of_learned_id: "인공지능 카메라가 학습한 클래스의 갯수", + robotis_Practice_ai_camera_block_value_of_id: "인공지능 카메라가 감지한 클래스가 %1인 %2의 %3", + robotis_Practice_ai_camera_arrow_value_of_id: "인공지능 카메라가 감지한 클래스가 %1인 화살표의 %2", - robotis_Practice_huskylens_if_learned_id: "인공지능 카메라가 클래스가 %1인 데이터를 학습하였으면", - robotis_Practice_huskylens_if_detected_id_type: "인공지능 카메라가 클래스가 %1인 %2데이터를 인식하였으면", + robotis_Practice_ai_camera_if_learned_id: "인공지능 카메라가 클래스가 %1인 데이터를 학습하였으면", + robotis_Practice_ai_camera_if_detected_id_type: "인공지능 카메라가 클래스가 %1인 %2데이터를 인식하였으면", // 인공지능 카메라 제어 - robotis_Practice_huskylens_set_mode: "인공지능 카메라의 작동방식을 %1(으)로 설정 %2", - robotis_Practice_huskylens_print_custom_text: "인공지능 카메라의 화면 위치 (%1,%2)에 %3를 보여주기%4", - robotis_Practice_huskylens_clear_custom_text: "인공지능 카메라의 화면의 글 지우기 %1", + robotis_Practice_ai_camera_set_mode: "인공지능 카메라의 작동방식을 %1(으)로 설정 %2", + robotis_Practice_ai_camera_print_custom_text: "인공지능 카메라의 화면 위치 (%1,%2)에 %3를 보여주기%4", + robotis_Practice_ai_camera_clear_custom_text: "인공지능 카메라의 화면의 글 지우기 %1", }, Helper: { // 주행 제어 @@ -343,6 +345,7 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_Practice_icon_screen_animal_human: "화면에 [동물/사람]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_Practice_icon_screen_object_tool: "화면에 [물건/도구]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_Practice_icon_screen_vehicle_number: "화면에 [탈것/숫자]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", + robotis_Practice_icon_screen_game_character: "화면에 [게임/캐릭터]중 특정 아이콘을 표시할 위치와 크기를 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_Practice_text_screen: "화면에 지정한 문구를 표시할 위치와 폰트크기, 색상을 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", robotis_Practice_text_screen_redraw: "화면에 지정한 문구를 새롭게(문구의 배경 지움) 표시할 위치와 색상을 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120\n크기: 0 ~ 200", robotis_Practice_pixel: "화면에 표시할 점의 위치와 색상을 설정\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", @@ -362,22 +365,22 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_Practice_dxl_set_multiturn_round: "지정한 ID의 모터가 지정한 속도와 방향으로 지정한 바퀴만큼 회전", // AI Camera 값 블록 - robotis_Practice_huskylens_connection_status: "인공지능 카메라가 연결된 상태이면 '참', 아니면 '거짓'으로 판단합니다.", - robotis_Practice_huskylens_if_detected: "인공지능 카메라의 LCD화면에 선택한 기호(사각형/화살표)가 표시되면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_Practice_ai_camera_connection_status: "인공지능 카메라가 연결된 상태이면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_Practice_ai_camera_if_detected: "인공지능 카메라의 LCD화면에 선택한 기호(사각형/화살표)가 표시되면 '참', 아니면 '거짓'으로 판단합니다.", - robotis_Practice_huskylens_block_value_closest_to_center: "인공지능 카메라 화면 중앙과 가장 가까운 사각형의 X좌표/Y좌표/너비/높이/클래스", - robotis_Practice_huskylens_arrow_value_closest_to_center: "인공지능 카메라 화면 중앙과 가장 가까운 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표/클래스", - robotis_Practice_huskylens_number_of_learned_id: "인공지능 카메라가 학습한 번호의 갯수", - robotis_Practice_huskylens_block_value_of_id: "인공지능 카메라가 감지한 사각형중 지정한 번호의 사각형의 X좌표/Y좌표/너비/높이", - robotis_Practice_huskylens_arrow_value_of_id: "인공지능 카메라가 감지한 화살표중 지정한 번호의 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표", + robotis_Practice_ai_camera_block_value_closest_to_center: "인공지능 카메라 화면 중앙과 가장 가까운 사각형의 X좌표/Y좌표/너비/높이/클래스", + robotis_Practice_ai_camera_arrow_value_closest_to_center: "인공지능 카메라 화면 중앙과 가장 가까운 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표/클래스", + robotis_Practice_ai_camera_number_of_learned_id: "인공지능 카메라가 학습한 번호의 갯수", + robotis_Practice_ai_camera_block_value_of_id: "인공지능 카메라가 감지한 사각형중 지정한 번호의 사각형의 X좌표/Y좌표/너비/높이", + robotis_Practice_ai_camera_arrow_value_of_id: "인공지능 카메라가 감지한 화살표중 지정한 번호의 화살표의 시작점X좌표/시작점Y좌표/끝점X좌표/끝점Y좌표", - robotis_Practice_huskylens_if_learned_id: "인공지능 카메라가 지정한 번호인 데이터를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", - robotis_Practice_huskylens_if_detected_id_type: "인공지능 카메라가 지정한 번호인 지정한 데이터(사각형/화살표)를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_Practice_ai_camera_if_learned_id: "인공지능 카메라가 지정한 번호인 데이터를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", + robotis_Practice_ai_camera_if_detected_id_type: "인공지능 카메라가 지정한 번호인 지정한 데이터(사각형/화살표)를 학습하였으면 '참', 아니면 '거짓'으로 판단합니다.", // 인공지능 카메라 제어 - robotis_Practice_huskylens_set_mode: "인공지능 카메라의 모드를 설정", - robotis_Practice_huskylens_print_custom_text: "인공지능 카메라 화면의 지정한 위치에 지정한 문구 출력\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", - robotis_Practice_huskylens_clear_custom_text: "인공지능 카메라 화면에 표시한 모든 문구 지우기", + robotis_Practice_ai_camera_set_mode: "인공지능 카메라의 모드를 설정", + robotis_Practice_ai_camera_print_custom_text: "인공지능 카메라 화면의 지정한 위치에 지정한 문구 출력\nX좌표: -160 ~ 160\nY좌표: -120 ~ 120", + robotis_Practice_ai_camera_clear_custom_text: "인공지능 카메라 화면에 표시한 모든 문구 지우기", }, Blocks: { robotis_red: "빨강", @@ -668,7 +671,7 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_icon_vehicle_number_11: "로켓", robotis_icon_vehicle_number_12: "어선", robotis_icon_vehicle_number_13: "여객선", - robotis_icon_vehicle_number_14: "잠수항(왼쪽)", + robotis_icon_vehicle_number_14: "잠수함(왼쪽)", robotis_icon_vehicle_number_15: "잠수함(오른쪽)", robotis_icon_vehicle_number_16: "비행기(왼쪽)", robotis_icon_vehicle_number_17: "비행기(오른쪽)", @@ -693,6 +696,50 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_icon_vehicle_number_36: "8", robotis_icon_vehicle_number_37: "9", robotis_icon_vehicle_number_38: "10", + robotis_icon_game_character_1: '알쥐(정면)', + robotis_icon_game_character_2: '알쥐(왼쪽)', + robotis_icon_game_character_3: '알쥐(오른쪽)', + robotis_icon_game_character_4: '알라(정면)', + robotis_icon_game_character_5: '알라(왼쪽))', + robotis_icon_game_character_6: '알라(오른쪽)', + robotis_icon_game_character_7: '유령', + robotis_icon_game_character_8: '괴물', + robotis_icon_game_character_9: '바이러스', + robotis_icon_game_character_10: '세균', + robotis_icon_game_character_11: '나는 알쥐(왼쪽)', + robotis_icon_game_character_12: '나는 알쥐(오른쪽)', + robotis_icon_game_character_13: '나는 알쥐(정면)', + robotis_icon_game_character_14: '메달', + robotis_icon_game_character_15: '돈(G)', + robotis_icon_game_character_16: '돈($)', + robotis_icon_game_character_17: '하트', + robotis_icon_game_character_18: '폭탄', + robotis_icon_game_character_19: '불', + robotis_icon_game_character_20: '구름1', + robotis_icon_game_character_21: '구름2', + robotis_icon_game_character_22: '포탄1', + robotis_icon_game_character_23: '포탄2', + robotis_icon_game_character_24: '대포(수평)', + robotis_icon_game_character_25: '대포(수직)', + robotis_icon_game_character_26: '레이저(수직)', + robotis_icon_game_character_27: '게이저(수평)', + robotis_icon_game_character_28: '화살(수평)', + robotis_icon_game_character_29: '화살(수직)', + robotis_icon_game_character_30: '미사일(U)', + robotis_icon_game_character_31: '미사일(D)', + robotis_icon_game_character_32: '미사일(L)', + robotis_icon_game_character_33: '미사일(R)', + robotis_icon_game_character_34: '낙하산', + robotis_icon_game_character_35: '폭발1', + robotis_icon_game_character_36: '폭발2', + robotis_icon_game_character_37: '조준경', + robotis_icon_game_character_38: '가위', + robotis_icon_game_character_39: '바위', + robotis_icon_game_character_40: '보', + robotis_icon_game_character_41: '걷는 사람1', + robotis_icon_game_character_42: '걷는 사람2', + robotis_icon_game_character_43: '뛰는 사람1', + robotis_icon_game_character_44: '뛰는 사람2', robotis_clockwise: "시계방향", robotis_counterclockwise: "반시계방향", robotis_up: "들기", @@ -753,29 +800,29 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_connected: "연결", robotis_disconnected: "없음", - robotis_huskylens_mode_face_recognition: "얼굴 인식", - robotis_huskylens_mode_line_tracking: "라인 인식", - robotis_huskylens_mode_color_recognition: "색상 인식", - robotis_huskylens_mode_tag_recognition: "태그 인식", - robotis_huskylens_mode_object_classification: "사물 분류", - robotis_huskylens_mode_expression_recognition: '표정 인식', - robotis_huskylens_target_face: "얼굴", - robotis_huskylens_target_expression: "표정", - robotis_huskylens_target_object: "사물", - robotis_huskylens_target_color: "색상", - robotis_huskylens_target_tag: "태그", - robotis_huskylens_target_qr: "QR코드", - robotis_huskylens_target_block: "사각형", - robotis_huskylens_target_arrow: "화살표", - robotis_huskylens_center_block_center_x: "중심 X좌표", - robotis_huskylens_center_block_center_y: "중심 Y좌표", - robotis_huskylens_center_block_width: "너비", - robotis_huskylens_center_block_height: "높이", - robotis_huskylens_center_leared_id: "클래스", - robotis_huskylens_center_arrow_origin_x: "시작점 X좌표", - robotis_huskylens_center_arrow_origin_y: "시작점 Y좌표", - robotis_huskylens_center_arrow_target_x: "끝점 X좌표", - robotis_huskylens_center_arrow_target_y: "끝점 Y좌표", + robotis_ai_camera_mode_face_recognition: "얼굴 인식", + robotis_ai_camera_mode_line_tracking: "라인 인식", + robotis_ai_camera_mode_color_recognition: "색상 인식", + robotis_ai_camera_mode_tag_recognition: "태그 인식", + robotis_ai_camera_mode_object_classification: "사물 분류", + robotis_ai_camera_mode_expression_recognition: '표정 인식', + robotis_ai_camera_target_face: "얼굴", + robotis_ai_camera_target_expression: "표정", + robotis_ai_camera_target_object: "사물", + robotis_ai_camera_target_color: "색상", + robotis_ai_camera_target_tag: "태그", + robotis_ai_camera_target_qr: "QR코드", + robotis_ai_camera_target_block: "사각형", + robotis_ai_camera_target_arrow: "화살표", + robotis_ai_camera_center_block_center_x: "중심 X좌표", + robotis_ai_camera_center_block_center_y: "중심 Y좌표", + robotis_ai_camera_center_block_width: "너비", + robotis_ai_camera_center_block_height: "높이", + robotis_ai_camera_center_leared_id: "클래스", + robotis_ai_camera_center_arrow_origin_x: "시작점 X좌표", + robotis_ai_camera_center_arrow_origin_y: "시작점 Y좌표", + robotis_ai_camera_center_arrow_target_x: "끝점 X좌표", + robotis_ai_camera_center_arrow_target_y: "끝점 Y좌표", robotis_plant_ripe: "빨간색으로 잘 익은", robotis_plant_unripe: "초록색으로 덜 익은", @@ -845,6 +892,7 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_Practice_icon_screen_animal_human: "Display %1 from [Animal/Human] at position (%2, %3) in size %4 %5", robotis_Practice_icon_screen_object_tool: "Display %1 from [Object/Tool] at position (%2, %3) in size %4 %5", robotis_Practice_icon_screen_vehicle_number: "Display %1 from [Vehicle/Number] at position (%2, %3) in size %4 %5", + robotis_Practice_icon_screen_game_character: "Display %1 from [Game/Character] at position (%2, %3) in size %4 %5", robotis_Practice_text_screen: "Display %1 in %5 in %4 at (%2, %3) on the screen %6", robotis_Practice_text_screen_redraw: "Newly display %1 in %4 at (%2, %3) %5", robotis_Practice_pixel: "Display %3 colored dot at (%1, %2) %4", @@ -866,22 +914,22 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { // AI Camera 값 블록 - robotis_Practice_huskylens_connection_status: "AI Camera: If %1", - robotis_Practice_huskylens_if_detected: "AI Camera: If %1 is displayed", + robotis_Practice_ai_camera_connection_status: "AI Camera: If %1", + robotis_Practice_ai_camera_if_detected: "AI Camera: If %1 is displayed", - robotis_Practice_huskylens_block_value_closest_to_center: "AI Camera: %2 of the %1 closest to the center of the screen", - robotis_Practice_huskylens_arrow_value_closest_to_center: "AI Camera: %1 of the arrow closest to the center of the screen", - robotis_Practice_huskylens_number_of_learned_id: "AI Camera: the number of learned ID", - robotis_Practice_huskylens_block_value_of_id: "AI Camera: %3 of %2 with detected ID %1", - robotis_Practice_huskylens_arrow_value_of_id: "AI Camera: %2 of arrow with detected ID %1", + robotis_Practice_ai_camera_block_value_closest_to_center: "AI Camera: %2 of the %1 closest to the center of the screen", + robotis_Practice_ai_camera_arrow_value_closest_to_center: "AI Camera: %1 of the arrow closest to the center of the screen", + robotis_Practice_ai_camera_number_of_learned_id: "AI Camera: the number of learned ID", + robotis_Practice_ai_camera_block_value_of_id: "AI Camera: %3 of %2 with detected ID %1", + robotis_Practice_ai_camera_arrow_value_of_id: "AI Camera: %2 of arrow with detected ID %1", - robotis_Practice_huskylens_if_learned_id: "AI Camera: If learned data with ID %1", - robotis_Practice_huskylens_if_detected_id_type: "AI Camera: If learned %2 data with ID %1", + robotis_Practice_ai_camera_if_learned_id: "AI Camera: If learned data with ID %1", + robotis_Practice_ai_camera_if_detected_id_type: "AI Camera: If learned %2 data with ID %1", // 인공지능 카메라 제어 - robotis_Practice_huskylens_set_mode: "AI Camera: Set mode to %1 %2", - robotis_Practice_huskylens_print_custom_text: "AI Camera: Display %3 at screen position (%1, %2) %4", - robotis_Practice_huskylens_clear_custom_text: "AI Camera: Clear screen text %1", + robotis_Practice_ai_camera_set_mode: "AI Camera: Set mode to %1 %2", + robotis_Practice_ai_camera_print_custom_text: "AI Camera: Display %3 at screen position (%1, %2) %4", + robotis_Practice_ai_camera_clear_custom_text: "AI Camera: Clear screen text %1", }, Helper: { // 주행 제어 @@ -931,6 +979,7 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_Practice_icon_screen_animal_human: "Set the position and size of a specific icon in [animal/human] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_Practice_icon_screen_object_tool: "Set the position and size of a specific icon in [object/tool] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_Practice_icon_screen_vehicle_number: "Set the position and size of a specific icon in [vehicle/number] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", + robotis_Practice_icon_screen_game_character: "Set the position and size of a specific icon in [game/character] on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_Practice_text_screen: "Set the position, font size, and color of the specified text on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", robotis_Practice_text_screen_redraw: "Set the position and color of the specified text to be newly displayed (clearing the background of the text) on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120\nSize: 0 ~ 200", robotis_Practice_pixel: "Set the position and color of the dot to be displayed on the screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", @@ -950,22 +999,22 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_Practice_dxl_set_multiturn_round: "Set the motor with the specified ID to rotate the specified number of turns at the specified speed and direction", // AI Camera 값 블록 - robotis_Practice_huskylens_connection_status: "If the AI camera is connected, it is determined as 'true'; otherwise, 'false'.", - robotis_Practice_huskylens_if_detected: "If the selected symbol (rectangle/arrow) is displayed on the LCD screen of the AI camera, it is determined as 'true'; otherwise, 'false'.", + robotis_Practice_ai_camera_connection_status: "If the AI camera is connected, it is determined as 'true'; otherwise, 'false'.", + robotis_Practice_ai_camera_if_detected: "If the selected symbol (rectangle/arrow) is displayed on the LCD screen of the AI camera, it is determined as 'true'; otherwise, 'false'.", - robotis_Practice_huskylens_block_value_closest_to_center: "X coordinate/Y coordinate/width/height/learning ID of the rectangle closest to the center of the AI camera screen", - robotis_Practice_huskylens_arrow_value_closest_to_center: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate/learning ID of the arrow closest to the center of the AI camera screen", - robotis_Practice_huskylens_number_of_learned_id: "Number of IDs learned by the AI camera", - robotis_Practice_huskylens_block_value_of_id: "X coordinate/Y coordinate/width/height of the rectangle with the specified ID detected by the AI camera", - robotis_Practice_huskylens_arrow_value_of_id: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate of the arrow with the specified ID detected by the AI camera", + robotis_Practice_ai_camera_block_value_closest_to_center: "X coordinate/Y coordinate/width/height/learning ID of the rectangle closest to the center of the AI camera screen", + robotis_Practice_ai_camera_arrow_value_closest_to_center: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate/learning ID of the arrow closest to the center of the AI camera screen", + robotis_Practice_ai_camera_number_of_learned_id: "Number of IDs learned by the AI camera", + robotis_Practice_ai_camera_block_value_of_id: "X coordinate/Y coordinate/width/height of the rectangle with the specified ID detected by the AI camera", + robotis_Practice_ai_camera_arrow_value_of_id: "Starting point X coordinate/starting point Y coordinate/end point X coordinate/end point Y coordinate of the arrow with the specified ID detected by the AI camera", - robotis_Practice_huskylens_if_learned_id: "If the AI camera has learned the data of the specified ID, it is determined as 'true'; otherwise, 'false'.", - robotis_Practice_huskylens_if_detected_id_type: "If the AI camera has learned the specified data (rectangle/arrow) of the specified ID, it is determined as 'true'; otherwise, 'false'.", + robotis_Practice_ai_camera_if_learned_id: "If the AI camera has learned the data of the specified ID, it is determined as 'true'; otherwise, 'false'.", + robotis_Practice_ai_camera_if_detected_id_type: "If the AI camera has learned the specified data (rectangle/arrow) of the specified ID, it is determined as 'true'; otherwise, 'false'.", // 인공지능 카메라 제어 - robotis_Practice_huskylens_set_mode: "Set the mode of the AI camera", - robotis_Practice_huskylens_print_custom_text: "Print the specified text at the specified position on the AI camera screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", - robotis_Practice_huskylens_clear_custom_text: "Clear all the text displayed on the AI camera screen", + robotis_Practice_ai_camera_set_mode: "Set the mode of the AI camera", + robotis_Practice_ai_camera_print_custom_text: "Print the specified text at the specified position on the AI camera screen\nX coordinate: -160 ~ 160\nY coordinate: -120 ~ 120", + robotis_Practice_ai_camera_clear_custom_text: "Clear all the text displayed on the AI camera screen", }, Blocks: { @@ -981,6 +1030,9 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_center: "Center", robotis_right: "Right", robotis_both: "Both", + robotis_rgee: "R-GEE", + robotis_rla: "KODALA", + robotis_kkokdu: "TIG", robotis_korean1: "Hello!", robotis_korean2: "Great to see you.", robotis_korean3: "Okay ~", @@ -1103,13 +1155,22 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_moveB: "Backward", robotis_moveL: "LeftTurn", robotis_moveR: "RightTurn", + robotis_moveU: "U-turn", + robotis_moveL_in_place: "Turn left in place", + robotis_moveR_in_place: "Trun right in place", + robotis_moveU_in_place: "U-turn in place", robotis_moveRG1: "Stand", robotis_moveRG2: "Sit", robotis_moveRG3: "Struggle", robotis_moveRG4: "RaiseFeet", - robotis_fast: 'Fast', - robotis_normal: 'Normal', - robotis_slow: 'Slow', + robotis_fast: "Fast", + robotis_normal: "Normal", + robotis_slow: "Slow", + robotis_stop: "Stop", + robotis_roll: "Left-right rotate angle (roll)", + robotis_pitch: "Forward-backward rotate angle (pitch)", + robotis_direction_forward: "Forward", + robotis_direction_backward: "Backward", robotis_stMotion1: "Standard", robotis_stMotion2: "Forward", robotis_stMotion3: "TurnRight", @@ -1147,31 +1208,257 @@ Entry.Robotis_rb_P_Assembly.setLanguage = function () { robotis_dxl_value_angle: "angle", robotis_dxl_value_velocity: "velocity", robotis_dxl_value_moving: "moving", - robotis_connected: "connected", - robotis_disconnected: "NOT connected", - robotis_huskylens_mode_face_recognition: "Face recognition", - robotis_huskylens_mode_line_recognition: "Line tracking", - robotis_huskylens_mode_color_recognition: "Color recognition", - robotis_huskylens_mode_tag_recognition: "Tag recognition", - robotis_huskylens_mode_object_classification: "Object classification", - robotis_huskylens_mode_expression_recognition: 'Expression recognition', - robotis_huskylens_target_face: "Face", - robotis_huskylens_target_expression: "Expression", - robotis_huskylens_target_object: "Object", - robotis_huskylens_target_color: "Color", - robotis_huskylens_target_tag: "Tag", - robotis_huskylens_target_qr: "QR", - robotis_huskylens_target_block: "Rectangle", - robotis_huskylens_target_arrow: "Arrow", - robotis_huskylens_center_block_center_x: "Center X", - robotis_huskylens_center_block_center_y: "Center Y", - robotis_huskylens_center_block_width: "Width", - robotis_huskylens_center_block_height: "Height", - robotis_huskylens_center_leared_id: "Learned ID", - robotis_huskylens_center_arrow_origin_x: "Origin X", - robotis_huskylens_center_arrow_origin_y: "Origin Y", - robotis_huskylens_center_arrow_target_x: "Target X", - robotis_huskylens_center_arrow_target_y: "Target Y", + robotis_icon_food_plant_1: "Milk", + robotis_icon_food_plant_2: "Tree", + robotis_icon_food_plant_3: "Soup", + robotis_icon_food_plant_4: "Cake", + robotis_icon_food_plant_5: "Water", + robotis_icon_food_plant_6: "Juice", + robotis_icon_food_plant_7: "Carrot", + robotis_icon_food_plant_8: "Apple", + robotis_icon_food_plant_9: "Orange", + robotis_icon_food_plant_10: "Meat", + robotis_icon_food_plant_11: "Flowerpot", + robotis_icon_food_plant_12: "Rose", + robotis_icon_food_plant_13: "Grape", + robotis_icon_food_plant_14: "Potato", + robotis_icon_food_plant_15: "Candy", + robotis_icon_food_plant_16: "Cheese", + robotis_icon_food_plant_17: "Bread", + robotis_icon_food_plant_18: "Flowers", + robotis_icon_food_plant_19: "Coffee", + robotis_icon_food_plant_20: "Tulip", + robotis_icon_food_plant_21: "Banana", + robotis_icon_food_plant_22: "Fruits", + robotis_icon_food_plant_23: "Hamburger", + robotis_icon_food_plant_24: "Pizza", + robotis_icon_animal_human_1: "Shiba Dog", + robotis_icon_animal_human_2: "Puppy", + robotis_icon_animal_human_3: "Bear", + robotis_icon_animal_human_4: "Bird", + robotis_icon_animal_human_5: "Duck", + robotis_icon_animal_human_6: "Lion", + robotis_icon_animal_human_7: "Tiger", + robotis_icon_animal_human_8: "Horse", + robotis_icon_animal_human_9: "Sheep", + robotis_icon_animal_human_10: "Shark 1 (Left)", + robotis_icon_animal_human_11: "Shark 1 (Right)", + robotis_icon_animal_human_12: "Shark 2 (Left)", + robotis_icon_animal_human_13: "Shark 2 (Right)", + robotis_icon_animal_human_14: "Fish 1", + robotis_icon_animal_human_15: "Fish 2", + robotis_icon_animal_human_16: "Fish 3", + robotis_icon_animal_human_17: "Octopus", + robotis_icon_animal_human_18: "Monkey", + robotis_icon_animal_human_19: "Chicken", + robotis_icon_animal_human_20: "Pig", + robotis_icon_animal_human_21: "Person (Chubby)", + robotis_icon_animal_human_22: "Person (Swimsuit)", + robotis_icon_animal_human_23: "Baby", + robotis_icon_animal_human_24: "Person (Running)", + robotis_icon_animal_human_25: "Person (Singing)", + robotis_icon_animal_human_26: "Person (Sitting)", + robotis_icon_animal_human_27: "Person (Angry)", + robotis_icon_animal_human_28: "Person (Cheering)", + robotis_icon_animal_human_29: "King", + robotis_icon_animal_human_30: "Prince", + robotis_icon_animal_human_31: "Princess", + robotis_icon_animal_human_32: "Chef", + robotis_icon_animal_human_33: "Doctor", + robotis_icon_animal_human_34: "Nurse", + robotis_icon_object_tool_1: "Bag", + robotis_icon_object_tool_2: "Box", + robotis_icon_object_tool_3: "Mug", + robotis_icon_object_tool_4: "Hat (Fedora)", + robotis_icon_object_tool_5: "Hat (Cap)", + robotis_icon_object_tool_6: "Key", + robotis_icon_object_tool_7: "Toy", + robotis_icon_object_tool_8: "Book", + robotis_icon_object_tool_9: "Teddy Bear", + robotis_icon_object_tool_10: "Drum", + robotis_icon_object_tool_11: "Notebook", + robotis_icon_object_tool_12: "Pen", + robotis_icon_object_tool_13: "Desk", + robotis_icon_object_tool_14: "Table", + robotis_icon_object_tool_15: "Chair", + robotis_icon_object_tool_16: "Bed", + robotis_icon_object_tool_17: "Tent", + robotis_icon_object_tool_18: "Plate", + robotis_icon_object_tool_19: "Soccer Ball", + robotis_icon_object_tool_20: "Bell", + robotis_icon_object_tool_21: "Watch", + robotis_icon_object_tool_22: "Shoes", + robotis_icon_object_tool_23: "Lamp", + robotis_icon_object_tool_24: "Radio", + robotis_icon_object_tool_25: "Banknote", + robotis_icon_object_tool_26: "Ruler", + robotis_icon_object_tool_27: "Camera", + robotis_icon_object_tool_28: "Spoon", + robotis_icon_object_tool_29: "Keyboard", + robotis_icon_object_tool_30: "Calendar", + robotis_icon_object_tool_31: "Knife", + robotis_icon_object_tool_32: "Balloon", + robotis_icon_object_tool_33: "Water Bottle", + robotis_icon_object_tool_34: "Wooden Stick (Horizontal)", + robotis_icon_object_tool_35: "Wooden Stick (Vertical)", + robotis_icon_object_tool_36: "Fishing Hook", + robotis_icon_vehicle_number_1: "Car", + robotis_icon_vehicle_number_2: "Bus", + robotis_icon_vehicle_number_3: "Truck", + robotis_icon_vehicle_number_4: "Jeep", + robotis_icon_vehicle_number_5: "Bicycle", + robotis_icon_vehicle_number_6: "Subway", + robotis_icon_vehicle_number_7: "Train", + robotis_icon_vehicle_number_8: "Airplane", + robotis_icon_vehicle_number_9: "Fighter Jet (Vertical)", + robotis_icon_vehicle_number_10: "Fighter Jet (Horizontal)", + robotis_icon_vehicle_number_11: "Rocket", + robotis_icon_vehicle_number_12: "Fishing Boat", + robotis_icon_vehicle_number_13: "Passenger Ship", + robotis_icon_vehicle_number_14: "Submarine (Left)", + robotis_icon_vehicle_number_15: "Submarine (Right)", + robotis_icon_vehicle_number_16: "Airplane (Left)", + robotis_icon_vehicle_number_17: "Airplane (Right)", + robotis_icon_vehicle_number_18: "Airplane (Top)", + robotis_icon_vehicle_number_19: "Spaceship (Left)", + robotis_icon_vehicle_number_20: "Spaceship (Right)", + robotis_icon_vehicle_number_21: "Spaceship (Top)", + robotis_icon_vehicle_number_22: "Dice (1)", + robotis_icon_vehicle_number_23: "Dice (2)", + robotis_icon_vehicle_number_24: "Dice (3)", + robotis_icon_vehicle_number_25: "Dice (4)", + robotis_icon_vehicle_number_26: "Dice (5)", + robotis_icon_vehicle_number_27: "Dice (6)", + robotis_icon_vehicle_number_28: "0", + robotis_icon_vehicle_number_29: "1", + robotis_icon_vehicle_number_30: "2", + robotis_icon_vehicle_number_31: "3", + robotis_icon_vehicle_number_32: "4", + robotis_icon_vehicle_number_33: "5", + robotis_icon_vehicle_number_34: "6", + robotis_icon_vehicle_number_35: "7", + robotis_icon_vehicle_number_36: "8", + robotis_icon_vehicle_number_37: "9", + robotis_icon_vehicle_number_38: "10", + robotis_icon_game_character_1: "R-GEE(F)", + robotis_icon_game_character_2: "R-GEE(L)", + robotis_icon_game_character_3: "R-GEE(R)", + robotis_icon_game_character_4: "KODALA(F)", + robotis_icon_game_character_5: "KODALA(L))", + robotis_icon_game_character_6: "KODALA(R)", + robotis_icon_game_character_7: "Ghost", + robotis_icon_game_character_8: "Monster", + robotis_icon_game_character_9: "Virus", + robotis_icon_game_character_10: "Bacteria", + robotis_icon_game_character_11: "Flying R-GEE (L)", + robotis_icon_game_character_12: "Flying R-GEE (R)", + robotis_icon_game_character_13: "Flying R-GEE (F)", + robotis_icon_game_character_14: "Medal", + robotis_icon_game_character_15: "Money (G)", + robotis_icon_game_character_16: "Money ($)", + robotis_icon_game_character_17: "Heart", + robotis_icon_game_character_18: "Bomb", + robotis_icon_game_character_19: "Fire", + robotis_icon_game_character_20: "Cloud 1", + robotis_icon_game_character_21: "Cloud 2", + robotis_icon_game_character_22: "Shell 1", + robotis_icon_game_character_23: "Shell 2", + robotis_icon_game_character_24: "Cannon (Horizontal)", + robotis_icon_game_character_25: "Cannon (Vertical)", + robotis_icon_game_character_26: "Laser (Vertical)", + robotis_icon_game_character_27: "Laser (Horizontal)", + robotis_icon_game_character_28: "Arrow (Horizontal)", + robotis_icon_game_character_29: "Arrow (Vertical)", + robotis_icon_game_character_30: "Missile (Up)", + robotis_icon_game_character_31: "Missile (Down)", + robotis_icon_game_character_32: "Missile (Left)", + robotis_icon_game_character_33: "Missile (Right)", + robotis_icon_game_character_34: "Parachute", + robotis_icon_game_character_35: "Explosion 1", + robotis_icon_game_character_36: "Explosion 2", + robotis_icon_game_character_37: "Scope", + robotis_icon_game_character_38: "Scissors", + robotis_icon_game_character_39: "Rock", + robotis_icon_game_character_40: "Paper", + robotis_icon_game_character_41: "Walking Person 1", + robotis_icon_game_character_42: "Walking Person 2", + robotis_icon_game_character_43: "Running Person 1", + robotis_icon_game_character_44: "Running Person 2", + robotis_speed_fast: "Fast Speed", + robotis_speed_midium: "Medium Speed", + robotis_speed_slow: "Slow Speed", + robotis_clockwise: "Clockwise", + robotis_counterclockwise: "Counterclockwise", + robotis_up: "Lift", + robotis_down: "Lower", + robotis_if_greater: "If Greater", + robotis_if_smaller: "If Smaller", + robotis_if_equal: "If Equal", + robotis_front_right: "Front Right", + robotis_front_left: "Front Left", + robotis_bottom_right: "Bottom Right", + robotis_bottom_left: "Bottom Left", + robotis_side_right: "Right Edge", + robotis_side_left: "Left Edge", + robotis_front_ir_sensor: "Infrared Sensor", + robotis_distance_sensor: "Distance Sensor", + robotis_front: "Front", + robotis_right: "Right", + robotis_left_wheel: "Left Wheel", + robotis_right_wheel: "Right Wheel", + robotis_beat_sound_8th_note: "Eighth Note (♪)", + robotis_beat_sound_dotted_8th_note: "Dotted Eighth Note (♪.)", + robotis_beat_sound_quarter_note: "Quarter Note (♩)", + robotis_beat_sound_dotted_quarter_note: "Dotted Quarter Note (♩.)", + robotis_beat_sound_half_note: "Half Note (𝅗𝅥)", + robotis_beat_sound_dotted_half_note: "Dotted Half Note (𝅗𝅥.)", + robotis_beat_sound_whole_note: "Whole Note (𝅝)", + robotis_beat_sound_dotted_note: "Dotted Whole Note (𝅝.)", + robotis_beat_rest_8th_note: "Eighth Rest (𝄾)", + robotis_beat_rest_dotted_8th_note: "Dotted Eighth Rest (𝄾.)", + robotis_beat_rest_quarter_note: "Quarter Rest (𝄽)", + robotis_beat_rest_dotted_quarter_note: "Dotted Quarter Rest (𝄽.)", + robotis_beat_rest_half_note: "Half Rest (𝄼)", + robotis_beat_rest_dotted_half_note: "Dotted Half Rest (𝄼˙)", + robotis_beat_rest_whole_note: "Whole Rest (𝄻)", + robotis_beat_rest_dotted_note: "Dotted Whole Rest (𝄻˙)", + robotis_line_cross_type_0: "|", + robotis_line_cross_type_1: " (Blank)", + robotis_line_cross_type_5: "🞣", + robotis_line_cross_type_6: "⏉", + robotis_line_cross_type_7: "⊣", + robotis_line_cross_type_8: "⊢", + robotis_line_cross_type_9: "⏋", + robotis_line_cross_type_10: "⎾", + robotis_line_cross_type_11: "¦", + robotis_line_cross_type_12: "︙", + robotis_connected: "Connected", + robotis_disconnected: "Not connected", + robotis_ai_camera_mode_face_recognition: "Face recognition", + robotis_ai_camera_mode_object_tracking: "Object tracking", + robotis_ai_camera_mode_object_recognition: "Object recognition", + robotis_ai_camera_mode_line_recognition: "Line tracking", + robotis_ai_camera_mode_color_recognition: "Color recognition", + robotis_ai_camera_mode_tag_recognition: "Tag recognition", + robotis_ai_camera_mode_object_classification: "Object classification", + robotis_ai_camera_mode_expression_recognition: "Expression recognition", + robotis_ai_camera_target_face: "Face", + robotis_ai_camera_target_expression: "Expression", + robotis_ai_camera_target_object: "Object", + robotis_ai_camera_target_color: "Color", + robotis_ai_camera_target_tag: "Tag", + robotis_ai_camera_target_qr: "QR", + robotis_ai_camera_target_block: "Rectangle", + robotis_ai_camera_target_arrow: "Arrow", + robotis_ai_camera_center_block_center_x: "Center X", + robotis_ai_camera_center_block_center_y: "Center Y", + robotis_ai_camera_center_block_width: "Width", + robotis_ai_camera_center_block_height: "Height", + robotis_ai_camera_center_leared_id: "Learned ID", + robotis_ai_camera_center_arrow_origin_x: "Origin X", + robotis_ai_camera_center_arrow_origin_y: "Origin Y", + robotis_ai_camera_center_arrow_target_x: "Target X", + robotis_ai_camera_center_arrow_target_y: "Target Y", robotis_plant_ripe: "ripe in red", robotis_plant_unripe: "green and unripe", @@ -1543,9 +1830,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { if (wheelSide == 1) { leftSpeed = wheelSpeed; rightSpeed = 127; // 속도제어 안함 - } else { + } else if (wheelSide == 0) { leftSpeed = 127; // 속도제어 안함 rightSpeed = wheelSpeed; + } else { + leftSpeed = wheelSpeed; + rightSpeed = wheelSpeed; } data_value = leftSpeed + rightSpeed * 256; @@ -4111,7 +4401,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.RB_rsp_screen(%1,%2,%3,%4)'], + py: ['Robotis.icon_screen_food_and_plant(%1,%2,%3,%4)'], }, }, robotis_Practice_icon_screen_animal_human: { @@ -4258,7 +4548,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.RB_rsp_screen(%1,%2,%3,%4)'], + py: ['Robotis.icon_screen_animal_and_human(%1,%2,%3,%4)'], }, }, robotis_Practice_icon_screen_object_tool: { @@ -4407,7 +4697,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.RB_rsp_screen(%1,%2,%3,%4)'], + py: ['Robotis.icon_screen_object_and_tool(%1,%2,%3,%4)'], }, }, robotis_Practice_icon_screen_vehicle_number: { @@ -4558,7 +4848,160 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.RB_rsp_screen(%1,%2,%3,%4)'], + py: ['Robotis.icon_screen_vehicle_and_number(%1,%2,%3,%4)'], + }, + }, + robotis_Practice_icon_screen_game_character: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_icon_game_character_1, '11520'], // 알쥐(정면) + [Lang.Blocks.robotis_icon_game_character_2, '11521'], // 알쥐(왼쪽) + [Lang.Blocks.robotis_icon_game_character_3, '11522'], // 알쥐(오른쪽) + [Lang.Blocks.robotis_icon_game_character_4, '11523'], // 알라(정면) + [Lang.Blocks.robotis_icon_game_character_5, '11524'], // 알라(왼쪽) + [Lang.Blocks.robotis_icon_game_character_6, '11525'], // 알라(오른쪽) + [Lang.Blocks.robotis_icon_game_character_7, '11526'], // 유령 + [Lang.Blocks.robotis_icon_game_character_8, '11527'], // 괴물 + [Lang.Blocks.robotis_icon_game_character_9, '11528'], // 바이러스 + [Lang.Blocks.robotis_icon_game_character_10, '11529'], // 세균 + [Lang.Blocks.robotis_icon_game_character_11, '11784'], // 나는 알쥐(L) + [Lang.Blocks.robotis_icon_game_character_12, '11785'], // 나는 알쥐(R) + [Lang.Blocks.robotis_icon_game_character_13, '11786'], // 나는 알쥐(U) + [Lang.Blocks.robotis_icon_game_character_14, '11530'], // 메달 + [Lang.Blocks.robotis_icon_game_character_15, '11531'], // 돈(G) + [Lang.Blocks.robotis_icon_game_character_16, '11532'], // 돈($) + [Lang.Blocks.robotis_icon_game_character_17, '11533'], // 하트 + [Lang.Blocks.robotis_icon_game_character_18, '11534'], // 포탄 + [Lang.Blocks.robotis_icon_game_character_19, '11535'], // 불 + [Lang.Blocks.robotis_icon_game_character_20, '11803'], // 구름1 + [Lang.Blocks.robotis_icon_game_character_21, '11804'], // 구름2 + [Lang.Blocks.robotis_icon_game_character_22, '11536'], // 포탄1 + [Lang.Blocks.robotis_icon_game_character_23, '11791'], // 포탄2 + [Lang.Blocks.robotis_icon_game_character_24, '11537'], // 대포(수평) + [Lang.Blocks.robotis_icon_game_character_25, '11538'], // 대포(수직) + [Lang.Blocks.robotis_icon_game_character_27, '11540'], // 레이저(수평) + [Lang.Blocks.robotis_icon_game_character_26, '11539'], // 레이저(수직) + [Lang.Blocks.robotis_icon_game_character_28, '11541'], // 화살(수평) + [Lang.Blocks.robotis_icon_game_character_29, '11542'], // 화살(수직) + [Lang.Blocks.robotis_icon_game_character_30, '11792'], // 미사일(U) + [Lang.Blocks.robotis_icon_game_character_31, '11793'], // 미사일(D) + [Lang.Blocks.robotis_icon_game_character_32, '11794'], // 미사일(L) + [Lang.Blocks.robotis_icon_game_character_33, '11795'], // 미사일(R) + [Lang.Blocks.robotis_icon_game_character_34, '11796'], // 낙하산 + [Lang.Blocks.robotis_icon_game_character_35, '11543'], // 폭발1 + [Lang.Blocks.robotis_icon_game_character_36, '11544'], // 폭발2 + [Lang.Blocks.robotis_icon_game_character_37, '11810'], // 조준경 + [Lang.Blocks.robotis_icon_game_character_38, '11545'], // 가위 + [Lang.Blocks.robotis_icon_game_character_39, '11546'], // 바위 + [Lang.Blocks.robotis_icon_game_character_40, '11547'], // 보 + [Lang.Blocks.robotis_icon_game_character_41, '11797'], // 걷는 사람1 + [Lang.Blocks.robotis_icon_game_character_42, '11798'], // 걷는 사람2 + [Lang.Blocks.robotis_icon_game_character_43, '11799'], // 뛰는 사람1 + [Lang.Blocks.robotis_icon_game_character_44, '11800'], // 뛰는 사람2 + ], + value: '11520', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [ + null, + { + type: 'number', + params: ['0'], + }, + { + type: 'number', + params: ['0'], + }, + 50, + null, + ], + type: 'robotis_Practice_icon_screen_game_character', + }, + paramsKeyMap: { + ICON: 0, + X: 1, + Y: 2, + SIZE: 3, + }, + class: 'robotis_rb100_lcd', + isNotFor: ['Robotis_rb_P_Assembly'], + func(sprite, script) { + // instruction / address / length / value / default length + let iconNum = script.getField('ICON', script); + let x = script.getNumberValue('X', script); + let y = script.getNumberValue('Y', script); + let size = script.getNumberValue('SIZE', script) * 2; + + let data_instruction = Entry.Robotis_rb.INSTRUCTION.WRITE; + let data_address = 166; + let data_length = 2; + let data_value = 10496; + + if (x < -160) { + x = -160; + } else if (x > 160) { + x = 160; + } + + if (y < -120) { + y = -120; + } else if (y > 120) { + y = 120; + } + + if (size < 0) { + size = 0; + } else if (size > 400) { + size = 400; + } + + data_value = iconNum; + + let data_sendqueue = [ + [Entry.Robotis_rb.INSTRUCTION.WRITE, 130, 2, x], + [Entry.Robotis_rb.INSTRUCTION.WRITE, 132, 2, y], + [Entry.Robotis_rb.INSTRUCTION.WRITE, 149, 2, size], + [data_instruction, data_address, data_length, data_value], + [Entry.Robotis_rb.INSTRUCTION.WRITE, 162, 1, 1], + ]; + + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + 200 + ); + }, + syntax: { + js: [], + py: ['Robotis.icon_screen_game_and_character(%1,%2,%3,%4)'], }, }, robotis_Practice_text_screen: { @@ -6858,7 +7301,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { - robotis_Practice_huskylens_block_value_closest_to_center: { + robotis_Practice_ai_camera_block_value_closest_to_center: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -6868,12 +7311,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_target_face, '0'], - [Lang.Blocks.robotis_huskylens_target_expression, '1'], - [Lang.Blocks.robotis_huskylens_target_object, '2'], - [Lang.Blocks.robotis_huskylens_target_color, '3'], - [Lang.Blocks.robotis_huskylens_target_tag, '4'], - [Lang.Blocks.robotis_huskylens_target_qr, '5'], + [Lang.Blocks.robotis_ai_camera_target_face, '0'], + [Lang.Blocks.robotis_ai_camera_target_expression, '1'], + [Lang.Blocks.robotis_ai_camera_target_object, '2'], + [Lang.Blocks.robotis_ai_camera_target_color, '3'], + [Lang.Blocks.robotis_ai_camera_target_tag, '4'], + [Lang.Blocks.robotis_ai_camera_target_qr, '5'], ], value: '0', fontSize: 11, @@ -6883,11 +7326,11 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_block_center_x, '0'], - [Lang.Blocks.robotis_huskylens_center_block_center_y, '1'], - [Lang.Blocks.robotis_huskylens_center_block_width, '2'], - [Lang.Blocks.robotis_huskylens_center_block_height, '3'], - [Lang.Blocks.robotis_huskylens_center_leared_id, '4'], + [Lang.Blocks.robotis_ai_camera_center_block_center_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_block_center_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_block_width, '2'], + [Lang.Blocks.robotis_ai_camera_center_block_height, '3'], + [Lang.Blocks.robotis_ai_camera_center_leared_id, '4'], ], value: '0', fontSize: 11, @@ -6901,13 +7344,13 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { null, null, ], - type: 'robotis_Practice_huskylens_block_value_closest_to_center', + type: 'robotis_Practice_ai_camera_block_value_closest_to_center', }, paramsKeyMap: { TARGET: 0, DATA_TYPE: 1, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -6923,10 +7366,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_block_value_closest_to_center(%1)'], + py: ['Robotis.robotis_ai_camera_block_value_closest_to_center(%1)'], }, }, - robotis_Practice_huskylens_arrow_value_closest_to_center: { + robotis_Practice_ai_camera_arrow_value_closest_to_center: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -6936,11 +7379,11 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_arrow_origin_x, '0'], - [Lang.Blocks.robotis_huskylens_center_arrow_origin_y, '1'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_x, '2'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_y, '3'], - [Lang.Blocks.robotis_huskylens_center_leared_id, '4'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_x, '2'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_y, '3'], + [Lang.Blocks.robotis_ai_camera_center_leared_id, '4'], ], value: '0', fontSize: 11, @@ -6953,12 +7396,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { params: [ null, ], - type: 'robotis_Practice_huskylens_arrow_value_closest_to_center', + type: 'robotis_Practice_ai_camera_arrow_value_closest_to_center', }, paramsKeyMap: { DATA_TYPE: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -6975,10 +7418,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_arrow_value_closest_to_center(%1)'], + py: ['Robotis.robotis_ai_camera_arrow_value_closest_to_center(%1)'], }, }, - robotis_Practice_huskylens_number_of_learned_id: { + robotis_Practice_ai_camera_number_of_learned_id: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -6990,11 +7433,11 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { def: { params: [ ], - type: 'robotis_Practice_huskylens_number_of_learned_id', + type: 'robotis_Practice_ai_camera_number_of_learned_id', }, paramsKeyMap: { }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -7008,10 +7451,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_number_of_learned_id()'], + py: ['Robotis.robotis_ai_camera_number_of_learned_id()'], }, }, - robotis_Practice_huskylens_block_value_of_id: { + robotis_Practice_ai_camera_block_value_of_id: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -7038,12 +7481,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_target_face, '0'], - [Lang.Blocks.robotis_huskylens_target_expression, '1'], - [Lang.Blocks.robotis_huskylens_target_object, '2'], - [Lang.Blocks.robotis_huskylens_target_color, '3'], - [Lang.Blocks.robotis_huskylens_target_tag, '4'], - [Lang.Blocks.robotis_huskylens_target_qr, '5'], + [Lang.Blocks.robotis_ai_camera_target_face, '0'], + [Lang.Blocks.robotis_ai_camera_target_expression, '1'], + [Lang.Blocks.robotis_ai_camera_target_object, '2'], + [Lang.Blocks.robotis_ai_camera_target_color, '3'], + [Lang.Blocks.robotis_ai_camera_target_tag, '4'], + [Lang.Blocks.robotis_ai_camera_target_qr, '5'], ], value: '0', fontSize: 11, @@ -7053,10 +7496,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_block_center_x, '0'], - [Lang.Blocks.robotis_huskylens_center_block_center_y, '1'], - [Lang.Blocks.robotis_huskylens_center_block_width, '2'], - [Lang.Blocks.robotis_huskylens_center_block_height, '3'], + [Lang.Blocks.robotis_ai_camera_center_block_center_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_block_center_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_block_width, '2'], + [Lang.Blocks.robotis_ai_camera_center_block_height, '3'], ], value: '0', fontSize: 11, @@ -7071,14 +7514,14 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { null, null, ], - type: 'robotis_Practice_huskylens_block_value_of_id', + type: 'robotis_Practice_ai_camera_block_value_of_id', }, paramsKeyMap: { ID: 0, TARGET: 1, TYPE: 2, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -7121,10 +7564,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_block_value_of_id(%1, %2)'], + py: ['Robotis.robotis_ai_camera_block_value_of_id(%1, %2)'], }, }, - robotis_Practice_huskylens_arrow_value_of_id: { + robotis_Practice_ai_camera_arrow_value_of_id: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -7151,10 +7594,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_center_arrow_origin_x, '0'], - [Lang.Blocks.robotis_huskylens_center_arrow_origin_y, '1'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_x, '2'], - [Lang.Blocks.robotis_huskylens_center_arrow_target_y, '3'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_x, '0'], + [Lang.Blocks.robotis_ai_camera_center_arrow_origin_y, '1'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_x, '2'], + [Lang.Blocks.robotis_ai_camera_center_arrow_target_y, '3'], ], value: '0', fontSize: 11, @@ -7168,13 +7611,13 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { null, null, ], - type: 'robotis_Practice_huskylens_arrow_value_of_id', + type: 'robotis_Practice_ai_camera_arrow_value_of_id', }, paramsKeyMap: { ID: 0, TYPE: 1, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -7216,10 +7659,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_arrow_value_of_id(%1, %2)'], + py: ['Robotis.robotis_ai_camera_arrow_value_of_id(%1, %2)'], }, }, - robotis_Practice_huskylens_connection_status: { + robotis_Practice_ai_camera_connection_status: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -7243,12 +7686,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { params: [ null, ], - type: 'robotis_Practice_huskylens_connection_status', + type: 'robotis_Practice_ai_camera_connection_status', }, paramsKeyMap: { STATUS: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -7265,10 +7708,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_connection_status(%1)'], + py: ['Robotis.robotis_ai_camera_connection_status(%1)'], }, }, - robotis_Practice_huskylens_if_detected: { + robotis_Practice_ai_camera_if_detected: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, fontColor: '#fff', @@ -7278,13 +7721,13 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_target_face, '0'], - [Lang.Blocks.robotis_huskylens_target_expression, '1'], - [Lang.Blocks.robotis_huskylens_target_object, '2'], - [Lang.Blocks.robotis_huskylens_target_color, '3'], - [Lang.Blocks.robotis_huskylens_target_tag, '4'], - [Lang.Blocks.robotis_huskylens_target_qr, '5'], - [Lang.Blocks.robotis_huskylens_target_arrow, '6'], + [Lang.Blocks.robotis_ai_camera_target_face, '0'], + [Lang.Blocks.robotis_ai_camera_target_expression, '1'], + [Lang.Blocks.robotis_ai_camera_target_object, '2'], + [Lang.Blocks.robotis_ai_camera_target_color, '3'], + [Lang.Blocks.robotis_ai_camera_target_tag, '4'], + [Lang.Blocks.robotis_ai_camera_target_qr, '5'], + [Lang.Blocks.robotis_ai_camera_target_arrow, '6'], ], value: '0', fontSize: 11, @@ -7297,12 +7740,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { params: [ null, ], - type: 'robotis_Practice_huskylens_if_detected', + type: 'robotis_Practice_ai_camera_if_detected', }, paramsKeyMap: { DETECT_TYPE: 0, }, - class: 'robotis_rb100_custom_huskylens', + class: 'robotis_rb100_custom_ai_camera', isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { var scope = script.executor.scope; @@ -7322,10 +7765,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_if_detected(%1)'], + py: ['Robotis.robotis_ai_camera_if_detected(%1)'], }, }, - robotis_Practice_huskylens_set_mode: { + robotis_Practice_ai_camera_set_mode: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', @@ -7334,12 +7777,12 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_huskylens_mode_face_recognition, '0'], - [Lang.Blocks.robotis_huskylens_mode_expression_recognition, '9'], - [Lang.Blocks.robotis_huskylens_mode_line_tracking, '3'], - [Lang.Blocks.robotis_huskylens_mode_color_recognition, '4'], - [Lang.Blocks.robotis_huskylens_mode_tag_recognition, '5'], - [Lang.Blocks.robotis_huskylens_mode_object_classification, '6'], + [Lang.Blocks.robotis_ai_camera_mode_face_recognition, '0'], + [Lang.Blocks.robotis_ai_camera_mode_expression_recognition, '9'], + [Lang.Blocks.robotis_ai_camera_mode_line_tracking, '3'], + [Lang.Blocks.robotis_ai_camera_mode_color_recognition, '4'], + [Lang.Blocks.robotis_ai_camera_mode_tag_recognition, '5'], + [Lang.Blocks.robotis_ai_camera_mode_object_classification, '6'], ], value: '0', fontSize: 11, @@ -7357,7 +7800,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { params: [ null, ], - type: 'robotis_Practice_huskylens_set_mode', + type: 'robotis_Practice_ai_camera_set_mode', }, paramsKeyMap: { AI_CAMERA_MODE: 0, @@ -7366,7 +7809,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { isNotFor: ['Robotis_rb_P_Assembly'], func: function (sprite, script) { // instruction / address / length / value / default length - var huskylens_mode = script.getField('AI_CAMERA_MODE', script); + var ai_camera_mode = script.getField('AI_CAMERA_MODE', script); var data_instruction = Entry.Robotis_rb.INSTRUCTION.WRITE; var data_address = 4001; @@ -7377,7 +7820,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { data_instruction, data_address, data_length, - huskylens_mode, + ai_camera_mode, ], ]; @@ -7389,10 +7832,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.set_huskylens_mode(%1)'], + py: ['Robotis.set_ai_camera_mode(%1)'], }, }, - robotis_Practice_huskylens_print_custom_text: { + robotis_Practice_ai_camera_print_custom_text: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', @@ -7429,7 +7872,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, "Hello!" ], - type: 'robotis_Practice_huskylens_print_custom_text', + type: 'robotis_Practice_ai_camera_print_custom_text', }, paramsKeyMap: { X: 0, @@ -7495,10 +7938,10 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_print_custom_text(%1,%2,%3)'], + py: ['Robotis.robotis_ai_camera_print_custom_text(%1,%2,%3)'], }, }, - robotis_Practice_huskylens_clear_custom_text: { + robotis_Practice_ai_camera_clear_custom_text: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', @@ -7514,7 +7957,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { def: { params: [ ], - type: 'robotis_Practice_huskylens_clear_custom_text', + type: 'robotis_Practice_ai_camera_clear_custom_text', }, paramsKeyMap: { }, @@ -7544,7 +7987,7 @@ Entry.Robotis_rb_P_Assembly.getBlocks = function () { }, syntax: { js: [], - py: ['Robotis.robotis_huskylens_clear_custom_text()'], + py: ['Robotis.robotis_ai_camera_clear_custom_text()'], }, }, diff --git a/src/playground/blocks/hardware/block_whalesbot_eagle_1001.js b/src/playground/blocks/hardware/block_whalesbot_eagle_1001.js index 3de716a65b..88fc415aed 100644 --- a/src/playground/blocks/hardware/block_whalesbot_eagle_1001.js +++ b/src/playground/blocks/hardware/block_whalesbot_eagle_1001.js @@ -15,13 +15,14 @@ Entry.WhalesbotEagle1001 = { }, simulatorPopup: null, unsupportBlockExist: false, - setZero: function() {}, + setZero: function () { }, sendCmd(msgString) { let sq = Entry.hw.sendQueue; sq['cmd'] = msgString; Entry.hw.update(); delete sq['cmd']; }, + invalidParamValue: false, exportProject() { let project = {}; @@ -50,37 +51,74 @@ Entry.WhalesbotEagle1001 = { } }; -Entry.WhalesbotEagle1001.setLanguage = function() { +Entry.WhalesbotEagle1001.setLanguage = function () { return { ko: { template: { whalesbot_eagle_1001_openning_3d_simulator: '3D 시뮬레이터를 엽니 다', - whalesbot_eagle_1001_clean:'삭제', + whalesbot_eagle_1001_clean: '삭제', whalesbot_eagle_1001_restart: '재시작', - whalesbot_eagle_1001_entering_pitch_mode:'준비모드 시작하기', - whalesbot_eagle_1001_exit_pitch_mode:'준비모드 끝내기', - whalesbot_eagle_1001_automatic_take_off_height:'자동 이륙 높이 %1 cm', - whalesbot_eagle_1001_automatic_take_off_altitude_speed_offset:'자동 이륙 고도 %1 cm 속도 %2 X 오프셋 %3 도 Y 오프셋 %4 도 으로 이동하기', - whalesbot_eagle_1001_automatic_landing:'드로착륙', - whalesbot_eagle_1001_automatic_descent_speed_offset:'자동 낙하 속도 %1 X 오프셋 %2 도 Y 오프셋 %3 도', - whalesbot_eagle_1001_set_the_flight_speed:'설정된 비행 속도는 %1 cm/s', - whalesbot_eagle_1001_get_setting_speed:'설정 속도 가져오기', - whalesbot_eagle_1001_rise:'위로 %1 cm', - whalesbot_eagle_1001_down:'아래로 %1 cm', - whalesbot_eagle_1001_fly_forward:'앞으로 %1 cm', - whalesbot_eagle_1001_fly_backward:'뒤로 %1 cm', - whalesbot_eagle_1001_fly_left:'왼쪽으로 %1 cm', - whalesbot_eagle_1001_fly_right:'오른쪽으로 %1 cm', - whalesbot_eagle_1001_turn_left:'왼쪽으로 회전 %1 °', - whalesbot_eagle_1001_turn_right:'오른쪽으로 회전 %1 °', - whalesbot_eagle_1001_fly_in_the_specified_direction:'속도 %1 , 방향 %2 으로이동하기', - whalesbot_eagle_1001_flight_designated:'지정된 거리를 비행합니다 x %1 cm y %2 cm z%3 cm 속도 %4 cm/s', - whalesbot_eagle_1001_set_the_four_channel_lever_quantity_of_remote_control:'리모컨 4개 채널 로드 설정 Pitch %1 Roll %2 액셀러레이터 %3 Yaw %4', - whalesbot_eagle_1001_stop_moving_and_hover:'호버링기능', - whalesbot_eagle_1001_hover_at_specified_altitude:'지정된 높이에 서스펜션 %1 cm', - whalesbot_eagle_1001_emergency_stop:'긴급정지', - whalesbot_eagle_1001_set_the_steering_gear:'스티어링기어 ID 설정 포트 %1 속도 %2 각도 %3', - whalesbot_eagle_1001_execute_script:'스크립트 실행', + whalesbot_eagle_1001_entering_pitch_mode: '준비모드 시작하기', + whalesbot_eagle_1001_exit_pitch_mode: '준비모드 끝내기', + whalesbot_eagle_1001_automatic_take_off_height: '자동 이륙 높이 %1 cm', + whalesbot_eagle_1001_automatic_take_off_altitude_speed_offset: '자동 이륙 고도 %1 cm 속도 %2 X 오프셋 %3 도 Y 오프셋 %4 도 으로 이동하기', + whalesbot_eagle_1001_automatic_landing: '드로착륙', + whalesbot_eagle_1001_automatic_descent_speed_offset: '자동 낙하 속도 %1 X 오프셋 %2 도 Y 오프셋 %3 도', + whalesbot_eagle_1001_set_the_flight_speed: '설정된 비행 속도는 %1 cm/s', + whalesbot_eagle_1001_get_setting_speed: '설정 속도 가져오기', + whalesbot_eagle_1001_rise: '위로 %1 cm', + whalesbot_eagle_1001_down: '아래로 %1 cm', + whalesbot_eagle_1001_fly_forward: '앞으로 %1 cm', + whalesbot_eagle_1001_fly_backward: '뒤로 %1 cm', + whalesbot_eagle_1001_fly_left: '왼쪽으로 %1 cm', + whalesbot_eagle_1001_fly_right: '오른쪽으로 %1 cm', + whalesbot_eagle_1001_turn_left: '왼쪽으로 회전 %1 °', + whalesbot_eagle_1001_turn_right: '오른쪽으로 회전 %1 °', + whalesbot_eagle_1001_fly_in_the_specified_direction: '속도 %1 , 방향 %2 으로이동하기', + whalesbot_eagle_1001_flight_designated: '지정된 거리를 비행합니다 x %1 cm y %2 cm z%3 cm 속도 %4 cm/s', + whalesbot_eagle_1001_set_the_four_channel_lever_quantity_of_remote_control: '리모컨 4개 채널 로드 설정 Pitch %1 Roll %2 액셀러레이터 %3 Yaw %4', + whalesbot_eagle_1001_stop_moving_and_hover: '호버링기능', + whalesbot_eagle_1001_hover_at_specified_altitude: '지정된 높이에 서스펜션 %1 cm', + whalesbot_eagle_1001_emergency_stop: '긴급정지', + whalesbot_eagle_1001_set_the_steering_gear: '스티어링기어 ID 설정 포트 %1 속도 %2 각도 %3', + whalesbot_eagle_1001_execute_script: '스크립트 실행', + // light & speaker blocks + whalesbot_eagle_1001_ls_debug_value: '센서 값 확인 %1 %2', + whalesbot_eagle_1001_ls_display_symbol: '도트매트릭스 %1 포트 %2', + whalesbot_eagle_1001_ls_off_LED: '표현스크린 닫기 포트 %1', + whalesbot_eagle_1001_ls_display_digital_tube: '디지털튜브 포트 %1 %2', + whalesbot_eagle_1001_ls_display_digital_tube_score: '디지털튜브에 점수 표시 포트 %1 %2 : %3', + whalesbot_eagle_1001_ls_off_digital_tube: '디지털튜브 닫기 포트 %1', + whalesbot_eagle_1001_ls_set_RGB: 'LED색상설정 포트 %1 색상 R %2 G %3 B %4', + whalesbot_eagle_1001_ls_fly_RGB: 'Led 조명인가요? %1', + whalesbot_eagle_1001_ls_set_DO: '전자석 포트 %1 %2', + whalesbot_eagle_1001_ls_execute_script: '동작 없이 스크립트 실행', + // sensors + whalesbot_eagle_1001_ss_fly_state_POS_Z: '비행 고도 cm', + whalesbot_eagle_1001_ss_fly_state_LASER: '동체 내부 레이저 거리 측정 cm', + whalesbot_eagle_1001_ss_battery_voltage: '배터리 전압 (V)', + whalesbot_eagle_1001_ss_fly_state_STATE_TEMP: '메인보드 온도 (°)', + whalesbot_eagle_1001_ss_attitude_angle: '자세각 %1 (°)', + whalesbot_eagle_1001_ss_flight_angular_velocity: '비행각속도 %1 cm/s', + whalesbot_eagle_1001_ss_flight_acceleration: '비행 가속도 %1 (1g)', + whalesbot_eagle_1001_ss_optical_flow: '광류 %1 (cm)', + whalesbot_eagle_1001_ss_get_infrared_distance: '적외선센 포트 %1 값', + whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool: '적외선센서 포트 %1 장애물 감지', + whalesbot_eagle_1001_ss_obstacle_infrared_detected_string: '적외선센서 포트 %1 장애물 감지', + whalesbot_eagle_1001_ss_human_infrared_value_bool: '인체 감지 센서 포트 %1 사람을 감지하다', + whalesbot_eagle_1001_ss_human_infrared_value_string: '인체 감지 센서 포트 %1 사람을 감지하다', + whalesbot_eagle_1001_ss_AI: '아날로그 입력 포트 %1 값', + whalesbot_eagle_1001_ss_get_ultrasonic_distance: '초음파센서 포트 %1 거리 강지 cm', + whalesbot_eagle_1001_ss_get_ambient_light: '조도센서 입력 포트 %1 값', + whalesbot_eagle_1001_ss_get_temperature: '온도 센서 포트 %1 °C', + whalesbot_eagle_1001_ss_get_humidity: '습도 센서 포트 %1 값 %', + whalesbot_eagle_1001_ss_get_flame: '불꽃센서 포트 %1 값', + whalesbot_eagle_1001_ss_get_gesture: '동작인식 포트 %1', + whalesbot_eagle_1001_ss_get_tof: '레이저 거리 측정 포트 %1', + whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE: '레이저 높이 %1', + whalesbot_eagle_1001_ss_get_bt_remote_control: '리모콘 버튼 %1 값', + whalesbot_eagle_1001_ss_seconds: '현재 타이머 값', + whalesbot_eagle_1001_ss_resettime: '타이머 재설정', }, Device: { whalesbot_eagle_1001: 'whalesbot_eagle_1001', @@ -89,6 +127,14 @@ Entry.WhalesbotEagle1001.setLanguage = function() { whalesbot_eagle_1001: 'WhalesbotEagle1001', }, Blocks: { + light_speaker: { + electro_magnet: { absorption: '붙다', break_off: '떨어지다' }, + }, + sensor: { + attitude_angle: { pitch: 'Pitch', roll: 'Roll', yaw: 'Yaw' }, + laser_height_determination: { on: 'On', off: 'Off' }, + remote_control_button: { key: 'Key', left_rocker_x: 'Left rocker X', left_rocker_y: 'Left rocker Y', right_rocker_x: 'Right rocker X', right_rocker_y: 'Right rocker Y' }, + }, whalesbot_eagle_1001_toast_status_title: "드론 상태", whalesbot_eagle_1001_toast_prepare_download: "다운로드 준비...", whalesbot_eagle_1001_toast_downloading_code: "코드 다운로드...", @@ -103,32 +149,69 @@ Entry.WhalesbotEagle1001.setLanguage = function() { en: { template: { whalesbot_eagle_1001_openning_3d_simulator: 'Open 3D Simulator', - whalesbot_eagle_1001_clean:'Clean', + whalesbot_eagle_1001_clean: 'Clean', whalesbot_eagle_1001_restart: 'Restart', - whalesbot_eagle_1001_entering_pitch_mode:'Entering Pitch Mode', - whalesbot_eagle_1001_exit_pitch_mode:'Exit Pitch Mode', - whalesbot_eagle_1001_automatic_take_off_height:'Automatic Take Off Height %1 cm', - whalesbot_eagle_1001_automatic_take_off_altitude_speed_offset:'Automatic Take Off Altitude %1 cm, Speed %2, X offset %3 degree, Y offset %4 degree', - whalesbot_eagle_1001_automatic_landing:'Automatic Landing', - whalesbot_eagle_1001_automatic_descent_speed_offset:'Automatic Descent Speed %1, X offset %2 degree, Y offset %3 degree', - whalesbot_eagle_1001_set_the_flight_speed:'Set The Flight Speed To %1 cm/s', - whalesbot_eagle_1001_get_setting_speed:'Get Setting Speed', - whalesbot_eagle_1001_rise:'Rise %1 cm', - whalesbot_eagle_1001_down:'Down %1 cm', - whalesbot_eagle_1001_fly_forward:'Fly Forward %1 cm', - whalesbot_eagle_1001_fly_backward:'Fly Backward %1 cm', - whalesbot_eagle_1001_fly_left:'Fly Left %1 cm', - whalesbot_eagle_1001_fly_right:'Fly Right %1 cm', - whalesbot_eagle_1001_turn_left:'Turn Left %1 °', - whalesbot_eagle_1001_turn_right:'Turn Right %1 °', - whalesbot_eagle_1001_fly_in_the_specified_direction:'Fly In The Specified Direction Speed %1 cm/s Direction %2 °', - whalesbot_eagle_1001_flight_designated:'Flight Designated Distance X %1 cm Y %2 cm Z %3 cm Speed %4 cm/s', - whalesbot_eagle_1001_set_the_four_channel_lever_quantity_of_remote_control:'Set The Four Channel Lever Quantity Of Remote Control Pitch %1° Roll %2° Throttle %3° Roll %4°', - whalesbot_eagle_1001_stop_moving_and_hover:'Stop Moving And Hover', - whalesbot_eagle_1001_hover_at_specified_altitude:'Hover At a Specified Altitude %1 cm', - whalesbot_eagle_1001_emergency_stop:'Emergency Stop', - whalesbot_eagle_1001_set_the_steering_gear:'Set The Steering Gear Port %1 Speed %2 cm/s Angle %3 °', - whalesbot_eagle_1001_execute_script:'Execute Script', + whalesbot_eagle_1001_entering_pitch_mode: 'Entering Pitch Mode', + whalesbot_eagle_1001_exit_pitch_mode: 'Exit Pitch Mode', + whalesbot_eagle_1001_automatic_take_off_height: 'Automatic Take Off Height %1 cm', + whalesbot_eagle_1001_automatic_take_off_altitude_speed_offset: 'Automatic Take Off Altitude %1 cm, Speed %2, X offset %3 degree, Y offset %4 degree', + whalesbot_eagle_1001_automatic_landing: 'Automatic Landing', + whalesbot_eagle_1001_automatic_descent_speed_offset: 'Automatic Descent Speed %1, X offset %2 degree, Y offset %3 degree', + whalesbot_eagle_1001_set_the_flight_speed: 'Set The Flight Speed To %1 cm/s', + whalesbot_eagle_1001_get_setting_speed: 'Get Setting Speed', + whalesbot_eagle_1001_rise: 'Rise %1 cm', + whalesbot_eagle_1001_down: 'Down %1 cm', + whalesbot_eagle_1001_fly_forward: 'Fly Forward %1 cm', + whalesbot_eagle_1001_fly_backward: 'Fly Backward %1 cm', + whalesbot_eagle_1001_fly_left: 'Fly Left %1 cm', + whalesbot_eagle_1001_fly_right: 'Fly Right %1 cm', + whalesbot_eagle_1001_turn_left: 'Turn Left %1 °', + whalesbot_eagle_1001_turn_right: 'Turn Right %1 °', + whalesbot_eagle_1001_fly_in_the_specified_direction: 'Fly In The Specified Direction Speed %1 cm/s Direction %2 °', + whalesbot_eagle_1001_flight_designated: 'Flight Designated Distance X %1 cm Y %2 cm Z %3 cm Speed %4 cm/s', + whalesbot_eagle_1001_set_the_four_channel_lever_quantity_of_remote_control: 'Set The Four Channel Lever Quantity Of Remote Control Pitch %1° Roll %2° Throttle %3° Roll %4°', + whalesbot_eagle_1001_stop_moving_and_hover: 'Stop Moving And Hover', + whalesbot_eagle_1001_hover_at_specified_altitude: 'Hover At a Specified Altitude %1 cm', + whalesbot_eagle_1001_emergency_stop: 'Emergency Stop', + whalesbot_eagle_1001_set_the_steering_gear: 'Set The Steering Gear Port %1 Speed %2 cm/s Angle %3 °', + whalesbot_eagle_1001_execute_script: 'Execute Script', + // light & speaker blocks + whalesbot_eagle_1001_ls_debug_value: 'Debugging: Data %1 %2', + whalesbot_eagle_1001_ls_display_symbol: 'Emotion screen symbols %1 port %2', + whalesbot_eagle_1001_ls_off_LED: 'Clear emotion screen port %1', + whalesbot_eagle_1001_ls_display_digital_tube: 'Digital tube port %1 %2', + whalesbot_eagle_1001_ls_display_digital_tube_score: 'Digital tube score display port %1 %2 : %3', + whalesbot_eagle_1001_ls_off_digital_tube: 'Clear digital tube port %1', + whalesbot_eagle_1001_ls_set_RGB: 'Set LED lights port %1 color R %2 G %3 B %4', + whalesbot_eagle_1001_ls_fly_RGB: 'Airborne lighting %1', + whalesbot_eagle_1001_ls_set_DO: 'Electromagnet port %1 %2', + whalesbot_eagle_1001_ls_execute_script: 'Execute Script Without Motion', + // sensors + whalesbot_eagle_1001_ss_fly_state_POS_Z: 'Flight attitude cm', + whalesbot_eagle_1001_ss_fly_state_LASER: 'Laser ranging inside the fuselage cm', + whalesbot_eagle_1001_ss_battery_voltage: 'Battery voltage (V)', + whalesbot_eagle_1001_ss_fly_state_STATE_TEMP: 'Main board temperature (°C)', + whalesbot_eagle_1001_ss_attitude_angle: 'Attitude angle %1 (°)', + whalesbot_eagle_1001_ss_flight_angular_velocity: 'Flight angular velocity %1 cm/s', + whalesbot_eagle_1001_ss_flight_acceleration: 'Flight acceleration %1 (1g)', + whalesbot_eagle_1001_ss_optical_flow: 'Optical flow %1 (cm)', + whalesbot_eagle_1001_ss_get_infrared_distance: 'Infrared ranging sensor port %1 value', + whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool: 'Infrared port %1 obstacle detected', + whalesbot_eagle_1001_ss_obstacle_infrared_detected_string: 'Infrared port %1 obstacle detected', + whalesbot_eagle_1001_ss_human_infrared_value_bool: 'Human infrared sensor port %1 detects a person', + whalesbot_eagle_1001_ss_human_infrared_value_string: 'Human infrared sensor port %1 detects a person', + whalesbot_eagle_1001_ss_AI: 'Analog input port %1 value', + whalesbot_eagle_1001_ss_get_ultrasonic_distance: 'Ultrasonic sensor port %1 detect distance cm', + whalesbot_eagle_1001_ss_get_ambient_light: 'Ambient light port %1 value', + whalesbot_eagle_1001_ss_get_temperature: 'Temperature sensor port %1 °C', + whalesbot_eagle_1001_ss_get_humidity: 'Humidity sensor port %1 value %', + whalesbot_eagle_1001_ss_get_flame: 'Flame sensor port %1 value', + whalesbot_eagle_1001_ss_get_gesture: 'Gesture recognition port %1', + whalesbot_eagle_1001_ss_get_tof: 'Laser ranging port %1', + whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE: 'Laser height determination %1', + whalesbot_eagle_1001_ss_get_bt_remote_control: 'Remote control button %1 value', + whalesbot_eagle_1001_ss_seconds: 'current timer value', + whalesbot_eagle_1001_ss_resettime: 'Reset timer', }, Device: { whalesbot_eagle_1001: 'whalesbot_eagle_1001', @@ -137,6 +220,14 @@ Entry.WhalesbotEagle1001.setLanguage = function() { whalesbot_eagle_1001: 'WhalesbotEagle1001', }, Blocks: { + light_speaker: { + electro_magnet: { absorption: 'Absorption', break_off: 'Break off' }, + }, + sensor: { + attitude_angle: { pitch: 'Pitch', roll: 'Roll', yaw: 'Yaw' }, + laser_height_determination: { on: 'On', off: 'Off' }, + remote_control_button: { key: 'Key', left_rocker_x: 'Left rocker X', left_rocker_y: 'Left rocker Y', right_rocker_x: 'Right rocker X', right_rocker_y: 'Right rocker Y' }, + }, whalesbot_eagle_1001_toast_status_title: "Drone Status", whalesbot_eagle_1001_toast_prepare_download: "Prepare Downloading...", whalesbot_eagle_1001_toast_downloading_code: "Downloading Code...", @@ -178,11 +269,65 @@ Entry.WhalesbotEagle1001.blockMenuBlocks = [ 'whalesbot_eagle_1001_set_the_steering_gear', 'whalesbot_eagle_1001_execute_script', 'whalesbot_eagle_1001_clean', - 'whalesbot_eagle_1001_restart' + 'whalesbot_eagle_1001_restart', + // light & speaker blocks + 'whalesbot_eagle_1001_ls_debug_value', + 'whalesbot_eagle_1001_ls_display_symbol', + 'whalesbot_eagle_1001_ls_off_LED', + 'whalesbot_eagle_1001_ls_display_digital_tube', + 'whalesbot_eagle_1001_ls_display_digital_tube_score', + 'whalesbot_eagle_1001_ls_off_digital_tube', + 'whalesbot_eagle_1001_ls_set_RGB', + 'whalesbot_eagle_1001_ls_fly_RGB', + // 'whalesbot_eagle_1001_ls_set_DO', + // 'whalesbot_eagle_1001_ls_execute_script', + // sensors + 'whalesbot_eagle_1001_ss_fly_state_POS_Z', + 'whalesbot_eagle_1001_ss_fly_state_LASER', + 'whalesbot_eagle_1001_ss_battery_voltage', + 'whalesbot_eagle_1001_ss_fly_state_STATE_TEMP', + 'whalesbot_eagle_1001_ss_attitude_angle', + 'whalesbot_eagle_1001_ss_flight_angular_velocity', + 'whalesbot_eagle_1001_ss_flight_acceleration', + 'whalesbot_eagle_1001_ss_optical_flow', + 'whalesbot_eagle_1001_ss_get_infrared_distance', + 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool', + // 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_string', + // 'whalesbot_eagle_1001_ss_human_infrared_value_bool', + // 'whalesbot_eagle_1001_ss_human_infrared_value_string', + 'whalesbot_eagle_1001_ss_AI', + // 'whalesbot_eagle_1001_ss_get_ultrasonic_distance', + 'whalesbot_eagle_1001_ss_get_ambient_light', + // 'whalesbot_eagle_1001_ss_get_temperature', + // 'whalesbot_eagle_1001_ss_get_humidity', + // 'whalesbot_eagle_1001_ss_get_flame', + // 'whalesbot_eagle_1001_ss_get_gesture', + // 'whalesbot_eagle_1001_ss_get_tof', + // 'whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE', + // 'whalesbot_eagle_1001_ss_get_bt_remote_control', + // 'whalesbot_eagle_1001_ss_seconds', + // 'whalesbot_eagle_1001_ss_resettime', ]; // 블록 생성 -Entry.WhalesbotEagle1001.getBlocks = function() { +Entry.WhalesbotEagle1001.getBlocks = function () { + const blockColors = { + color: { + light_speaker: '#5b90ff', + sensor: '#8066f9' + }, + outerLine: { + light_speaker: '#2b6eff', + sensor: '#8a6bf0' + }, + } + + const notificationType = { + "SUCCESS": "success", + "UNSUPPORTED": "unsupported", + "ALERT": "alert", + } + let _this = this; let sourceCode; @@ -202,7 +347,30 @@ Entry.WhalesbotEagle1001.getBlocks = function() { }; const wbVariables = { - "whalesbot_eagle_1001_get_setting_speed": "fly_state(SETSPEED)" + 'whalesbot_eagle_1001_get_setting_speed': 'fly_state(SETSPEED)', + 'whalesbot_eagle_1001_ss_fly_state_POS_Z': 'fly_state(POS_Z)', + 'whalesbot_eagle_1001_ss_fly_state_LASER': 'fly_state(LASER)', + 'whalesbot_eagle_1001_ss_battery_voltage': 'battery()', + 'whalesbot_eagle_1001_ss_fly_state_STATE_TEMP': 'fly_state(STATE_TEMP)', + 'whalesbot_eagle_1001_ss_attitude_angle': 'fly_state($VALUE)', + 'whalesbot_eagle_1001_ss_flight_angular_velocity': 'fly_state($VALUE)', + 'whalesbot_eagle_1001_ss_flight_acceleration': 'fly_state($VALUE)', + 'whalesbot_eagle_1001_ss_optical_flow': 'fly_state($VALUE)', + 'whalesbot_eagle_1001_ss_get_infrared_distance': 'get_infrared_distance($VALUE)', + 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_string': 'obstacle_infrared_detected($VALUE)', + 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool': 'obstacle_infrared_detected($VALUE)', + 'whalesbot_eagle_1001_ss_human_infrared_value_string': 'human_infrared_value($VALUE)', + 'whalesbot_eagle_1001_ss_human_infrared_value_bool': 'human_infrared_value($VALUE)', + 'whalesbot_eagle_1001_ss_AI': 'AI($VALUE)', + 'whalesbot_eagle_1001_ss_get_ultrasonic_distance': 'get_ultrasonic_distance($VALUE)', + 'whalesbot_eagle_1001_ss_get_ambient_light': 'get_ambient_light($VALUE)', + 'whalesbot_eagle_1001_ss_get_temperature': 'get_temperature($VALUE)', + 'whalesbot_eagle_1001_ss_get_humidity': 'get_humidity($VALUE)', + 'whalesbot_eagle_1001_ss_get_flame': 'get_flame($VALUE)', + 'whalesbot_eagle_1001_ss_get_gesture': 'get_gesture($VALUE)', + 'whalesbot_eagle_1001_ss_get_tof': 'get_tof($VALUE)', + 'whalesbot_eagle_1001_ss_get_bt_remote_control': 'get_bt_remote_control($VALUE)', + 'whalesbot_eagle_1001_ss_seconds': 'seconds()', } const startBlocks = [ @@ -212,28 +380,40 @@ Entry.WhalesbotEagle1001.getBlocks = function() { "mouse_click_cancled", "when_object_click", "when_object_click_canceled", + 'whalesbot_eagle_1001_execute_script', + 'whalesbot_eagle_1001_ls_debug_value', + 'whalesbot_eagle_1001_ls_display_symbol', + 'whalesbot_eagle_1001_ls_off_LED', + 'whalesbot_eagle_1001_ls_display_digital_tube', + 'whalesbot_eagle_1001_ls_display_digital_tube_score', + 'whalesbot_eagle_1001_ls_off_digital_tube', + 'whalesbot_eagle_1001_ls_set_RGB', + 'whalesbot_eagle_1001_ls_fly_RGB', + 'whalesbot_eagle_1001_ls_set_DO', + 'whalesbot_eagle_1001_ls_execute_script', ] let globlalCVariables = {} - function _getParameter (parameter) { + function _getParameter(parameter) { let param = parameter.params[0] != "" ? parameter.params[0] : "0" if (parameter.type != "text" && parameter.type != "number" && parameter.type != "get_variable") { - param = wbVariables[parameter.type] + let raw_param = wbVariables[parameter.type] + param = raw_param.includes("$VALUE") ? raw_param.replace("$VALUE", parameter.params[0]) : raw_param; } else if (parameter.type == "get_variable") { param = globlalCVariables[parameter.params[0]] } return param } - function _generateConditions (params) { + function _generateConditions(params) { let left = _getParameter(params[0]) let operator = params[1] != undefined ? wbOperators[params[1]] : "0" let right = _getParameter(params[2]) return { left, operator, right } } - function generateCCode (block) { + function generateCCode(block) { switch (block.type) { // LOOP case 'repeat_basic': @@ -248,7 +428,8 @@ Entry.WhalesbotEagle1001.getBlocks = function() { "type": block.params[0].type, "params": block.params[0].params, }; - return `\twhile(!(${generateCCode(rpWhileDecision)})) {\n${block.statements[0].map(generateCCode).join('')}\t}\n`; + let rpWhileMark = block.params[1] == 'until' ? '!' : ''; + return `\twhile(${rpWhileMark}(${generateCCode(rpWhileDecision)})) {\n${block.statements[0].map(generateCCode).join('')}\t}\n`; case 'wait_second': let second = _getParameter(block.params[0]); @@ -302,7 +483,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { // VARIABLE case 'True': - return "0"; + return "1"; case 'False': return "0"; @@ -348,9 +529,6 @@ Entry.WhalesbotEagle1001.getBlocks = function() { let speed = _getParameter(block.params[0]); return `\tfly_setspeed(${speed});\n`; - case 'whalesbot_eagle_1001_get_setting_speed': - return `\tfly_state(SETSPEED);\n`; - case 'whalesbot_eagle_1001_rise': let up = _getParameter(block.params[0]); return `\tfly_moveto(UP,${up});\n`; @@ -430,15 +608,77 @@ Entry.WhalesbotEagle1001.getBlocks = function() { } return `\tSetServo(P2,${servoSpeed},${servoAngle});\n`; + // light & speaker blocks + case 'whalesbot_eagle_1001_ls_debug_value': + let lsDebugValue1 = _getParameter(block.params[0]); + let lsDebugValue2 = _getParameter(block.params[1]); + return `\tDebugValue(${lsDebugValue1}, ${lsDebugValue2});\n`; + + case 'whalesbot_eagle_1001_ls_display_symbol': + let lsDisplaySymbol = block.params[0]; + let lsDisplaySymbolPort = block.params[1]; + return `\tdisplay_symbol(${lsDisplaySymbolPort}, ${lsDisplaySymbol});\n`; + + case 'whalesbot_eagle_1001_ls_off_LED': + let lsOffLedPort = block.params[0]; + return `\toff_LED(${lsOffLedPort});\n`; + + case 'whalesbot_eagle_1001_ls_display_digital_tube': + let lsDisplayDigitalTubePort = block.params[0]; + let lsDisplayDigitalTubeValue = _getParameter(block.params[1]); + return `\tdisplay_digital_tube(${lsDisplayDigitalTubePort}, ${lsDisplayDigitalTubeValue});\n`; + + case 'whalesbot_eagle_1001_ls_display_digital_tube_score': + let lsDisplayDigitalTubeScorePort = block.params[0]; + let lsDisplayDigitalTubeScoreValue1 = _getParameter(block.params[1]); + let lsDisplayDigitalTubeScoreValue2 = _getParameter(block.params[2]); + return `\tdisplay_digital_tube_score(${lsDisplayDigitalTubeScorePort}, ${lsDisplayDigitalTubeScoreValue1}, ${lsDisplayDigitalTubeScoreValue2});\n`; + + case 'whalesbot_eagle_1001_ls_off_digital_tube': + let lsOffDigitalTubePort = block.params[0]; + return `\toff_digital_tube(${lsOffDigitalTubePort});\n`; + + case 'whalesbot_eagle_1001_ls_set_RGB': + let lsSetRGBPort = block.params[0]; + let lsSetRGBR = _getParameter(block.params[1]); + let lsSetRGBG = _getParameter(block.params[2]); + let lsSetRGBB = _getParameter(block.params[3]); + return `\tset_RGB(${lsSetRGBPort}, ${lsSetRGBR}, ${lsSetRGBG}, ${lsSetRGBB});\n`; + + case 'whalesbot_eagle_1001_ls_fly_RGB': + let lsFlyRGB = block.params[0]; + // let lsFlyRGBR = _getParameter(block.params[1]); + // let lsFlyRGBG = _getParameter(block.params[2]); + // let lsFlyRGBB = _getParameter(block.params[3]); + return `\tfly_RGB(${lsFlyRGB});\n`; + + case 'whalesbot_eagle_1001_ls_set_DO': + let lsSetDOPort = block.params[0]; + let lsSetDOValue = block.params[1]; + return `\tSetDO(${lsSetDOPort}, ${lsSetDOValue});\n`; + + // sensors + case 'whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE': + let ssFlySetpointToggle = block.params[0]; + return `\tfly_setpoint(LASER_ENABLE, ${ssFlySetpointToggle});\n`; + + case 'whalesbot_eagle_1001_ss_resettime': + return `\tresettime();\n`; + + case 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool': + let ssBbstacleInfraredDetectedBool = block.params[0]; + return `obstacle_infrared_detected(${ssBbstacleInfraredDetectedBool})`; + default: if (!startBlocks.includes(block.type)) { + // console.log("unsupport block: " + block.type); _this.unsupportBlockExist = true; } return ''; } } - function setUpCVariables (variable) { + function setUpCVariables(variable) { if (variable.visible) { const varName = `var_${variable.name}` globlalCVariables[variable.id] = varName @@ -448,13 +688,29 @@ Entry.WhalesbotEagle1001.getBlocks = function() { return "" } - function openedSimulatorPopup () { + function openedSimulatorPopup() { if (_this.simulatorPopup == null) { return false; } return !_this.simulatorPopup.closed; } + function notify(type, msg) { + switch (type) { + case notificationType["SUCCESS"]: + Entry.toast.success( + Lang.Blocks.whalesbot_mc_102_toast_success_title, + msg + ); + break; + default: + Entry.toast.alert( + Lang.Blocks.whalesbot_mc_102_toast_alert_title, + msg + ); + } + } + return { whalesbot_eagle_1001_openning_3d_simulator: { color: EntryStatic.colorSet.block.default.HARDWARE, @@ -478,7 +734,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { }, class: 'whalesbot_eagle_1001', isNotFor: ['whalesbot_eagle_1001'], - func (sprite, script) { + func(sprite, script) { const width = window.innerWidth * 0.8; const height = window.innerHeight * 0.8; _this.simulatorPopup = window.open( @@ -516,7 +772,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { }, class: 'whalesbot_eagle_1001', isNotFor: ['whalesbot_eagle_1001'], - func (sprite, script) { + func(sprite, script) { _this.sendCmd('restartCode'); }, syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_restart()'] }, @@ -548,7 +804,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { }, class: 'whalesbot_eagle_1001', isNotFor: ['whalesbot_eagle_1001'], - func (sprite, script) { + func(sprite, script) { _this.sendCmd('stopCode'); Entry.toast.success( Lang.Blocks.whalesbot_eagle_1001_toast_status_title, @@ -577,7 +833,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { paramsKeyMap: {}, class: 'whalesbot_eagle_1001', isNotFor: ['whalesbot_eagle_1001'], - func (sprite, script) { + func(sprite, script) { // console.log("whalesbot_eagle_1001_entering_pitch_mode"); }, syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_entering_pitch_mode()'] }, @@ -624,7 +880,10 @@ Entry.WhalesbotEagle1001.getBlocks = function() { return; } - // console.log(sourceCode) + if (_this.invalidParamValue) { + _this.invalidParamValue = false; + return; + } if (openedSimulatorPopup()) { Entry.toast.success( @@ -634,6 +893,8 @@ Entry.WhalesbotEagle1001.getBlocks = function() { return; } + console.log(sourceCode); + _this.sendCmd(sourceCode); Entry.toast.success( @@ -673,7 +934,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { params: [ { type: 'number', - params: ['50'], + params: ['100'], }, null, ], @@ -722,7 +983,7 @@ Entry.WhalesbotEagle1001.getBlocks = function() { params: [ { type: 'number', - params: ['50'], + params: ['100'], }, { type: 'number', @@ -804,6 +1065,20 @@ Entry.WhalesbotEagle1001.getBlocks = function() { ], events: {}, def: { + params: [ + { + type: 'number', + params: ['50'], + }, + { + type: 'number', + params: ['0'], + }, + { + type: 'number', + params: ['0'], + }, + ], type: 'whalesbot_eagle_1001_automatic_descent_speed_offset', }, paramsKeyMap: { @@ -1474,7 +1749,1298 @@ Entry.WhalesbotEagle1001.getBlocks = function() { }, syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_execute_script()'] }, }, + + // light & speaker blocks + whalesbot_eagle_1001_ls_debug_value: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + ], + events: {}, + def: { + params: [ + { + type: 'number', + params: ['1'], + }, + { + type: 'number', + params: [''], + }, + ], + type: 'whalesbot_eagle_1001_ls_debug_value', + }, + paramsKeyMap: { + VALUE1: 0, + VALUE2: 1, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + var value1 = Number(script.values[0]); + var value2 = Number(script.values[1]); + if (value1 < 1 || value1 > 6) { + notify(notificationType.ALERT, 'Debugging: Data [1 ~ 6] and [0 ~ 999999]') + _this.invalidParamValue = true; + throw new Error(); + } + if (value2 < 0 || value2 > 999999) { + notify(notificationType.ALERT, 'Debugging: Data [1 ~ 6] and [0 ~ 999999]') + _this.invalidParamValue = true; + throw new Error(); + } + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_debug_value()'] }, + }, + + whalesbot_eagle_1001_ls_display_symbol: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['?', 'LED_symbol_question_mark'], ['!', 'LED_symbol_exclamation'], ['$', 'LED_symbol_dollar'], ['¥', 'LED_symbol_RMB'], + ['=', 'LED_symbol_equal'], ['+', 'LED_symbol_plus'], ['-', 'LED_symbol_minus'], ['x', 'LED_symbol_multiplied'], + ['÷', 'LED_symbol_divided'], ['0', 'LED_symbol_0'], ['1', 'LED_symbol_1'], ['2', 'LED_symbol_2'], + ['3', 'LED_symbol_3'], ['4', 'LED_symbol_4'], ['5', 'LED_symbol_5'], ['6', 'LED_symbol_6'], + ['7', 'LED_symbol_7'], ['8', 'LED_symbol_8'], ['9', 'LED_symbol_9'], ['A', 'LED_symbol_A'], + ['B', 'LED_symbol_B'], ['C', 'LED_symbol_C'], ['D', 'LED_symbol_D'], ['E', 'LED_symbol_E'], + ['F', 'LED_symbol_F'], ['G', 'LED_symbol_G'], ['H', 'LED_symbol_H'], ['I', 'LED_symbol_I'], + ['J', 'LED_symbol_J'], ['K', 'LED_symbol_K'], ['L', 'LED_symbol_L'], ['M', 'LED_symbol_M'], + ['N', 'LED_symbol_N'], ['O', 'LED_symbol_O'], ['P', 'LED_symbol_P'], ['Q', 'LED_symbol_Q'], + ['R', 'LED_symbol_R'], ['S', 'LED_symbol_S'], ['T', 'LED_symbol_T'], ['U', 'LED_symbol_U'], + ['V', 'LED_symbol_V'], ['W', 'LED_symbol_W'], ['X', 'LED_symbol_X'], ['Y', 'LED_symbol_Y'], + ['Z', 'LED_symbol_Z'], ['❤︎', 'LED_symbol_big_heart'], ['♥︎', 'LED_symbol_little_heart'], ['↑', 'LED_symbol_forward'], + ['↓', 'LED_symbol_backward'], ['←', 'LED_symbol_turnleft'], ['→', 'LED_symbol_turnright'], ['GO', 'LED_symbol_GO'], + ['⊘', 'LED_symbol_stop'], + ], + value: 'LED_symbol_question_mark', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + null, + ], + type: 'whalesbot_eagle_1001_ls_display_symbol', + }, + paramsKeyMap: { + SYMBOLS: 0, + PORT: 1, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_display_symbol()'] }, + }, + + whalesbot_eagle_1001_ls_off_LED: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ls_off_LED', + }, + paramsKeyMap: { + PORT: 0, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_off_LED()'] }, + }, + + whalesbot_eagle_1001_ls_display_digital_tube: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + ], + events: {}, + def: { + params: [ + null, + { + type: 'number', + params: [''], + }, + ], + type: 'whalesbot_eagle_1001_ls_display_digital_tube', + }, + paramsKeyMap: { + PORT: 0, + NUMBER: 1, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + var number = Number(script.values[1]); + if (number < 0 || number > 9999) { + notify(notificationType.ALERT, '0 ~ 9999') + _this.invalidParamValue = true; + throw new Error(); + } + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_display_digital_tube()'] }, + }, + + whalesbot_eagle_1001_ls_display_digital_tube_score: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + ], + events: {}, + def: { + params: [ + null, + { + type: 'number', + params: [''], + }, + { + type: 'number', + params: [''], + }, + ], + type: 'whalesbot_eagle_1001_ls_display_digital_tube_score', + }, + paramsKeyMap: { + PORT: 0, + NUMBER1: 1, + NUMBER2: 2, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + var number1 = Number(script.values[1]); + var number2 = Number(script.values[2]); + if (number1 < 0 || number1 > 9999 || number2 < 0 || number2 > 9999) { + notify(notificationType.ALERT, '0 ~ 9999') + _this.invalidParamValue = true; + throw new Error(); + } + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_display_digital_tube_score()'] }, + }, + + whalesbot_eagle_1001_ls_off_digital_tube: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ls_off_digital_tube', + }, + paramsKeyMap: { + PORT: 0, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_off_digital_tube()'] }, + }, + + whalesbot_eagle_1001_ls_set_RGB: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + ], + events: {}, + def: { + params: [ + null, + { + type: 'number', + params: ['255'], + }, + { + type: 'number', + params: ['255'], + }, + { + type: 'number', + params: ['255'], + }, + ], + type: 'whalesbot_eagle_1001_ls_set_RGB', + }, + paramsKeyMap: { + PORT: 0, + RED: 1, + GREEN: 2, + BLUE: 3, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + var red = Number(script.values[1]); + var green = Number(script.values[2]); + var blue = Number(script.values[3]); + if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255) { + notify(notificationType.ALERT, '0 ~ 255') + _this.invalidParamValue = true; + throw new Error(); + } + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_set_RGB()'] }, + }, + + whalesbot_eagle_1001_ls_fly_RGB: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['⚪', 'color_white'], ['🟡', 'color_yellow'], + ['🟣', 'color_purple'], ['🟦', 'color_cyan'], + ['🔴', 'color_red'], ['🟢', 'color_green'], + ['🔵', 'color_blue'], ['⚫', 'color_black'], + ], + value: 'color_white', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ls_fly_RGB', + }, + paramsKeyMap: { + COLOR: 0, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_fly_RGB()'] }, + }, + + whalesbot_eagle_1001_ls_set_DO: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.light_speaker.electro_magnet.absorption, 'true'], + [Lang.Blocks.light_speaker.electro_magnet.break_off, 'false'] + ], + value: 'true', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + null, + ], + type: 'whalesbot_eagle_1001_ls_set_DO', + }, + paramsKeyMap: { + PORT: 0, + ELECTROMAGNET: 1, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_set_DO()'] }, + }, + + whalesbot_eagle_1001_ls_execute_script: { + color: blockColors.color.light_speaker, + outerLine: blockColors.outerLine.light_speaker, + fontColor: '#fff', + skeleton: 'basic_without_next', + statements: [], + params: [ + { + type: 'Block', + accept: 'string', + defaultType: 'number', + }, + { + type: 'Indicator', + img: 'block_icon/moving_icon.svg', + size: 11, + }, + ], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ls_execute_script', + }, + paramsKeyMap: { + VALUE: 0, + }, + class: 'whalesbot_eagle_1001_ls', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + const project = _this.exportProject(); + const listVariables = project.variables; + const rawScript = project.objects[0].script; + const allScript = JSON.parse(rawScript); + const droneScript = allScript.filter((arr) => arr.length > 2); + + let sourceCode = `#include "whalesbot.h"\n${listVariables.map(setUpCVariables).join('')}\nvoid user_main() {\n`; + sourceCode += `${droneScript[0].map(generateCCode).join('')}}\n\nuser_main();`; + + if (_this.unsupportBlockExist) { + Entry.toast.alert( + Lang.Blocks.whalesbot_eagle_1001_toast_unsupport_block_title, + Lang.Blocks.whalesbot_eagle_1001_toast_unsupport_block_msg + ) + _this.unsupportBlockExist = false; + Entry.engine.toggleStop(); + return; + } + + if (_this.invalidParamValue) { + _this.invalidParamValue = false; + return; + } + + if (openedSimulatorPopup()) { + Entry.toast.success( + Lang.Blocks.whalesbot_eagle_1001_toast_status_title, + Lang.Blocks.whalesbot_eagle_1001_toast_download_success + ); + return; + } + + console.log(sourceCode); + + _this.sendCmd(sourceCode); + + Entry.toast.success( + Lang.Blocks.whalesbot_eagle_1001_toast_status_title, + Lang.Blocks.whalesbot_eagle_1001_toast_prepare_download + ); + setTimeout(() => { + Entry.toast.success( + Lang.Blocks.whalesbot_eagle_1001_toast_status_title, + Lang.Blocks.whalesbot_eagle_1001_toast_downloading_code + ); + setTimeout(() => { + Entry.toast.success( + Lang.Blocks.whalesbot_eagle_1001_toast_status_title, + Lang.Blocks.whalesbot_eagle_1001_toast_download_success + ); + }, 3000); + }, 4000); + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ls_execute_script()'] }, + }, + + // sensors + whalesbot_eagle_1001_ss_fly_state_POS_Z: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ss_fly_state_POS_Z', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_fly_state_POS_Z()'] }, + }, + + whalesbot_eagle_1001_ss_fly_state_LASER: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ss_fly_state_LASER', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_fly_state_LASER()'] }, + }, + + whalesbot_eagle_1001_ss_battery_voltage: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ss_battery_voltage', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_battery_voltage()'] }, + }, + + whalesbot_eagle_1001_ss_fly_state_STATE_TEMP: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ss_fly_state_STATE_TEMP', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_fly_state_STATE_TEMP()'] }, + }, + + whalesbot_eagle_1001_ss_attitude_angle: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.sensor.attitude_angle.pitch, 'STATE_PITCH'], + [Lang.Blocks.sensor.attitude_angle.roll, 'STATE_ROLL'], + [Lang.Blocks.sensor.attitude_angle.yaw, 'STATE_YAW'], + ], + value: 'STATE_PITCH', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_attitude_angle', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_attitude_angle()'] }, + }, + + whalesbot_eagle_1001_ss_flight_angular_velocity: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['X', 'GYPO_X'], ['Y', 'GYPO_Y'], ['Z', 'GYPO_Z'], + ], + value: 'GYPO_X', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_flight_angular_velocity', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_flight_angular_velocity()'] }, + }, + + whalesbot_eagle_1001_ss_flight_acceleration: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['X', 'ACC_X'], ['Y', 'ACC_Y'], ['Z', 'ACC_Z'], + ], + value: 'ACC_X', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_flight_acceleration', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_flight_acceleration()'] }, + }, + + whalesbot_eagle_1001_ss_optical_flow: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['X', 'OPX'], ['Y', 'OPY'] + ], + value: 'OPX', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_optical_flow', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_optical_flow()'] }, + }, + + whalesbot_eagle_1001_ss_get_infrared_distance: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_infrared_distance', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_infrared_distance()'] }, + }, + + whalesbot_eagle_1001_ss_obstacle_infrared_detected_string: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_string', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_obstacle_infrared_detected_string()'] }, + }, + + whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_boolean_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_obstacle_infrared_detected_bool()'] }, + }, + + whalesbot_eagle_1001_ss_human_infrared_value_string: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_human_infrared_value_string', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_human_infrared_value_string()'] }, + }, + + whalesbot_eagle_1001_ss_human_infrared_value_bool: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_boolean_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_human_infrared_value_bool', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_human_infrared_value_bool()'] }, + }, + + whalesbot_eagle_1001_ss_AI: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_AI', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_AI()'] }, + }, + + whalesbot_eagle_1001_ss_get_ultrasonic_distance: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_ultrasonic_distance', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_ultrasonic_distance()'] }, + }, + + whalesbot_eagle_1001_ss_get_ambient_light: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_ambient_light', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_ambient_light()'] }, + }, + + whalesbot_eagle_1001_ss_get_temperature: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_temperature', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_temperature()'] }, + }, + + whalesbot_eagle_1001_ss_get_humidity: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_humidity', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_humidity()'] }, + }, + + whalesbot_eagle_1001_ss_get_flame: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_flame', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_flame()'] }, + }, + + whalesbot_eagle_1001_ss_get_gesture: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_gesture', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_gesture()'] }, + }, + + whalesbot_eagle_1001_ss_get_tof: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['P1', 'P1'], ['P2', 'P2'] + ], + value: 'P1', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_tof', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_tof()'] }, + }, + + whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.sensor.laser_height_determination.on, 'true'], + [Lang.Blocks.sensor.laser_height_determination.off, 'false'] + ], + value: 'true', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_fly_setpoint_LASER_ENABLE()'] }, + }, + + whalesbot_eagle_1001_ss_get_bt_remote_control: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.sensor.remote_control_button.key, 'BTKEY'], + [Lang.Blocks.sensor.remote_control_button.left_rocker_x, 'BTSTICK2'], + [Lang.Blocks.sensor.remote_control_button.left_rocker_y, 'BTSTICK1'], + [Lang.Blocks.sensor.remote_control_button.right_rocker_x, 'BTSTICK4'], + [Lang.Blocks.sensor.remote_control_button.right_rocker_y, 'BTSTICK3'], + ], + value: 'BTKEY', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + ], + events: {}, + def: { + params: [ + null, + ], + type: 'whalesbot_eagle_1001_ss_get_bt_remote_control', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_get_bt_remote_control()'] }, + }, + + whalesbot_eagle_1001_ss_seconds: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic_string_field', + statements: [], + params: [], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ss_seconds', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_seconds()'] }, + }, + + whalesbot_eagle_1001_ss_resettime: { + color: blockColors.color.sensor, + outerLine: blockColors.outerLine.sensor, + fontColor: '#fff', + skeleton: 'basic', + statements: [], + params: [], + events: {}, + def: { + type: 'whalesbot_eagle_1001_ss_resettime', + }, + paramsKeyMap: {}, + class: 'whalesbot_eagle_1001_ss', + isNotFor: ['whalesbot_eagle_1001'], + func(sprite, script) { + }, + syntax: { js: [], py: ['Entry.whalesbot_eagle_1001_ss_resettime()'] }, + }, }; }; -module.exports = Entry.WhalesbotEagle1001; \ No newline at end of file +module.exports = Entry.WhalesbotEagle1001; diff --git a/src/textcoding/util/textCodingUtil.js b/src/textcoding/util/textCodingUtil.js index 93f55d8c5a..27711135e6 100755 --- a/src/textcoding/util/textCodingUtil.js +++ b/src/textcoding/util/textCodingUtil.js @@ -531,7 +531,7 @@ class TextCodingUtil { return EntryStatic.pythonDisabled; } EntryStatic.pythonDisabled = Object.keys(Entry.block).filter( - (key) => Entry.block[key]?.isNotFor.indexOf('python_disable') >= 0 + (key) => Entry.block[key]?.isNotFor?.indexOf('python_disable') >= 0 ); return EntryStatic.pythonDisabled; }