"camera_odom_frame" passed to lookupTransform argument target_frame does not exist

asked 2023-04-06 03:16:03 -0500

Zaveid gravatar image

updated 2023-04-08 08:09:32 -0500

Mike Scheutzow gravatar image

Can u help me, im run

roslaunch vision_to_mavros apriltags_to_mavros.launch

in terminal And out the message came out.

This is file apriltag_to_mavros.launch

<launch>
    <!-- Set this to your camera's name -->
    <arg name="cam_name" value="camera" />
    <arg name="tag_name" value="tags" />


    <!-- This node description you can take from usb_cam-test.launch -->
    <node name="$(arg cam_name)" pkg="usb_cam" type="usb_cam_node" output="screen" >
        <param name="video_device" value="/dev/video0" />
        <param name="image_width" value="640" />
        <param name="image_height" value="480" />
        <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam" />
        <param name="camera_name" value="head_camera" />
        <param name="camera_info_url" value="file:///home/flyrg/.ros/camera_info/head_camera.yaml" />
        <param name="io_method" value="mmap"/>
    </node>


    <!-- This node provides image rectification -->
    <node name="image_proc" pkg="image_proc" type="image_proc" ns="$(arg cam_name)"/>


    <!-- This node will launch apriltag_ros -->
    <arg name="launch_prefix" default="" /> 
    <arg name="node_namespace" default="apriltag_ros_continuous_node" />
    <arg name="camera_name" default="/$(arg cam_name)" />
    <arg name="camera_frame" default="camera_frame" />
    <arg name="image_topic" default="image_rect" />

    <!-- Set parameters -->
    <rosparam command="load" file="$(find apriltag_ros)/config/settings.yaml" ns="$(arg node_namespace)" />
    <rosparam command="load" file="$(find apriltag_ros)/config/$(arg tag_name).yaml" ns="$(arg node_namespace)" />

    <node pkg="apriltag_ros" type="apriltag_ros_continuous_node" name="$(arg node_namespace)" clear_params="true" output="screen" launch-prefix="$(arg launch_prefix)" >
        <remap from="image_rect" to="$(arg camera_name)/$(arg image_topic)" />
        <remap from="camera_info" to="$(arg camera_name)/camera_info" />

        <param name="camera_frame" type="str" value="$(arg camera_frame)" />
        <param name="publish_tag_detections_image" type="bool" value="true" /> 
    </node>


    <!-- This node will launch frame conversion from vision pose (tf) to mavros pose -->
    <node pkg="vision_to_mavros" type="vision_to_mavros_node" name="apriltags_to_mavros" output="screen" >

        <param name="target_frame_id" value="$(arg tag_name)" />
        <param name="source_frame_id" value="$(arg cam_name)" />
        <param name="output_rate" value="30" />
        <remap from="vision_pose" to="/mavros/vision_pose/pose" />
    </node>

</launch>

and this is my head_camera.yaml

image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [643.6938955193606, 0, 322.1687010087148, 0, 643.0356838658893, 222.9685357709785, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [0.0508200784351784, -0.1603128351536864, 0.001266319785413063, 0.0002711642774743168, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [645.5255737304688, 0, 322.3296973789984, 0, 0, 645.75439453125, 223.3237399020436, 0, 0, 0, 1, 0]

and I try run

rostopic echo /mavros/vision_pose/pose

in terminal And out the message came out

[ WARN] [1680767769.071981645]: "camera_odom_frame" passed to lookupTransform argument target_frame does not exist.

Note: im sorry my english is very bad

edit retag flag offensive close merge delete

Comments

I have formatted your question using the 101010 button, and shortened the title.

This warning could be caused by a config problem (you have a mismatch in frame_id somewhere), or it could be that no camera image has been received. frame_id are created when the first image is processed.

You need to use rostopic echo to check if your usb_cam_node is publishing images or not.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-04-08 08:39:23 -0500 )edit