手眼标定过程记录

手眼标定过程记录手眼标定过程记录============================================================================================以下四个变量是最重要的数据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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Git常用命令

    Git常用命令Git常用命令

    2022年4月23日
    46
  • IPNC dm368 sd烧写[通俗易懂]

    IPNC dm368 sd烧写[通俗易懂]http://e2e.ti.com/support/embedded/linux/f/354/t/87980.aspx

    2022年8月13日
    9
  • 损失函数loss大总结

    损失函数loss大总结分类任务loss:二分类交叉熵损失sigmoid_cross_entropy:TensorFlow接口:tf.losses.sigmoid_cross_entropy(multi_class_labels,logits,weights=1.0,label_smoothing=0,scope=None,loss_c…

    2022年6月19日
    20
  • ftp客户端发起对ftp服务器_ftp登陆命令

    ftp客户端发起对ftp服务器_ftp登陆命令FTP是一个C/S类型的软件,连接服务端需要FTP客户端才能完成,常见的FTP客户端有以下几种:浏览器:可以通过浏览器中输入ftp://ip或者ftp://域名的方式3分钟了解计算机发展历史-组团学来访问FTP自带客户端:命令行下可以使用ftp命令去连接三方客户端:FileZilla8uftp图形软件或者文本界面的lftp等三种方式中,文本界面是比较麻烦的,无法鼠标流。所以我重点给大家讲解一…

    2022年10月21日
    4
  • CListCtrl使用「建议收藏」

    CListCtrl使用「建议收藏」列表控件可以看作是功能增强的ListBox,它提供了四种风格,而且可以同时显示一列的多中属性值。MFC中使用CListCtrl类来封装列表控件的各种操作。通过调用BOOLCreate(DWORDdwStyle,constRECT&rect,CWnd*pParentWnd,UINTnID)创建一个窗口,dwStyle中可以使用以下一些列表控件的专用风格:•

    2022年6月23日
    32
  • Spring Boot Configuration Annotation Processor not found in classpath解决方法

    版权声明: 这是我在学习SpringBoot入门中遇到的第一个问题,其实就是说提示的classpath中找不到,查询此注解的使用关系怎么指定classpath。如果是配置在application.properties下的,Spring默认在加载的时候就会转到容器里面。所有说问题很简单:解决方案: 其实这个可能就是你没有在maven中导入自动装配映射的依赖包 &amp;amp;amp;lt;!– …

    2021年11月30日
    49

发表回复

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

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