关于珞石机器人二次开发SDK的posture函数的算法RX RY RZ纠正 C#

在珞石SDK二次开发的函数钟,获取当前机器人位姿的函数posture函数在输出时会发现数据不正确,与示教器数据不一致。

其中第一个数据正确 第二三各数据为相反 第四五六各数据为弧度制

转换方法为(弧度/PI)*180度

然后发现第四个数据还要加上180度

第五六各数据要取反,,所以设计了以下代码

cs 复制代码
void(){
ErrorCode ec;
Lamp1.IsHighlight =  robot.getDO(1, 1, out ec);
Lamp2.IsHighlight = robot.getDO(1, 11, out ec);
Lamp3.IsHighlight = robot.getDO(1, 12, out ec);
Lamp4.IsHighlight = robot.getDO(1, 13, out ec);
Lamp5.IsHighlight = robot.getDO(1, 14, out ec);
Lamp6.IsHighlight = robot.getDO(1, 15, out ec);
Lamp7.IsHighlight = robot.getDO(1, 16, out ec);
//创建新数组保存数据
double[] aa=new double[6];
aa[0] = robot.posture(CoordinateType.endInRef, out ec)[0]*1000;//TX
aa[1] = -robot.posture(CoordinateType.endInRef, out ec)[1] * 1000;//TY
aa[2] = -robot.posture(CoordinateType.endInRef, out ec)[2] * 1000;//TZ
aa[3] = robot.posture(CoordinateType.endInRef, out ec)[3];//RX
aa[4] = robot.posture(CoordinateType.endInRef, out ec)[4];//RY
aa[5] = robot.posture(CoordinateType.endInRef, out ec)[5];//RZ

double pi = 3.14159265354;
double rad = 180;
//二次转换
aa[3]= 180+(aa[3]*rad)/pi;
aa[4]= -(aa[4]*rad)/pi;
aa[5]= -(aa[5]*rad)/pi;
label1.Text = "当前位置:"+aa[0].ToString("0.000")+','+aa[1].ToString("0.000") + ',' + aa[2].ToString("0.000") + ',' + aa[3].ToString("0.000") + ',' + aa[4].ToString("0.000") + ',' + aa[5].ToString("0.000");
label2.Text = "坐标系:" + String.Join(",",robot.baseFrame(out ec));
label3.Text = "关节位置:" + String.Join(",",robot.jointPos(out ec));
}
相关推荐
中國龍在廣州5 小时前
现在人工智能的研究路径可能走反了
人工智能·算法·搜索引擎·chatgpt·机器人
数据与后端架构提升之路5 小时前
RT-2:Google DeepMind的机器人革命——如何让AI从网页知识中学会操控现实世界
机器人·视觉语言动作模型·rt-2模型·google deepmind·链式思维推理
攻城狮7号5 小时前
小米具身大模型 MiMo-Embodied 发布并全面开源:统一机器人与自动驾驶
人工智能·机器人·自动驾驶·开源大模型·mimo-embodied·小米具身大模型
shayudiandian7 小时前
ChatGPT风格对话机器人搭建教程
人工智能·chatgpt·机器人
robot_learner12 小时前
11 月 AI 动态:多模态突破・智能体模型・开源浪潮・机器人仿真・AI 安全与主权 AI
人工智能·机器人·开源
IT观测14 小时前
手部动作捕捉技术系统推荐:机器人灵巧操作的革命
机器人
m0_650108241 天前
PaLM-E:具身智能的多模态语言模型新范式
论文阅读·人工智能·机器人·具身智能·多模态大语言模型·palm-e·大模型驱动
J_Xiong01171 天前
【VLNs篇】17:NaVid:基于视频的VLM规划视觉语言导航的下一步
人工智能·机器人
ModestCoder_1 天前
PPO-clip算法在Gymnasium的Pendulum环境实现
人工智能·算法·机器人·具身智能
AiTEN_Robot3 天前
技术赋能降本:机器人叉车在物流场景的成本优化实践
机器人·自动化·制造