Sync D435i and D455 in ROS
First, I have connected the two cameras physically.
I have added the serial number in the rs_multiple_devices.launch. And I also start the camera using $roslaunch realsense2_camera rs_multiple_devices.launch. Besides, in rqt_reconfigure I have turned auto-exposure off and made sure the configurations were the same to both cameras. I wonder why they still can not sync together. I've tested using the cameras shooting the same clock, but the time in photos from two cameras are not identical. I am really confused.
my rs_multiple_devices.launch is shown below:
<launch>
<arg name="serial_no_camera1" default="045322074543"/> <!-- Note: Replace with actual serial number -->
<arg name="serial_no_camera2" default="043422252137"/> <!-- Note: Replace with actual serial number -->
<arg name="camera1" default="master"/> <!-- Note: Replace with camera name -->
<arg name="camera2" default="slaver"/> <!-- Note: Replace with camera name -->
<arg name="tf_prefix_camera1" default="$(arg camera1)"/>
<arg name="tf_prefix_camera2" default="$(arg camera2)"/>
<arg name="initial_reset" default="false"/>
<group ns="$(arg camera1)">
<include file="$(find realsense2_camera)/launch/includes/nodelet.launch.xml">
<arg name="serial_no" value="$(arg serial_no_camera1)"/>
<arg name="tf_prefix" value="$(arg tf_prefix_camera1)"/>
<arg name="initial_reset" value="$(arg initial_reset)"/>
</include>
</group>
<group ns="$(arg camera2)">
<include file="$(find realsense2_camera)/launch/includes/nodelet.launch.xml">
<arg name="serial_no" value="$(arg serial_no_camera2)"/>
<arg name="tf_prefix" value="$(arg tf_prefix_camera2)"/>
<arg name="initial_reset" value="$(arg initial_reset)"/>
</include>
</group>
<rosparam>
/master/stereo_module/intel_cam_sync_mode: 1
/slaver/stereo_module/intel_cam_sync_mode: 2
</rosparam>
</launch>
-
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
-
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
-
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.
-
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
Please try setting the D455 as Master (1) and the D435 as Full Slave (3).
-
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.
-
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.
-
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.
-
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.
-
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.
-
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?
-
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.
-
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?
-
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.
Please sign in to leave a comment.
Comments
29 comments