-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
External trigger docs and dynamic reconfigure error #2592
Comments
Hi @dongdongbh You are correct, if you are using a trigger generated by an external device instead of by a master RealSense camera then the trigger frequency needs to be matched very closely to the FPS of the slave camera. This close match can be difficult to achieve. Trigger sync is easier to achieve with the External Synchronization method of hardware sync. However, Intel have recently removed the External Synchronization white-paper document from availability. This is because the paper was an experimental proof of concept and was not officially validated by Intel or considered a mature solution. The original Multi-camera configurations method (modes 1 and 2) is considered by Intel to be mature and validated. If you would prefer to use mode 4 (genlock) with your external trigger then I have attached an offline PDF version of the genlock paper below. As mentioned though, this method was experimental and does not have technical support provided for it beyond the information in the paper. Modes 259 and 260 are discussed at IntelRealSense/librealsense#10516 (comment) and the comments beneath it. 259 and 260 produce two frames per trigger with laser ON-OFF (259) and OFF-ON (260). The difference between 259 and 260 is that with 259, the Laser ON frame is sent first and then the Laser OFF frame secondly. With 260 it is the opposite - the Laser OFF frame is sent first and then the Laser ON frame secondly. Information about the interval between frames with these modes is not available. In genlock mode, the camera waits indefinitely for a trigger and does not capture during this wait period. Once it receives the trigger, exposure starts. Are you able to set the inter_cam_sync_mode value if you do so through the graphical interface for dynamic_reconfigure that can be opened with the command rosrun rqt_reconfigure rqt_reconfigure librealsense 2.53.1 is not a suitable SDK version to use with ROS1 wrapper 2.3.2. It is important to match a particular ROS wrapper version as closely as possible with the librealsense version listed in that particular wrapper's release notes. The best match is version 2.50.1, and 2.51.1 should also work. |
According the discussion issue you refered, seem in mode 259 and 260, the interval of two frames may be same. I will test it later. I have another idea that may produce similar result as I set inter_cam_sync_mode as 259. I set inter_cam_sync_mode=4, and enable emitter_on_off option. For example, I use my custom trigger as 30hz in mode 4, there will be 15 images with emitter and 15 without it, they alternate streaming. In this case, I have exact same timestamp as my 30hz external trigger timestamp which I already know by my external clock and counter. And I can identify the image with emitter on or off by the frame counte (since they alternate). Am I right? Does emitter_on_off still works on inter_cam_sync_mode 4? I addition, I want to use a microcontroller to generate the trigger signal. The signal has 3.3v positive pulse. Can realsense tolerate 3.3v? |
emitter_on_off should still work when inter_cam_sync_mode 4 is active. The emitter component of the camera is independent from the depth sensors so whilst emitter_on_off does indeed alternate the emitter on-off on a per-frame basis (emitter on, then off, then on, etc), it would not be in sync with hardware-sync triggering of depth capture. The link IntelRealSense/librealsense#3066 with information about the emitter on-off mode has an animated image with a fast-strobing light. The trigger pulse should be 1.8v. Some RealSense users performing hardware sync have used a component known as a voltage shifter or level shifter to convert their voltage to 1.8v. A couple of users have used one similar to the SparkFun 12009 component mentioned in the guide below. https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all |
“it would not be in sync with hardware-sync triggering of depth capture.” what does this means? If it is not sync with hardware-sync triggering, how does the emitter on and off triggered (or worked)? In my understanding, it should be triggered by external trigger signal. E.g. the first positive pulse trigger the first frame and the emitter on, the second pulse trigger next frame and the emitter off, then the third pulse with emitter on, etc. Emitter alternates pulse by pulse. In addition, I read the
|
Inside the camera, the IR emitter is a separate hardware component from the sensors. It is part of the projector and operates independently from the sensors. It projects a semi-random pattern of IR dots onto surfaces in the real-world scene to aid the left and right sensors' ability to read those surfaces for depth information, as the dots act as an analyzable surface texture. If the IR emitter is disabled then the IR streams are still able to operate because of this independence. I should clarify that the statement about the emitter being unsynched was made in relation to the Emitter On Off mode described at IntelRealSense/librealsense#3066 and not regarding genlock modes 259 and 260, which clearly are designed to work in harmony with hardware sync. My apologies for the confusion. In regard to 'Laser ON all the time': the projector component on the D435 / D435i models pulses in time with exposure, whilst the D415's projector component is on all the time. It is possible to set the projector to always-on to emulate the behaviour of the D415''s projector on the D435 / D435i. It would be impractical for the projector to be allowed to be always on in a mode where the emitter is toggled on-off though. |
Yes, genlock mode 259 and 260 are designed to work in harmony with hardware sync. What I'm really confused about is, in genlock mode 4 with emitter_on_off enabled, the emitter on-off on a per-frame basis, which means both the emitter-on-off and the depth camera are triggered the external trigger hardware pulse. The first positive pulse of external signal triggers the first camera frame with the emitter on, the second pulse triggers next camera frame with the emitter off, then the third pulse with emitter on, etc. Is this statement right? |
My understanding is that when the trigger is received, if the Inter Cam Sync Mode is set to 259 or 260 then two frames are sent per trigger. The mode value (259 or 260) depends on whether the first frame is Laser On or Laser Off. So one trigger produces a pair of frames. And the next trigger would produce another pair of frames. It will likely be less confusing if you forget about the emitter_on_off function, as it is not required to be used in this case as mode 259 / 260 of genlock is controlling the laser state instead. The difference is that emitter_on_off alternates the laser on and off on a per-frame basis (frame 1 on, frame 2 off, frame 3 on, etc). Genlock modes 259 and 260 produce a pair of frames from a single trigger, with the mode value determining whether the frame pair's laser state is on then off, or off then on. Another difference is that emitter_on_off alternates the laser on-off constantly in a continuous stream of frames, whilst genlock modes 259 / 260 only produce one pair of frames and only when a trigger is received. |
I understand how Genlock modes 259 and 260 works. But I'm asking how inter_cam_sync_mode=4 with emitter_on_off enabled works with external trigger, not the Genlock modes 259 and 260!!! |
My meaning in the above explanation is that Emitter On Off is a function of the RealSense SDK that was not designed for use with hardware sync. If your intention is to have Emitter On Off enabled and have Inter Cam Sync Mode set to 259 or 260 then you do not need to do both. Only use one of them, as both methods alternate the laser but in different ways. If you want the laser to be constantly alternated on-off on a per-frame basis (one frame off, one frame on, one frame off) then enable the Emitter On Off function and do not use Inter Cam Sync mode numbers 259 or 260. You cannot control the timing of the Emitter On Off function with an external trigger. Once enabled, it will continuously alternate the laser automatically and uncontrollably until it is disabled. If you want to precisely control the laser on-off with a trigger then use Inter Cam Sync Mode set to 259 or 260, and keep the Emitter On Off function disabled (it is disabled by default). Modes 259 and 260 will alternate the laser even if the Emitter On Off function is off. |
Yes, I want to precisely control the laser on-off with a trigger, and I also want to know the trigger time of every frame, and you said "Information about the interval between frames with these modes is not available", but I want to control the trigger of all frames (even each frame time of emitter on and off). So I guess that Inter Cam Sync Mode set to 259 or 260 can not exactly do that. I'm thinking about maybe using inter_cam_sync_mode=4 with emitter_on_off enabled can do that. You said emitter on-off is automatical and uncontrollable. So I think the only way is using mode 259 or 260, and log the timestamp between the emitter on-off pair and align the second one of the pair with my external hardware clock. Thanks for your explanation. |
You are very welcome, @dongdongbh |
Multi-Camera configurations
I'm using D435i, I want to use custom external trigger to trigger depth camera. According to white paper of Multi-Camera configurations. I should use pins 5 (SYNC) and pins 9 (Ground). In software, set up
inter_cam_sync_mode
as 0=default, 1=Master, and 2=Slave. Then the doc says that "The frequency of the signal generator needs to exactly match the sensor frame rate. ", Does this means the external trigger need to be exactly match the sensor frame rate set in realsense launch file? If it is. Then that isn't my propose. I want to sync with my external clock.External Synchronization
I noticed that External Synchronization (genlock) mode, but its white paper link: https://dev.intelrealsense.com/docs/external-synchronization-of-intel-realsense-depth-cameras broken. I guess
inter_cam_sync_mode=4
is what I want.The trigger time
The white paper of Multi-Camera configurations says " the HW SYNC input requires a 100 microsecond positive pulse". but what exact time the camera triggered? Is the time positive pulse start or end, or is related to camera expose time, how can I calculate it?
I also saw there is laser ON-OFF trigger mode with inter_cam_sync_mode 259 and 260. Is it means every trigger will take two frame wirh laser ON-OFF? what is the intervel between these two frames?
Dynamic reconfigure not work
I encounter the same problem as #984. I use
and I do
rosrun rqt_reconfigure rqt_reconfigure
also not work.Test environment
ubuntu 20.04 server
v2.3.2
v2.53.1
The text was updated successfully, but these errors were encountered: