Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the timestamp of IMU have two kinds of base number, sometime the secs of timestamp is like 1608015601, sometime the secs of timestamp is like 3216031523 #1569

Closed
TouchDeeper opened this issue Dec 15, 2020 · 5 comments
Labels

Comments

@TouchDeeper
Copy link

Hello,

Required Info
Camera Model D400
Firmware Version 05.12.09.00
Operating System & Version Ubuntu 16
Kernel Version (Linux Only) 4.15.0-128-generic
Platform PC
SDK Version 2.40.0
Language C
Segment Robot
installation Method backend installation refer to https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md

I find a strange phenomenon. the timestamp of IMU has two kinds of the base number. sometimes I start the realsense node, the secs of the timestamp is like 1608015601, but there are also sometimes I start the realsense node, the secs of the timestamp is like 3216031523. The Global time of Motion Module showed in realsense-viewer is like 1608015601, and I guess the timestamp like 1608015601 is what I want since if the timestamp is like 3216031523, I will have timestamp related error when using Kalibr to process camera-imu joint calibration. I have posted the isue in Kalibr repository.
Could you please provide some advice to keep the secs of the timestamp of IMU in 1608015601 like number? Thans a lot.
The launch file I used to start the realsense node is:

<launch>
  <arg name="serial_no"           default=""/>
  <arg name="usb_port_id"         default=""/>
  <arg name="device_type"         default=""/>
  <arg name="json_file_path"      default="/home/td/realsense/realsense_ws/src/realsense-ros-2.2.20/realsense2_camera/conifg/kalibr.json"/>
  <arg name="camera"              default="camera"/>
  <arg name="tf_prefix"           default="$(arg camera)"/>
  <arg name="external_manager"    default="false"/>
  <arg name="manager"             default="realsense2_camera_manager"/>
  <arg name="output"              default="screen"/>

  <arg name="fisheye_width"       default="640"/>
  <arg name="fisheye_height"      default="480"/>
  <arg name="enable_fisheye"      default="false"/>

  <arg name="depth_width"         default="640"/>
  <arg name="depth_height"        default="480"/>
  <arg name="enable_depth"        default="false"/>

  <arg name="infra_width"         default="640"/>
  <arg name="infra_height"        default="480"/>
  <arg name="enable_infra"        default="false"/>
  <arg name="enable_infra1"       default="true"/>
  <arg name="enable_infra2"       default="true"/>
  <arg name="infra_rgb"           default="false"/>

  <arg name="color_width"         default="640"/>
  <arg name="color_height"        default="480"/>
  <arg name="enable_color"        default="false"/>

  <arg name="fisheye_fps"         default="30"/>
  <arg name="depth_fps"           default="30"/>
  <arg name="infra_fps"           default="30"/>
  <arg name="color_fps"           default="30"/>
  <arg name="gyro_fps"            default="400"/>
  <arg name="accel_fps"           default="250"/>
  <arg name="enable_gyro"         default="true"/>
  <arg name="enable_accel"        default="true"/>

  <arg name="enable_pointcloud"         default="false"/>
  <arg name="pointcloud_texture_stream" default="RS2_STREAM_COLOR"/>
  <arg name="pointcloud_texture_index"  default="0"/>

  <arg name="enable_sync"               default="true"/>
  <arg name="align_depth"               default="false"/>

  <arg name="publish_tf"                default="true"/>
  <arg name="tf_publish_rate"           default="0"/>

  <arg name="filters"                   default=""/>
  <arg name="clip_distance"             default="-2"/>
  <arg name="linear_accel_cov"          default="0.01"/>
  <arg name="initial_reset"             default="false"/>
  <arg name="unite_imu_method"          default="linear_interpolation"/>
  <arg name="topic_odom_in"             default="odom_in"/>
  <arg name="calib_odom_file"           default=""/>
  <arg name="publish_odom_tf"           default="true"/>
  <arg name="allow_no_texture_points"   default="false"/>
  <arg name="hold_back_imu_for_frames"      default="true"/>

  <group ns="$(arg camera)">
    <include file="$(find realsense2_camera)/launch/includes/nodelet.launch.xml">
      <arg name="tf_prefix"                value="$(arg tf_prefix)"/>
      <arg name="external_manager"         value="$(arg external_manager)"/>
      <arg name="manager"                  value="$(arg manager)"/>
      <arg name="output"                   value="$(arg output)"/>
      <arg name="serial_no"                value="$(arg serial_no)"/>
      <arg name="usb_port_id"              value="$(arg usb_port_id)"/>
      <arg name="device_type"              value="$(arg device_type)"/>
      <arg name="json_file_path"           value="$(arg json_file_path)"/>

      <arg name="enable_pointcloud"        value="$(arg enable_pointcloud)"/>
      <arg name="pointcloud_texture_stream" value="$(arg pointcloud_texture_stream)"/>
      <arg name="pointcloud_texture_index"  value="$(arg pointcloud_texture_index)"/>
      <arg name="enable_sync"              value="$(arg enable_sync)"/>
      <arg name="align_depth"              value="$(arg align_depth)"/>

      <arg name="fisheye_width"            value="$(arg fisheye_width)"/>
      <arg name="fisheye_height"           value="$(arg fisheye_height)"/>
      <arg name="enable_fisheye"           value="$(arg enable_fisheye)"/>

      <arg name="depth_width"              value="$(arg depth_width)"/>
      <arg name="depth_height"             value="$(arg depth_height)"/>
      <arg name="enable_depth"             value="$(arg enable_depth)"/>

      <arg name="color_width"              value="$(arg color_width)"/>
      <arg name="color_height"             value="$(arg color_height)"/>
      <arg name="enable_color"             value="$(arg enable_color)"/>

      <arg name="infra_width"              value="$(arg infra_width)"/>
      <arg name="infra_height"             value="$(arg infra_height)"/>
      <arg name="enable_infra"             value="$(arg enable_infra)"/>
      <arg name="enable_infra1"            value="$(arg enable_infra1)"/>
      <arg name="enable_infra2"            value="$(arg enable_infra2)"/>
      <arg name="infra_rgb"                value="$(arg infra_rgb)"/>

      <arg name="fisheye_fps"              value="$(arg fisheye_fps)"/>
      <arg name="depth_fps"                value="$(arg depth_fps)"/>
      <arg name="infra_fps"                value="$(arg infra_fps)"/>
      <arg name="color_fps"                value="$(arg color_fps)"/>
      <arg name="gyro_fps"                 value="$(arg gyro_fps)"/>
      <arg name="accel_fps"                value="$(arg accel_fps)"/>
      <arg name="enable_gyro"              value="$(arg enable_gyro)"/>
      <arg name="enable_accel"             value="$(arg enable_accel)"/>

      <arg name="publish_tf"               value="$(arg publish_tf)"/>
      <arg name="tf_publish_rate"          value="$(arg tf_publish_rate)"/>

      <arg name="filters"                  value="$(arg filters)"/>
      <arg name="clip_distance"            value="$(arg clip_distance)"/>
      <arg name="linear_accel_cov"         value="$(arg linear_accel_cov)"/>
      <arg name="initial_reset"            value="$(arg initial_reset)"/>
      <arg name="unite_imu_method"         value="$(arg unite_imu_method)"/>
      <arg name="topic_odom_in"            value="$(arg topic_odom_in)"/>
      <arg name="calib_odom_file"          value="$(arg calib_odom_file)"/>
      <arg name="publish_odom_tf"          value="$(arg publish_odom_tf)"/>
      <arg name="allow_no_texture_points"  value="$(arg allow_no_texture_points)"/>
    </include>
  </group>
  <node name="throttle_infra1" pkg="topic_tools" type="throttle" args="messages /camera/infra1/image_rect_raw 30.0 /infra_left" />
  <node name="throttle_infra2" pkg="topic_tools" type="throttle" args="messages /camera/infra2/image_rect_raw 30.0 /infra_right" />
  <node name="throttle_imu" pkg="topic_tools" type="throttle" args="messages /camera/imu 262 /imu" />
<!--  <node name="throttle_infra2" pkg="topic_tools" type="throttle" args="messages /camera/infra2/image_rect_raw 10.0 /infra_right" />-->

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find realsense2_camera)/rviz/imu_camera_kalibr.rviz" required="true"/>
</launch>

the output of terminal when I start the realsense node is:

... logging to /home/td/.ros/log/0aca047a-3ea4-11eb-9e75-2016b9896a4d/roslaunch-td-Pc-14387.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://td-Pc:38223/

SUMMARY
========

PARAMETERS
 * /camera/realsense2_camera/accel_fps: 250
 * /camera/realsense2_camera/accel_frame_id: camera_accel_frame
 * /camera/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
 * /camera/realsense2_camera/align_depth: False
 * /camera/realsense2_camera/aligned_depth_to_color_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_fisheye1_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_fisheye2_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_fisheye_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_infra1_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_infra2_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/allow_no_texture_points: False
 * /camera/realsense2_camera/base_frame_id: camera_link
 * /camera/realsense2_camera/calib_odom_file: 
 * /camera/realsense2_camera/clip_distance: -2.0
 * /camera/realsense2_camera/color_fps: 30
 * /camera/realsense2_camera/color_frame_id: camera_color_frame
 * /camera/realsense2_camera/color_height: 480
 * /camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
 * /camera/realsense2_camera/color_width: 640
 * /camera/realsense2_camera/depth_fps: 30
 * /camera/realsense2_camera/depth_frame_id: camera_depth_frame
 * /camera/realsense2_camera/depth_height: 480
 * /camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
 * /camera/realsense2_camera/depth_width: 640
 * /camera/realsense2_camera/device_type: 
 * /camera/realsense2_camera/enable_accel: True
 * /camera/realsense2_camera/enable_color: False
 * /camera/realsense2_camera/enable_depth: False
 * /camera/realsense2_camera/enable_fisheye1: False
 * /camera/realsense2_camera/enable_fisheye2: False
 * /camera/realsense2_camera/enable_fisheye: False
 * /camera/realsense2_camera/enable_gyro: True
 * /camera/realsense2_camera/enable_infra1: True
 * /camera/realsense2_camera/enable_infra2: True
 * /camera/realsense2_camera/enable_infra: False
 * /camera/realsense2_camera/enable_pointcloud: False
 * /camera/realsense2_camera/enable_pose: False
 * /camera/realsense2_camera/enable_sync: True
 * /camera/realsense2_camera/filters: 
 * /camera/realsense2_camera/fisheye1_frame_id: camera_fisheye1_f...
 * /camera/realsense2_camera/fisheye1_optical_frame_id: camera_fisheye1_o...
 * /camera/realsense2_camera/fisheye2_frame_id: camera_fisheye2_f...
 * /camera/realsense2_camera/fisheye2_optical_frame_id: camera_fisheye2_o...
 * /camera/realsense2_camera/fisheye_fps: 30
 * /camera/realsense2_camera/fisheye_frame_id: camera_fisheye_frame
 * /camera/realsense2_camera/fisheye_height: 480
 * /camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
 * /camera/realsense2_camera/fisheye_width: 640
 * /camera/realsense2_camera/gyro_fps: 400
 * /camera/realsense2_camera/gyro_frame_id: camera_gyro_frame
 * /camera/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
 * /camera/realsense2_camera/imu_optical_frame_id: camera_imu_optica...
 * /camera/realsense2_camera/infra1_frame_id: camera_infra1_frame
 * /camera/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
 * /camera/realsense2_camera/infra2_frame_id: camera_infra2_frame
 * /camera/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
 * /camera/realsense2_camera/infra_fps: 30
 * /camera/realsense2_camera/infra_height: 480
 * /camera/realsense2_camera/infra_rgb: False
 * /camera/realsense2_camera/infra_width: 640
 * /camera/realsense2_camera/initial_reset: False
 * /camera/realsense2_camera/json_file_path: /home/td/realsens...
 * /camera/realsense2_camera/linear_accel_cov: 0.01
 * /camera/realsense2_camera/odom_frame_id: camera_odom_frame
 * /camera/realsense2_camera/pointcloud_texture_index: 0
 * /camera/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
 * /camera/realsense2_camera/pose_frame_id: camera_pose_frame
 * /camera/realsense2_camera/pose_optical_frame_id: camera_pose_optic...
 * /camera/realsense2_camera/publish_odom_tf: True
 * /camera/realsense2_camera/publish_tf: True
 * /camera/realsense2_camera/rosbag_filename: 
 * /camera/realsense2_camera/serial_no: 
 * /camera/realsense2_camera/tf_publish_rate: 0.0
 * /camera/realsense2_camera/topic_odom_in: odom_in
 * /camera/realsense2_camera/unite_imu_method: linear_interpolation
 * /camera/realsense2_camera/usb_port_id: 
 * /rosdistro: kinetic
 * /rosversion: 1.12.17

NODES
  /camera/
    realsense2_camera (nodelet/nodelet)
    realsense2_camera_manager (nodelet/nodelet)
  /
    rviz (rviz/rviz)
    throttle_imu (topic_tools/throttle)
    throttle_infra1 (topic_tools/throttle)
    throttle_infra2 (topic_tools/throttle)

auto-starting new master
process[master]: started with pid [14398]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 0aca047a-3ea4-11eb-9e75-2016b9896a4d
process[rosout-1]: started with pid [14411]
started core service [/rosout]
process[camera/realsense2_camera_manager-2]: started with pid [14428]
[ INFO] [1608015985.883539018]: Initializing nodelet with 6 worker threads.
process[camera/realsense2_camera-3]: started with pid [14429]
[ INFO] [1608015986.236206066]: RealSense ROS v2.2.20
[ INFO] [1608015986.236246226]: Built with LibRealSense v2.40.0
[ INFO] [1608015986.236257248]: Running with LibRealSense v2.40.0
[ INFO] [1608015986.247639468]:  
[ INFO] [1608015986.358642551]: Device with serial number 040322070519 was found.

[ INFO] [1608015986.358670190]: Device with physical ID 2-2-5 was found.
[ INFO] [1608015986.358678119]: Device with name Intel RealSense D435I was found.
[ INFO] [1608015986.359041519]: Device with port number 2-2 was found.
[ INFO] [1608015986.359057462]: Device USB type: 3.2
[ INFO] [1608015986.360669796]: getParameters...
[ INFO] [1608015986.418451633]: setupDevice...
process[throttle_infra1-4]: started with pid [14451]
process[throttle_infra2-5]: started with pid [14703]
 15/12 15:06:27,074 WARNING [139851357734656] (messenger-libusb.cpp:42) control_transfer returned error, index: 300, error: No data available, number: 3d
[ INFO] [1608015987.191903058]: JSON file is loaded! (/home/td/realsense/realsense_ws/src/realsense-ros-2.2.20/realsense2_camera/conifg/kalibr.json)
[ INFO] [1608015987.191969291]: ROS Node Namespace: camera
[ INFO] [1608015987.191997271]: Device Name: Intel RealSense D435I
[ INFO] [1608015987.192007276]: Device Serial No: 040322070519
[ INFO] [1608015987.192014726]: Device physical port: 2-2-5
[ INFO] [1608015987.192021193]: Device FW version: 05.12.09.00
[ INFO] [1608015987.192027753]: Device Product ID: 0x0B3A
[ INFO] [1608015987.192033586]: Enable PointCloud: Off
[ INFO] [1608015987.192043274]: Align Depth: Off
[ INFO] [1608015987.192051249]: Sync Mode: On
[ INFO] [1608015987.192080822]: Device Sensors: 
[ INFO] [1608015987.206349824]: Stereo Module was found.
[ INFO] [1608015987.214034460]: RGB Camera was found.
[ INFO] [1608015987.214250726]: Motion Module was found.
[ INFO] [1608015987.214271857]: num_filters: 0
[ INFO] [1608015987.214279094]: Setting Dynamic reconfig parameters.
 15/12 15:06:27,248 WARNING [139851357734656] (messenger-libusb.cpp:42) control_transfer returned error, index: 300, error: No data available, number: 3d
process[throttle_imu-6]: started with pid [14750]
process[rviz-7]: started with pid [14802]
[ INFO] [1608015987.662909437]: Done Setting Dynamic reconfig parameters.
[ INFO] [1608015987.663250072]: infra1 stream is enabled - width: 640, height: 480, fps: 30, Format: Y8
[ INFO] [1608015987.663455853]: infra2 stream is enabled - width: 640, height: 480, fps: 30, Format: Y8
[ INFO] [1608015987.663473843]: setupPublishers...
[ INFO] [1608015987.665978762]: Expected frequency for infra1 = 30.00000
[ INFO] [1608015987.688157299]: Expected frequency for infra2 = 30.00000
[ INFO] [1608015987.709051303]: Start publisher IMU
[ INFO] [1608015987.709581796]: setupStreams...
[ INFO] [1608015987.730978192]: insert Infrared to Stereo Module
[ INFO] [1608015987.731019356]: insert Infrared to Stereo Module
[ INFO] [1608015987.731035117]: insert Gyro to Motion Module
[ INFO] [1608015987.731046205]: insert Accel to Motion Module
 15/12 15:06:27,743 WARNING [139851357734656] (messenger-libusb.cpp:42) control_transfer returned error, index: 300, error: No data available, number: 3d
[ INFO] [1608015987.827078781]: SELECTED BASE:Depth, 0
[ INFO] [1608015987.832709921]: RealSense Node Is Up!
 15/12 15:06:27,931 WARNING [139851357734656] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
 15/12 15:06:27,982 WARNING [139851357734656] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Dec 15, 2020

Hi @TouchDeeper I hope that the comment I have linked to below will answer your question.

#1454 (comment)

The two methods that worked for RealSense users in that discussion to correct the timestamps are to add initial_reset:=true to the end of the roslaunch instruction, or to enable global time.

@TouchDeeper
Copy link
Author

@MartyG-RealSense
Hi
Thanks for your reply. Adding <arg name="initial_reset" default="true"/> solve my issue.
I want to know what the initial_reset do. In addition, I recommend you can write a parameter explanation document that explant what teach parameter do, this document will be very popular and useful. Thanks again.

@MartyG-RealSense
Copy link
Collaborator

initial_reset performs a hardware reset of the camera at launch, similar to the Hardware Reset option in the RealSense Viewer and the hardware_reset() programming instruction in librealsense.

The RealSense ROS wrapper front page has a section with a list of launch commands that includes initial_reset:

https://github.com/IntelRealSense/realsense-ros#launch-parameters

@TouchDeeper
Copy link
Author

@MartyG-RealSense Thank you for your reply.

I'm sorry I forget the parameters page. I have calibrated the realsense d435i successfully. I recorded this process and the problems encountered and solutions. To thank you, I shared this document in my repository. I hope it will help other people.

@MartyG-RealSense
Copy link
Collaborator

Excellent resource - thanks very much for sharing that with the RealSense community :)

Do you need assistance with anything else, please? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants