当前位置: 首页 > news >正文

湖州网站建设推广网页制作源代码

湖州网站建设推广,网页制作源代码,凡科做网站类型应该做哪个,为什么不建议学电子商务?虽然索尼toio Q宝机器人主要是为儿童教育娱乐开发的,但我认为它在工业等领域也有一定应用潜力。例如,工业领域经常会有某些平面在实际作业中持续震动,导致零件过疲劳、平台失去稳定等问题。而这样的平台往往位于机器内部,从外部很…

虽然索尼toio Q宝机器人主要是为儿童教育娱乐开发的,但我认为它在工业等领域也有一定应用潜力。例如,工业领域经常会有某些平面在实际作业中持续震动,导致零件过疲劳、平台失去稳定等问题。而这样的平台往往位于机器内部,从外部很难直接观察。为此,我们可以使用Q宝机器人来持续监测平台的震动情况,当震动导致机器人位移过多,就让机器人移动到预定位置报警,提前避免潜在的风险。

具体操作中,我们需要为机器人预置一个周期间隔,每一个间隔结束后机器人检测自身位置是否发生变化,如果发生变化就移动到预定位置闪灯报警。代码如下:

import asyncio
from toio import *green_cube_location = None
red_cube_location = None
red_cube_arrived = Truedef id_notification_handler(payload: bytearray):global green_cube_locationid_info = IdInformation.is_my_data(payload)if isinstance(id_info, PositionId):green_cube_location = id_info.centerdef id_notification_handler_red(payload: bytearray):global red_cube_locationid_info = IdInformation.is_my_data(payload)if isinstance(id_info, PositionId):red_cube_location = id_info.centerdef motor_notification_handler(payload: bytearray):global red_cube_arrivedmotor_response = Motor.is_my_data(payload)if isinstance(motor_response, ResponseMotorControlTarget):print(motor_response)red_cube_arrived = Trueinit_green_cube_location = green_cube_location.pointdev_list = await BLEScanner.scan(2)
assert len(dev_list) == 2
cube_1 = ToioCoreCube(dev_list[0].interface)
cube_2 = ToioCoreCube(dev_list[1].interface)print("connect cube_1")
await cube_1.connect()
print("connect cube_2")
await cube_2.connect()red = IndicatorParam(duration_ms=0,color=Color(r=255, g=0, b=0)
)green = IndicatorParam(duration_ms=0,color=Color(r=0, g=255, b=0)
)await cube_1.api.indicator.turn_on(green)
await cube_2.api.indicator.turn_on(green)print("start")
await cube_1.api.id_information.register_notification_handler(id_notification_handler)
await cube_2.api.id_information.register_notification_handler(id_notification_handler_red)
await cube_2.api.motor.register_notification_handler(motor_notification_handler)target1 = CubeLocation(point=Point(x=384, y=331), angle=95)
target2 = CubeLocation(point=Point(x=344, y=337), angle=94)# 记录初始位置
init_green_cube_location = green_cube_location.point
init_red_cube_location = red_cube_location.point
print(init_green_cube_location)
print(red_cube_location)# 检测坐标是否改变
while True:if init_green_cube_location != green_cube_location.point or init_red_cube_location != red_cube_location.point:tmp_green_cube_location = green_cube_locationprint(green_cube_location)print("位置变了")# 变红await cube_1.api.indicator.turn_on(red)await cube_2.api.motor.motor_control_target(timeout=5,movement_type=MovementType.Linear,speed=Speed(max=100, speed_change_type=SpeedChangeType.AccelerationAndDeceleration),target=TargetPosition(cube_location=target2,rotation_option=RotationOption.AbsoluteOptimal,),)await cube_1.api.motor.motor_control_target(timeout=5,movement_type=MovementType.Linear,speed=Speed(max=100, speed_change_type=SpeedChangeType.AccelerationAndDeceleration),target=TargetPosition(cube_location=target1,rotation_option=RotationOption.AbsoluteOptimal,),)breakawait asyncio.sleep(1)
await cube_1.api.indicator.turn_on(red)
await cube_2.api.indicator.turn_on(red)
await asyncio.sleep(10)
print("check end  ")
await cube_2.api.motor.unregister_notification_handler(motor_notification_handler
)
await cube_1.api.id_information.unregister_notification_handler(id_notification_handler
)
await cube_2.api.id_information.unregister_notification_handler(id_notification_handler_red
)
print("end")
await cube_1.disconnect()
await cube_2.disconnect()

我们可以在平台不同位置安放两个机器人,从而提高检测精度,同时避免单个机器人故障带来的检测失效问题。实际的检测效果示意如下:

检测工业平台震动1

检测工业平台震动2

可以看到,无论哪个机器人的位置发生移动,都会向另一个机器人发出通知,之后两个机器人一同移动到预定位置闪红灯报警。我们还可以增加更多机器人,即使在更大的平面上也能实现较为可靠的检测效果。

从本案例可以看出,Q宝机器人并非只能用于Q12教学用途,在其他领域也有待挖掘的应用潜力。未来,随着Q宝机器人的能力不断迭代,我们或许可以发现更多可以利用Q宝低成本实现的工业等场景的生产力用途。即便无法直接投入实际生产场景,Q宝机器人也可以用来快速搭建设备原型,为更成熟的产品设计提供参考。未来,希望更多开发者加入Q宝生态,将Q宝的潜能发挥到最大水平。

http://www.yayakq.cn/news/273563/

相关文章:

  • 公司想建个网站泉州网页网站制作
  • 贵阳制作网站vs网站开发入门
  • 杭州建设网站官网国内 wordpress主机
  • 校园网站开发的目的域名免费查询
  • 天河网站建设wordpress提示没有权限
  • 如何做论坛网站成都附近的旅游景点大全
  • 分辨率大于1920的网站怎么做百度地图手机网站代码
  • 环保设计院的网站建设找别人做淘客网站他能改pid吗
  • 无锡做网站哪家好丰台建设企业网站
  • 域名和网站一样吗江阴 网站开发
  • 淘宝客都在什么平台建网站百度网站怎么建设
  • 青岛网站互联网公司淘宝网页版手机登录
  • 个人网站 虚拟主机价格阳泉 网站建设合作
  • 长沙品牌logo设计公司seo推广效果怎么样
  • 通辽北京网站建设如何发布网页
  • 果洛营销网站建设哪家好长沙建设教育网
  • 做美食教程的网站有哪些建设银行网站一直打不开
  • 外包网站自己维护个人申请公众号注册
  • 企业网站制作 优帮云英文网站设计制作
  • 长沙点梦网站建设河北省建设资格执业中心网站
  • 福步外贸官网济南seo的排名优化
  • iis7配置asp网站国家企业营业执照查询
  • 广州万安建设监理有限公司网站wordpress nginx php.ini
  • 做3d打印网站枣强网站建设培训学校
  • 网站建设地基本流程太原提高网站排名
  • 青岛网站建设青岛新思维网站按钮样式
  • 公司网站的留言板怎么做企业网站制作比较好的
  • 关于做外汇现货的网站网站目录改版如何301跳转呀
  • 网站导航栏按钮网站建设与行政管理
  • 做班级网站的素材网站制作模版