手眼标定过程记录

手眼标定过程记录手眼标定过程记录============================================================================================以下四个变量是最重要的数据rvecs_rb2gripper,tvecs_rb2gripperrvecs_cam,tvecs_cam1.首先排查机械臂末端到底座的旋转平移

大家好,又见面了,我是你们的朋友全栈君。

手眼标定过程记录

============================================================================================

以下四个变量是最重要的数据

rvecs_rb2gripper, tvecs_rb2gripper
rvecs_cam, tvecs_cam

1. 首先排查机械臂末端到底座的旋转平移是否正确

通过查看clopema_certh_ros
1.首先末端到底座的变换,listen的结果居然求逆了。

gripper_to_base.push_back(tr.inverse()) ;

2.然后标定板到相机的变换
最重要的rvecs和tvecs是通过下面的函数得到的,收集好所有帧的imagepoints一次性运算出所有外参

cv::calibrateCamera

而glawgow是通过对每一帧的imagepoints采用下面的函数获得每一次的外参矩阵的

solvePnPRansac

具体函数如下:

cv::calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags|CV_CALIB_FIX_K4|CV_CALIB_FIX_K5);
solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvecEx, tvecEx, false, 100, 1.0, 0.99, inliers);

2. 关于容器中使用Eigen的报错:

/usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
Aborted

解决方法:

头文件里添加如下:

#include <Eigen/StdVector>
using namespace Eigen;
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Affine3d)//解决vector中Eigen对齐的问题

参考

eigen官网


3. 关于tool0_controller报错的问题

2017/12/29
由于ur_modern_driver需要修改urdf,即用modern_driver进行ur驱动协助手眼标定的时候,在ur3.urdf.xacro中添加了tool0_controller

/home/cbc/catkin_ws/src/universal_robot/ur_description/urdf/ur3.urdf.xacro

一开始以为是tool0_controller的问题,导致rviz不能正常使用,经常闪退,ur3_moveit_config更是报错打不开。报错内容如下:

[ERROR] [1515404258.018207679]: Ignoring transform for child_frame_id "tool0_controller" from authority "unknown_publisher" because of a nan value in the transform (0.000000 26815622274503241629349378993175553962225540122973894056168551426931042827562994218784229639762337459109057520690886188494020583679371347120178163255083008.000000 26815622274206272770731577112262473438093890782345820683584369763133472687942565341004009969841415624372630858128332080466218773763999513725165301565227008.000000) (-nan -nan -nan -nan)

后经查询是因为loosing the connection to the realtime port,导致tf信息丢失,并且重新获得连接后,随机发布末端位姿信息,严重影响标定过程。

解决方法:

修改ur_modern_driver里的ur_communication.cpp和ur_realtime_communication.cpp,使得在每次重连(Reconnect)的时候清空buffer等等,主要添加以下:

bzero(buf, 2048);
FD_ZERO(&readfds);
FD_SET(sockfd_, &readfds);  

参考

ur_modern_driver——issues——Wrong/random joint positions published by the driver after loosing the connection to the realtime port


4. 关于TransformBroadcaster和TransformListener

之前一直搞不清Get the transform between two frames by frame ID,到底是哪个坐标系到哪个的变换,这方面官网没有介绍清楚,查找资料结合实验验证,不保证完全正确,总结如下:
发布transform:

tf::TransformStampedTFToMsg(transform, msg_trans);
StampedTransform (const tf::Transform &input, const ros::Time &timestamp,
                  const std::string &frame_id, const std::string &child_frame_id)

表示child_frame_id在frame_id下的位姿;

接收transform:

lookupTransform (const std::string &target_frame, const std::string &source_frame,
         const ros::Time &time,  StampedTransform &transform) const

表示source_frame相对于target_frame的位置和姿态.

参考:

关于坐标系变换的一篇比较详细的


5. 关于实时显示点云,fixed frame不存在的问题

roslaunch kinect2_bridge kinect2_bridge.launch
rviz

报错内容如下:

displayed Pointcloud2 using Rviz, "fixed frame(map)does not exist"

解决方法:

主要是launch的时候,要将publish_tf置为true,并将rviz中的fixed frame填为kinect2_link

roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true

参考:

1kinect2 fixed frame does not exist
2kinect2_link Location on Device?


6. 每次标定的流程

启动node顺序

roslaunch calibration_glasgow  baxter_handeye_calibration.launch 
rosrun    calibration_glasgow  pub_robot_trans
rosrun    calibration_glasgow  call_handeye_calib

根据标定结果修改urdf

/home/cbc/catkin_ws/src/iai_robots/iai_kinect2_description/urdf/kinect2_camera.urdf.xacro

由于reconnect的问题,rviz时常崩溃

rviz

奇怪的事情

1.rviz显示点云以前都是没有颜色的,刚才突然就有颜色了
哈哈这是因为我自己每次都拍一张静态图,然后以PointXYZ的格式读入。。。

2.标定程序上周就没有改,为什么突然就准了

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/140639.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • icmp 报文详解

    icmp 报文详解以下内容转载自: http://blog.csdn.net/tigerjibo/article/details/7356936写的很好的icmp报文详解:一.概述:1.   ICMP允许主机或路由报告差错情况和提供有关异常情况。ICMP是因特网的标准协议,但ICMP不是高层协议,而是IP层的协议。通常ICMP报文被IP层或更高层协议(

    2022年4月29日
    44
  • 51单片机iic通信例程_linux移植8位单片机

    51单片机iic通信例程_linux移植8位单片机移植好的源码下载:http://download.csdn.net/detail/lxj_com2006/3746433Keil3C518.18注册版下载:http://download.csdn.net/detail/lxj_com2006/3746501网络抓包工具下载:http://download.csdn.net/detail/lxj_com2006/3746594

    2022年10月21日
    0
  • CSS-圆角边框

    CSS-圆角边框掌握了圆角边框的内容就可以做出类似百度搜索框的效果来代码 DOCTYPE tml htmllang en head metacharset UTF 8 metahttp equiv X UA Compatible content IE edge metahttp equiv X UA Compatible content IE edge metacharset UTF 8 head htmllang en

    2025年6月11日
    0
  • eclipse使用jrebel

    eclipse使用jrebeljrebel 注:以下都是网上收集整理的,可能不全,仅限于学习和研究使用。 JavaRebel是一个工具,主要是用于热加载,比如说在Tomcat之类的应用服务器中,更新了class或者某些资源文件,使用了JRebel之后,就不需要重新启动应用服务器。这里有一点先声明一下,本文只是激活成功教程仅限于学习和研究使用,勿用于其他用途。下载地址:http://www.zeroturnar…

    2022年6月18日
    49
  • GBDT算法梳理_gbdt分类

    GBDT算法梳理_gbdt分类集成算法大致分为两类:Boosting(迭代)和Bagging(装袋)。在前面的博客中,有提到,存在强依赖关系、必须串行生成的序列化方法,代表算法是Boosting,不存在强依赖关系、可同时生成的并行化方法,代表算法有Bagging、RandomForest。其中Boosting集成算法的典型代表算法有Adaboost,GBDT(GradientBoostingDecisionTree),…

    2022年10月12日
    0
  • android内置存储器memory和第三方外部存储disk管理

    android内置存储器memory和第三方外部存储disk管理

    2022年1月9日
    37

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号