关于珞石机器人二次开发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));
}
相关推荐
nenchoumi31193 小时前
AirSim/Cosys-AirSim 游戏开发(四)外部固定位置监控相机
ue5·机器人·无人机
老胖闲聊9 小时前
Python ROS2【机器人中间件框架】 简介
python·中间件·机器人
老歌老听老掉牙12 小时前
旋量理论:刚体运动的几何描述与机器人应用
python·算法·机器学习·机器人·旋量
计算机集成_12 小时前
具身智能之人形机器人核心零部件介绍
人工智能·经验分享·机器人
zhbi982 天前
RoboDK 自定义机器人
机器人
Tipriest_2 天前
Pinocchio 库详解及其在足式机器人上的应用
机器人·动力学·足式机器人·运动学·pinocchio
zhuhit2 天前
FASTDDS的安全设计
分布式·机器人·嵌入式
曹勖之2 天前
基于ROS2,撰写python脚本,根据给定的舵-桨动力学模型实现动力学更新
开发语言·python·机器人·ros2
ABB自动化2 天前
for AC500 PLCs 3ADR025003M9903的安全说明
服务器·安全·机器人
DFminer2 天前
【LLM】fast-api 流式生成测试
人工智能·机器人