View my account

Sync D435i and D455 in ROS

Comments

29 comments

  • MartyG

    Hi, may I first confirm please what you are comparing between the two cameras when 'shooting the same clock'.  On the 400 Series cameras, the purpose of hardware sync is to synchronize the timestamps of the cameras so that the slave camera tries to follow the timestamp timing of the master camera.

    It is also not recommended to mix different models of camera together in a hardware sync setup, even though they are physically compatible.  Whilst it is possible to use hardware sync with different models, ideally both master and slave would be all D435i, or all D455, etc.  Using all the same model helps to avoid problems that may arise due to hardware differences between the models.

    You could also test hardware sync in the RealSense Viewer tool to confirm that the sync cable is correctly constructed.  You can do this by adding the second camera to the list of cameras in the Viewer's side-panel using the Add Source button, and then go to the Inter Cam Sync Mode option for each listed camera under the 'Controls' category of the Stereo Module options and setting Inter Cam Sync Mode to '1' for one of the cameras and '2' for the other camera.

    In the link below, an Intel-provided image gives further guidance about the construction of a 400 Series sync cable in addition to the guidance already in the official documentation.

    https://support.intelrealsense.com/hc/en-us/community/posts/360050894574/comments/360013337454

    Also bear in mind that when hardware sync is successful, timestamps may be identical at the start of streaming but begin to drift apart over a period of time.   This is discussed in the paragraph of the original multiple camera paper that begins with Now to the somewhat counter intuitive aspect of time stamps

    https://dev.intelrealsense.com/docs/multiple-depth-cameras-configuration#section-3-multi-camera-programming

    0
    Comment actions Permalink
  • 1520870736

    I have connected the cameras together, but in realsense-viewer, sync button is not available.

    0
    Comment actions Permalink
  • MartyG

    The 'Sync' option is not related to hardware sync.  It relates to software sync and can be ignored.  A RealSense team member provides information about this in the link below.

    https://github.com/IntelRealSense/librealsense/issues/3084#issuecomment-455227691

    0
    Comment actions Permalink
  • 1520870736

    "shooting the same clock" I mean i use the cameras to watch the same second clock and I use PrtSc button on my keyboard to save the current clock like pictures shown below:

    0
    Comment actions Permalink
  • 1520870736

    And the time of different images are not the same.

    0
    Comment actions Permalink
  • MartyG

    In the clock images that you are capturing, are the timestamps of each camera visible in the image too?

    0
    Comment actions Permalink
  • 1520870736

    Before all of this, is it possible that the D435i is hot during usage?

    0
    Comment actions Permalink
  • MartyG

    As a general rule, if the casing of the camera is hot to the touch after only a few minutes after beginning streaming from a cold state then it could indicate a USB problem that is causing overheating, such as a bad USB cable or a glitch on the computer's USB port.  There have also been a couple of past cases with single-board computers overheating.

    0
    Comment actions Permalink
  • 1520870736

    I've followed the instructions, but the fps is not the same in realsense-viewer:

    0
    Comment actions Permalink
  • MartyG

    Hardware sync does not sync the FPS of multiple cameras, it syncs their frame timestamps.  

     

     

    0
    Comment actions Permalink
  • 1520870736

    thanks, I will check this immediately

     

    0
    Comment actions Permalink
  • 1520870736

    Obviously, their frame timestamps are not the same. So is this because the connection is not done yet?The connections are shown below:

    0
    Comment actions Permalink
  • 1520870736

    And my changes on realsense-viewer are also shown below:

    0
    Comment actions Permalink
  • MartyG

    The images are very helpful to see what is occurring, thank you.  You are enabling RGB only and using modes 1 (Master) and 2 (Slave).  However, Inter Cam Sync Mode 1 and 2 only support depth timestamp sync.

      

    Intel released an External Synchronization paper (in the link below) that introduced Inter Cam Sync Mode '3' (Full Slave), which also synchronizes the color camera.

    https://dev.intelrealsense.com/docs/external-synchronization-of-intel-realsense-depth-cameras

    https://dev.intelrealsense.com/docs/external-synchronization-of-intel-realsense-depth-cameras#section-appendix-a

    Please try setting the D455 as Master (1) and the D435 as Full Slave (3).

    0
    Comment actions Permalink
  • 1520870736

    Still didn't work. Is it possible the connection is to be blame?qwq

    0
    Comment actions Permalink
  • 1520870736

    And also, is it possible  the voltage of  sync(pin 9) and gnd(pin 5) are the same ? I can't detect any difference between two pins. They are both the same waveform in oscilloscope.

    0
    Comment actions Permalink
  • MartyG

    Considering that the Inter Cam Sync Mode setting is in the Stereo Module depth controls, do you see any change if you have both depth and RGB enabled on both cameras?

    0
    Comment actions Permalink
  • 1520870736

    ROS Warning:

    Non-sequential Video and Metadata v4l buffers

    ideo frame dropped, video and metadata buffers inconsistency

    UVC metadata payloads not available. Please refer to the installation chapter for details

     

    0
    Comment actions Permalink
  • MartyG

    It looks as though you are using Ubuntu.  Which method did you use to install the RealSense SDK, please?  If you built the SDK from source code then you need to patch the kernel to enable support for hardware metadata.

    Pin 5 is the Sync pin.  Pin 9 is Ground.  Can you confirm please that 5 is Sync and 9 is Ground on your cabling setup, as you mention it being the reverse above.

     

    0
    Comment actions Permalink
  • 1520870736

    I install the RealSense SDK using the instructions from a website called CSDN because the git clone method is not quite working well at that moment. And the which pin is what doesn't matter, because I have followed the instructions that Pin5-Pin5, Pin 9-Pin 9 and the waveform of both pins are exactly the same, pictures are shown before.

    0
    Comment actions Permalink
  • MartyG

    You can confirm please that pin 5 goes to pin 5 and pin 9 to pin 9, as shown below?  

     

    0
    Comment actions Permalink
  • 1520870736
    0
    Comment actions Permalink
  • MartyG

    Thanks very much for the visual confirmation.

    May I enquire please about the reason why multiple camera hardware sync is being used in your project.  If the original intention was to sync FPS but hardware sync does not sync FPS (just timestamps), it may no longer be necessary to use sync if it cannot align the FPS speeds.

    0
    Comment actions Permalink
  • 1520870736

    There is a project using two cameras at the same time. And I need to get the pictures from camera simultaneously. Currently, two cameras can not provide me with the pictures at the same time. Thus, i will test it with the experiments like:

    The calculation requires the cameras provide the pictures at the exactly same time. And that's why i also need to modify the exposure and other configs.

    0
    Comment actions Permalink
  • MartyG

    If you are able to use C++ language and you only need static image capture rather than moving video then there is an existing multiple camera script created by a RealSense user that can capture an image from all attached cameras simultaneously.  The script does not use hardware sync.

    https://github.com/IntelRealSense/librealsense/issues/2219#issuecomment-412899468

    The script is designed to check if the attached model is a D415 and only capture if the camera is that model, so if you decide to use this script then you should remove that camera model checking mechanism.

    0
    Comment actions Permalink
  • 1520870736

    Thank you!!! Really Appreciate your hep. I will contact with my supervisor instantly about this solution. Besides, there is not other way to sync the two cameras using the hardware? The situation now is, Pin 5 and Pin 9 are producing the same waveform and I do not use the capacity and the resistor to construct a low pass filter. Does that influence the hardware sync process?

    0
    Comment actions Permalink
  • MartyG

    It is possible to generate a master trigger pulse wirelessly with a signal generator instead of using physical sync cabling, though it can be significantly more difficult to achieve success than using cabling.

    https://github.com/IntelRealSense/librealsense/issues/2171#issuecomment-409559217

    The best approach may be to have the two cameras operate independently but set them up so that they try to enforce a constant FPS rate.  This can be done by having auto-exposure enabled and disabling an RGB option called Auto-Exposure Priority.  

    https://github.com/IntelRealSense/librealsense/issues/7749

     

    You should not need the optional ESD protection components in the sync cable if your cable length is short (under 3 meters), unless the cameras are being used in an environment where electrostatic discharge is likely to occur. 

    Apart from that, I would recommend following the cable diagram closely in order to have confidence that the cable is operating efficiently.  Having said that, as mentioned earlier, your particular application does not sound as though it would benefit from hardware sync.  You can certainly have multiple camera setups that are not hardware synced.

    0
    Comment actions Permalink
  • 1520870736

    Yeah, I do not have confidence in the cable. But I have used the oscilloscope to watch the waveform of Pin-5 and Pin-9 and they looked like a sine wave while they were exactly the same. Is it possible? If the cable and everything were correct, what would happen? I wonder the correct waveform from both pins. Pictures? It will be very helpful. By the way, the peak-to-peak value of both waves were around 300 V. Is it natural?

    0
    Comment actions Permalink
  • MartyG

    There is very limited information available on the subject of the hardware sync pins outside of the multiple camera guides and no waveform images that can be found, so there is not much that I can add unfortunately in regard to this particular question.  300V sounds high though, given that when using an external trigger the sync pulse should be 1.8V.

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.