目录
3.准备标定板,一定要选择Original ArUco,但是最好是100mm
1.参考链接
1)https://blog.csdn.net/m0_56661101/article/details/134860576?fromshare=blogdetail&sharetype=blogdetail&sharerId=134860576&sharerefer=PC&sharesource=qq_70851292&sharefrom=from_link
2)https://blog.csdn.net/weixin_45702459/article/details/139293764?fromshare=blogdetail&sharetype=blogdetail&sharerId=139293764&sharerefer=PC&sharesource=qq_70851292&sharefrom=from_link
3)https://zhuanlan.zhihu.com/p/33441113
2. intel realsense 的深度相机配置
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
3.配置easy_handeye和aruco_ros
# Go to src directory under your workspace
cd ~/ur5_ws/src
# Download repo Aruco是一个用于检测和估计姿态的库
# “easy handeye” 是一个用于手眼标定(Hand-Eye Calibration)的软件工具。
git clone https://github.com/IFL-CAMP/easy_handeye
git clone https://github.com/pal-robotics/aruco_ros.git --branch noetic-devel
# Go to your workspace
cd ~/ur5_ws
# Install dependencies 安装依赖
rosdep install -iyr --from-paths src
# Go to your workspace
cd ~/ur_ws
# Build your workspace 编译
catkin_make
# 更新环境变量
source ./devel/setup.bash
source .bashrc
3.准备标定板,一定要选择Original ArUco,但是最好是100mm
网站:https://chev.me/arucogen/
# 创建用于标定的launch文件
touch ur5_cali.launch
<launch>
<arg name="namespace_prefix" default="ur5_realsense_handeyecalibration" />
<arg name="robot_ip" doc="The IP address of the UR5 robot" />
<arg name="marker_size" doc="Size of the ArUco marker used, in meters" default="0.165" />
<arg name="marker_id" doc="The ID of the ArUco marker used" default="55"/>
<!-- start the realsen435 -->
<include file="$(find realsense2_camera)/launch/rs_camera.launch" >
</include>
<!-- 2. start ArUco -->
<node name="aruco_tracker" pkg="aruco_ros" type="single">
<remap from="/camera_info" to="/camera/color/camera_info" />
<remap from="/image" to="/camera/color/image_raw" />
<param name="image_is_rectified" value="true"/>
<param name="marker_size" value="$(arg marker_size)"/>
<param name="marker_id" value="$(arg marker_id)"/>
<param name="reference_frame" value="camera_color_optical_frame"/>
<param name="camera_frame" value="camera_color_optical_frame"/>
<param name="marker_frame" value="camera_marker" />
</node>
<!-- start the robot -->
<include file="$(find ur_robot_driver)/launch/ur5_bringup.launch">
<arg name="robot_ip" value="192.168.55.101" />
</include>
<include file="$(find ur5_moveit_config)/launch/ur5_moveit_planning_execution.launch">
</include>
<!-- 4. start easy_handeye -->
<include file="$(find easy_handeye)/launch/calibrate.launch" >
<arg name="namespace_prefix" value="$(arg namespace_prefix)" />
<arg name="eye_on_hand" value="true" />
<arg name="tracking_base_frame" value="camera_link" />
<arg name="tracking_marker_frame" value="camera_marker" />
<arg name="robot_base_frame" value="base" />
<arg name="robot_effector_frame" value="tool0" />
<arg name="freehand_robot_movement" value="false" />
<arg name="robot_velocity_scaling" value="0.5" />
<arg name="robot_acceleration_scaling" value="0.2" />
</include>
</launch>
查看ur5 ip,启动文件,<arg name="eye_on_hand" value="true" />眼在手上,marker_size尺寸和id
robot_base_frame,robot_effector_frame
4.标定
roslaunch easy_handeye ur5_cali.launch
rviz中Fixed Frame 选择为base,添加话题/aruco_tracker中的/resultdeimage,查看tf
首先check , take sample, Next pose,execute(Next pose,execute,重复直到图案在相机图像中),然后就是take sample, Next pose,execute,重复16次,最后compute,save
bitranslation:
x: 0.08153486992230667
y: 0.08917161860998708
z: 0.04254003925205098
rotation:
x: -0.62178924917567
y: -0.3208396282465462
z: -0.6376606852273734
w: 0.32222494172787386
5.创建发布tf变化的launch
touch ur5_cali.launch
<launch>
<!-- start the robot -->
<include file="$(find ur_robot_driver)/launch/ur5_bringup.launch">
<arg name="robot_ip" value="192.168.55.101" />
</include>
<include file="$(find ur5_moveit_config)/launch/ur5_moveit_planning_execution.launch">
</include>
<include file="$(find ur5_moveit_config)/launch/moveit_rviz.launch">
</include>
<arg name="serial_no" default=""/>
<arg name="json_file_path" default=""/>
<arg name="camera" default="camera"/>
<group ns="$(arg camera)">
<include file="$(find realsense2_camera)/launch/includes/nodelet.launch.xml">
<arg name="serial_no" value="$(arg serial_no)"/>
<arg name="json_file_path" value="$(arg json_file_path)"/>
<arg name="depth_width" value="640"/>
<arg name="depth_height" value="480"/>
<arg name="depth_fps" value="30"/>
<arg name="color_width" value="640"/>
<arg name="color_height" value="480"/>
<arg name="color_fps" value="30"/>
<arg name="enable_depth" value="true"/>
<arg name="enable_color" value="true"/>
<arg name="enable_infra1" value="false"/>
<arg name="enable_infra2" value="false"/>
<arg name="enable_fisheye" value="false"/>
<arg name="enable_gyro" value="false"/>
<arg name="enable_accel" value="false"/>
<arg name="enable_pointcloud" value="true"/>
<arg name="enable_sync" value="true"/>
<arg name="tf_prefix" value="$(arg camera)"/>
</include>
// static_transform_publisher x y z qx qy qz qw frame_id child_frame_id period_in_ms
<node pkg="tf2_ros" type="static_transform_publisher" name="ur5_broadcaster" args="0.11098614183021381 0.08257733459112608 0.0020134820545441396 -0.6102823667892885 -0.32919866299197686 -0.6520172498587709 0.306687428755996 tool0 camera_link" />
</group>
</launch>
查看ur5 ip,启动文件,x y z qx qy qz qw frame_id child_frame_id,工具坐标系tool0,相机坐标系
roslaunch easy_handeye tfpc.launch
添加tf,查看相机位姿