def apply(self, image, scale):
d = ImageDraw.Draw(image)
bounds = [3, 0, image.width, image.height]
def print_line(text_line):
text = cozmo.annotate.ImageText(text_line, position=cozmo.annotate.TOP_LEFT, color='lightblue')
text.render(d, bounds)
TEXT_HEIGHT = 11
bounds[1] += TEXT_HEIGHT
robot = self.world.robot
# Display the Pose info for the robot
pose = robot.pose
print_line('Pose: Pos = <%.1f, %.1f, %.1f>' % pose.position.x_y_z)
print_line('Pose: Rot quat = <%.1f, %.1f, %.1f, %.1f>' % pose.rotation.q0_q1_q2_q3)
print_line('Pose: angle_z = %.1f' % pose.rotation.angle_z.degrees)
print_line('Pose: origin_id: %s' % pose.origin_id)
# Display the Accelerometer and Gyro data for the robot
print_line('Accelmtr: <%.1f, %.1f, %.1f>' % robot.accelerometer.x_y_z)
print_line('Gyro: <%.1f, %.1f, %.1f>' % robot.gyro.x_y_z)
capture_imgs_remote_driving_cozmo.py 文件源码
python
阅读 35
收藏 0
点赞 0
评论 0
评论列表
文章目录