【CSEN006】Get the variable value or position data of CS model

External controller could communicate with CS model via port 30001 based on TCP/IP protocol. CS model could send fixed length data with 100ms frequency to controller, which is in specifed format and users should inteprete this info by themselves. Also they can send scripts to control the movement of robot arm with this port.

For example, if host pc needs to get current robot position data, it could send the following script to robot system via this port, and users could define the responding port (like 23333) to recieve the feedback data after executing the script.

The host pc:

 ip: 192.168.230.1,

port work as server :23333

Robot ip:

192.168.230.138

If robot is in remote mode,host pc send the following script to robot via port 30001, the robot will stop executing the task right now if it is engaged in some tasks, meanwihle it will execute the script if it is idle.

def t1():
  pose = get_actual_tcp_pose()
  x = pose[0]
  y = pose[1]
  z = pose[2]

  socket_open("192.168.230.1",23333,"socket_1")
  socket_send_string(str(x)+","+str(y),"socket_1")
  sleep(5)
  # sleep cammand here is for host pc to monitor the feedback info easily
end

But if users send script as below, robot will keep on running without interrupting the task process right now

sec t1():
  pose = get_actual_tcp_pose()
  x = pose[0]
  y = pose[1]
  z = pose[2]

  socket_open("192.168.230.1",23333,"socket_1")
  socket_send_string(str(x)+","+str(y),"socket_1")
  sleep(5)
end
点击显示全文
赞同0
发表评论
分享

手机扫码分享
0
504
收藏
举报
收起
登录
  • 密码登录
  • 验证码登录
还没有账号,立即注册
还没有账号,立即注册
注册
已有账号,立即登录
选择发帖板块
上传文件
举报
请选择举报理由
举报
举报说明