终端一体化运控平台
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.

robot_test.proto 5.5 KiB

2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. syntax = "proto3";
  2. import "messages.proto";
  3. package robotc;
  4. service RobotTest {
  5. rpc InitReducerTest(Empty) returns (Result);
  6. rpc ReducerTest(ReducerRequest) returns (ReducerResult);
  7. rpc InitJointTest(Empty) returns (Result);
  8. rpc JointStudy(Empty) returns (JointStudyResult);
  9. rpc JointTest(JointRequest) returns (JointResult);
  10. rpc TestCommand(CommandRequest) returns (CommandResult);
  11. /// 磨合测试,返回每个周期的结果,主动断开即停止
  12. rpc RunInTest(RunInRequest) returns(RunInResult);
  13. /// 绝对精度测试
  14. rpc MoveDetectTest(MoveDetectRequest) returns(MoveDetectResult);
  15. /// 百分表读取
  16. rpc GetDialIndicator(DeviceIds) returns(DeviceValues);
  17. /// 量产测试
  18. rpc StartProductTest(ProductTestRequest) returns(ProductTestResult);
  19. /// 主机箱测试: 1, 正常;其他异常
  20. rpc BoxTest(Empty) returns(Result);
  21. // 初始化机器人设备信息
  22. /**
  23. {
  24. "robot": {
  25. "model": "LM6J",
  26. "sn": "C01905010001XX"
  27. },
  28. "name": "lebai-Yonnie",
  29. "mac": "B6LLYLUAQG19",
  30. "arm": {
  31. "sn": "R01905010001XX"
  32. }
  33. }
  34. */
  35. rpc InitRobot(RobotInfo) returns (InitRobotResult);
  36. rpc WriteSn(DeviceInfo) returns (WriteSnResult);
  37. rpc ReadSn(DeviceTypeRequest) returns (DeviceInfo);
  38. }
  39. message Empty {}
  40. message Result {
  41. int32 ok = 1; // 0 正常 其他异常
  42. int32 testError = 2;
  43. }
  44. message Joints {
  45. repeated double pose = 1;
  46. }
  47. message ReducerRequest {
  48. double v = 1; // 转速
  49. }
  50. message ReducerResult {
  51. double voltage = 1; // 电压 V
  52. double v = 2; // 转速 rpm
  53. double torque = 3; // 扭矩 Nm
  54. }
  55. message JointStudyResult {
  56. uint32 motor_encoder = 1; // 电机编码(磁编位置)
  57. }
  58. message JointRequest {
  59. uint32 joint_type = 1; // 0 大关节 1 小关节
  60. }
  61. message JointResult {
  62. double backlash = 1; // 空程 °
  63. double pos_stable_time = 2; // 位置稳定时间 s
  64. double pos_overshot = 3; // 位置超调量 rad
  65. double temperature = 4; // 关节内部温度 ℃
  66. double current = 5; // 电流 A
  67. double voltage = 6; // 电压 V
  68. double v = 7; // 转速 rpm
  69. double torque = 8; // 电机扭矩 Nm
  70. uint32 motor_encoder = 9; // 电机编码(磁编位置)
  71. double joint_torque = 10; // 关节扭矩
  72. double reducer_eff = 11; // 减速器效率
  73. double motor_eff = 12; // 电机效率
  74. }
  75. message CommandRequest {
  76. int32 type = 1; // 类型
  77. int32 value_i = 2;
  78. double value_f = 3;
  79. }
  80. message CommandResult {
  81. int32 code = 1; // 返回码,默认0即可
  82. }
  83. message MovePoint {
  84. // 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
  85. repeated double joint_pose_to = 1;
  86. // 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
  87. bool pose_is_joint_angle = 2;
  88. // 单位:rad/s^2,主轴的关节加速度
  89. double acceleration = 3;
  90. // 单位:rad/s,主轴的关节速度
  91. double velocity = 4;
  92. // 单位:s,运动时间
  93. double time = 5;
  94. // 单位:m,下一段的交融半径
  95. double blend_radius = 6;
  96. }
  97. message RunInRequest {
  98. repeated MovePoint path = 1; // 单个磨合测试周期轨迹
  99. double equivalent_radius = 2; // 等效半径 m
  100. double threshold_distance = 3;// 门限距离 m
  101. double position_stable_time = 4; // 位置稳定时间(最大) s
  102. double position_overshoot = 5; // 位置超调量(最大) m
  103. double pose_stable_time = 6; // 姿态稳定时间(最大) s
  104. double pose_overshoot = 7; // 姿态超调量(最大) m
  105. }
  106. message RunInJointInfo {
  107. double min_velocity = 1; // 反馈速度 m/s
  108. double max_velocity = 2; // 反馈速度
  109. double min_voltage = 3; // 电压 V
  110. double max_voltage = 4; // 电压
  111. double min_temperature = 5; // 温度 ℃
  112. double max_temperature = 6; // 温度
  113. }
  114. message RunInPathResult {
  115. repeated RunInJointInfo joints = 1;
  116. }
  117. message RunInResult {
  118. bool ok = 1; // 是否符合标准
  119. repeated RunInPathResult path = 2; // 每条轨迹的抖动值
  120. double position_stable_time = 4; // 位置稳定时间 s
  121. double position_overshoot = 5; // 位置超调量 m
  122. double pose_stable_time = 6; // 姿态稳定时间 s
  123. double pose_overshoot = 7; // 姿态超调量 m
  124. string filename = 8; // csv文件路径
  125. }
  126. message DeviceIds {
  127. repeated uint32 id = 1; // 同类型的第几个设备
  128. }
  129. message DeviceValues {
  130. repeated double value = 1; // 读数结果
  131. }
  132. message ProductTestRequest {
  133. uint32 cmd = 1; // 测试命令
  134. }
  135. message ProductTestResult {
  136. uint32 testRes = 1; // 测试结果
  137. uint32 testError = 2;
  138. }
  139. message InitRobotResult {
  140. int32 ret = 1; // 初始化Robort返回结果
  141. string cup = 2; // 绑定hash值
  142. }
  143. message WriteSnResult {
  144. int32 writeSnRes = 1; // 写sn结果
  145. }
  146. message DeviceTypeRequest {
  147. int32 devType = 1; // 要读sn的设备类型
  148. }
  149. message DecimalInput {
  150. int32 pin = 1;
  151. int32 value = 2; // 1 或者 0。若为 -1 则表示没有结果(没有运行到此处)
  152. }
  153. message MoveDetectPath {
  154. MovePoint path = 1; // 单个轨迹
  155. repeated DecimalInput moving = 2; // 移动中的各传感器应有值
  156. repeated DecimalInput cross = 3; // 移动完成后(交点)时的各传感器应有值
  157. }
  158. message MoveDetectRequest {
  159. repeated MoveDetectPath req = 1;
  160. }
  161. message MoveDetectResult {
  162. bool ok = 1; // 是否符合标准
  163. repeated MoveDetectPath res = 2; // 周期内移动中的传感器值,不保证path是对的
  164. string filename = 3; // csv文件路径
  165. }