当前位置:网站首页>Yamaha robot splits visual strings
Yamaha robot splits visual strings
2022-06-26 05:47:00 【self85】
'---------------------- Visual data analysis ----------------------------
SUB *SplitStrToPos(Source$, xTag!, yTag!, rTag!)
pos% = 0 ' The array subscript
DIM sysPos!(3) ' Define array elements sysPos!(0) ? sysPos!(3)
FOR Index% = 1 TO LEN(Source$)
IF MID$(Source$,Index%,1) = "," THEN
sysPos!(pos%) = VAL(MID$(Source$,1,Index%-1))
pos% = pos% + 1
Source$ = MID$(Source$,Index% + 1,LEN(Source$)-Index%)
Index% = 0
ENDIF
NEXT Index%
xTag! = sysPos!(0)
yTag! = sysPos!(1)
rTag! = sysPos!(2)
END SUB
A simple translation
'---------------------- Visual data analysis ----------------------------
SUB *SplitStrToPos(Source$, xTag!, yTag!, rTag!)
' Split the string to get the dot ( The string passed in , Got X coordinate ,Y coordinate ,RZ angle )
pos% = 0 ' The array subscript
DIM sysPos!(3) ' Define array elements sysPos!(0) ? sysPos!(3)
' Defines a one-dimensional array , There are three elements in total ,0-2
FOR Index% = 1 TO LEN(Source$)
'for Cycle from 1 Start to " The total length of the string passed in "
IF MID$(Source$,Index%,1) = "," THEN
'MID$(Source$,Index%,1) It means in Source$ in , from Index% Start looking for , look for 1 position
' find "," After entering if The cycle of
sysPos!(pos%) = VAL(MID$(Source$,1,Index%-1))
'sysPos Array assignment ,
'MID$(Source$,1,Index%-1) stay Source$ In the string , Start from the first , The termination bit is found "," Count forward one digit
pos% = pos% + 1
'sysPos Array subscript auto increment , Assign a value to the next loop , Corresponding to the back sysPos!(0)/sysPos!(1)/sysPos!(2)
Source$ = MID$(Source$,Index% + 1,LEN(Source$)-Index%)
'MID$(Source$,Index% + 1,LEN(Source$)-Index%)
' stay Source$ In the string , From the last time I found "," The location starts to look for , Then I'll intercept all the remaining strings .
' For example , The string passed is "25,28,36,", The first cycle will remove X Coordinates of 25,
' then Source$ The string is now "28,36,"
' The third time is "36,"
Index% = 0
ENDIF
NEXT Index%
xTag! = sysPos!(0)
yTag! = sysPos!(1)
rTag! = sysPos!(2)
END SUB
边栏推荐
- 虚拟项目失败感想
- 从新东方直播来探究下小程序音视频通话及互动直播
- Talk 5 wireless communication
- How Navicat reuses the current connection information to another computer
- Introduction to GUI programming to game practice (II)
- Leetcode513. Find the value in the lower left corner of the tree
- The State Council issued a document to improve the application of identity authentication and electronic seals, and strengthen the construction of Digital Government
- Supplementary course on basic knowledge of IM development (II): how to design a server-side storage architecture for a large number of image files?
- 慢慢学JVM之缓存行和伪共享
- Leetcode114. 二叉树展开为链表
猜你喜欢

电商借助小程序技术发力寻找增长突破口

Kolla ansible deploy openstack Yoga version

小程序如何关联微信小程序二维码,实现二码聚合

Adapter mode

使用Jenkins执行TestNg+Selenium+Jsoup自动化测试和生成ExtentReport测试报告

How to use the tablet as the second extended screen of the PC

怎么把平板作为电脑的第二扩展屏幕

421-二叉树(226. 翻转二叉树、101. 对称二叉树、104.二叉树的最大深度、222.完全二叉树的节点个数)

【C语言】深度剖析数据在内存中的存储

REUSE_ ALV_ GRID_ Display event implementation (data_changed)
随机推荐
Old love letters
一段不离不弃的爱情
LeetCode_ Binary search tree_ Simple_ 108. convert an ordered array to a binary search tree
Data storage: the difference between MySQL InnoDB and MyISAM
旧情书
使用Jenkins执行TestNg+Selenium+Jsoup自动化测试和生成ExtentReport测试报告
Command line interface of alluxio
1212312321
Daily production training report (17)
A new journey
BOM document
力扣 875. 爱吃香蕉的珂珂
Daily production training report (16)
冒泡排序(Bubble Sort)
The news of thunderbolt
redis探索之布隆过滤器
The model defined (modified) in pytoch loads some required pre training model parameters and freezes them
Sql查询时间段内容
Could not get unknown property ‘*‘ for SigningConfig container of type org.gradle.api.internal
电机专用MCU芯片LCM32F037系列内容介绍