Closed makolele12 closed 1 year ago
Update: when subscribing to the topics with gray images (instead of RGB), occurs the same problem.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days
same issue
Preliminary Checks
Description
I am using a ZED2i for SLAM. My SLAM algorithm is implemented in ROS and is really sensitive to sudden frame drops or changes in the frame rate. That is why I am expecting a stable frame rate from the camera.
As I am mainly doing offline tests, I am using the zed-ros-wrapper to publish the camera data and then recording it in rosbags. However, when analyzing the rosbags to see how stable the recordings were, I noticed there are multiple framedrops or frame rate changes during the recording.
I rewrote the bag's messages with header timestamps as explained here, as normally the rosbag's messages are timestamped with the time when the message was received and not with the time when the message was generated (the latter is what my SLAM algorithm expects).
I wrote the following Python Code to analyze the bag jittering and generate some plots:
Basically, it plots the time difference delta_t between message
t_i
andt_i+1
in a given camera topic.Steps to Reproduce
Expected Result
As comparison I tested the same with an Intel RealSense D455 and its respective ros-wrapper. The result that I expect is shown in the plot below, a line around ~33ms (of course with some small peaks).
Actual Result
When initializing the ZED Node I used the following parameters:
Therefore, I am expecting my plots to be a line somewhere around ~33.33 ms (30FPS). However, I get the following result for the left camera. The plot for the right camera looks really similar that is why i am not posting it.
One can see roughly a line around 33 ms, with multiple peaks in multiples of 33ms which are clearly frame drops. One can also see multiple peaks going below 30ms, which shows some messages being generated before expected.
I would like to know if there is a way to get a much stable result here.I do not believe the problem here is being caused by
rosbag record
because otherwise I would get similar results with the RealSense Camera. I guess the problem is from the zed-ros-wrapper itself.Am I maybe misinterpreting the timestamps from the ZED camera? The timestamp that the zed-ros-wrapper writes to the message is the time when the image was taken right? Or does it have any other meaning?
ZED Camera model
ZED2i
Environment
Anything else?
It is worth mentioning that:
grab_frame_rate = 100
while leavingpub_frame_rate = 30
and had similar results.