1.实现目标
相对与world坐标系,有两个子坐标系,已经知道子坐标系的位置,求son1相对于son2的位置
2.发布两个坐标系相对于world的位置,用launch文件实现
<launch>
<!--发布son1和son2相对于world的关系-->
<node pkg="tf2_ros" name="son1toworld" type="static_transform_publisher" args="5 0 0 0 0 0 /world /son1" output="screen" />
<node pkg="tf2_ros" name="son2toworld" type="static_transform_publisher" args="4 0 5 0 0 0 /world /son2" output="screen" />
</launch>
3.发布坐标系的相对关系
#include "ros/ros.h"
#include "tf2_ros/transform_listener.h" //创建定阅对象所需的头文件
#