| 166 | } |
| 167 | |
| 168 | function buildFrameId(block) { |
| 169 | let frame = block.getFieldValue('FRAME_ID').toLowerCase(); |
| 170 | let id = Blockly.Python.valueToCode(block, 'ID', Blockly.Python.ORDER_NONE); |
| 171 | if (frame == 'aruco') { // aruco marker frame |
| 172 | if (id.match(/^[0-9]+$/)) { // id is positive integer |
| 173 | return `'${frame}_${id}'`; |
| 174 | } else { // something else... |
| 175 | return `'${frame}_' + str(int(${id}))`; |
| 176 | } |
| 177 | } else { |
| 178 | return `'${frame}'`; |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | Blockly.Python.navigate = function(block) { |
| 183 | let x = Blockly.Python.valueToCode(block, 'X', Blockly.Python.ORDER_NONE); |