def _set_motor_positions(self, pos):
gain = 1 / 0.009
msg = Float32()
if not USE_F32:
msg.header.stamp = rospy.rostime.get_rostime()
if (pos - 0.95).all() and self._hyperparams['constraint']:
pos = self._constraint.find_nearest_valid_values(pos)
for i in range(12):
msg.data = min(max(7.5, ((0.95 - pos[i]) * gain) + (7.5 / gain)), 40)
self._motor_pubs[i].publish(msg)
评论列表
文章目录