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

做电影网站要怎么样的主机付费内容网站

做电影网站要怎么样的主机,付费内容网站,花店网页设计素材,需要注册的网站建设问题: 在Isaac-sim中如果采用set_world_pose()和get_world_pose()得到的都是四元数,如何将弧度转四元数,或者将四元数转为弧度是需要解决的一个问题, 这里的弧度是以x轴为0度,y轴为90度,逆时针方向逐渐增大…

问题:

在Isaac-sim中如果采用set_world_pose()和get_world_pose()得到的都是四元数,如何将弧度转四元数,或者将四元数转为弧度是需要解决的一个问题,
这里的弧度是以x轴为0度,y轴为90度,逆时针方向逐渐增大;

解决方案:

采用scipy.spatial.transform中的Rotation库,进行转换;
在转换的时候涉及到角度的变换,
即如果直接采用Rotation.from_euler(‘x’, angle_rad2, degrees=False)进行转换,得到的是以x轴负方向为0度,y轴为90度,顺时针方向逐渐增大;
因此需要在rad_to_quaternion函数中通过angle_rad2 = -angle_rad + math.pi方法进行转换,同样的在quaternion_to_angle函数中通过angle_rad = -angle_rad + math.pi将转换回来。

import math
from scipy.spatial.transform import Rotation
import torchdef rad_to_quaternion(angle_rad):if angle_rad > math.pi:angle_rad -= 2 * math.pielif angle_rad < -math.pi:angle_rad += 2 * math.piangle_rad2 = -angle_rad + math.pirotation = Rotation.from_euler('x', angle_rad2, degrees=False)# print("rotation.as_quat()=%s" % (str(rotation.as_quat())))quaternion = rotation.as_quat()[:]  # 将旋转矩阵转换为四元数return quaternion, angle_rad, angle_rad2def quaternion_to_angle(quaternion):rotation = Rotation.from_quat(quaternion)euler_angles = rotation.as_euler('xyz')angle_rad = euler_angles[0]angle_rad = -angle_rad + math.piif angle_rad > math.pi:angle_rad -= 2 * math.pielif angle_rad < -math.pi:angle_rad += 2 * math.pireturn angle_radfor i in range(361):rad = math.radians(i)quaternion, rad_ori, rad_new = rad_to_quaternion(rad)rad_bak = quaternion_to_angle(quaternion)theta0 = math.degrees(rad_ori)theta1 = math.degrees(rad_new)theta2 = math.degrees(rad_bak)print("原始角度为%s,经过变换后角度为%s,转换后的角度为%s"%(str(round(theta0)), str(round(theta1)), str(round(theta2))))# rad_new = math.floor(rad_new * 10000) / 10000# rad_bak = math.floor(rad_bak * 10000) / 10000# if rad_new != rad_bak:#     print("出错了rad_new=%s, rad_bak=%s"%(str(rad_new), str(rad_bak)))# print("rad=%.4f, rad_bak=%.4f"%(rad, rad_bak))
http://www.dt0577.cn/news/579.html

相关文章:

  • 酷玛网站建设申请域名
  • 做网站卖产品投资大嘛网络营销与推广
  • 用网站做淘宝客最近发生的热点新闻事件
  • 网站权重如何提高南昌seo排名
  • django网站开发流程高州网站seo
  • 公司设计网站定制湖南网络推广机构
  • 设计网站页面出现问题优化网络推广外包
  • 做时时彩网站平台软件宁波seo软件免费课程
  • 如何用html和css做网站外链seo
  • 网站落地页如何做网站设计的基本原则
  • 企业培训 电子商务网站建设 图片公众号seo排名优化
  • WordPress5分钟建站天津seo排名公司
  • 公司网站制作费用多少windows优化大师是什么软件
  • 网站被k如何恢复徐州百度运营中心
  • 做网站新手流程网络优化seo薪酬
  • 宁夏银川做网站的公司有哪些在广州做seo找哪家公司
  • 洛阳电商网站建设b2b平台推广
  • 网站建设客户沟通模块百度seo培训
  • 需要找做网站的国家高新技术企业查询
  • 教做详情页的网站广州搜索seo网站优化
  • 17做网店一样的网站百度导航下载2020新版语音
  • 国家电网网站制作首页关键词怎么排名靠前
  • 郑州微网站建设公司营销型网站更受用户欢迎的原因是
  • 网站怎么做h5支付网站加速
  • 网站建设的完整流程包括网络营销学校
  • 游戏软件开发公司简介西安百度关键词优化排名
  • github php 网站开发成都百度seo推广
  • 烟台高端网站建设广告投放平台都有哪些
  • 有经验的坪山网站建设百度一下百度搜索百度
  • 网站开发人员 怎么保存网络推广主要做什么