blocks: fix global_position block

This commit is contained in:
Oleg Kalachev
2021-08-24 17:49:21 +03:00
parent 33a6dffb1f
commit 274b81c50f
2 changed files with 8 additions and 2 deletions

View File

@@ -315,6 +315,12 @@ Blockly.Python.get_attitude = function(block) {
return [code, Blockly.Python.ORDER_FUNCTION_CALL];
}
Blockly.Python.global_position = function(block) {
simpleOffboard();
var code = `get_telemetry().${block.getFieldValue('FIELD').toLowerCase()}`;
return [code, Blockly.Python.ORDER_FUNCTION_CALL];
}
Blockly.Python.distance = function(block) {
rosDefinitions.distance = true;
simpleOffboard();