From d0a5f03a45cccf50467390056ad07abeaf7b57b0 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Tue, 30 May 2023 20:15:50 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=EC=9D=BC=EB=B0=98=ED=98=95=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=8B=A4=EA=B3=BC=EB=A1=9C=EB=B4=87=20=EC=84=BC?= =?UTF-8?q?=EC=84=9C=EA=B8=B0=EB=8A=A5=20=EC=82=AC=EC=9A=A9=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocks/hardware/block_robotis.js | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index 31a2c7352d..4d91a52753 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -1353,6 +1353,7 @@ Entry.Robotis_openCM70.getBlocks = function() { var sensor = script.getStringField('SENSOR'); var increase = 0; + var sensor_name = ''; if (sensor == 'CM_SOUND_DETECTED') { data_default_address = @@ -1360,6 +1361,7 @@ Entry.Robotis_openCM70.getBlocks = function() { data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1]; + sensor_name = 'DETECTEDSOUNDE'; } else if (sensor == 'CM_SOUND_DETECTING') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0]; @@ -1367,11 +1369,13 @@ Entry.Robotis_openCM70.getBlocks = function() { Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1]; + sensor_name = 'DETECTINGSOUNDE1'; } else if (sensor == 'CM_USER_BUTTON') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1]; + sensor_name = 'USERBUTTONSTATE'; } data_default_address = data_default_address + increase * data_default_length; @@ -1395,7 +1399,7 @@ Entry.Robotis_openCM70.getBlocks = function() { // Entry.hw.socket.send(JSON.stringify(Entry.hw.sendQueue)); Entry.Robotis_carCont.update(); - var result = Entry.hw.portData[data_default_address]; + var result = Entry.hw.portData[sensor_name]; Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -1472,6 +1476,8 @@ Entry.Robotis_openCM70.getBlocks = function() { var port = script.getStringField('PORT'); var sensor = script.getStringField('SENSOR'); + var aux_name = ''; + var increase = 0; if (port == 'PORT_3') { increase = 2; @@ -1490,26 +1496,31 @@ Entry.Robotis_openCM70.getBlocks = function() { Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1]; + aux_name = 'LIGHT' + (increase-2); } else if (sensor == 'AUX_IR') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1]; + aux_name = 'IR' + (increase-2); } else if (sensor == 'AUX_TOUCH') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1]; + aux_name = 'TOUCH' + (increase-2); } else if (sensor == 'AUX_TEMPERATURE') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1]; + aux_name = 'TEMPERATURE' + (increase-2); } else if (sensor == 'AUX_BRIGHTNESS') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1]; + aux_name = 'LIGHT' + (increase-2); } else if (sensor == 'AUX_HYDRO_THEMO_HUMIDITY') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[0]; @@ -1517,6 +1528,7 @@ Entry.Robotis_openCM70.getBlocks = function() { Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1]; + aux_name = 'HUMIDTY' + (increase-2); } else if (sensor == 'AUX_HYDRO_THEMO_TEMPER') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[0]; @@ -1524,16 +1536,19 @@ Entry.Robotis_openCM70.getBlocks = function() { Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1]; + aux_name = 'HT_TEMPERATURE' + (increase-2); } else if (sensor == 'AUX_ULTRASONIC') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1]; + aux_name = 'ULTRASONIC' + (increase-2); } else if (sensor == 'AUX_MAGNETIC') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1]; + aux_name = 'MAGNETIC' + (increase-2); } else if (sensor == 'AUX_MOTION_DETECTION') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[0]; @@ -1541,16 +1556,19 @@ Entry.Robotis_openCM70.getBlocks = function() { Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1]; + aux_name = 'MOTION' + (increase-2); } else if (sensor == 'AUX_COLOR') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1]; + aux_name = 'COLOR' + (increase-2); } else if (sensor == 'AUX_CUSTOM') { data_default_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0]; data_default_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1]; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0]; data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1]; + aux_name = 'LIGHT' + (increase-2); } data_default_address = data_default_address + increase * data_default_length; @@ -1578,7 +1596,7 @@ Entry.Robotis_openCM70.getBlocks = function() { // Entry.hw.socket.send(JSON.stringify(Entry.hw.sendQueue)); Entry.Robotis_carCont.update(); - var result = Entry.hw.portData[data_default_address]; + var result = Entry.hw.portData[aux_name]; Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; From 46cd1598afeecfd92f3f885c0e3e9c025edb9ca6 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Wed, 31 May 2023 16:44:31 +0900 Subject: [PATCH 02/11] =?UTF-8?q?=EC=9E=90=EC=9C=A8=EC=A3=BC=ED=96=89?= =?UTF-8?q?=EC=9A=A9=20=EB=B8=94=EB=A1=9D=203=EC=A2=85=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=EC=9E=90=EB=8F=99=EA=BA=BC=EC=A7=90=ED=83=80?= =?UTF-8?q?=EC=9D=B4=EB=A8=B8=20=EB=B8=94=EB=A1=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/code.js | 11 + extern/lang/ebs.js | 11 + extern/lang/en.js | 11 + extern/lang/jp.js | 11 + extern/lang/ko.js | 12 + extern/lang/vn.js | 11 + .../blocks/hardware/block_robotis.js | 339 ++++++++++++++++++ 7 files changed, 406 insertions(+) diff --git a/extern/lang/code.js b/extern/lang/code.js index 6a7bec2bc3..89445d35c3 100644 --- a/extern/lang/code.js +++ b/extern/lang/code.js @@ -1299,6 +1299,9 @@ Lang.Blocks = { "robotis_common_play_motion": "실행", "robotis_common_motion": "모션", "robotis_common_index_number": "번", + "robotis_common_left": "왼쪽", + "robotis_common_right": "오른쪽", + "robotis_common_minute": "분", "robotis_cm_custom": "직접입력 주소", "robotis_cm_spring_left": "왼쪽 접촉 센서", "robotis_cm_spring_right": "오른쪽 접촉 센서", @@ -5426,12 +5429,16 @@ Lang.Helper = { "robotis_openCM70_cm_sound_detected_clear": "최종 소리 감지횟 수를 0 으로 초기화 합니다.", "robotis_openCM70_cm_led": "제어기의 빨간색, 녹색, 파란색 LED 를 켜거나 끕니다.", "robotis_openCM70_cm_motion": "제어기에 다운로드 되어있는 모션을 실행합니다.", + "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", + "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", + "robotis_openCM70_cm_autodrive_speed": "차로를 따라 지정한 속도로 자율주행을 수행합니다.", "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_position": "서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", "robotis_openCM70_aux_led_module": "LED 모듈의 LED 를 켜거나 끕니다.", "robotis_openCM70_aux_custom": "사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", + "robotis_openCM70_cm_poweroff_timer": "제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.", "robotis_openCM70_cm_custom_value": "컨트롤 테이블 주소를 직접 입력하여 값을 확인 합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "robotis_openCM70_cm_custom": "컨트롤 테이블 주소를 직접 입력하여 값을 정합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "show_variable": "선택한 변수의 '변수 창'을 실행화면에 보이게 합니다.", @@ -6336,12 +6343,16 @@ Lang.template = { "robotis_openCM70_cm_sound_detected_clear": "최종소리감지횟수 초기화 %1", "robotis_openCM70_cm_led": "제어기 %1 LED %2 %3", "robotis_openCM70_cm_motion": "모션 %1 번 실행 %2", + "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차 %1모터를 %2 에 연결 %3", + "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차 %1적외선센서를 %2 에 연결 %3", + "robotis_openCM70_cm_autodrive_speed": "차로를 따라 %1의 속도로 자율주행 %2", "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", "robotis_openCM70_aux_servo_mode": "%1 서보모터 모드를 %2 (으)로 정하기 %3", "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", "robotis_openCM70_aux_servo_position": "%1 서보모터 위치를 %2 (으)로 정하기 %3", "robotis_openCM70_aux_led_module": "%1 LED 모듈을 %2 (으)로 정하기 %3", "robotis_openCM70_aux_custom": "%1 사용자 장치를 %2 (으)로 정하기 %3", + "robotis_openCM70_cm_poweroff_timer": "제어기 자동꺼짐 타이머 %1 %2", "robotis_openCM70_cm_custom": "직접입력 주소 ( %1 ) (을)를 %2 (으)로 정하기 %3", "robotis_carCont_sensor_value": "%1 값", "robotis_carCont_cm_led": "4번 LED %1 , 1번 LED %2 %3", diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 1609d88d39..8ffac37975 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -1304,6 +1304,9 @@ Lang.Blocks = { "robotis_common_play_motion": "실행", "robotis_common_motion": "모션", "robotis_common_index_number": "번", + "robotis_common_left": "왼쪽", + "robotis_common_right": "오른쪽", + "robotis_common_minute": "분", "robotis_cm_custom": "직접입력 주소", "robotis_cm_spring_left": "왼쪽 접촉 센서", "robotis_cm_spring_right": "오른쪽 접촉 센서", @@ -5438,12 +5441,16 @@ Lang.Helper = { "robotis_openCM70_cm_sound_detected_clear": "최종 소리 감지횟 수를 0 으로 초기화 합니다.", "robotis_openCM70_cm_led": "제어기의 빨간색, 녹색, 파란색 LED 를 켜거나 끕니다.", "robotis_openCM70_cm_motion": "제어기에 다운로드 되어있는 모션을 실행합니다.", + "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", + "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", + "robotis_openCM70_cm_autodrive_speed": "지정한 속도로 자율주행을 수행합니다.", "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_position": "서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", "robotis_openCM70_aux_led_module": "LED 모듈의 LED 를 켜거나 끕니다.", "robotis_openCM70_aux_custom": "사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", + "robotis_openCM70_cm_poweroff_timer": "제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.", "robotis_openCM70_cm_custom_value": "컨트롤 테이블 주소를 직접 입력하여 값을 확인 합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "robotis_openCM70_cm_custom": "컨트롤 테이블 주소를 직접 입력하여 값을 정합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "show_variable": "선택한 변수의 '변수 창'을 실행화면에 보이게 합니다.", @@ -6352,12 +6359,16 @@ Lang.template = { "robotis_openCM70_cm_sound_detected_clear": "최종소리감지횟수 초기화 %1", "robotis_openCM70_cm_led": "제어기 %1 LED %2 %3", "robotis_openCM70_cm_motion": "모션 %1 번 실행 %2", + "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차 %1 모터를 %2 에 연결 %3", + "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차 %1 적외선센서를 %2 에 연결 %3", + "robotis_openCM70_cm_autodrive_speed": "차로를 따라 %1의 속도로 자율주행 %2", "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", "robotis_openCM70_aux_servo_mode": "%1 서보모터 모드를 %2 (으)로 정하기 %3", "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", "robotis_openCM70_aux_servo_position": "%1 서보모터 위치를 %2 (으)로 정하기 %3", "robotis_openCM70_aux_led_module": "%1 LED 모듈을 %2 (으)로 정하기 %3", "robotis_openCM70_aux_custom": "%1 사용자 장치를 %2 (으)로 정하기 %3", + "robotis_openCM70_cm_poweroff_timer": "제어기 자동꺼짐 타이머 %1 %2", "robotis_openCM70_cm_custom": "직접입력 주소 ( %1 ) (을)를 %2 (으)로 정하기 %3", "robotis_carCont_sensor_value": "%1 값", "robotis_carCont_cm_led": "4번 LED %1 , 1번 LED %2 %3", diff --git a/extern/lang/en.js b/extern/lang/en.js index 9887c9cec7..4e11067977 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -498,6 +498,9 @@ Lang.Blocks = { "robotis_common_play_motion": "Play", "robotis_common_motion": "Motion", "robotis_common_index_number": "Number", + "robotis_common_left": "Left", + "robotis_common_right": "Right", + "robotis_common_minute": "minute(s)", "robotis_cm_custom": "Custom address", "robotis_cm_spring_left": "Left contact sensor", "robotis_cm_spring_right": "Right contact sensor", @@ -4645,12 +4648,16 @@ Lang.Helper = { "robotis_openCM70_cm_sound_detected_clear": "Final number of sound detection ", "robotis_openCM70_cm_led": "Turns the red, green, blue LED of the device on or off.", "robotis_openCM70_cm_motion": "Executes the motion downloaded on the device.", + "robotis_openCM70_cm_autodrive_motor": "Specifies the motor port of the autonomous driving car.", + "robotis_openCM70_cm_autodrive_ir": "Specifies the IR sensor port of the autonomous driving car.", + "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the specified speed along the lane.", "robotis_openCM70_aux_motor_speed": "Sets the speed of decelerating motor to the value of 0 - 1023.", "robotis_openCM70_aux_servo_mode": "Sets the servo motor as wheel mode or joint mode.
The same mode continues to apply once it's set.
Wheel mode designates the servo motor's speed, and spins the servo motor.
Joint mode moves the servo motor's position with the set servo motor speed.", "robotis_openCM70_aux_servo_speed": "Sets servo motor's speed to the value of 0 - 1023.", "robotis_openCM70_aux_servo_position": "Sets servo motor's position to the value of 0-1023.
Use as servo motor speed", "robotis_openCM70_aux_led_module": "Turns the LED of LED module on or off.", "robotis_openCM70_aux_custom": "Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation of user sensor production.", + "robotis_openCM70_cm_poweroff_timer": "Set the controller's auto-off timer.
If there is no communication for the set amount of time, the controller will automatically turn off.", "robotis_openCM70_cm_custom_value": "Checks the value by directly inputting the control table address.
Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation about control table.", "robotis_openCM70_cm_custom": "Checks the value by directly inputting the control table address.
Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation about control table.", "show_variable": "Shows the value of the selected variable on the stage.", @@ -5562,12 +5569,16 @@ Lang.template = { "robotis_openCM70_cm_sound_detected_clear": "Initialize the final number of sound detection %1", "robotis_openCM70_cm_led": "Controller %1 LED %2 %3", "robotis_openCM70_cm_motion": "Play the motion %1 times", + "robotis_openCM70_cm_autodrive_motor": "Autonomous driving car %1 motor uses %2 %3", + "robotis_openCM70_cm_autodrive_ir": "Autonomous driving car %1 IR sensor uses %2 %3", + "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the speed of %1 %2", "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3 %4", "robotis_openCM70_aux_servo_mode": "Set the mode of %1 servo motor to %2 %3", "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3 %4", "robotis_openCM70_aux_servo_position": "Set the position of %1 servo motor to %2 %3", "robotis_openCM70_aux_led_module": "Set the LED module of %1 as %2 %3", "robotis_openCM70_aux_custom": "Set the user device of %1 as %2 %3", + "robotis_openCM70_cm_poweroff_timer": "Set auto-off timer as %1 %2", "robotis_openCM70_cm_custom": "Set the custom address ( %1 ) as %2 %3", "robotis_carCont_sensor_value": "Value %1", "robotis_carCont_cm_led": "%1 LED 4, %2 LED %3", diff --git a/extern/lang/jp.js b/extern/lang/jp.js index 276e6c6079..b4bbb5c4cf 100644 --- a/extern/lang/jp.js +++ b/extern/lang/jp.js @@ -1295,6 +1295,9 @@ Lang.Blocks = { "robotis_common_play_motion": "実行", "robotis_common_motion": "モーション", "robotis_common_index_number": "回", + "robotis_common_left": "左", + "robotis_common_right": "右", + "robotis_common_minute": "分", "robotis_cm_custom": "直接入力アドレス", "robotis_cm_spring_left": "左側接触センサー", "robotis_cm_spring_right": "右側接触センサー", @@ -5430,12 +5433,16 @@ Lang.Helper = { "robotis_openCM70_cm_sound_detected_clear": "최종 소리 감지횟 수를 0 으로 초기화 합니다.", "robotis_openCM70_cm_led": "제어기의 빨간색, 녹색, 파란색 LED 를 켜거나 끕니다.", "robotis_openCM70_cm_motion": "제어기에 다운로드 되어있는 모션을 실행합니다.", + "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", + "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", + "robotis_openCM70_cm_autodrive_speed": "지정한 속도로 자율주행을 수행합니다.", "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_position": "서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", "robotis_openCM70_aux_led_module": "LED 모듈의 LED 를 켜거나 끕니다.", "robotis_openCM70_aux_custom": "사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", + "robotis_openCM70_cm_poweroff_timer": "제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.", "robotis_openCM70_cm_custom_value": "컨트롤 테이블 주소를 직접 입력하여 값을 확인 합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "robotis_openCM70_cm_custom": "컨트롤 테이블 주소를 직접 입력하여 값을 정합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "show_variable": "選択した変数ウィンドウを実行画面に表示します。", @@ -6342,12 +6349,16 @@ Lang.template = { "robotis_openCM70_cm_sound_detected_clear": "Initialize the final number of sound detection %1", "robotis_openCM70_cm_led": "Controller %1 LED %2 %3", "robotis_openCM70_cm_motion": "Play the motion %1 times", + "robotis_openCM70_cm_autodrive_motor": "Autonomous driving car %1 motor uses %2 %3", + "robotis_openCM70_cm_autodrive_ir": "Autonomous driving car %1 IR sensor uses %2 %3", + "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the speed of %1 %2", "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3 %4", "robotis_openCM70_aux_servo_mode": "Set the mode of %1 servo motor to %2 %3", "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3 %4", "robotis_openCM70_aux_servo_position": "Set the position of %1 servo motor to %2 %3", "robotis_openCM70_aux_led_module": "Set the LED module of %1 as %2 %3", "robotis_openCM70_aux_custom": "Set the user device of %1 as %2 %3", + "robotis_openCM70_cm_poweroff_timer": "Set auto-off timer as %1 %2", "robotis_openCM70_cm_custom": "Set the custom address ( %1 ) as %2 %3", "robotis_carCont_sensor_value": "Value %1", "robotis_carCont_cm_led": "%1 LED 4, %2 LED %3", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index b2b4bdfb0b..02883b5614 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -1320,6 +1320,9 @@ Lang.Blocks = { robotis_common_play_motion: '실행', robotis_common_motion: '모션', robotis_common_index_number: '번', + robotis_common_left: '왼쪽', + robotis_common_right: '오른쪽', + robotis_common_minute: '분', robotis_cm_custom: '직접입력 주소', robotis_cm_spring_left: '왼쪽 접촉 센서', robotis_cm_spring_right: '오른쪽 접촉 센서', @@ -5989,6 +5992,9 @@ Lang.Helper = { robotis_openCM70_cm_sound_detected_clear: '최종 소리 감지횟 수를 0 으로 초기화 합니다.', robotis_openCM70_cm_led: '제어기의 빨간색, 녹색, 파란색 LED 를 켜거나 끕니다.', robotis_openCM70_cm_motion: '제어기에 다운로드 되어있는 모션을 실행합니다.', + robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', + robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', + robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.', robotis_openCM70_aux_servo_mode: '서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.', @@ -5998,6 +6004,8 @@ Lang.Helper = { robotis_openCM70_aux_led_module: 'LED 모듈의 LED 를 켜거나 끕니다.', robotis_openCM70_aux_custom: '사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.', + robotis_openCM70_cm_poweroff_timer: + '제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.', robotis_openCM70_cm_custom_value: '컨트롤 테이블 주소를 직접 입력하여 값을 확인 합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.', robotis_openCM70_cm_custom: @@ -7359,11 +7367,15 @@ Lang.template = { robotis_openCM70_cm_sound_detected_clear: '최종소리감지횟수 초기화 %1', robotis_openCM70_cm_led: '제어기 %1 LED %2 %3', robotis_openCM70_cm_motion: '모션 %1 번 실행 %2', + robotis_openCM70_cm_autodrive_motor: '자율주행 자동차 %1 모터를 %2 에 연결 %3', + robotis_openCM70_cm_autodrive_ir: '자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', + robotis_openCM70_cm_autodrive_speed: '차로를 따라 %1의 속도로 자율주행 %2', robotis_openCM70_aux_motor_speed: '%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', robotis_openCM70_aux_servo_mode: '%1 서보모터 모드를 %2 (으)로 정하기 %3', robotis_openCM70_aux_servo_speed: '%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', robotis_openCM70_aux_servo_position: '%1 서보모터 위치를 %2 (으)로 정하기 %3', robotis_openCM70_aux_led_module: '%1 LED 모듈을 %2 (으)로 정하기 %3', + robotis_openCM70_cm_poweroff_timer: '제어기 자동꺼짐 타이머 %1 %2', robotis_openCM70_aux_custom: '%1 사용자 장치를 %2 (으)로 정하기 %3', robotis_openCM70_cm_custom: '직접입력 주소 ( %1 ) (을)를 %2 (으)로 정하기 %3', robotis_carCont_sensor_value: '%1 값', diff --git a/extern/lang/vn.js b/extern/lang/vn.js index 2986523405..6514397ba5 100644 --- a/extern/lang/vn.js +++ b/extern/lang/vn.js @@ -1294,6 +1294,9 @@ Lang.Blocks = { "robotis_common_play_motion": "thực hiện", "robotis_common_motion": "chuyển động ", "robotis_common_index_number": "số", + "robotis_common_left": "Bên trái", + "robotis_common_right": "Phải", + "robotis_common_minute": "phút", "robotis_cm_custom": "nhập địa chỉ", "robotis_cm_spring_left": "cảm biến tiếp xúc trái", "robotis_cm_spring_right": "cảm biến tiếp xúc phải", @@ -5429,12 +5432,16 @@ Lang.Helper = { "robotis_openCM70_cm_sound_detected_clear": "Số cuối cùng phát hiện âm thanh ", "robotis_openCM70_cm_led": "Bật hoặc tắt đèn LED màu đỏ, màu xanh lá cây, màu xanh dương của thiết bị.", "robotis_openCM70_cm_motion": "Thực hiện chuyển động tải về thiết bị. ", + "robotis_openCM70_cm_autodrive_motor": "Chỉ định cổng động cơ của ô tô lái tự động.", + "robotis_openCM70_cm_autodrive_ir": "Chỉ định cổng cảm biến hồng ngoại của xe lái tự động.", + "robotis_openCM70_cm_autodrive_speed": "Lái xe tự động được thực hiện ở tốc độ quy định dọc theo làn đường.", "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ của động cơ giảm tốc với giá trị 0-1023.", "robotis_openCM70_aux_servo_mode": "Thiết lập động cơ servo như chế độ bánh xe hoặc chế độ chung.
Các chế độ tương tự vẫn tiếp tục áp dụng một khi đã cài đặt.
Chế độ bánh xe chỉ định tốc độ động cơ servo, và quay động cơ servo.
Chọn chế độ di chuyển vị trí của động cơ servo và tốc độ động cơ servo.", "robotis_openCM70_aux_servo_speed": "Cài đặt tốc độ của động cơ servo với giá trị từ 0 - 1023. ", "robotis_openCM70_aux_servo_position": "Cài đặt vị trí của động cơ servo với giá trị từ 0 - 1023.
Sử dụng như tốc độ động cơ servo", "robotis_openCM70_aux_led_module": "Bật hoặc tắt các mô-đun LED của LED.", "robotis_openCM70_aux_custom": "Vui lòng tham khảo ROBOTIS e-manual (http://support.robotis.com/ko/) để được giải thích về người sử dụng cảm biến sản xuất.", + "robotis_openCM70_cm_poweroff_timer": "Đặt bộ hẹn giờ tự động tắt của bộ điều khiển.
Nếu giao tiếp không diễn ra trong khoảng thời gian đã đặt, bộ điều khiển sẽ tự động tắt.", "robotis_openCM70_cm_custom_value": "Kiểm tra các giá trị bằng cách nhập trực tiếp địa chỉ bảng điều khiển.
Vui lòng tham khảo ROBOTIS e-manual (http://support.robotis.com/ko/)để được giải thích về bảng điều khiển.", "robotis_openCM70_cm_custom": "Kiểm tra các giá trị bằng cách nhập trực tiếp địa chỉ bảng điều khiển.
Vui lòng tham khảo ROBOTIS e-manual (http://support.robotis.com/ko/)để được giải thích về bảng điều khiển.", "show_variable": "Hiển thị giá trị của biến đã chọn trên màn hình.", @@ -6339,12 +6346,16 @@ Lang.template = { "robotis_openCM70_cm_sound_detected_clear": "phát bộ điều khiển giai điệu %1 lần %2", "robotis_openCM70_cm_led": "bộ điều khiển %1 LED %2 %3", "robotis_openCM70_cm_motion": "mở chuyển động %1 lần", + "robotis_openCM70_cm_autodrive_motor": "Ô tô lái tự động %1 sử dụng động cơ %2 %3", + "robotis_openCM70_cm_autodrive_ir": "Ô tô tự lái %1 sử dụng cảm biến hồng ngoại %2 %3", + "robotis_openCM70_cm_autodrive_speed": "Thực hiện lái xe tự trị ở tốc độ %1 %2", "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ giảm tốc động cơ của %1 tới %2 , và giá trị đầu ra đến %3 %4", "robotis_openCM70_aux_servo_mode": "Thiết lập chế độ của %1 động cơ servo bằng %2 %3", "robotis_openCM70_aux_servo_speed": "Thiết lập tốc độ tốc động cơ servo của %1 tới %2, và giá trị đầu ra đến %3 %4", "robotis_openCM70_aux_servo_position": "Thiết lập vị trí của %1 động cơ servo bằng %2 %3", "robotis_openCM70_aux_led_module": "thiết lập %1 mô-đun LED như %2 %3", "robotis_openCM70_aux_custom": "thiết lập %1 thiết bị người dùng như %2 %3", + "robotis_openCM70_cm_poweroff_timer": "Bộ hẹn giờ tự động tắt bộ điều khiển %1 %2", "robotis_openCM70_cm_custom": "thiết lập địa chỉ tùy chỉnh ( %1 ) như %2 %3", "robotis_carCont_sensor_value": "giá trị %1", "robotis_carCont_cm_led": "%1 LED 4, %2 LED %3", diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index 4d91a52753..722d5e0f13 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -157,6 +157,12 @@ Entry.Robotis_openCM70 = { CM_SOUND_DETECTING: [87, 1], CM_USER_BUTTON: [26, 1], CM_MOTION: [66, 1], + CM_AUTODRIVE: [40, 1], + CM_AUTODRIVE_LEFT_MOTOR_PORT: [42, 1], + CM_AUTODRIVE_RIGHT_MOTOR_PORT: [43, 1], + CM_AUTODRIVE_LEFT_IR_PORT: [44, 1], + CM_AUTODRIVE_RIGHT_IR_PORT: [45, 1], + CM_POWEROFF_TIMER: [76, 1], AUX_SERVO_POSITION: [152, 2], AUX_IR: [168, 2], @@ -262,6 +268,12 @@ Entry.Robotis_openCM70EDU = { CM_SOUND_DETECTING: [87, 1], CM_USER_BUTTON: [26, 1], CM_MOTION: [66, 1], + CM_AUTODRIVE: [40, 1], + CM_AUTODRIVE_LEFT_MOTOR_PORT: [42, 1], + CM_AUTODRIVE_RIGHT_MOTOR_PORT: [43, 1], + CM_AUTODRIVE_LEFT_IR_PORT: [44, 1], + CM_AUTODRIVE_RIGHT_IR_PORT: [45, 1], + CM_POWEROFF_TIMER: [76, 1], AUX_SERVO_POSITION: [152, 2], AUX_IR: [168, 2], @@ -410,6 +422,9 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_sound_detected_clear: '최종소리감지횟수 초기화 %1', robotis_openCM70_cm_led: '제어기 %1 LED %2 %3', robotis_openCM70_cm_motion: '모션 %1 번 실행 %2', + robotis_openCM70_cm_autodrive_motor: '🚗 자율주행 자동차 %1 모터를 %2 에 연결 %3', + robotis_openCM70_cm_autodrive_ir: '🚗 자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', + robotis_openCM70_cm_autodrive_speed: '🚗 차로를 따라 %1의 속도로 자율주행 %2', robotis_openCM70_aux_motor_speed: '%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', robotis_openCM70_aux_servo_mode: '%1 서보모터 모드를 %2 (으)로 정하기 %3', @@ -417,6 +432,7 @@ Entry.Robotis_carCont.setLanguage = function() { '%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', robotis_openCM70_aux_servo_position: '%1 서보모터 위치를 %2 (으)로 정하기 %3', robotis_openCM70_aux_led_module: '%1 LED 모듈을 %2 (으)로 정하기 %3', + robotis_openCM70_cm_poweroff_timer: '제어기 자동꺼짐 타이머 %1 %2', robotis_openCM70_aux_custom: '%1 사용자 장치를 %2 (으)로 정하기 %3', robotis_openCM70_cm_custom: '직접입력 주소 ( %1 ) (을)를 %2 (으)로 정하기 %3', }, @@ -441,6 +457,9 @@ Entry.Robotis_carCont.setLanguage = function() { '최종 소리 감지횟 수를 0 으로 초기화 합니다.', robotis_openCM70_cm_led: '제어기의 빨간색, 녹색, 파란색 LED 를 켜거나 끕니다.', robotis_openCM70_cm_motion: '제어기에 다운로드 되어있는 모션을 실행합니다.', + robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', + robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', + robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.', robotis_openCM70_aux_servo_mode: '서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.', @@ -450,6 +469,8 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_aux_led_module: 'LED 모듈의 LED 를 켜거나 끕니다.', robotis_openCM70_aux_custom: '사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.', + robotis_openCM70_cm_poweroff_timer: + '제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.', robotis_openCM70_cm_custom_value: '컨트롤 테이블 주소를 직접 입력하여 값을 확인 합니다.
컨트롤 테이블 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.', robotis_openCM70_cm_custom: @@ -482,6 +503,9 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_common_play_motion: '실행', robotis_common_motion: '모션', robotis_common_index_number: '번', + robotis_common_left: '왼쪽', + robotis_common_right: '오른쪽', + robotis_common_minute: '분', robotis_cm_custom: '직접입력 주소', robotis_cm_spring_left: '왼쪽 접촉 센서', robotis_cm_spring_right: '오른쪽 접촉 센서', @@ -535,6 +559,9 @@ Entry.Robotis_carCont.setLanguage = function() { 'Initialize the final number of sound detection %1', robotis_openCM70_cm_led: 'Controller %1 LED %2 %3', robotis_openCM70_cm_motion: 'Play the motion %1 times', + robotis_openCM70_cm_autodrive_motor: 'Autonomous driving car %1 motor uses %2 %3', + robotis_openCM70_cm_autodrive_ir: 'Autonomous driving car %1 IR sensor uses %2 %3', + robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the speed of %1 %2', robotis_openCM70_aux_motor_speed: 'Set the speed of decelerating motor of %1 to %2 , and the output value to %3 %4', robotis_openCM70_aux_servo_mode: 'Set the mode of %1 servo motor to %2 %3', @@ -543,6 +570,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_aux_servo_position: 'Set the position of %1 servo motor to %2 %3', robotis_openCM70_aux_led_module: 'Set the LED module of %1 as %2 %3', robotis_openCM70_aux_custom: 'Set the user device of %1 as %2 %3', + robotis_openCM70_cm_poweroff_timer: 'Set auto-off timer as %1 %2', robotis_openCM70_cm_custom: 'Set the custom address ( %1 ) as %2 %3', }, Helper: { @@ -556,6 +584,9 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_sound_detected_clear: 'Final number of sound detection ', robotis_openCM70_cm_led: 'Turns the red, green, blue LED of the device on or off.', robotis_openCM70_cm_motion: 'Executes the motion downloaded on the device.', + robotis_openCM70_cm_autodrive_motor: 'Specifies the motor port of the autonomous driving car.', + robotis_openCM70_cm_autodrive_ir: 'Specifies the IR sensor port of the autonomous driving car.', + robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the specified speed along the lane.', robotis_openCM70_aux_motor_speed: 'Sets the speed of decelerating motor to the value of 0 - 1023.', robotis_openCM70_aux_servo_mode: @@ -567,6 +598,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_aux_led_module: 'Turns the LED of LED module on or off.', robotis_openCM70_aux_custom: 'Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation of user sensor production.', + robotis_openCM70_cm_poweroff_timer: "Set the controllers auto-off timer.
If there is no communication for the set amount of time, the controller will automatically turn off.", robotis_openCM70_cm_custom_value: 'Checks the value by directly inputting the control table address.
Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation about control table.', robotis_openCM70_cm_custom: @@ -609,6 +641,9 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_common_play_motion: 'Play', robotis_common_motion: 'Motion', robotis_common_index_number: 'Number', + robotis_common_left: 'Left', + robotis_common_right: 'Right', + robotis_common_minute: 'minute(s)', robotis_cm_custom: 'Custom address', robotis_cm_spring_left: 'Left contact sensor', robotis_cm_spring_right: 'Right contact sensor', @@ -1195,16 +1230,22 @@ Entry.Robotis_openCM70.blockMenuBlocks = [ 'robotis_openCM70_cm_sound_detected_clear', 'robotis_openCM70_cm_led', 'robotis_openCM70_cm_motion', + 'robotis_openCM70_cm_autodrive_motor', + 'robotis_openCM70_cm_autodrive_ir', + 'robotis_openCM70_cm_autodrive_speed', 'robotis_openCM70_aux_motor_speed', 'robotis_openCM70_aux_servo_mode', 'robotis_openCM70_aux_servo_speed', 'robotis_openCM70_aux_servo_position', 'robotis_openCM70_aux_led_module', 'robotis_openCM70_aux_custom', + 'robotis_openCM70_cm_poweroff_timer', 'robotis_openCM70_cm_custom_value', 'robotis_openCM70_cm_custom', ]; +let opencm70_last_valid_value = []; + Entry.Robotis_openCM70.getBlocks = function() { return { //region robotis 로보티즈 openCM70 @@ -1597,6 +1638,14 @@ Entry.Robotis_openCM70.getBlocks = function() { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[aux_name]; + if (result == undefined) + { + result = opencm70_last_valid_value[data_default_address]; + } + else + { + opencm70_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2004,6 +2053,220 @@ Entry.Robotis_openCM70.getBlocks = function() { }, syntax: { js: [], py: ['Robotis.opencm70_cm_motion(%1)'] }, }, + robotis_openCM70_cm_autodrive_motor: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_left, 'CM_LEFT'], + [Lang.Blocks.robotis_common_right, 'CM_RIGHT'], + ], + value: 'CM_LEFT', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_port_1, '1'], + [Lang.Blocks.robotis_common_port_2, '2'], + ], + value: '1', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null, null, null], + type: 'robotis_openCM70_cm_autodrive_motor', + }, + paramsKeyMap: { + CM_MOTOR_POSITION: 0, + PORT_NUM: 1, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var motor_position = script.getField('CM_MOTOR_POSITION', script); + var port_num = script.getField('PORT_NUM', script); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + if (motor_position == 'CM_LEFT') { + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_LEFT_MOTOR_PORT[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_LEFT_MOTOR_PORT[1]; + } else if (motor_position == 'CM_RIGHT') { + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_RIGHT_MOTOR_PORT[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_RIGHT_MOTOR_PORT[1]; + } + + data_value = port_num; + + var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_cm_autodrive_motor_port(%1, %2)'] }, + }, + robotis_openCM70_cm_autodrive_ir: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_left, 'CM_LEFT'], + [Lang.Blocks.robotis_common_right, 'CM_RIGHT'], + ], + value: 'CM_LEFT', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_port_3, '3'], + [Lang.Blocks.robotis_common_port_4, '4'], + [Lang.Blocks.robotis_common_port_5, '5'], + [Lang.Blocks.robotis_common_port_6, '6'], + ], + value: '3', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null, null, null], + type: 'robotis_openCM70_cm_autodrive_ir', + }, + paramsKeyMap: { + CM_IR_POSITION: 0, + PORT_NUM: 1, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var ir_position = script.getField('CM_IR_POSITION', script); + var port_num = script.getField('PORT_NUM', script); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + if (ir_position == 'CM_LEFT') { + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_LEFT_IR_PORT[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_LEFT_IR_PORT[1]; + } else if (ir_position == 'CM_RIGHT') { + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_RIGHT_IR_PORT[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE_RIGHT_IR_PORT[1]; + } + + data_value = port_num; + + var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_cm_autodrive_ir_port(%1, %2)'] }, + }, + robotis_openCM70_cm_autodrive_speed: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['100%', '100'], + ['90%', '90'], + ['80%', '80'], + ['70%', '70'], + ['60%', '60'], + ['50%', '50'], + ['40%', '40'], + ['30%', '30'], + ['20%', '20'], + ['10%', '10'], + ['0%', '0'], + ], + value: '80', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null], + type: 'robotis_openCM70_cm_autodrive_speed', + }, + paramsKeyMap: { + CM_AUTODRIVE_SPEED: 0, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var autodrive_speed = script.getField('CM_AUTODRIVE_SPEED', script); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_AUTODRIVE[1]; + data_value = autodrive_speed; + + var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_cm_autodrive_speed(%1)'] }, + }, robotis_openCM70_aux_motor_speed: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, @@ -2504,6 +2767,82 @@ Entry.Robotis_openCM70.getBlocks = function() { }, syntax: { js: [], py: ['Robotis.opencm70_aux_custom(%1, %2)'] }, }, + robotis_openCM70_cm_poweroff_timer: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_off, '0'], + ['1' + Lang.Blocks.robotis_common_minute, '1'], + ['2' + Lang.Blocks.robotis_common_minute, '2'], + ['3' + Lang.Blocks.robotis_common_minute, '3'], + ['4' + Lang.Blocks.robotis_common_minute, '4'], + ['5' + Lang.Blocks.robotis_common_minute, '5'], + ['6' + Lang.Blocks.robotis_common_minute, '6'], + ['7' + Lang.Blocks.robotis_common_minute, '7'], + ['8' + Lang.Blocks.robotis_common_minute, '8'], + ['9' + Lang.Blocks.robotis_common_minute, '9'], + ['10' + Lang.Blocks.robotis_common_minute, '10'], + ['11' + Lang.Blocks.robotis_common_minute, '11'], + ['12' + Lang.Blocks.robotis_common_minute, '12'], + ['13' + Lang.Blocks.robotis_common_minute, '13'], + ['14' + Lang.Blocks.robotis_common_minute, '14'], + ['15' + Lang.Blocks.robotis_common_minute, '15'], + ['16' + Lang.Blocks.robotis_common_minute, '16'], + ['17' + Lang.Blocks.robotis_common_minute, '17'], + ['18' + Lang.Blocks.robotis_common_minute, '18'], + ['19' + Lang.Blocks.robotis_common_minute, '19'], + ['20' + Lang.Blocks.robotis_common_minute, '20'], + ], + value: '0', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null, null], + type: 'robotis_openCM70_cm_poweroff_timer', + }, + paramsKeyMap: { + CM_POWEROFF_TIMER: 0, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var cm_poweroff_timer = script.getField('CM_POWEROFF_TIMER', script); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.CM_POWEROFF_TIMER[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.CM_POWEROFF_TIMER[1]; + data_value = cm_poweroff_timer; + + var data_sendqueue = [ + [data_instruction, data_address, data_length, data_value], + ]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_cm_poweroff_timer(%1)'] }, + }, robotis_openCM70_cm_custom: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, From 6b6cc55b384194e51abbdbdafda334642552ccfe Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Wed, 31 May 2023 16:44:51 +0900 Subject: [PATCH 03/11] =?UTF-8?q?=EB=AA=A8=EC=85=98=EC=8B=A4=ED=96=89=20?= =?UTF-8?q?=EB=B8=94=EB=A1=9D=20=EC=A3=BC=EC=84=9D=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/playground/blocks/hardware/block_robotis.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index 722d5e0f13..cc2b010deb 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -421,7 +421,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_buzzer_melody: '제어기 멜로디 %1 번 연주 %2', robotis_openCM70_cm_sound_detected_clear: '최종소리감지횟수 초기화 %1', robotis_openCM70_cm_led: '제어기 %1 LED %2 %3', - robotis_openCM70_cm_motion: '모션 %1 번 실행 %2', + //robotis_openCM70_cm_motion: '모션 %1 번 실행 %2', robotis_openCM70_cm_autodrive_motor: '🚗 자율주행 자동차 %1 모터를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_ir: '🚗 자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_speed: '🚗 차로를 따라 %1의 속도로 자율주행 %2', @@ -456,7 +456,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_sound_detected_clear: '최종 소리 감지횟 수를 0 으로 초기화 합니다.', robotis_openCM70_cm_led: '제어기의 빨간색, 녹색, 파란색 LED 를 켜거나 끕니다.', - robotis_openCM70_cm_motion: '제어기에 다운로드 되어있는 모션을 실행합니다.', + //robotis_openCM70_cm_motion: '제어기에 다운로드 되어있는 모션을 실행합니다.', robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', @@ -558,7 +558,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_sound_detected_clear: 'Initialize the final number of sound detection %1', robotis_openCM70_cm_led: 'Controller %1 LED %2 %3', - robotis_openCM70_cm_motion: 'Play the motion %1 times', + //robotis_openCM70_cm_motion: 'Play the motion %1 times', robotis_openCM70_cm_autodrive_motor: 'Autonomous driving car %1 motor uses %2 %3', robotis_openCM70_cm_autodrive_ir: 'Autonomous driving car %1 IR sensor uses %2 %3', robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the speed of %1 %2', @@ -583,7 +583,7 @@ Entry.Robotis_carCont.setLanguage = function() { "Plays melody.
If the following sound doesn't play when repeatedly playing melodies, use the block 'flow > wait for X seconds' and execute it again.", robotis_openCM70_cm_sound_detected_clear: 'Final number of sound detection ', robotis_openCM70_cm_led: 'Turns the red, green, blue LED of the device on or off.', - robotis_openCM70_cm_motion: 'Executes the motion downloaded on the device.', + //robotis_openCM70_cm_motion: 'Executes the motion downloaded on the device.', robotis_openCM70_cm_autodrive_motor: 'Specifies the motor port of the autonomous driving car.', robotis_openCM70_cm_autodrive_ir: 'Specifies the IR sensor port of the autonomous driving car.', robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the specified speed along the lane.', @@ -1229,7 +1229,7 @@ Entry.Robotis_openCM70.blockMenuBlocks = [ 'robotis_openCM70_cm_buzzer_melody', 'robotis_openCM70_cm_sound_detected_clear', 'robotis_openCM70_cm_led', - 'robotis_openCM70_cm_motion', + //'robotis_openCM70_cm_motion', 'robotis_openCM70_cm_autodrive_motor', 'robotis_openCM70_cm_autodrive_ir', 'robotis_openCM70_cm_autodrive_speed', @@ -2001,6 +2001,7 @@ Entry.Robotis_openCM70.getBlocks = function() { }, syntax: { js: [], py: ['Robotis.opencm70_cm_led(%1, %2)'] }, }, + /* robotis_openCM70_cm_motion: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, @@ -2053,6 +2054,7 @@ Entry.Robotis_openCM70.getBlocks = function() { }, syntax: { js: [], py: ['Robotis.opencm70_cm_motion(%1)'] }, }, + */ robotis_openCM70_cm_autodrive_motor: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, From ad09815831f17736e25936d1b330d4a1685bf953 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Thu, 1 Jun 2023 21:40:04 +0900 Subject: [PATCH 04/11] =?UTF-8?q?=EC=95=8C=EB=9D=BC=20=EB=B0=B0=EA=B2=BD?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B2=88=ED=98=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocks/hardware/block_robotisRB.js | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/playground/blocks/hardware/block_robotisRB.js b/src/playground/blocks/hardware/block_robotisRB.js index b71bd5c4fc..01ce5bbe62 100644 --- a/src/playground/blocks/hardware/block_robotisRB.js +++ b/src/playground/blocks/hardware/block_robotisRB.js @@ -2814,30 +2814,30 @@ Entry.Robotis_rb.getBlocks = function () { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_car_anim01, '2840'], - [Lang.Blocks.robotis_car_anim02, '2841'], - [Lang.Blocks.robotis_car_anim03, '2842'], - [Lang.Blocks.robotis_car_anim04, '2843'], - [Lang.Blocks.robotis_car_anim05, '2844'], - - [Lang.Blocks.robotis_car_anim06, '2845'], - [Lang.Blocks.robotis_car_anim07, '2846'], - [Lang.Blocks.robotis_car_anim08, '2847'], - [Lang.Blocks.robotis_car_anim09, '2848'], - [Lang.Blocks.robotis_car_anim10, '2849'], - - [Lang.Blocks.robotis_car_anim11, '2850'], - [Lang.Blocks.robotis_car_anim12, '2851'], - [Lang.Blocks.robotis_car_anim13, '2852'], - [Lang.Blocks.robotis_car_anim14, '2853'], - [Lang.Blocks.robotis_car_anim15, '2854'], - - [Lang.Blocks.robotis_car_anim16, '2855'], - [Lang.Blocks.robotis_car_anim17, '2856'], - [Lang.Blocks.robotis_car_anim18, '2857'], - [Lang.Blocks.robotis_car_anim19, '2858'], + [Lang.Blocks.robotis_car_anim01, '3329'], + [Lang.Blocks.robotis_car_anim02, '3330'], + [Lang.Blocks.robotis_car_anim03, '3331'], + [Lang.Blocks.robotis_car_anim04, '3332'], + [Lang.Blocks.robotis_car_anim05, '3333'], + + [Lang.Blocks.robotis_car_anim06, '3334'], + [Lang.Blocks.robotis_car_anim07, '3335'], + [Lang.Blocks.robotis_car_anim08, '3336'], + [Lang.Blocks.robotis_car_anim09, '3337'], + [Lang.Blocks.robotis_car_anim10, '3338'], + + [Lang.Blocks.robotis_car_anim11, '3339'], + [Lang.Blocks.robotis_car_anim12, '3340'], + [Lang.Blocks.robotis_car_anim13, '3341'], + [Lang.Blocks.robotis_car_anim14, '3342'], + [Lang.Blocks.robotis_car_anim15, '3343'], + + [Lang.Blocks.robotis_car_anim16, '3344'], + [Lang.Blocks.robotis_car_anim17, '3345'], + [Lang.Blocks.robotis_car_anim18, '3346'], + [Lang.Blocks.robotis_car_anim19, '3347'], ], - value: '2840', + value: '3329', fontSize: 11, bgColor: EntryStatic.colorSet.block.darken.HARDWARE, arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, From f2fa88796b09f986efa1634f5e7767bd2140eb1d Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Sun, 4 Jun 2023 14:35:30 +0900 Subject: [PATCH 05/11] =?UTF-8?q?=EA=BC=AD=EB=91=90=20=EB=B0=B0=EA=B2=BD/?= =?UTF-8?q?=EC=95=A0=EB=8B=88=EB=A9=94=EC=9D=B4=EC=85=98=20=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20=EC=B6=94=EA=B0=80.=20=EC=88=9C=EC=84=9C=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocks/hardware/block_robotisRB.js | 198 ++++++++++++++++-- .../blocks/hardware/block_robotisRBCar.js | 6 +- .../hardware/block_robotisRBHumanoid.js | 8 +- 3 files changed, 192 insertions(+), 20 deletions(-) diff --git a/src/playground/blocks/hardware/block_robotisRB.js b/src/playground/blocks/hardware/block_robotisRB.js index 01ce5bbe62..103fcb9148 100644 --- a/src/playground/blocks/hardware/block_robotisRB.js +++ b/src/playground/blocks/hardware/block_robotisRB.js @@ -80,12 +80,8 @@ Entry.Robotis_rb.blockMenuBlocks = [ 'robotis_RB_cm_buzzer_index', - 'robotis_RB_car_screen', - 'robotis_RB_car_anim_screen', - - - 'robotis_RB_cm_screen', - 'robotis_RB_cm_anim_screen', + 'robotis_RB_kkokdu_screen', + 'robotis_RB_kkokdu_anim_screen', 'robotis_RB_rsp_screen', 'robotis_RB_LCDBright', @@ -93,11 +89,16 @@ Entry.Robotis_rb.blockMenuBlocks = [ 'robotis_RB_LEDBright', 'robotis_RB_cm_led', - 'robotis_RB_Hello', 'robotis_RB_effectSound', 'robotis_RB_record', 'robotis_RB_playRecord', + + 'robotis_RB_car_screen', + 'robotis_RB_car_anim_screen', + + 'robotis_RB_cm_screen', + 'robotis_RB_cm_anim_screen', 'robotis_openCM70_RGee_go', 'robotis_openCM70_RGee_stop', @@ -105,7 +106,7 @@ Entry.Robotis_rb.blockMenuBlocks = [ 'robotis_dxl_control', 'robotis_dxl_each_control', - + // 'robotis_RB_cm_custom_value', // 'robotis_RB_cm_custom', ]; @@ -126,8 +127,10 @@ Entry.Robotis_rb.setLanguage = function() { robotis_RB_detectPose: "로봇이 %1 넘어지면", robotis_RB_cm_buzzer_index: "제어기 음계값 %1 을(를) %2 옥타브로 %3 초 동안 %4 %5", - robotis_RB_cm_screen: "제어기 화면 배경을 알쥐 %1 로 선택 %2", - robotis_RB_cm_anim_screen: "제어기 화면 애니메이션을 알쥐 %1 로 선택 %2", + + robotis_RB_kkokdu_screen: "제어기 화면 배경을 꼭두 %1 로 선택 %2", + robotis_RB_kkokdu_anim_screen: "제어기 화면 애니메이션을 꼭두 %1 로 선택 %2", + robotis_RB_rsp_screen: "제어기 화면에 %1 출력하기 %2", robotis_RB_LCDBright: "제어기 화면 밝기를 %1로 정하기 %2", @@ -144,8 +147,11 @@ Entry.Robotis_rb.setLanguage = function() { robotis_openCM70_RGee_stop: "알쥐 정지하기 %1", robotis_openCM70_RGee_motion: "알쥐 %1 %2", + robotis_RB_cm_screen: "제어기 화면 배경을 알쥐 %1 로 선택 %2", + robotis_RB_cm_anim_screen: "제어기 화면 애니메이션을 알쥐 %1 로 선택 %2", + robotis_RB_car_screen: "제어기 화면 배경을 알라 %1 로 선택 %2", - robotis_RB_car_anim_screen: "제어기 화면 애니메이션을 알라 %1 로 선택 %2" + robotis_RB_car_anim_screen: "제어기 화면 애니메이션을 알라 %1 로 선택 %2", }, Blocks: { robotis_red: "빨강", @@ -350,8 +356,10 @@ Entry.Robotis_rb.setLanguage = function() { robotis_RB_detectPose:"If robot falls %1", robotis_RB_cm_buzzer_index:"%1 at %2 octaves for %3 second(s) -> %4 %5", - robotis_RB_cm_screen:"Choose %1 as a screen background %2", - robotis_RB_cm_anim_screen: "Choose %1 as a screen animation %2", + + robotis_RB_kkokdu_screen: "Choose %1 Tiger as a screen background %2", + robotis_RB_kkokdu_anim_screen: "Choose %1 Tiger as a screen animation %2", + robotis_RB_rsp_screen:"Print %1 on the screen %2", robotis_RB_LCDBright:"Adjust screen brightness to %1 %2", @@ -368,8 +376,11 @@ Entry.Robotis_rb.setLanguage = function() { robotis_openCM70_RGee_stop:"R-G STOP", robotis_openCM70_RGee_motion:"Do %1", - robotis_RB_car_screen: "Choose %1 as a screen Rla background %2", - robotis_RB_car_anim_screen: "Choose %1 as a screen Rla animation %2" + robotis_RB_cm_screen:"Choose %1 R-Gee as a screen background %2", + robotis_RB_cm_anim_screen: "Choose %1 R-Gee as a screen animation %2", + + robotis_RB_car_screen: "Choose %1 R-La as a screen background %2", + robotis_RB_car_anim_screen: "Choose %1 R-La as a screen animation %2", }, Blocks: { robotis_red: "Red", @@ -2636,6 +2647,163 @@ Entry.Robotis_rb.getBlocks = function () { py: ['Robotis.opencm70_cm_buzzer_index(%1, %2)'], }, }, + + + robotis_RB_kkokdu_screen: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_car_anim01, '3585'], + [Lang.Blocks.robotis_car_anim02, '3586'], + [Lang.Blocks.robotis_car_anim03, '3587'], + [Lang.Blocks.robotis_car_anim04, '3588'], + [Lang.Blocks.robotis_car_anim05, '3589'], + + [Lang.Blocks.robotis_car_anim06, '3590'], + [Lang.Blocks.robotis_car_anim07, '3591'], + [Lang.Blocks.robotis_car_anim08, '3592'], + [Lang.Blocks.robotis_car_anim09, '3593'], + [Lang.Blocks.robotis_car_anim10, '3594'], + + [Lang.Blocks.robotis_car_anim11, '3595'], + [Lang.Blocks.robotis_car_anim12, '3596'], + [Lang.Blocks.robotis_car_anim13, '3597'], + [Lang.Blocks.robotis_car_anim14, '3598'], + [Lang.Blocks.robotis_car_anim15, '3599'], + + [Lang.Blocks.robotis_car_anim16, '3600'], + [Lang.Blocks.robotis_car_anim17, '3601'], + [Lang.Blocks.robotis_car_anim18, '3602'], + [Lang.Blocks.robotis_car_anim19, '3603'], + ], + value: '3585', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null], + type: 'robotis_RB_kkokdu_screen', + }, + paramsKeyMap: { + BACKGROUND: 0, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['Robotis_rb', 'Robotis_rb_H', 'Robotis_rb_car'], + func: function (sprite, script) { + // instruction / address / length / value / default length + var screenValue = script.getNumberValue('BACKGROUND', script); + + var data_instruction = Entry.Robotis_rb.INSTRUCTION.WRITE; + var data_address = 163; + var data_length = 2; + var data_value = screenValue; + + var data_sendqueue = [ + [data_instruction, data_address, data_length, data_value], + [3, 162, 1, 1] + ]; + + + + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + 1000 + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_cm_screen(%1)'] }, + }, + + robotis_RB_kkokdu_anim_screen: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_car_anim01, '31234'], + [Lang.Blocks.robotis_car_anim02, '31237'], + [Lang.Blocks.robotis_car_anim03, '31238'], + [Lang.Blocks.robotis_car_anim04, '31239'], + [Lang.Blocks.robotis_car_anim05, '31240'], + + [Lang.Blocks.robotis_car_anim06, '31241'], + [Lang.Blocks.robotis_car_anim07, '31242'], + [Lang.Blocks.robotis_car_anim08, '31243'], + [Lang.Blocks.robotis_car_anim09, '31244'], + [Lang.Blocks.robotis_car_anim10, '31245'], + + [Lang.Blocks.robotis_car_anim11, '31246'], + [Lang.Blocks.robotis_car_anim12, '31247'], + [Lang.Blocks.robotis_car_anim13, '31248'], + [Lang.Blocks.robotis_car_anim14, '31249'], + [Lang.Blocks.robotis_car_anim15, '31250'], + + [Lang.Blocks.robotis_car_anim16, '31251'], + [Lang.Blocks.robotis_car_anim17, '31252'], + [Lang.Blocks.robotis_car_anim18, '31253'], + [Lang.Blocks.robotis_car_anim19, '31254'], + ], + value: '31234', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null], + type: 'robotis_RB_kkokdu_anim_screen', + }, + paramsKeyMap: { + BACKGROUND: 0, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['Robotis_rb', 'Robotis_rb_H', 'Robotis_rb_car'], + func: function (sprite, script) { + // instruction / address / length / value / default length + var screenValue = script.getNumberValue('BACKGROUND', script); + + var data_instruction = Entry.Robotis_rb.INSTRUCTION.WRITE; + var data_address = 163; + var data_length = 2; + var data_value = screenValue; + + var data_sendqueue = [ + [data_instruction, data_address, data_length, data_value], + [3, 162, 1, 1] + ]; + + + + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay //+ 1000 + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_cm_screen(%1)'] }, + }, robotis_RB_cm_screen: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, diff --git a/src/playground/blocks/hardware/block_robotisRBCar.js b/src/playground/blocks/hardware/block_robotisRBCar.js index 476549b15e..7b840bb097 100644 --- a/src/playground/blocks/hardware/block_robotisRBCar.js +++ b/src/playground/blocks/hardware/block_robotisRBCar.js @@ -84,9 +84,6 @@ Entry.Robotis_rb_car.blockMenuBlocks = [ //화면 애니메이션 'robotis_RB_car_screen', 'robotis_RB_car_anim_screen', - - 'robotis_RB_cm_screen', - 'robotis_RB_cm_anim_screen', 'robotis_RB_rsp_screen', 'robotis_RB_LCDBright', @@ -99,6 +96,9 @@ Entry.Robotis_rb_car.blockMenuBlocks = [ 'robotis_RB_effectSound', 'robotis_RB_record', 'robotis_RB_playRecord', + + 'robotis_RB_cm_screen', + 'robotis_RB_cm_anim_screen', 'robotis_openCM70_RLa_go', 'robotis_openCM70_RLa_stop', diff --git a/src/playground/blocks/hardware/block_robotisRBHumanoid.js b/src/playground/blocks/hardware/block_robotisRBHumanoid.js index fb289009ca..817f15993e 100644 --- a/src/playground/blocks/hardware/block_robotisRBHumanoid.js +++ b/src/playground/blocks/hardware/block_robotisRBHumanoid.js @@ -85,8 +85,9 @@ Entry.Robotis_rb_H.blockMenuBlocks = [ 'robotis_RB_detectPose', 'robotis_RB_cm_buzzer_index', - 'robotis_RB_cm_screen', - 'robotis_RB_cm_anim_screen', + + 'robotis_RB_kkokdu_screen', + 'robotis_RB_kkokdu_anim_screen', 'robotis_RB_rsp_screen', 'robotis_RB_LCDBright', @@ -100,6 +101,9 @@ Entry.Robotis_rb_H.blockMenuBlocks = [ 'robotis_RB_record', 'robotis_RB_playRecord', + 'robotis_RB_cm_screen', + 'robotis_RB_cm_anim_screen', + 'robotis_RB_cm_motion', 'robotis_RB_cm_motion2', 'robotis_RB_cm_motion_custom', From 00a50894480e4e6022ae54788aadb6e85ac9db73 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Tue, 6 Jun 2023 21:50:02 +0900 Subject: [PATCH 06/11] =?UTF-8?q?RB-100=20=EC=A0=9C=EC=96=B4=EA=B8=B0=20?= =?UTF-8?q?=EA=B0=92=20undefined=EB=A1=9C=20=EC=9D=BD=EC=96=B4=EC=98=AC=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EB=A7=88=EC=A7=80=EB=A7=89=20=EC=9C=A0?= =?UTF-8?q?=ED=9A=A8=EA=B0=92=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocks/hardware/block_robotisRB.js | 99 ++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/src/playground/blocks/hardware/block_robotisRB.js b/src/playground/blocks/hardware/block_robotisRB.js index 103fcb9148..408c1b78ea 100644 --- a/src/playground/blocks/hardware/block_robotisRB.js +++ b/src/playground/blocks/hardware/block_robotisRB.js @@ -575,6 +575,7 @@ Entry.Robotis_rb.setLanguage = function() { } }; +let rb100_last_valid_value = []; Entry.Robotis_rb.getBlocks = function () { return { @@ -770,6 +771,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -881,6 +890,15 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } + Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -978,6 +996,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -1106,12 +1132,19 @@ Entry.Robotis_rb.getBlocks = function () { var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; if(result == undefined) { - console.log('언디파인') return false; } @@ -1342,6 +1375,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -1900,6 +1941,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2000,6 +2049,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2082,6 +2139,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2189,6 +2254,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2282,6 +2355,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2382,6 +2463,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; @@ -2488,6 +2577,14 @@ Entry.Robotis_rb.getBlocks = function () { Entry.Robotis_carCont.update(); var result = Entry.hw.portData[data_default_address]; + if (result == undefined) + { + result = rb100_last_valid_value[data_default_address]; + } + else + { + rb100_last_valid_value[data_default_address] = result; + } Entry.hw.sendQueue.prevAddress = data_default_address; Entry.hw.sendQueue.prevTime = new Date(); Entry.hw.sendQueue.prevResult = result; From 65d2c5a03f9db100835dd1a19d2e5f34d0b74f63 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Tue, 6 Jun 2023 22:41:22 +0900 Subject: [PATCH 07/11] =?UTF-8?q?=EC=8B=A4=EA=B3=BC=EB=A1=9C=EB=B4=87=20?= =?UTF-8?q?=EA=B0=90=EC=86=8D=EB=AA=A8=ED=84=B0=20=EC=86=8D=EB=8F=84,=20?= =?UTF-8?q?=EC=84=9C=EB=B3=B4=EB=AA=A8=ED=84=B0=20=EC=86=8D=EB=8F=84=20?= =?UTF-8?q?=EB=B2=94=EC=9C=84=EB=A5=BC=200~100%=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EC=8B=A4=EA=B3=BC=EB=A1=9C=EB=B4=87=20=EC=84=9C?= =?UTF-8?q?=EB=B3=B4=EB=AA=A8=ED=84=B0=20=EC=9C=84=EC=B9=98=20=EB=B2=94?= =?UTF-8?q?=EC=9C=84=EB=A5=BC=20-150=EB=8F=84~150=EB=8F=84=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/code.js | 12 ++-- extern/lang/ebs.js | 12 ++-- extern/lang/en.js | 10 +-- extern/lang/jp.js | 12 ++-- extern/lang/ko.js | 12 ++-- extern/lang/vn.js | 12 ++-- .../blocks/hardware/block_robotis.js | 64 +++++++++++++------ 7 files changed, 80 insertions(+), 54 deletions(-) diff --git a/extern/lang/code.js b/extern/lang/code.js index 89445d35c3..816cbac1ae 100644 --- a/extern/lang/code.js +++ b/extern/lang/code.js @@ -5432,10 +5432,10 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_speed": "차로를 따라 지정한 속도로 자율주행을 수행합니다.", - "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", + "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 100% 의 값(으)로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", - "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", - "robotis_openCM70_aux_servo_position": "서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", + "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 100% 의 값(으)로 정합니다.", + "robotis_openCM70_aux_servo_position": "서보모터 위치를 -150도 ~ 150도 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", "robotis_openCM70_aux_led_module": "LED 모듈의 LED 를 켜거나 끕니다.", "robotis_openCM70_aux_custom": "사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "robotis_openCM70_cm_poweroff_timer": "제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.", @@ -6346,10 +6346,10 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차 %1모터를 %2 에 연결 %3", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차 %1적외선센서를 %2 에 연결 %3", "robotis_openCM70_cm_autodrive_speed": "차로를 따라 %1의 속도로 자율주행 %2", - "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", + "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2, 출력값을 %3%로 정하기 %4", "robotis_openCM70_aux_servo_mode": "%1 서보모터 모드를 %2 (으)로 정하기 %3", - "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", - "robotis_openCM70_aux_servo_position": "%1 서보모터 위치를 %2 (으)로 정하기 %3", + "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2, 출력값을 %3%로 정하기 %4", + "robotis_openCM70_aux_servo_position": "%1 서보모터 위치를 %2도로 정하기 %3", "robotis_openCM70_aux_led_module": "%1 LED 모듈을 %2 (으)로 정하기 %3", "robotis_openCM70_aux_custom": "%1 사용자 장치를 %2 (으)로 정하기 %3", "robotis_openCM70_cm_poweroff_timer": "제어기 자동꺼짐 타이머 %1 %2", diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 8ffac37975..6da5e0a199 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -5444,10 +5444,10 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_speed": "지정한 속도로 자율주행을 수행합니다.", - "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", + "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 100% 의 값으로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", - "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", - "robotis_openCM70_aux_servo_position": "서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", + "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 100% 의 값으로 정합니다.", + "robotis_openCM70_aux_servo_position": "서보모터 위치를 -150도 ~ 150도 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", "robotis_openCM70_aux_led_module": "LED 모듈의 LED 를 켜거나 끕니다.", "robotis_openCM70_aux_custom": "사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "robotis_openCM70_cm_poweroff_timer": "제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.", @@ -6362,10 +6362,10 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차 %1 모터를 %2 에 연결 %3", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차 %1 적외선센서를 %2 에 연결 %3", "robotis_openCM70_cm_autodrive_speed": "차로를 따라 %1의 속도로 자율주행 %2", - "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", + "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2 , 출력값을 %3%로 정하기 %4", "robotis_openCM70_aux_servo_mode": "%1 서보모터 모드를 %2 (으)로 정하기 %3", - "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4", - "robotis_openCM70_aux_servo_position": "%1 서보모터 위치를 %2 (으)로 정하기 %3", + "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2 , 출력값을 %3%로 정하기 %4", + "robotis_openCM70_aux_servo_position": "%1 서보모터 위치를 %2도로 정하기 %3", "robotis_openCM70_aux_led_module": "%1 LED 모듈을 %2 (으)로 정하기 %3", "robotis_openCM70_aux_custom": "%1 사용자 장치를 %2 (으)로 정하기 %3", "robotis_openCM70_cm_poweroff_timer": "제어기 자동꺼짐 타이머 %1 %2", diff --git a/extern/lang/en.js b/extern/lang/en.js index 4e11067977..3390df6ef9 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -4651,10 +4651,10 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "Specifies the motor port of the autonomous driving car.", "robotis_openCM70_cm_autodrive_ir": "Specifies the IR sensor port of the autonomous driving car.", "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the specified speed along the lane.", - "robotis_openCM70_aux_motor_speed": "Sets the speed of decelerating motor to the value of 0 - 1023.", + "robotis_openCM70_aux_motor_speed": "Sets the speed of decelerating motor to the value of 0 - 100%.", "robotis_openCM70_aux_servo_mode": "Sets the servo motor as wheel mode or joint mode.
The same mode continues to apply once it's set.
Wheel mode designates the servo motor's speed, and spins the servo motor.
Joint mode moves the servo motor's position with the set servo motor speed.", "robotis_openCM70_aux_servo_speed": "Sets servo motor's speed to the value of 0 - 1023.", - "robotis_openCM70_aux_servo_position": "Sets servo motor's position to the value of 0-1023.
Use as servo motor speed", + "robotis_openCM70_aux_servo_position": "Sets servo motor's position to the value of -150 - 150 degree.
Use as servo motor speed", "robotis_openCM70_aux_led_module": "Turns the LED of LED module on or off.", "robotis_openCM70_aux_custom": "Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation of user sensor production.", "robotis_openCM70_cm_poweroff_timer": "Set the controller's auto-off timer.
If there is no communication for the set amount of time, the controller will automatically turn off.", @@ -5572,10 +5572,10 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "Autonomous driving car %1 motor uses %2 %3", "robotis_openCM70_cm_autodrive_ir": "Autonomous driving car %1 IR sensor uses %2 %3", "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the speed of %1 %2", - "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3 %4", + "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3% %4", "robotis_openCM70_aux_servo_mode": "Set the mode of %1 servo motor to %2 %3", - "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3 %4", - "robotis_openCM70_aux_servo_position": "Set the position of %1 servo motor to %2 %3", + "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3% %4", + "robotis_openCM70_aux_servo_position": "Set the position of %1 servo motor to %2 degree %3", "robotis_openCM70_aux_led_module": "Set the LED module of %1 as %2 %3", "robotis_openCM70_aux_custom": "Set the user device of %1 as %2 %3", "robotis_openCM70_cm_poweroff_timer": "Set auto-off timer as %1 %2", diff --git a/extern/lang/jp.js b/extern/lang/jp.js index b4bbb5c4cf..badab679f1 100644 --- a/extern/lang/jp.js +++ b/extern/lang/jp.js @@ -5436,10 +5436,10 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_speed": "지정한 속도로 자율주행을 수행합니다.", - "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", + "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 100% 의 값으로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", - "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.", - "robotis_openCM70_aux_servo_position": "서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", + "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 100% 의 값으로 정합니다.", + "robotis_openCM70_aux_servo_position": "서보모터 위치를 -150도 ~ 150도 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.", "robotis_openCM70_aux_led_module": "LED 모듈의 LED 를 켜거나 끕니다.", "robotis_openCM70_aux_custom": "사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.", "robotis_openCM70_cm_poweroff_timer": "제어기의 자동꺼짐 타이머를 설정합니다.
설정된 만큼의 시간동안 통신이 진행되지 않으면 제어기는 자동으로 꺼집니다.", @@ -6352,10 +6352,10 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "Autonomous driving car %1 motor uses %2 %3", "robotis_openCM70_cm_autodrive_ir": "Autonomous driving car %1 IR sensor uses %2 %3", "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the speed of %1 %2", - "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3 %4", + "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3% %4", "robotis_openCM70_aux_servo_mode": "Set the mode of %1 servo motor to %2 %3", - "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3 %4", - "robotis_openCM70_aux_servo_position": "Set the position of %1 servo motor to %2 %3", + "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3% %4", + "robotis_openCM70_aux_servo_position": "Set the position of %1 servo motor to %2 degree %3", "robotis_openCM70_aux_led_module": "Set the LED module of %1 as %2 %3", "robotis_openCM70_aux_custom": "Set the user device of %1 as %2 %3", "robotis_openCM70_cm_poweroff_timer": "Set auto-off timer as %1 %2", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 02883b5614..5886bfe223 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -5995,12 +5995,12 @@ Lang.Helper = { robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', - robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.', + robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 100% 의 값으로 정합니다.', robotis_openCM70_aux_servo_mode: '서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.', - robotis_openCM70_aux_servo_speed: '서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.', + robotis_openCM70_aux_servo_speed: '서보모터 속도를 0 ~ 100% 의 값으로 정합니다.', robotis_openCM70_aux_servo_position: - '서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.', + '서보모터 위치를 -150도 ~ 150도 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.', robotis_openCM70_aux_led_module: 'LED 모듈의 LED 를 켜거나 끕니다.', robotis_openCM70_aux_custom: '사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.', @@ -7370,10 +7370,10 @@ Lang.template = { robotis_openCM70_cm_autodrive_motor: '자율주행 자동차 %1 모터를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_speed: '차로를 따라 %1의 속도로 자율주행 %2', - robotis_openCM70_aux_motor_speed: '%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', + robotis_openCM70_aux_motor_speed: '%1 감속모터 속도를 %2 , 출력값을 %3%로 정하기 %4', robotis_openCM70_aux_servo_mode: '%1 서보모터 모드를 %2 (으)로 정하기 %3', - robotis_openCM70_aux_servo_speed: '%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', - robotis_openCM70_aux_servo_position: '%1 서보모터 위치를 %2 (으)로 정하기 %3', + robotis_openCM70_aux_servo_speed: '%1 서보모터 속도를 %2 , 출력값을 %3%로 정하기 %4', + robotis_openCM70_aux_servo_position: '%1 서보모터 위치를 %2도로 정하기 %3', robotis_openCM70_aux_led_module: '%1 LED 모듈을 %2 (으)로 정하기 %3', robotis_openCM70_cm_poweroff_timer: '제어기 자동꺼짐 타이머 %1 %2', robotis_openCM70_aux_custom: '%1 사용자 장치를 %2 (으)로 정하기 %3', diff --git a/extern/lang/vn.js b/extern/lang/vn.js index 6514397ba5..24fc13451c 100644 --- a/extern/lang/vn.js +++ b/extern/lang/vn.js @@ -5435,10 +5435,10 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "Chỉ định cổng động cơ của ô tô lái tự động.", "robotis_openCM70_cm_autodrive_ir": "Chỉ định cổng cảm biến hồng ngoại của xe lái tự động.", "robotis_openCM70_cm_autodrive_speed": "Lái xe tự động được thực hiện ở tốc độ quy định dọc theo làn đường.", - "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ của động cơ giảm tốc với giá trị 0-1023.", + "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ của động cơ giảm tốc với giá trị 0-100%.", "robotis_openCM70_aux_servo_mode": "Thiết lập động cơ servo như chế độ bánh xe hoặc chế độ chung.
Các chế độ tương tự vẫn tiếp tục áp dụng một khi đã cài đặt.
Chế độ bánh xe chỉ định tốc độ động cơ servo, và quay động cơ servo.
Chọn chế độ di chuyển vị trí của động cơ servo và tốc độ động cơ servo.", - "robotis_openCM70_aux_servo_speed": "Cài đặt tốc độ của động cơ servo với giá trị từ 0 - 1023. ", - "robotis_openCM70_aux_servo_position": "Cài đặt vị trí của động cơ servo với giá trị từ 0 - 1023.
Sử dụng như tốc độ động cơ servo", + "robotis_openCM70_aux_servo_speed": "Cài đặt tốc độ của động cơ servo với giá trị từ 0 - 100%. ", + "robotis_openCM70_aux_servo_position": "Cài đặt vị trí của động cơ servo với giá trị từ -150 - 150 độ.
Sử dụng như tốc độ động cơ servo", "robotis_openCM70_aux_led_module": "Bật hoặc tắt các mô-đun LED của LED.", "robotis_openCM70_aux_custom": "Vui lòng tham khảo ROBOTIS e-manual (http://support.robotis.com/ko/) để được giải thích về người sử dụng cảm biến sản xuất.", "robotis_openCM70_cm_poweroff_timer": "Đặt bộ hẹn giờ tự động tắt của bộ điều khiển.
Nếu giao tiếp không diễn ra trong khoảng thời gian đã đặt, bộ điều khiển sẽ tự động tắt.", @@ -6349,10 +6349,10 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "Ô tô lái tự động %1 sử dụng động cơ %2 %3", "robotis_openCM70_cm_autodrive_ir": "Ô tô tự lái %1 sử dụng cảm biến hồng ngoại %2 %3", "robotis_openCM70_cm_autodrive_speed": "Thực hiện lái xe tự trị ở tốc độ %1 %2", - "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ giảm tốc động cơ của %1 tới %2 , và giá trị đầu ra đến %3 %4", + "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ giảm tốc động cơ của %1 tới %2 , và giá trị đầu ra đến %3% %4", "robotis_openCM70_aux_servo_mode": "Thiết lập chế độ của %1 động cơ servo bằng %2 %3", - "robotis_openCM70_aux_servo_speed": "Thiết lập tốc độ tốc động cơ servo của %1 tới %2, và giá trị đầu ra đến %3 %4", - "robotis_openCM70_aux_servo_position": "Thiết lập vị trí của %1 động cơ servo bằng %2 %3", + "robotis_openCM70_aux_servo_speed": "Thiết lập tốc độ tốc động cơ servo của %1 tới %2, và giá trị đầu ra đến %3% %4", + "robotis_openCM70_aux_servo_position": "Thiết lập vị trí của %1 động cơ servo bằng %2 độ %3", "robotis_openCM70_aux_led_module": "thiết lập %1 mô-đun LED như %2 %3", "robotis_openCM70_aux_custom": "thiết lập %1 thiết bị người dùng như %2 %3", "robotis_openCM70_cm_poweroff_timer": "Bộ hẹn giờ tự động tắt bộ điều khiển %1 %2", diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index cc2b010deb..9ce9ee7da5 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -426,11 +426,11 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_ir: '🚗 자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_speed: '🚗 차로를 따라 %1의 속도로 자율주행 %2', robotis_openCM70_aux_motor_speed: - '%1 감속모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', + '%1 감속모터 속도를 %2 , 출력값을 %3%로 정하기 %4', robotis_openCM70_aux_servo_mode: '%1 서보모터 모드를 %2 (으)로 정하기 %3', robotis_openCM70_aux_servo_speed: - '%1 서보모터 속도를 %2 , 출력값을 %3 (으)로 정하기 %4', - robotis_openCM70_aux_servo_position: '%1 서보모터 위치를 %2 (으)로 정하기 %3', + '%1 서보모터 속도를 %2 , 출력값을 %3%로 정하기 %4', + robotis_openCM70_aux_servo_position: '%1 서보모터 위치를 %2도로 정하기 %3', robotis_openCM70_aux_led_module: '%1 LED 모듈을 %2 (으)로 정하기 %3', robotis_openCM70_cm_poweroff_timer: '제어기 자동꺼짐 타이머 %1 %2', robotis_openCM70_aux_custom: '%1 사용자 장치를 %2 (으)로 정하기 %3', @@ -460,12 +460,12 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', - robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 1023 의 값(으)로 정합니다.', + robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 100% 의 값으로 정합니다.', robotis_openCM70_aux_servo_mode: '서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.', - robotis_openCM70_aux_servo_speed: '서보모터 속도를 0 ~ 1023 의 값(으)로 정합니다.', + robotis_openCM70_aux_servo_speed: '서보모터 속도를 0 ~ 100% 의 값으로 정합니다.', robotis_openCM70_aux_servo_position: - '서보모터 위치를 0 ~ 1023 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.', + '서보모터 위치를 -150 ~ 150도 의 값(으)로 정합니다.
서보모터 속도와 같이 사용해야 합니다.', robotis_openCM70_aux_led_module: 'LED 모듈의 LED 를 켜거나 끕니다.', robotis_openCM70_aux_custom: '사용자 센서 제작에 대한 설명은 ROBOTIS e-매뉴얼(http://support.robotis.com/ko/)을 참고하세요.', @@ -563,11 +563,11 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_ir: 'Autonomous driving car %1 IR sensor uses %2 %3', robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the speed of %1 %2', robotis_openCM70_aux_motor_speed: - 'Set the speed of decelerating motor of %1 to %2 , and the output value to %3 %4', + 'Set the speed of decelerating motor of %1 to %2 , and the output value to %3% %4', robotis_openCM70_aux_servo_mode: 'Set the mode of %1 servo motor to %2 %3', robotis_openCM70_aux_servo_speed: - 'Set the speed of servo motor of %1 to %2 , and the output value to %3 %4', - robotis_openCM70_aux_servo_position: 'Set the position of %1 servo motor to %2 %3', + 'Set the speed of servo motor of %1 to %2 , and the output value to %3% %4', + robotis_openCM70_aux_servo_position: 'Set the position of %1 servo motor to %2 degree %3', robotis_openCM70_aux_led_module: 'Set the LED module of %1 as %2 %3', robotis_openCM70_aux_custom: 'Set the user device of %1 as %2 %3', robotis_openCM70_cm_poweroff_timer: 'Set auto-off timer as %1 %2', @@ -588,13 +588,13 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_ir: 'Specifies the IR sensor port of the autonomous driving car.', robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the specified speed along the lane.', robotis_openCM70_aux_motor_speed: - 'Sets the speed of decelerating motor to the value of 0 - 1023.', + 'Sets the speed of decelerating motor to the value of 0 - 100%.', robotis_openCM70_aux_servo_mode: "Sets the servo motor as wheel mode or joint mode.
The same mode continues to apply once it's set.
Wheel mode designates the servo motor's speed, and spins the servo motor.
Joint mode moves the servo motor's position with the set servo motor speed.", robotis_openCM70_aux_servo_speed: "Sets servo motor's speed to the value of 0 - 1023.", robotis_openCM70_aux_servo_position: - "Sets servo motor's position to the value of 0-1023.
Use as servo motor speed", + "Sets servo motor's position to the value of -150 ~ 150 degree.
Use as servo motor speed", robotis_openCM70_aux_led_module: 'Turns the LED of LED module on or off.', robotis_openCM70_aux_custom: 'Please refer to the ROBOTIS e-manual (http://support.robotis.com/ko/) for the explanation of user sensor production.', @@ -1644,6 +1644,17 @@ Entry.Robotis_openCM70.getBlocks = function() { } else { + if (sensor == 'AUX_SERVO_POSITION') { + if (result < 0) result = 0; + else if (result > 1023) result = 1023; + + result = (512 - result) * 300 / 1023; + + result = Math.floor(result * 9 / 8); + + if (result > 150) result = 150; + else if (result < -150) result = -150; + } opencm70_last_valid_value[data_default_address] = result; } Entry.hw.sendQueue.prevAddress = data_default_address; @@ -2314,7 +2325,7 @@ Entry.Robotis_openCM70.getBlocks = function() { null, { type: 'number', - params: ['500'], + params: ['50'], }, null, ], @@ -2343,6 +2354,11 @@ Entry.Robotis_openCM70.getBlocks = function() { data_address = data_address + (port - 1) * data_length; + if (value < 0) value = 0; + else if (value > 100) value = 100; + + value = Math.floor(value * 1023 / 100); + if (directionAngle == 'CW') { value = value + 1024; if (value > 2047) { @@ -2487,7 +2503,7 @@ Entry.Robotis_openCM70.getBlocks = function() { null, { type: 'number', - params: ['500'], + params: ['50'], }, null, ], @@ -2516,6 +2532,11 @@ Entry.Robotis_openCM70.getBlocks = function() { data_address = data_address + (port - 1) * data_length; + if (value < 0) value = 0; + else if (value > 100) value = 100; + + value = Math.floor(value * 1023 / 100); + if (directionAngle == 'CW') { value = value + 1024; if (value > 2047) { @@ -2576,7 +2597,7 @@ Entry.Robotis_openCM70.getBlocks = function() { null, { type: 'number', - params: ['512'], + params: ['0'], }, null, ], @@ -2603,13 +2624,18 @@ Entry.Robotis_openCM70.getBlocks = function() { data_address = data_address + (port - 1) * data_length; - if (value > 1023) { - value = 1023; - } else if (value < 0) { - value = 0; + if (value > 150) { + value = 150; + } else if (value < -150) { + value = -150; } - data_value = value; + value = value * 8 / 9; + + data_value = 512 - Math.floor(value * 1023 / 300); + + if (data_value < 0) data_value = 0; + else if (data_value > 1023) data_value = 1023; var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; return Entry.Robotis_carCont.postCallReturn( From c4b19d4fa4af507e41a9e24a7e0144673524ab23 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Tue, 6 Jun 2023 22:47:34 +0900 Subject: [PATCH 08/11] =?UTF-8?q?=EC=8B=A4=EA=B3=BC=EB=A1=9C=EB=B4=87=20?= =?UTF-8?q?=EA=B0=90=EC=86=8D=EB=AA=A8=ED=84=B0=204=EB=B0=94=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=86=8D=EB=8F=84=EC=84=A4=EC=A0=95=20=ED=8A=B9?= =?UTF-8?q?=EB=B3=84=EC=B2=98=EB=A6=AC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/playground/blocks/hardware/block_robotis.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index 9ce9ee7da5..18d1b8cd10 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -4646,6 +4646,13 @@ Entry.Robotis_openCM70.getPracticalBlocks = function() { } } } + + if ( value < 1024) { + value = value + (value + 1024) * 0x10000; + } + else { + value = value + (value - 1024) * 0x10000; + } data_value = value; @@ -4787,6 +4794,13 @@ Entry.Robotis_openCM70.getPracticalBlocks = function() { } } } + + if ( value < 1024) { + value = value + (value + 1024) * 0x10000; + } + else { + value = value + (value - 1024) * 0x10000; + } data_value = value; From 955ddc6dd4504a8635197a709453cbfc4210aa04 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Tue, 6 Jun 2023 22:56:43 +0900 Subject: [PATCH 09/11] =?UTF-8?q?=EC=8B=A4=EA=B3=BC=EB=A1=9C=EB=B4=87=20?= =?UTF-8?q?=EC=A7=80=EC=A0=95=EC=86=8D=EB=8F=84=20=EC=A3=BC=ED=96=89?= =?UTF-8?q?=EB=B8=94=EB=A1=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 2 + extern/lang/en.js | 2 + extern/lang/jp.js | 2 + extern/lang/ko.js | 2 + extern/lang/vn.js | 2 + .../blocks/hardware/block_robotis.js | 95 ++++++++++--------- 6 files changed, 58 insertions(+), 47 deletions(-) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 6da5e0a199..4ddba3d41f 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -5444,6 +5444,7 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_speed": "지정한 속도로 자율주행을 수행합니다.", + "robotis_openCM70_aux_car_move": "로봇을 지정한 속도와 방향으로 움직이도록 합니다.", "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 100% 의 값으로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 100% 의 값으로 정합니다.", @@ -6362,6 +6363,7 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차 %1 모터를 %2 에 연결 %3", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차 %1 적외선센서를 %2 에 연결 %3", "robotis_openCM70_cm_autodrive_speed": "차로를 따라 %1의 속도로 자율주행 %2", + "robotis_openCM70_aux_car_move": "로봇을 %1% 의 속도로 %2 %3", "robotis_openCM70_aux_motor_speed": "%1 감속모터 속도를 %2 , 출력값을 %3%로 정하기 %4", "robotis_openCM70_aux_servo_mode": "%1 서보모터 모드를 %2 (으)로 정하기 %3", "robotis_openCM70_aux_servo_speed": "%1 서보모터 속도를 %2 , 출력값을 %3%로 정하기 %4", diff --git a/extern/lang/en.js b/extern/lang/en.js index 3390df6ef9..3b99b5641d 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -4651,6 +4651,7 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "Specifies the motor port of the autonomous driving car.", "robotis_openCM70_cm_autodrive_ir": "Specifies the IR sensor port of the autonomous driving car.", "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the specified speed along the lane.", + "robotis_openCM70_aux_car_move": "Make the robot move at the specified speed and direction.", "robotis_openCM70_aux_motor_speed": "Sets the speed of decelerating motor to the value of 0 - 100%.", "robotis_openCM70_aux_servo_mode": "Sets the servo motor as wheel mode or joint mode.
The same mode continues to apply once it's set.
Wheel mode designates the servo motor's speed, and spins the servo motor.
Joint mode moves the servo motor's position with the set servo motor speed.", "robotis_openCM70_aux_servo_speed": "Sets servo motor's speed to the value of 0 - 1023.", @@ -5572,6 +5573,7 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "Autonomous driving car %1 motor uses %2 %3", "robotis_openCM70_cm_autodrive_ir": "Autonomous driving car %1 IR sensor uses %2 %3", "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the speed of %1 %2", + "robotis_openCM70_aux_car_move": "Make the robot %2 at a speed of %1% %3", "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3% %4", "robotis_openCM70_aux_servo_mode": "Set the mode of %1 servo motor to %2 %3", "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3% %4", diff --git a/extern/lang/jp.js b/extern/lang/jp.js index badab679f1..21dfd4f196 100644 --- a/extern/lang/jp.js +++ b/extern/lang/jp.js @@ -5436,6 +5436,7 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "자율주행 자동차의 모터 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_ir": "자율주행 자동차의 적외선 센서 포트를 지정합니다.", "robotis_openCM70_cm_autodrive_speed": "지정한 속도로 자율주행을 수행합니다.", + "robotis_openCM70_aux_car_move": "로봇을 지정한 속도와 방향으로 움직이도록 합니다.", "robotis_openCM70_aux_motor_speed": "감속모터 속도를 0 ~ 100% 의 값으로 정합니다.", "robotis_openCM70_aux_servo_mode": "서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.", "robotis_openCM70_aux_servo_speed": "서보모터 속도를 0 ~ 100% 의 값으로 정합니다.", @@ -6352,6 +6353,7 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "Autonomous driving car %1 motor uses %2 %3", "robotis_openCM70_cm_autodrive_ir": "Autonomous driving car %1 IR sensor uses %2 %3", "robotis_openCM70_cm_autodrive_speed": "Perform autonomous driving at the speed of %1 %2", + "robotis_openCM70_aux_car_move": "Make the robot %2 at a speed of %1% %3", "robotis_openCM70_aux_motor_speed": "Set the speed of decelerating motor of %1 to %2 , and the output value to %3% %4", "robotis_openCM70_aux_servo_mode": "Set the mode of %1 servo motor to %2 %3", "robotis_openCM70_aux_servo_speed": "Set the speed of servo motor of %1 to %2 , and the output value to %3% %4", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 5886bfe223..0973142cb0 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -5995,6 +5995,7 @@ Lang.Helper = { robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', + robotis_openCM70_aux_car_move: '로봇을 지정한 속도와 방향으로 움직이도록 합니다.', robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 100% 의 값으로 정합니다.', robotis_openCM70_aux_servo_mode: '서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.', @@ -7370,6 +7371,7 @@ Lang.template = { robotis_openCM70_cm_autodrive_motor: '자율주행 자동차 %1 모터를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_speed: '차로를 따라 %1의 속도로 자율주행 %2', + robotis_openCM70_aux_car_move: '로봇을 %1% 의 속도로 %2 %3', robotis_openCM70_aux_motor_speed: '%1 감속모터 속도를 %2 , 출력값을 %3%로 정하기 %4', robotis_openCM70_aux_servo_mode: '%1 서보모터 모드를 %2 (으)로 정하기 %3', robotis_openCM70_aux_servo_speed: '%1 서보모터 속도를 %2 , 출력값을 %3%로 정하기 %4', diff --git a/extern/lang/vn.js b/extern/lang/vn.js index 24fc13451c..d003ae00a1 100644 --- a/extern/lang/vn.js +++ b/extern/lang/vn.js @@ -5435,6 +5435,7 @@ Lang.Helper = { "robotis_openCM70_cm_autodrive_motor": "Chỉ định cổng động cơ của ô tô lái tự động.", "robotis_openCM70_cm_autodrive_ir": "Chỉ định cổng cảm biến hồng ngoại của xe lái tự động.", "robotis_openCM70_cm_autodrive_speed": "Lái xe tự động được thực hiện ở tốc độ quy định dọc theo làn đường.", + "robotis_openCM70_aux_car_move": "Làm cho robot di chuyển với tốc độ và hướng xác định.", "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ của động cơ giảm tốc với giá trị 0-100%.", "robotis_openCM70_aux_servo_mode": "Thiết lập động cơ servo như chế độ bánh xe hoặc chế độ chung.
Các chế độ tương tự vẫn tiếp tục áp dụng một khi đã cài đặt.
Chế độ bánh xe chỉ định tốc độ động cơ servo, và quay động cơ servo.
Chọn chế độ di chuyển vị trí của động cơ servo và tốc độ động cơ servo.", "robotis_openCM70_aux_servo_speed": "Cài đặt tốc độ của động cơ servo với giá trị từ 0 - 100%. ", @@ -6349,6 +6350,7 @@ Lang.template = { "robotis_openCM70_cm_autodrive_motor": "Ô tô lái tự động %1 sử dụng động cơ %2 %3", "robotis_openCM70_cm_autodrive_ir": "Ô tô tự lái %1 sử dụng cảm biến hồng ngoại %2 %3", "robotis_openCM70_cm_autodrive_speed": "Thực hiện lái xe tự trị ở tốc độ %1 %2", + "robotis_openCM70_aux_car_move": "Làm cho robot đi %2 với tốc độ %1% %3", "robotis_openCM70_aux_motor_speed": "Thiết lập tốc độ giảm tốc động cơ của %1 tới %2 , và giá trị đầu ra đến %3% %4", "robotis_openCM70_aux_servo_mode": "Thiết lập chế độ của %1 động cơ servo bằng %2 %3", "robotis_openCM70_aux_servo_speed": "Thiết lập tốc độ tốc động cơ servo của %1 tới %2, và giá trị đầu ra đến %3% %4", diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index 18d1b8cd10..c0056f8b20 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -425,6 +425,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_motor: '🚗 자율주행 자동차 %1 모터를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_ir: '🚗 자율주행 자동차 %1 적외선센서를 %2 에 연결 %3', robotis_openCM70_cm_autodrive_speed: '🚗 차로를 따라 %1의 속도로 자율주행 %2', + robotis_openCM70_aux_car_move: '로봇을 %1% 의 속도로 %2 %3', robotis_openCM70_aux_motor_speed: '%1 감속모터 속도를 %2 , 출력값을 %3%로 정하기 %4', robotis_openCM70_aux_servo_mode: '%1 서보모터 모드를 %2 (으)로 정하기 %3', @@ -460,6 +461,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_motor: '자율주행 자동차의 모터 포트를 지정합니다.', robotis_openCM70_cm_autodrive_ir: '자율주행 자동차의 적외선 센서 포트를 지정합니다.', robotis_openCM70_cm_autodrive_speed: '지정한 속도로 자율주행을 수행합니다.', + robotis_openCM70_aux_car_move: '로봇을 지정한 속도와 방향으로 움직이도록 합니다.', robotis_openCM70_aux_motor_speed: '감속모터 속도를 0 ~ 100% 의 값으로 정합니다.', robotis_openCM70_aux_servo_mode: '서보모터를 회전모드 또는 관절모드로 정합니다.
한번 설정된 모드는 계속 적용됩니다.
회전모드는 서보모터 속도를 지정하여 서보모터를 회전 시킵니다.
관절모드는 지정한 서보모터 속도로 서보모터 위치를 이동 시킵니다.', @@ -506,6 +508,11 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_common_left: '왼쪽', robotis_common_right: '오른쪽', robotis_common_minute: '분', + robotis_common_forward: '직진', + robotis_common_backward: '후진', + robotis_common_turn_left: '좌회전', + robotis_common_turn_right: '우회전', + robotis_common_stop: '정지', robotis_cm_custom: '직접입력 주소', robotis_cm_spring_left: '왼쪽 접촉 센서', robotis_cm_spring_right: '오른쪽 접촉 센서', @@ -562,6 +569,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_motor: 'Autonomous driving car %1 motor uses %2 %3', robotis_openCM70_cm_autodrive_ir: 'Autonomous driving car %1 IR sensor uses %2 %3', robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the speed of %1 %2', + robotis_openCM70_aux_car_move: 'Make the robot %2 at a speed of %1% %3', robotis_openCM70_aux_motor_speed: 'Set the speed of decelerating motor of %1 to %2 , and the output value to %3% %4', robotis_openCM70_aux_servo_mode: 'Set the mode of %1 servo motor to %2 %3', @@ -587,6 +595,7 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_openCM70_cm_autodrive_motor: 'Specifies the motor port of the autonomous driving car.', robotis_openCM70_cm_autodrive_ir: 'Specifies the IR sensor port of the autonomous driving car.', robotis_openCM70_cm_autodrive_speed: 'Perform autonomous driving at the specified speed along the lane.', + robotis_openCM70_aux_car_move: 'Make the robot move at the specified speed and direction.', robotis_openCM70_aux_motor_speed: 'Sets the speed of decelerating motor to the value of 0 - 100%.', robotis_openCM70_aux_servo_mode: @@ -644,6 +653,11 @@ Entry.Robotis_carCont.setLanguage = function() { robotis_common_left: 'Left', robotis_common_right: 'Right', robotis_common_minute: 'minute(s)', + robotis_common_forward: 'Forward', + robotis_common_backward: 'Backword', + robotis_common_turn_left: 'Turn left', + robotis_common_turn_right: 'Turn Right', + robotis_common_stop: 'Stop', robotis_cm_custom: 'Custom address', robotis_cm_spring_left: 'Left contact sensor', robotis_cm_spring_right: 'Right contact sensor', @@ -1233,6 +1247,7 @@ Entry.Robotis_openCM70.blockMenuBlocks = [ 'robotis_openCM70_cm_autodrive_motor', 'robotis_openCM70_cm_autodrive_ir', 'robotis_openCM70_cm_autodrive_speed', + 'robotis_openCM70_aux_car_move', 'robotis_openCM70_aux_motor_speed', 'robotis_openCM70_aux_servo_mode', 'robotis_openCM70_aux_servo_speed', @@ -2280,38 +2295,30 @@ Entry.Robotis_openCM70.getBlocks = function() { }, syntax: { js: [], py: ['Robotis.opencm70_cm_autodrive_speed(%1)'] }, }, - robotis_openCM70_aux_motor_speed: { + robotis_openCM70_aux_car_move: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, skeleton: 'basic', statements: [], params: [ { - type: 'Dropdown', - options: [ - [Lang.Blocks.robotis_common_port_1, '1'], - [Lang.Blocks.robotis_common_port_2, '2'], - ], - value: '1', - fontSize: 11, - bgColor: EntryStatic.colorSet.block.darken.HARDWARE, - arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + type: 'Block', + accept: 'string', }, { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_clockwhise, 'CW'], - [Lang.Blocks.robotis_common_counter_clockwhise, 'CCW'], + [Lang.Blocks.robotis_common_forward, 'F'], + [Lang.Blocks.robotis_common_backward, 'B'], + [Lang.Blocks.robotis_common_turn_left, 'L'], + [Lang.Blocks.robotis_common_turn_right, 'R'], + [Lang.Blocks.robotis_common_stop, 'S'], ], - value: 'CW', + value: 'F', fontSize: 11, bgColor: EntryStatic.colorSet.block.darken.HARDWARE, arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, }, - { - type: 'Block', - accept: 'string', - }, { type: 'Indicator', img: 'block_icon/hardware_icon.svg', @@ -2321,28 +2328,25 @@ Entry.Robotis_openCM70.getBlocks = function() { events: {}, def: { params: [ - null, - null, { type: 'number', params: ['50'], }, null, + null, ], - type: 'robotis_openCM70_aux_motor_speed', + type: 'robotis_openCM70_aux_car_move', }, paramsKeyMap: { - PORT: 0, - DIRECTION_ANGLE: 1, - VALUE: 2, + SPEED: 0, + MOVE_DIRECTION: 1, }, class: 'robotis_openCM70_cm', isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], func: function(sprite, script) { // instruction / address / length / value / default length - var port = script.getField('PORT', script); - var directionAngle = script.getField('DIRECTION_ANGLE', script); - var value = script.getNumberValue('VALUE'); + var speed = script.getNumberValue('SPEED'); + var direction = script.getField('MOVE_DIRECTION', script); var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; var data_address = 0; @@ -2350,28 +2354,25 @@ Entry.Robotis_openCM70.getBlocks = function() { var data_value = 0; data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTOR_SPEED[0]; - data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTOR_SPEED[1]; - - data_address = data_address + (port - 1) * data_length; - - if (value < 0) value = 0; - else if (value > 100) value = 100; - - value = Math.floor(value * 1023 / 100); - - if (directionAngle == 'CW') { - value = value + 1024; - if (value > 2047) { - value = 2047; - } - } else { - if (value > 1023) { - value = 1023; - } + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTOR_SPEED[1] * 2; + + if (speed < 0) speed = 0; + else if (speed > 100) speed = 100; + + speed = Math.floor(speed * 1023 /100); + + if (direction == 'F') { + data_value = speed + (speed + 1024) * 65536; + } else if (direction == 'B'){ + data_value = (speed + 1024) + speed * 65536; + } else if (direction == 'L'){ + data_value = (speed + 1024) + (speed + 1024) * 65536; + } else if (direction == 'R'){ + data_value = speed + speed * 65536; + } else if (direction == 'S'){ + data_value = 0; } - data_value = value; - var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; return Entry.Robotis_carCont.postCallReturn( script, @@ -2381,7 +2382,7 @@ Entry.Robotis_openCM70.getBlocks = function() { }, syntax: { js: [], - py: ['Robotis.opencm70_aux_motor_speed(%1, %2, %3)'], + py: ['Robotis.opencm70_aux_car_move(%1, %2)'], }, }, robotis_openCM70_aux_servo_mode: { From 19029f89a3bc84102ed984cc70344e9fdaf866ae Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Tue, 6 Jun 2023 23:00:58 +0900 Subject: [PATCH 10/11] =?UTF-8?q?=EC=8B=A4=EA=B3=BC=EB=A1=9C=EB=B4=87=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=ED=98=95=EC=97=90=20=EC=84=BC=EC=84=9C?= =?UTF-8?q?=EC=9A=A9=204=EC=A2=85=20=EB=B8=94=EB=A1=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20/=20=EA=B8=B0=EB=B3=B8=ED=98=95=20=ED=8F=AC?= =?UTF-8?q?=ED=8A=B8=EB=AA=85=EC=9D=84=20"PORT=20N"=20=ED=98=95=EC=8B=9D?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocks/hardware/block_robotis.js | 826 ++++++++++++++---- 1 file changed, 677 insertions(+), 149 deletions(-) diff --git a/src/playground/blocks/hardware/block_robotis.js b/src/playground/blocks/hardware/block_robotis.js index c0056f8b20..dd02706e63 100644 --- a/src/playground/blocks/hardware/block_robotis.js +++ b/src/playground/blocks/hardware/block_robotis.js @@ -1237,6 +1237,10 @@ Entry.Robotis_carCont.getBlocks = function() { Entry.Robotis_openCM70.blockMenuBlocks = [ //robotis_openCM70 + 'robotis_irs_value', + 'robotis_irs_value_boolean', + 'robotis_color_value', + 'robotis_color_value_boolean', 'robotis_openCM70_sensor_value', 'robotis_openCM70_aux_sensor_value', 'robotis_openCM70_cm_buzzer_index', @@ -1474,12 +1478,12 @@ Entry.Robotis_openCM70.getBlocks = function() { { type: 'Dropdown', options: [ - ['3', 'PORT_3'], - ['4', 'PORT_4'], - ['5', 'PORT_5'], - ['6', 'PORT_6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], - value: 'PORT_3', + value: '3', fontSize: 11, bgColor: EntryStatic.colorSet.block.darken.HARDWARE, arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, @@ -1535,13 +1539,13 @@ Entry.Robotis_openCM70.getBlocks = function() { var aux_name = ''; var increase = 0; - if (port == 'PORT_3') { + if (port == '3') { increase = 2; - } else if (port == 'PORT_4') { + } else if (port == '4') { increase = 3; - } else if (port == 'PORT_5') { + } else if (port == '5') { increase = 4; - } else if (port == 'PORT_6') { + } else if (port == '6') { increase = 5; } @@ -2101,8 +2105,8 @@ Entry.Robotis_openCM70.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_1, '1'], - [Lang.Blocks.robotis_common_port_2, '2'], + ['PORT 1', '1'], + ['PORT 2', '2'], ], value: '1', fontSize: 11, @@ -2175,10 +2179,10 @@ Entry.Robotis_openCM70.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_3, '3'], - [Lang.Blocks.robotis_common_port_4, '4'], - [Lang.Blocks.robotis_common_port_5, '5'], - [Lang.Blocks.robotis_common_port_6, '6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], value: '3', fontSize: 11, @@ -2385,91 +2389,108 @@ Entry.Robotis_openCM70.getBlocks = function() { py: ['Robotis.opencm70_aux_car_move(%1, %2)'], }, }, - robotis_openCM70_aux_servo_mode: { + robotis_irs_value: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, - skeleton: 'basic', + skeleton: 'basic_string_field', + fontColor: '#fff', statements: [], + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + template: '%1 적외선 센서 값', params: [ { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_3, '3'], - [Lang.Blocks.robotis_common_port_4, '4'], - [Lang.Blocks.robotis_common_port_5, '5'], - [Lang.Blocks.robotis_common_port_6, '6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], value: '3', fontSize: 11, bgColor: EntryStatic.colorSet.block.darken.HARDWARE, arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, }, - { - type: 'Dropdown', - options: [ - [Lang.Blocks.robotis_common_wheel_mode, '0'], - [Lang.Blocks.robotis_common_joint_mode, '1'], - ], - value: '0', - fontSize: 11, - bgColor: EntryStatic.colorSet.block.darken.HARDWARE, - arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, - }, - { - type: 'Indicator', - img: 'block_icon/hardware_icon.svg', - size: 12, - }, ], events: {}, def: { - params: [null, null, null], - type: 'robotis_openCM70_aux_servo_mode', + params: [null], + type: 'robotis_irs_value', }, paramsKeyMap: { PORT: 0, - MODE: 1, }, - class: 'robotis_openCM70_cm', - isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], - func: function(sprite, script) { - // instruction / address / length / value / default length - var port = script.getField('PORT', script); - var mode = script.getField('MODE', script); - - var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; - var data_address = 0; - var data_length = 0; - var data_value = 0; - - data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_MODE[0]; - data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_MODE[1]; - - data_address = data_address + (port - 1) * data_length; - data_value = mode; - - var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; - return Entry.Robotis_carCont.postCallReturn( - script, - data_sendqueue, - Entry.Robotis_openCM70.delay - ); + class: 'robotis_irs', + //'isNotFor': ['mini'], + func(sprite, script) { + Entry.hw.sendQueue.IS_EDU = true; + const port = script.getStringField('PORT'); + let value = 0; + let data_address = 0; + switch (port) { + case '3': + value = Entry.hw.portData.IR0; + data_address = 108; + break; + case '4': + value = Entry.hw.portData.IR1; + data_address = 109; + break; + case '5': + value = Entry.hw.portData.IR2; + data_address = 110; + break; + case '6': + value = Entry.hw.portData.IR3; + data_address = 111; + break; + } + const data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + const data_length = 1; + const data_value = 2; + + const data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + //Entry.Robotis_carCont.setRobotisData(data_sendqueue); + //Entry.Robotis_carCont.update(); + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT3 && port == '3') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT3 = true; + } + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT4 && port == '4') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT4 = true; + } + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT5 && port == '5') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT5 = true; + } + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT6 && port == '6') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT6 = true; + } + //var value = (Entry.hw.portData['IN' + port] > 125) ? 1 : 0; + return value; }, - syntax: { js: [], py: ['Robotis.opencm70_aux_servo_mode(%1, %2)'] }, }, - robotis_openCM70_aux_servo_speed: { + robotis_irs_value_boolean: { color: EntryStatic.colorSet.block.default.HARDWARE, outerLine: EntryStatic.colorSet.block.darken.HARDWARE, - skeleton: 'basic', - statements: [], + skeleton: 'basic_boolean_field', + fontColor: '#fff', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + template: '%1 적외선 센서 값 %2 %3', params: [ { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_3, '3'], - [Lang.Blocks.robotis_common_port_4, '4'], - [Lang.Blocks.robotis_common_port_5, '5'], - [Lang.Blocks.robotis_common_port_6, '6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], value: '3', fontSize: 11, @@ -2479,103 +2500,610 @@ Entry.Robotis_openCM70.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_clockwhise, 'CW'], - [Lang.Blocks.robotis_common_counter_clockwhise, 'CCW'], + ['=', 'EQUAL'], + ['>', 'GREATER'], + ['<', 'LESS'], + ['≥', 'GREATER_OR_EQUAL'], + ['≤', 'LESS_OR_EQUAL'], ], - value: 'CW', + value: 'GREATER', fontSize: 11, bgColor: EntryStatic.colorSet.block.darken.HARDWARE, arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + noaRrow: true, }, { type: 'Block', accept: 'string', }, - { - type: 'Indicator', - img: 'block_icon/hardware_icon.svg', - size: 12, - }, ], - events: {}, def: { params: [ null, null, { type: 'number', - params: ['50'], + params: ['100'], }, - null, ], - type: 'robotis_openCM70_aux_servo_speed', + type: 'robotis_irs_value_boolean', }, paramsKeyMap: { PORT: 0, - DIRECTION_ANGLE: 1, - VALUE: 2, + OPERATOR: 1, + RIGHTVALUE: 2, }, - class: 'robotis_openCM70_cm', - isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], - func: function(sprite, script) { - // instruction / address / length / value / default length - var port = script.getField('PORT', script); - var directionAngle = script.getField('DIRECTION_ANGLE', script); - var value = script.getNumberValue('VALUE'); - - var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; - var data_address = 0; - var data_length = 0; - var data_value = 0; - - data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_SPEED[0]; - data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_SPEED[1]; - - data_address = data_address + (port - 1) * data_length; - - if (value < 0) value = 0; - else if (value > 100) value = 100; - - value = Math.floor(value * 1023 / 100); - - if (directionAngle == 'CW') { - value = value + 1024; - if (value > 2047) { - value = 2047; - } - } else { - if (value > 1023) { - value = 1023; - } + class: 'robotis_irs', + //'isNotFor': ['mini'], + func(sprite, script) { + Entry.hw.sendQueue.IS_EDU = true; + const port = script.getStringField('PORT', script); + const operator = script.getField('OPERATOR', script); + const rightValue = script.getNumberValue('RIGHTVALUE', script); + let leftValue = 0; + let isCheck = false; + let data_address = 0; + + switch (port) { + case '3': + leftValue = Entry.hw.portData.IR0; + data_address = 108; + break; + case '4': + leftValue = Entry.hw.portData.IR1; + data_address = 109; + break; + case '5': + leftValue = Entry.hw.portData.IR2; + data_address = 110; + break; + case '6': + leftValue = Entry.hw.portData.IR3; + data_address = 111; + break; } - - data_value = value; - - var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; - return Entry.Robotis_carCont.postCallReturn( - script, - data_sendqueue, - Entry.Robotis_openCM70.delay - ); - }, - syntax: { - js: [], - py: ['Robotis.opencm70_aux_servo_speed(%1, %2, %3)'], - }, - }, - robotis_openCM70_aux_servo_position: { - color: EntryStatic.colorSet.block.default.HARDWARE, - outerLine: EntryStatic.colorSet.block.darken.HARDWARE, - skeleton: 'basic', + const data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + const data_length = 1; + const data_value = 2; + + const data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + //Entry.Robotis_carCont.setRobotisData(data_sendqueue); + //Entry.Robotis_carCont.update(); + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT3 && port == '3') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT3 = true; + } + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT4 && port == '4') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT4 = true; + } + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT5 && port == '5') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT5 = true; + } + if (!Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT6 && port == '6') { + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + Entry.Robotis_openCM70.IRS_MODULEWRITE.PORT6 = true; + } + + switch (operator) { + case 'EQUAL': + isCheck = leftValue == rightValue; + break; + case 'GREATER': + isCheck = Number(leftValue) > Number(rightValue); + break; + case 'LESS': + isCheck = Number(leftValue) < Number(rightValue); + break; + case 'GREATER_OR_EQUAL': + isCheck = Number(leftValue) >= Number(rightValue); + break; + case 'LESS_OR_EQUAL': + isCheck = Number(leftValue) <= Number(rightValue); + break; + } + + return isCheck; + }, + }, + robotis_color_value: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic_string_field', + fontColor: '#fff', + statements: [], + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + template: '%1 컬러 센서 값', + params: [ + { + type: 'Dropdown', + options: [ + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], + ], + value: '3', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.common.WHITE, + }, + ], + events: {}, + def: { + params: [null], + type: 'robotis_color_value', + }, + paramsKeyMap: { + PORT: 0, + }, + class: 'robotis_color', + func(sprite, script) { + Entry.hw.sendQueue.IS_EDU = true; + const port = script.getStringField('PORT'); + let value = 0; + let data_address = 0; + switch (port) { + case '3': + value = Entry.hw.portData.COLOR0; + data_address = 108; + break; + case '4': + value = Entry.hw.portData.COLOR1; + data_address = 109; + break; + case '5': + value = Entry.hw.portData.COLOR2; + data_address = 110; + break; + case '6': + value = Entry.hw.portData.COLOR3; + data_address = 111; + break; + } + const data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + const data_length = 1; + const data_value = 4; + + const data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + + switch (value) { + case 0: + value = '알 수 없음'; + break; + case 1: + value = '흰색'; + break; + case 2: + value = '검은색'; + break; + case 3: + value = '빨강색'; + break; + case 4: + value = '초록색'; + break; + case 5: + value = '파랑색'; + break; + case 6: + value = '노랑색'; + break; + } + + return value; + }, + }, + robotis_color_value_boolean: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic_boolean_field', + fontColor: '#fff', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + template: '%1 컬러 센서 값 %2 %3', + params: [ + { + type: 'Dropdown', + options: [ + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], + ], + value: '3', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.common.WHITE, + }, + { + type: 'Dropdown', + options: [ + ['=', 'EQUAL'], + ['!=', 'NOT_EQUAL'], + ], + value: 'EQUAL', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.common.WHITE, + noaRrow: true, + }, + { + type: 'Dropdown', + options: [ + ['알 수 없음 : 0', '0'], + ['흰색 : 1', '1'], + ['검은색 : 2', '2'], + ['빨강색 : 3', '3'], + ['초록색 : 4', '4'], + ['파랑색 : 5', '5'], + ['노랑색 : 6', '6'], + ], + value: '3', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.common.WHITE, + }, + ], + def: { + params: [null, null, null], + type: 'robotis_color_value_boolean', + }, + paramsKeyMap: { + PORT: 0, + OPERATOR: 1, + RIGHTVALUE: 2, + }, + class: 'robotis_color', + func(sprite, script) { + Entry.hw.sendQueue.IS_EDU = true; + const port = script.getField('PORT', script); + const operator = script.getField('OPERATOR', script); + const rightValue = script.getNumberField('RIGHTVALUE', script); + let leftValue = 0; + let data_address = 0; + let isCheck = false; + + switch (port) { + case '3': + leftValue = Entry.hw.portData.COLOR0; + data_address = 108; + break; + case '4': + leftValue = Entry.hw.portData.COLOR1; + data_address = 109; + break; + case '5': + leftValue = Entry.hw.portData.COLOR2; + data_address = 110; + break; + case '6': + leftValue = Entry.hw.portData.COLOR3; + data_address = 111; + break; + } + + const data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + const data_length = 1; + const data_value = 4; + + const data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + Entry.Robotis_carCont.setRobotisData(data_sendqueue); + Entry.Robotis_carCont.update(); + + switch (operator) { + case 'EQUAL': + isCheck = leftValue == rightValue; + break; + case 'NOT_EQUAL': + isCheck = Number(leftValue) != Number(rightValue); + break; + } + + return isCheck; + }, + }, + robotis_openCM70_aux_motor_speed: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['PORT 1', '1'], + ['PORT 2', '2'], + ], + value: '1', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_clockwhise, 'CW'], + [Lang.Blocks.robotis_common_counter_clockwhise, 'CCW'], + ], + value: 'CW', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [ + null, + null, + { + type: 'number', + params: ['50'], + }, + null, + ], + type: 'robotis_openCM70_aux_motor_speed', + }, + paramsKeyMap: { + PORT: 0, + DIRECTION_ANGLE: 1, + VALUE: 2, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var port = script.getField('PORT', script); + var directionAngle = script.getField('DIRECTION_ANGLE', script); + var value = script.getNumberValue('VALUE'); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTOR_SPEED[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTOR_SPEED[1]; + + data_address = data_address + (port - 1) * data_length; + + if (value < 0) value = 0; + else if (value > 100) value = 100; + + value = Math.floor(value * 1023 / 100); + + if (directionAngle == 'CW') { + value = value + 1024; + if (value > 2047) { + value = 2047; + } + } else { + if (value > 1023) { + value = 1023; + } + } + + data_value = value; + + var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { + js: [], + py: ['Robotis.opencm70_aux_motor_speed(%1, %2, %3)'], + }, + }, + robotis_openCM70_aux_servo_mode: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', statements: [], params: [ { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_3, '3'], - [Lang.Blocks.robotis_common_port_4, '4'], - [Lang.Blocks.robotis_common_port_5, '5'], - [Lang.Blocks.robotis_common_port_6, '6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], + ], + value: '3', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_wheel_mode, '0'], + [Lang.Blocks.robotis_common_joint_mode, '1'], + ], + value: '0', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [null, null, null], + type: 'robotis_openCM70_aux_servo_mode', + }, + paramsKeyMap: { + PORT: 0, + MODE: 1, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var port = script.getField('PORT', script); + var mode = script.getField('MODE', script); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_MODE[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_MODE[1]; + + data_address = data_address + (port - 1) * data_length; + data_value = mode; + + var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { js: [], py: ['Robotis.opencm70_aux_servo_mode(%1, %2)'] }, + }, + robotis_openCM70_aux_servo_speed: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], + ], + value: '3', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.robotis_common_clockwhise, 'CW'], + [Lang.Blocks.robotis_common_counter_clockwhise, 'CCW'], + ], + value: 'CW', + fontSize: 11, + bgColor: EntryStatic.colorSet.block.darken.HARDWARE, + arrowColor: EntryStatic.colorSet.arrow.default.HARDWARE, + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Indicator', + img: 'block_icon/hardware_icon.svg', + size: 12, + }, + ], + events: {}, + def: { + params: [ + null, + null, + { + type: 'number', + params: ['50'], + }, + null, + ], + type: 'robotis_openCM70_aux_servo_speed', + }, + paramsKeyMap: { + PORT: 0, + DIRECTION_ANGLE: 1, + VALUE: 2, + }, + class: 'robotis_openCM70_cm', + isNotFor: ['robotis_openCM70', 'robotis_openCM70EDU'], + func: function(sprite, script) { + // instruction / address / length / value / default length + var port = script.getField('PORT', script); + var directionAngle = script.getField('DIRECTION_ANGLE', script); + var value = script.getNumberValue('VALUE'); + + var data_instruction = Entry.Robotis_openCM70.INSTRUCTION.WRITE; + var data_address = 0; + var data_length = 0; + var data_value = 0; + + data_address = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_SPEED[0]; + data_length = Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_SPEED[1]; + + data_address = data_address + (port - 1) * data_length; + + if (value < 0) value = 0; + else if (value > 100) value = 100; + + value = Math.floor(value * 1023 / 100); + + if (directionAngle == 'CW') { + value = value + 1024; + if (value > 2047) { + value = 2047; + } + } else { + if (value > 1023) { + value = 1023; + } + } + + data_value = value; + + var data_sendqueue = [[data_instruction, data_address, data_length, data_value]]; + return Entry.Robotis_carCont.postCallReturn( + script, + data_sendqueue, + Entry.Robotis_openCM70.delay + ); + }, + syntax: { + js: [], + py: ['Robotis.opencm70_aux_servo_speed(%1, %2, %3)'], + }, + }, + robotis_openCM70_aux_servo_position: { + color: EntryStatic.colorSet.block.default.HARDWARE, + outerLine: EntryStatic.colorSet.block.darken.HARDWARE, + skeleton: 'basic', + statements: [], + params: [ + { + type: 'Dropdown', + options: [ + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], value: '3', fontSize: 11, @@ -2659,10 +3187,10 @@ Entry.Robotis_openCM70.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_3, '3'], - [Lang.Blocks.robotis_common_port_4, '4'], - [Lang.Blocks.robotis_common_port_5, '5'], - [Lang.Blocks.robotis_common_port_6, '6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], value: '3', fontSize: 11, @@ -2733,10 +3261,10 @@ Entry.Robotis_openCM70.getBlocks = function() { { type: 'Dropdown', options: [ - [Lang.Blocks.robotis_common_port_3, '3'], - [Lang.Blocks.robotis_common_port_4, '4'], - [Lang.Blocks.robotis_common_port_5, '5'], - [Lang.Blocks.robotis_common_port_6, '6'], + ['PORT 3', '3'], + ['PORT 4', '4'], + ['PORT 5', '5'], + ['PORT 6', '6'], ], value: '3', fontSize: 11, From ca6d1e5ac693d779742d57b3b9758444ead00501 Mon Sep 17 00:00:00 2001 From: Jason Kim Date: Fri, 16 Jun 2023 13:04:18 +0900 Subject: [PATCH 11/11] =?UTF-8?q?RB=EC=A0=9C=EC=96=B4=EA=B8=B0=20=EB=B0=B0?= =?UTF-8?q?=EA=B2=BD=EB=B8=94=EB=A1=9D=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/playground/blocks/hardware/block_robotisRB.js | 9 ++++----- src/playground/blocks/hardware/block_robotisRBCar.js | 10 ++++++---- .../blocks/hardware/block_robotisRBHumanoid.js | 10 ++++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/playground/blocks/hardware/block_robotisRB.js b/src/playground/blocks/hardware/block_robotisRB.js index 408c1b78ea..b4d2fb3f6f 100644 --- a/src/playground/blocks/hardware/block_robotisRB.js +++ b/src/playground/blocks/hardware/block_robotisRB.js @@ -80,8 +80,8 @@ Entry.Robotis_rb.blockMenuBlocks = [ 'robotis_RB_cm_buzzer_index', - 'robotis_RB_kkokdu_screen', - 'robotis_RB_kkokdu_anim_screen', + 'robotis_RB_cm_screen', + 'robotis_RB_cm_anim_screen', 'robotis_RB_rsp_screen', 'robotis_RB_LCDBright', @@ -96,9 +96,8 @@ Entry.Robotis_rb.blockMenuBlocks = [ 'robotis_RB_car_screen', 'robotis_RB_car_anim_screen', - - 'robotis_RB_cm_screen', - 'robotis_RB_cm_anim_screen', + 'robotis_RB_kkokdu_screen', + 'robotis_RB_kkokdu_anim_screen', 'robotis_openCM70_RGee_go', 'robotis_openCM70_RGee_stop', diff --git a/src/playground/blocks/hardware/block_robotisRBCar.js b/src/playground/blocks/hardware/block_robotisRBCar.js index 7b840bb097..4a07624c22 100644 --- a/src/playground/blocks/hardware/block_robotisRBCar.js +++ b/src/playground/blocks/hardware/block_robotisRBCar.js @@ -82,8 +82,8 @@ Entry.Robotis_rb_car.blockMenuBlocks = [ //알라표정 //화면 애니메이션 - 'robotis_RB_car_screen', - 'robotis_RB_car_anim_screen', + 'robotis_RB_cm_screen', + 'robotis_RB_cm_anim_screen', 'robotis_RB_rsp_screen', 'robotis_RB_LCDBright', @@ -97,8 +97,10 @@ Entry.Robotis_rb_car.blockMenuBlocks = [ 'robotis_RB_record', 'robotis_RB_playRecord', - 'robotis_RB_cm_screen', - 'robotis_RB_cm_anim_screen', + 'robotis_RB_car_screen', + 'robotis_RB_car_anim_screen', + 'robotis_RB_kkokdu_screen', + 'robotis_RB_kkokdu_anim_screen', 'robotis_openCM70_RLa_go', 'robotis_openCM70_RLa_stop', diff --git a/src/playground/blocks/hardware/block_robotisRBHumanoid.js b/src/playground/blocks/hardware/block_robotisRBHumanoid.js index 817f15993e..5a38d78398 100644 --- a/src/playground/blocks/hardware/block_robotisRBHumanoid.js +++ b/src/playground/blocks/hardware/block_robotisRBHumanoid.js @@ -86,8 +86,8 @@ Entry.Robotis_rb_H.blockMenuBlocks = [ 'robotis_RB_cm_buzzer_index', - 'robotis_RB_kkokdu_screen', - 'robotis_RB_kkokdu_anim_screen', + 'robotis_RB_cm_screen', + 'robotis_RB_cm_anim_screen', 'robotis_RB_rsp_screen', 'robotis_RB_LCDBright', @@ -101,8 +101,10 @@ Entry.Robotis_rb_H.blockMenuBlocks = [ 'robotis_RB_record', 'robotis_RB_playRecord', - 'robotis_RB_cm_screen', - 'robotis_RB_cm_anim_screen', + 'robotis_RB_car_screen', + 'robotis_RB_car_anim_screen', + 'robotis_RB_kkokdu_screen', + 'robotis_RB_kkokdu_anim_screen', 'robotis_RB_cm_motion', 'robotis_RB_cm_motion2',