TF Frame delay transform

asked 2016-07-27 08:35:30 -0600

metRo_ gravatar image

Hi,

I have a camera attached to a motor for yaw control. The motor has a encoder that I use to update the TF at 100Hz. Odometry is working at 50Hz.

The value measured from the encoder is in measured variable and update the TF with the follwing code:

static tf::TransformBroadcaster br;
tf::Transform transform;
transform.setOrigin( tf::Vector3(0.0, 0.0, 1.550) );
tf::Quaternion q;

lastAngle = (((20000.0-control.measured)*0.04366)*(M_PI/180));

q.setRPY(0, 0, lastAngle);
transform.setRotation(q);
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_link", "camera2_link"));

I have the following model defined:

<link name="camera2_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="${camera_length} ${camera_width} ${camera_height}"/>
      </geometry>
    </visual>
    <inertial>
      <mass value="1"/>
      <inertia ixx="100" ixy="0.0" ixz="0.0" iyy="100" iyz="0.0" izz="100"/>
    </inertial>
  </link>  

  <joint name="CameratoBL" type="fixed">
      <origin
      xyz="${camera_x} ${camera_y} ${camera_z}"
      rpy="0 0 0" /> 

      <parent link="base_link" />
      <child link="camera2_link" />
  </joint>

If you look at the video https://www.youtube.com/watch?v=YG3-V... there is a delay on the camera2_link and I can't understand where it come from :s

edit retag flag offensive close merge delete

Comments

Any idea why is it happening?

metRo_ gravatar image metRo_  ( 2016-08-18 04:43:21 -0600 )edit

Hey, did you figure out what the issue was?

i_robot_flight gravatar image i_robot_flight  ( 2017-11-10 09:05:23 -0600 )edit

Hi, I think it was only a rviz issue and if you change the frame on rviz it looks ok.

metRo_ gravatar image metRo_  ( 2017-11-10 09:17:45 -0600 )edit

Okay, but I am seeing a delay between transforms even on rviz for a similar implementation on LiDAR pointclouds. Thanks!

i_robot_flight gravatar image i_robot_flight  ( 2017-11-10 11:42:16 -0600 )edit