终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

736 line
22 KiB

  1. /**
  2. * Copyright © 2017-2018 Shanghai Lebai Robotic Co., Ltd. All rights reserved.
  3. *
  4. * FileName: robot_controller.proto
  5. *
  6. * Author: Yonnie Lu
  7. * Email: zhangyong.lu@lebai.ltd
  8. * Date: 2018-12-28 17:26
  9. * Description:
  10. * History:
  11. * <Author> <Time> <version> <desc>
  12. * YonnieLu 2018-12-28 17:26 1.0 Create
  13. *
  14. * compile methods:
  15. * 1. c++
  16. * protoc --grpc_out=./ --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` *.proto
  17. * protoc --cpp_out=. *.proto
  18. *
  19. * 2. golang
  20. * protoc *.proto --go_out=plugins=grpc:../
  21. *
  22. * 3. python
  23. */
  24. syntax = "proto3";
  25. import "google/protobuf/empty.proto";
  26. import "messages.proto";
  27. package robotc;
  28. // Robot controller gRPC & protobuf idl language definition
  29. service RobotController {
  30. // 1. Basic control commands
  31. // 关闭电源
  32. rpc PowerDown(google.protobuf.Empty) returns (CmdId);
  33. // 等待,单位毫秒
  34. rpc Sleep(SleepRequest) returns (CmdId);
  35. // 同步,等待指定命令执行完成,type为0时表示所有(默认)
  36. rpc Sync(google.protobuf.Empty) returns (CmdId);
  37. rpc SyncFor(SyncRequest) returns (CmdId);
  38. // 2. Config commands
  39. // 开启示教模式
  40. rpc TeachMode(google.protobuf.Empty) returns (CmdId);
  41. // 关闭示教模式
  42. rpc EndTeachMode(google.protobuf.Empty) returns (CmdId);
  43. // 设置速度因子(0-100)
  44. rpc SetVelocityFactor(Factor) returns (CmdId);
  45. // 获取速度因子(0-100)
  46. rpc GetVelocityFactor(google.protobuf.Empty) returns (Factor);
  47. rpc SetGravity(Coordinate) returns (CmdId);
  48. rpc GetGravity(google.protobuf.Empty) returns (Coordinate);
  49. rpc SetPayload(Payload) returns (CmdId);
  50. rpc GetPayload(google.protobuf.Empty) returns (Payload);
  51. rpc SetPayloadMass(PayloadMass) returns (CmdId);
  52. rpc GetPayloadMass(google.protobuf.Empty) returns (PayloadMass);
  53. rpc SetPayloadCog(PayloadCog) returns (CmdId);
  54. rpc GetPayloadCog(google.protobuf.Empty) returns (PayloadCog);
  55. rpc SetTcp(PR) returns (CmdId);
  56. rpc GetTcp(google.protobuf.Empty) returns (PR);
  57. // 设置手爪幅度:0-100 double
  58. rpc SetClawAmplitude(Amplitude) returns (CmdId);
  59. // 获得手爪幅度:0-100 double
  60. rpc GetClawAmplitude(google.protobuf.Empty) returns (Amplitude);
  61. // 获得手爪目前是否夹紧物体状态1表示夹紧,0为松开
  62. rpc GetClawHoldOn(google.protobuf.Empty) returns (HoldOn);
  63. // 设置手爪力度:0-100 double
  64. rpc SetClawForce(Force) returns (CmdId);
  65. // 获得手爪称重结果
  66. rpc GetClawWeight(google.protobuf.Empty) returns (Weight);
  67. // implement later
  68. // rpc Force(google.protobuf.Empty) returns (Force);
  69. // implement later
  70. rpc GetTcpForce(google.protobuf.Empty) returns (ForceTorque);
  71. rpc SetClaw(ClawInfo) returns (ClawInfo);
  72. rpc GetClaw(google.protobuf.Empty) returns (ClawInfo);
  73. // 3. Motion control commands
  74. rpc SetPos(JPose) returns (CmdId);
  75. // implement later
  76. rpc SpeedJ(SpeedJRequest) returns (CmdId);
  77. // implement later
  78. rpc SpeedL(SpeedLRequest) returns (CmdId);
  79. // implement later
  80. rpc StopJ(StopJRequest) returns (CmdId);
  81. // implement later
  82. rpc StopL(StopLRequest) returns (CmdId);
  83. // 停止当前移动
  84. rpc StopMove(google.protobuf.Empty) returns (CmdId);
  85. // 圆弧移动
  86. rpc MoveC(MoveCRequest) returns (CmdId);
  87. // 关节空间线性移动
  88. rpc MoveJ(MoveJRequest) returns (CmdId);
  89. // 笛卡尔空间线性移动
  90. rpc MoveL(MoveLRequest) returns (CmdId);
  91. // DEPRECIATED
  92. rpc MoveLJ(MoveLRequest) returns (CmdId);
  93. // implement later
  94. rpc MoveP(MovePRequest) returns (CmdId);
  95. // pt move
  96. rpc MovePT(PVATRequest) returns (CmdId);
  97. rpc MovePTStream(stream PVATRequest) returns (CmdId);
  98. // pvt move
  99. rpc MovePVT(PVATRequest) returns (CmdId);
  100. rpc MovePVTStream(stream PVATRequest) returns (CmdId);
  101. // pvat move
  102. rpc MovePVAT(PVATRequest) returns (CmdId);
  103. rpc MovePVATStream(stream PVATRequest) returns (CmdId);
  104. // implement later
  105. rpc ServoC(ServoCRequest) returns (CmdId);
  106. // implement later
  107. rpc ServoJ(ServoJRequest) returns (CmdId);
  108. // 4. Status and data query commands
  109. // 获取机器人所有状态数据
  110. rpc GetRobotData(google.protobuf.Empty) returns (RobotData);
  111. // 获取机器人概要数据
  112. rpc GetRobotBriefData(stream RobotDataCmd) returns (stream RobotBriefData);
  113. // 获取机器人的IO数据
  114. rpc GetRobotIOData(stream RobotDataCmd) returns (stream IO);
  115. // 获取机器人状态
  116. rpc GetRobotMode(google.protobuf.Empty) returns (RobotMode);
  117. // 获得实际关节位置
  118. rpc GetActualJointPositions(google.protobuf.Empty) returns (Joint);
  119. // 获得目标关节位置
  120. rpc GetTargetJointPositions(google.protobuf.Empty) returns (Joint);
  121. // 获得实际关节速度
  122. rpc GetActualJointSpeeds(google.protobuf.Empty) returns (Joint);
  123. // 获得目标关节速度
  124. rpc GetTargetJointSpeeds(google.protobuf.Empty) returns (Joint);
  125. // 获得末端在笛卡尔坐标系下的位姿
  126. rpc GetActualTcpPose(google.protobuf.Empty) returns (Vector);
  127. // 获得末端在笛卡尔坐标系下的目标位姿
  128. rpc GetTargetTcpPose(google.protobuf.Empty) returns (Vector);
  129. // implement later
  130. rpc GetActualTcpSpeed(google.protobuf.Empty) returns (Vector);
  131. // implement later
  132. rpc GetTargetTcpSpeed(google.protobuf.Empty) returns (Vector);
  133. // implement later
  134. rpc GetActualFlangePose(google.protobuf.Empty) returns (Vector);
  135. // 获取关节扭矩
  136. rpc GetJointTorques(google.protobuf.Empty) returns (Joint);
  137. // 获取控制器温度
  138. rpc GetControllerTemp(google.protobuf.Empty) returns (Temperature);
  139. // 获取关节内部温度
  140. rpc GetJointTemp(IntRequest) returns (Temperature);
  141. // implement later
  142. rpc GetToolCurrent(google.protobuf.Empty) returns (Current);
  143. //xxx
  144. // 5. IO-related cmds
  145. // 设置数字输出端口的值
  146. rpc SetDIO(DIO) returns (CmdId);
  147. // 设置扩展数字输出端口的值
  148. rpc SetExtraDIO(DIO) returns (CmdId);
  149. // 获得数字输入端口的值
  150. rpc GetDIO(IOPin) returns (DIO);
  151. // 获得扩展数字数如端口的值
  152. rpc GetExtraDIO(IOPin) returns (DIO);
  153. // 设置TCP数字输出端口的值
  154. rpc SetTcpDIO(DIO) returns (CmdId);
  155. // 获得TCP数字输入端口的值
  156. rpc GetTcpDIO(IOPin) returns (DIO);
  157. // 设置模拟输出端口的值
  158. rpc SetAIO(AIO) returns (CmdId);
  159. // 获得模拟输入端口的值
  160. rpc SetExtraAIO(AIO) returns (CmdId);
  161. // 获得模拟输入端口的值
  162. rpc GetAIO(IOPin) returns (AIO);
  163. // 获得扩展模拟输入端口的值
  164. rpc GetExtraAIO(IOPin) returns (AIO);
  165. // 设置模拟输入端口工作模式:0:电压,1:电流
  166. rpc SetAInMode(AIO) returns (CmdId);
  167. // 设置扩展模拟输入端口工作模式:0:电压,1:电流
  168. rpc SetExtraAInMode(AIO) returns (CmdId);
  169. // 获得模拟输入端口工作模式:0:电压,1:电流
  170. rpc GetAInMode(IOPin) returns (AIO);
  171. // 获得扩展模拟输入端口工作模式:0:电压,1:电流
  172. rpc GetExtraAInMode(IOPin) returns (AIO);
  173. // 设置模拟输出端口工作模式:0:电压,1:电流
  174. rpc SetAOutMode(AIO) returns (CmdId);
  175. // 设置扩展模拟输出端口工作模式:0:电压,1:电流
  176. rpc SetExtraAOutMode(AIO) returns (CmdId);
  177. // 获得模拟输出端口工作模式:0:电压,1:电流
  178. rpc GetAOutMode(IOPin) returns (AIO);
  179. // 获得扩展模拟输出端口工作模式:0:电压,1:电流
  180. rpc GetExtraAOutMode(IOPin) returns (AIO);
  181. // 6. Control commands
  182. // 开启/启动系统
  183. rpc StartSys(google.protobuf.Empty) returns (CmdId);
  184. // 关闭/停止系统
  185. rpc StopSys(google.protobuf.Empty) returns (CmdId);
  186. // 程序停止
  187. rpc Stop(google.protobuf.Empty) returns (CmdId);
  188. // 急停
  189. rpc EStop(google.protobuf.Empty) returns (CmdId);
  190. // 7. Internal commands
  191. // 获取kdl参数
  192. rpc GetKDL(google.protobuf.Empty) returns (KDParam);
  193. // 查询系统里面的日志信息
  194. rpc GetLogs(google.protobuf.Empty) returns (Logs);
  195. // 获得当前正在执行的命令id,如果没有在执行的命令,则返回-1
  196. rpc GetCurrentCmd(google.protobuf.Empty) returns (CmdId); // 命令id
  197. // 获得指定命令id的执行结果:-1: 未执行;0: 已执行
  198. rpc GetCmdExecStatus(CmdId) returns (CmdStatus);
  199. // 开始微调: 如果当前有其他微调再传入新的微调命令会终止当前的微调进行新的微调
  200. rpc StartFineTuning(FineTuning) returns (CmdId);
  201. // 停止微调
  202. rpc StopFineTuning(google.protobuf.Empty) returns (CmdId);
  203. // 暂停机器人
  204. rpc Pause(google.protobuf.Empty) returns (CmdId);
  205. // 恢复机器人
  206. rpc Resume(google.protobuf.Empty) returns (CmdId);
  207. // 机器人正解
  208. rpc KinematicsForward(Joint) returns (Vector);
  209. // 机器人反解
  210. rpc KinematicsInverse(Vector) returns (Joint);
  211. // TCP示教添加
  212. rpc CalcTcpTranslation(CalcTcpParam) returns (Vector);
  213. // 8. Test command
  214. // 测试命令,以给定的RPY数据执行线性移动
  215. rpc MoveLRPY(MoveLRPYRequest) returns (CmdId);
  216. // 9. 扬声器和LED灯
  217. // 设置LED灯状态
  218. rpc SetLED(LEDStatus) returns (CmdId);
  219. // 设置声音
  220. rpc SetVoice(VoiceStatus) returns (CmdId);
  221. // 设置风扇
  222. rpc SetFan(FanStatus) returns (CmdId);
  223. // 获取灯板状态
  224. rpc GetLampStatus(google.protobuf.Empty) returns (LampStatus);
  225. // Lua 状态查询
  226. rpc GetLuaState(google.protobuf.Empty) returns (LuaStatus);
  227. // 外置数字输出
  228. rpc SetExternalDO(ExternalDigital) returns (Response);
  229. rpc GetExternalDO(ExternalPin) returns (ExternalDigital);
  230. // 外置数字输入
  231. rpc GetExternalDI(ExternalPin) returns (ExternalDigital);
  232. // 外置模拟输出
  233. rpc SetExternalAO(ExternalAnalog) returns (Response);
  234. rpc GetExternalAO(ExternalPin) returns (ExternalAnalog);
  235. // 外置模拟输入
  236. rpc GetExternalAI(ExternalPin) returns (ExternalAnalog);
  237. // 获取某个外置io的全部io信息
  238. rpc GetExternalIOs(ExternalDevice) returns (ExternalIOs);
  239. // 外置IO的复数版本
  240. // 外置数字输出
  241. rpc SetExternalDOs(ExternalDigitals) returns (Response);
  242. rpc GetExternalDOs(ExternalPins) returns (ExternalDigitals);
  243. // 外置数字输入
  244. rpc GetExternalDIs(ExternalPins) returns (ExternalDigitals);
  245. // 外置模拟输出
  246. rpc SetExternalAOs(ExternalAnalogs) returns (Response);
  247. rpc GetExternalAOs(ExternalPins) returns (ExternalAnalogs);
  248. // 外置模拟输入
  249. rpc GetExternalAIs(ExternalPins) returns (ExternalAnalogs);
  250. // 信号量
  251. rpc SetSignal(SignalValue) returns (SignalResult);
  252. rpc GetSignal(SignalValue) returns (SignalResult);
  253. rpc AddSignal(SignalValue) returns (SignalResult);
  254. rpc RegisterSignals(stream SignalList) returns (stream SignalValue);
  255. }
  256. message SignalValue {
  257. int32 index = 1;
  258. int32 value = 2;
  259. }
  260. message SignalResult {
  261. int32 index = 1;
  262. int32 value = 2;
  263. bool ok = 3;
  264. }
  265. message SignalList {
  266. repeated int32 indexes = 1;
  267. }
  268. // 机器人所有状态数据
  269. message RobotData {
  270. // 机器人模式
  271. RobotMode robotMode = 1;
  272. // 机器人各个关节模式
  273. repeated JointMode jointModes = 2;
  274. // 实际关节位置
  275. Joint actualJoint = 3;
  276. // 实际关节速度
  277. Joint actualJointSpeed = 4;
  278. // 目标关节位置
  279. Joint targetJoint = 5;
  280. // 目标关节速度
  281. Joint targetJointSpeed = 6;
  282. // 实际tcp位置
  283. Vector actualTcpPose = 7;
  284. // 实际tcp速度
  285. Vector actualTcpSpeed = 8;
  286. // 目标tcp位置
  287. Vector targetTcpPose = 9;
  288. // 目标tcp速度
  289. Vector targetTcpSpeed = 10;
  290. // 当前系统正在执行的命令状态:id + value
  291. CmdStatus currentCmd = 11;
  292. // 所有的io数据
  293. IO io = 12;
  294. // 速度因子
  295. double velocityFactor = 13;
  296. // 爪子信息
  297. ClawInfo clawInfo = 14;
  298. // 关节温度
  299. Joint jointTemps = 15;
  300. // 理论力矩
  301. Joint targetTorque = 16;
  302. // 实际力矩
  303. Joint actualTorque = 17;
  304. // 加速度
  305. Joint actualJointAcc = 18;
  306. Joint targetJointAcc = 19;
  307. }
  308. // 机器人需要获取数据的请求cmd
  309. message RobotDataCmd {
  310. // empty
  311. }
  312. // 机器人概要状态数据
  313. message RobotBriefData {
  314. // 机器人模式
  315. RobotMode robotMode = 1;
  316. // 实际关节位置
  317. Joint actualJoint = 2;
  318. // 目标关节位置
  319. Joint targetJoint = 3;
  320. // 实际tcp位置
  321. Vector actualTcpPose = 4;
  322. // 目标tcp位置
  323. Vector targetTcpPose = 5;
  324. // 速度因子
  325. double velocityFactor = 6;
  326. // 关节温度
  327. Joint jointTemps = 7;
  328. }
  329. // 机器人状态枚举值
  330. message RobotMode { int32 mode = 1; }
  331. // dh参数
  332. message DH {
  333. double d = 1;
  334. double a = 2;
  335. double alpha = 3;
  336. double theta = 4;
  337. }
  338. // 运动学动力学参数
  339. message KDParam {
  340. repeated DH dhParams = 1;
  341. }
  342. // 关节状态枚举值
  343. message JointMode { int32 mode = 1; }
  344. message Amplitude { double amplitude = 1; }
  345. message HoldOn { int32 hold_on = 1; }
  346. message Force { double force = 1; }
  347. message Weight { double weight = 1; }
  348. // 爪子信息
  349. message ClawInfo {
  350. double amplitude = 1;
  351. double force = 2;
  352. double weight = 3;
  353. int32 hold_on = 4;
  354. }
  355. message ForceTorque { repeated double forceTorque = 1; }
  356. message Joint { // it can represent joint angles(rad) or joint speed (rad/s) or
  357. // torques (Nm)
  358. repeated double joints = 1;
  359. }
  360. message Vector { // x, y, z, rx, ry, rz
  361. repeated double vector = 1;
  362. }
  363. message Temperature { double degree = 1; }
  364. message Current { double current = 1; }
  365. message Factor { double value = 1; }
  366. message Ret { bool ret = 1; }
  367. message CmdId { int32 id = 1; }
  368. message CmdStatus {
  369. // 命令id
  370. int32 id = 1;
  371. // -1: 未执行;0: 已执行
  372. int32 value = 2;
  373. }
  374. message IntRequest { int32 index = 1; }
  375. message Logs {
  376. // 如果没有错误,则返回空
  377. repeated Log log = 1;
  378. }
  379. message Log {
  380. // 1 - Fatal: 严重错误,无法正常运行, 2 - Error:错误,系统可能还能继续运行, 3
  381. // - Warning: 潜在的警告类错误, 4 - Info, 信息类,5 - Debug:调试类
  382. int32 level = 1;
  383. int32 code = 2;
  384. string msg = 3;
  385. }
  386. message SleepRequest { int32 time = 1; }
  387. message SyncRequest { int32 type = 1; }
  388. message SpeedJRequest {
  389. // 单位:rad/s{base, shoulder, elbow, wrist1, wrist2, wrist3}
  390. repeated double joint_speed = 1;
  391. // 单位:rad/s^2
  392. double acceleration = 2;
  393. // 可选参数,单位:秒,设定方法多少秒后返回
  394. double time = 3;
  395. }
  396. message SpeedLRequest {
  397. // 单位:m/s {base, shoulder, elbow, wrist1, wrist2, wrist3}
  398. repeated double velocity = 1;
  399. // 单位:m/s^2,以移动位置长度为衡量标准的加速度
  400. double position_acceleration = 2;
  401. // 可选参数,单位:秒,设定方法多少秒后返回
  402. double time = 3;
  403. // 可选参数,单位:rad/s^2,以转动角度为衡量标准的加速度,如果没给到,则使用第二个参数;如果给到,则使用这个参数
  404. double acceleration = 4;
  405. }
  406. message StopJRequest {
  407. // deceleration 单位:rad/s^2,减速度
  408. double deceleration = 1;
  409. }
  410. message StopLRequest {
  411. // 单位:m/s^2,以移动位置长度为衡量标准的减速度
  412. double position_deceleration = 1;
  413. // 单位:rad/s^2,可选,以转动角度为衡量标准的减速度,如果设定了该值,则使用该值不使用第一个参数??
  414. double deceleration = 2;
  415. }
  416. message MoveCRequest {
  417. // 若 pose_is_joint_angle 为false,则是{x, y, z, rx, ry, rz};否则为{j0, j1,
  418. // j2, j3, j4, j5}每个关节的关节角度,正向运动学会换算成对应的pose
  419. repeated double pose_via = 1;
  420. // 同上
  421. repeated double pose_to = 2;
  422. // 设定pose_via和pose_to是用{x, y, z, rx, ry,
  423. // rz}描述末端位置和姿态还是用关节角度
  424. bool pose_via_is_joint = 3;
  425. bool pose_to_is_joint = 4;
  426. // 单位:m/s^2,工具加速度
  427. double acceleration = 5;
  428. // 单位:m/s,工具速度
  429. double velocity = 6;
  430. // 单位:m,下一段的交融半径
  431. double blend_radius = 7;
  432. // 工作模式:0:无约束模式,Interpolate orientation from current pose to
  433. // target pose (pose_to);1:固定方向模式,使用相对于圆弧切换固定方向的圆弧
  434. int32 mode = 8;
  435. // 单位:s,运动时间
  436. double time = 9;
  437. // 相对坐标系,仅pose_is_joint_angle=false时有效。世界坐标系为{0,0,0,0,0,0}
  438. PR pose_base = 10;
  439. // 弧度 (rad)
  440. double rad = 11;
  441. }
  442. message MoveJRequest {
  443. // 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
  444. repeated double joint_pose_to = 1;
  445. // 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
  446. bool pose_is_joint_angle = 2;
  447. // 单位:rad/s^2,主轴的关节加速度
  448. double acceleration = 3;
  449. // 单位:rad/s,主轴的关节速度
  450. double velocity = 4;
  451. // 单位:s,运动时间
  452. double time = 5;
  453. // 单位:m,下一段的交融半径
  454. double blend_radius = 6;
  455. // 相对坐标系,仅pose_is_joint_angle=false时有效。世界坐标系为{0,0,0,0,0,0}
  456. PR pose_base = 7;
  457. }
  458. message MoveLRequest {
  459. // 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
  460. repeated double pose_to = 1;
  461. // 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
  462. bool pose_is_joint_angle = 2;
  463. // 单位:rad/s^2,主轴的关节加速度
  464. double acceleration = 3;
  465. // 单位:rad/s,主轴的关节速度
  466. double velocity = 4;
  467. // 单位:s,运动时间
  468. double time = 5;
  469. // 单位:m,下一段的交融半径
  470. double blend_radius = 6;
  471. // 相对坐标系,仅pose_is_joint_angle=false时有效。世界坐标系为{0,0,0,0,0,0}
  472. PR pose_base = 7;
  473. }
  474. message MoveLRPYRequest {
  475. // 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
  476. repeated double pose_to = 1;
  477. // 单位:rad/s^2,主轴的关节加速度,如果为-1,则表示未设置值
  478. double acceleration = 2;
  479. // 单位:rad/s,主轴的关节速度,如果为-1,则表示未设置值
  480. double velocity = 3;
  481. // 单位:s,运动时间,如果为-1,则表示未设置值
  482. double time = 4;
  483. // 单位:m,下一段的交融半径,如果为-1,则表示未设置值
  484. double blend_radius = 5;
  485. }
  486. message MovePRequest {
  487. repeated double pose_to = 1;
  488. // 设定pose_to是用{x, y, z, rx, ry,
  489. // rz}描述末端位置和姿态还是用关节角度,如果pose_is_joint_angle是true,正向运动学会计算出对应的{x,
  490. // y, z, rx, ry, rz}
  491. bool pose_is_joint_angle = 2;
  492. // 单位:m/s^2,工具加速度
  493. double acceleration = 3;
  494. // 单位:m/s,工具速度
  495. double velocity = 4;
  496. // 单位:m,下一段的交融半径
  497. double blend_radius = 5;
  498. }
  499. message ServoCRequest {
  500. repeated double pose_to = 1;
  501. // 设定pose_to是用{x, y, z, rx, ry,
  502. // rz}描述末端位置和姿态还是用关节角度,如果pose_is_joint_angle是true,正向运动学会计算出对应的{x,
  503. // y, z, rx, ry, rz}
  504. bool pose_is_joint_angle = 2;
  505. // 单位:m/s^2,工具加速度
  506. double acceleration = 3;
  507. // 单位:m/s,工具速度
  508. double velocity = 4;
  509. // 单位:m,下一段的交融半径
  510. double blend_radius = 5;
  511. }
  512. message ServoJRequest {
  513. // 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
  514. repeated double joint_pose_to = 1;
  515. // 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
  516. bool pose_is_joint_angle = 2;
  517. // 单位:rad/s^2,主轴的关节加速度
  518. double acceleration = 3;
  519. // 单位:rad/s,主轴的关节速度
  520. double velocity = 4;
  521. // 单位:s,运动时间
  522. double time = 5;
  523. // 单位:s,取值范围:0.03 ~ 0.2,使用预向前看的时间来让轨迹平滑
  524. double look_ahead_time = 6;
  525. // 取值范围:100 ~ 2000,proportinal gain for following target position,
  526. int32 gain = 7;
  527. }
  528. // 微调参数
  529. message FineTuning {
  530. int32 mode = 1; // 1: 坐标系模式;2:关节模式
  531. int32 base = 2; // 1: world;2: tcp
  532. int32 coordinate = 3; // 1: 直角坐标系;2:圆柱坐标系
  533. /*
  534. * 需要微调的目标: 轴/关节:
  535. * 1)关节模式下表示关节编号:0-6;
  536. * 2)坐标系模式下
  537. * a) 直角坐标系:0: x, 1: y, 2: z, 3: r, 4: p, 5: y
  538. * b) 圆柱坐标系:0: ρ,1: φ,2: z, 3: r, 4: p, 5: y
  539. */
  540. int32 target = 4;
  541. int32 direction = 5; // 1: +向;-1:负向
  542. }
  543. message LEDStatus {
  544. int32 mode = 1;
  545. // LED_MODE_OFF 1 // 关闭
  546. // LED_MODE_CONST 2 // 常亮
  547. // LED_MODE_BREATHING 3 // 呼吸
  548. // LED_MODE_4_PIES_ROTATE 4 // 四块旋转
  549. // LED_MODE_SINGLE_ROTATE 5 // 同色旋转
  550. // LED_MODE_FLASHING 6 // 闪烁
  551. int32 speed = 2;
  552. // LED_SPEED_HIGH 1
  553. // LED_SPEED_NORMAL 2
  554. // LED_SPEED_SLOW 3
  555. repeated int32 color = 3; // 最多包含4个 0 ~ 15 之间的整数
  556. }
  557. message VoiceStatus {
  558. int32 voice = 1; // 声音列表 0~10
  559. int32 volume = 2;
  560. // VOLUME_MUTE 0
  561. // VOLUME_LOW 1
  562. // VOLUME_DEFAULT 2
  563. // VOLUME_HIGH 3
  564. }
  565. message FanStatus {
  566. int32 fan = 1; // 1 关闭 2 开启
  567. }
  568. message CalcTcpParam {
  569. repeated Vector poses = 1; // all the sampled frame, usually use flange frame.
  570. double tol = 2; // tolerance for standard deviation computing,
  571. // * if any deviation exceed tolerance, the function returns error.
  572. }
  573. message LuaStatus {
  574. LuaState state = 1;
  575. PR last_pose = 2;
  576. JPose last_joints = 3;
  577. }
  578. message LampStatus {
  579. LEDStatus led = 1;
  580. VoiceStatus voice = 2;
  581. FanStatus fan = 3;
  582. }
  583. message PVATRequest {
  584. double duration = 1;
  585. repeated double q = 2;
  586. repeated double v = 3;
  587. repeated double acc = 4;
  588. }
  589. message ExternalPin {
  590. // 外置设备的id
  591. int32 id = 1;
  592. // pin索引
  593. int32 pin = 2;
  594. }
  595. message ExternalPins {
  596. // 外置设备的id
  597. int32 id = 1;
  598. // 起始地址
  599. int32 pin = 2;
  600. // 长度
  601. int32 length = 3;
  602. }
  603. message ExternalDigital {
  604. // 外置设备的id
  605. int32 id = 1;
  606. // pin索引
  607. int32 pin = 2;
  608. // pin索引对应的值
  609. int32 value = 3;
  610. }
  611. message ExternalDigitals {
  612. // 外置设备的id
  613. int32 id = 1;
  614. // 起始地址
  615. int32 pin = 2;
  616. // 长度
  617. int32 length = 3;
  618. // 值数组
  619. repeated int32 values = 4;
  620. }
  621. message ExternalAnalog {
  622. // 外置设备的id
  623. int32 id = 1;
  624. // pin索引
  625. int32 pin = 2;
  626. // pin索引对应的值
  627. double value = 3;
  628. }
  629. message ExternalAnalogs {
  630. // 外置设备的id
  631. int32 id = 1;
  632. // 起始地址
  633. int32 pin = 2;
  634. // 长度
  635. int32 length = 3;
  636. // 值数组
  637. repeated double values = 4;
  638. }
  639. message ExternalDevice {
  640. int32 id = 1;
  641. }
  642. message ExternalIOs {
  643. repeated ExternalDigital dis = 1;
  644. repeated ExternalDigital dos = 2;
  645. repeated ExternalAnalog ais = 3;
  646. repeated ExternalAnalog aos = 4;
  647. }