# Zed 2i IMU ROS topic frequency low (1.6 - 1.8 Hz)

**URL:** <https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007>\
**Category:** ROS1\
**Created:** [January 13, 2023, 6:56am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007 "2023-01-13T06:56:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 13, 2023, 6:56am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/1 "2023-01-13T06:56:21Z")

</div>

I’m using the zed-ros-wrapper for using zed 2i with ros1 melodic and ubuntu 18 with a RTX 2060 GPU.  
I want to use the IMU and magnetometer rostopics from zed.  
I had seen in the zed documentation that the IMU can offer 25 or 50 Hz frequency, would anything need to be changed to get this speed?

```auto
average rate: 1.656
	min: 0.604s max: 0.604s std dev: 0.00000s window: 2
average rate: 1.655
	min: 0.604s max: 0.605s std dev: 0.00043s window: 4
average rate: 1.654
	min: 0.604s max: 0.606s std dev: 0.00069s window: 5
average rate: 1.655
	min: 0.604s max: 0.606s std dev: 0.00065s window: 7
average rate: 1.655
	min: 0.603s max: 0.606s std dev: 0.00080s window: 9
average rate: 1.655
	min: 0.603s max: 0.606s std dev: 0.00076s window: 10

```

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 13, 2023, 9:34am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/2 "2023-01-13T09:34:28Z")

</div>

Hi @ap07  
Welcome to the Stereolabs community.

Can you please check the value of the sensor frequency parameter:

> <https://github.com/stereolabs/zed-ros-wrapper/blob/master/zed_wrapper/params/zed2i.yaml#L17>

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 13, 2023, 9:42am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/3 "2023-01-13T09:42:17Z")

</div>

Hi @Myzhar,

I don’t think that was changed. This is what I use. Does reducing help?  
I have also observed the framerate of

> …/left/image\_rect\_color

is around 3.8 hz. which I dont think was what I have set as default. I had set that as grab\_frame\_rate: 15.

```auto
# params/zed2i.yaml
# Parameters for Stereolabs ZED2 camera
---

general:
    camera_model: 'zed2i'

depth:
    min_depth: 0.3 # Min: 0.2, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory
    max_depth: 5.0 # Max: 40.0

pos_tracking:
    imu_fusion: true # enable/disable IMU fusion. When set to false, only the optical odometry will be used.

sensors:
    sensors_timestamp_sync: false # Synchronize Sensors messages timestamp with latest received frame
    max_pub_rate: 200. # max frequency of publishing of sensors data. MAX: 400. - MIN: grab rate
    publish_imu_tf: true # publish `IMU -> <cam_name>_left_camera_frame` TF

object_detection:
    od_enabled: false # True to enable Object Detection [not available for ZED]
    model: 0 # '0': MULTI_CLASS_BOX - '1': MULTI_CLASS_BOX_ACCURATE - '2': HUMAN_BODY_FAST - '3': HUMAN_BODY_ACCURATE - '4': MULTI_CLASS_BOX_MEDIUM - '5': HUMAN_BODY_MEDIUM - '6': PERSON_HEAD_BOX
    confidence_threshold: 50 # Minimum value of the detection confidence of an object [0,100]
    max_range: 15. # Maximum detection range
    object_tracking_enabled: true # Enable/disable the tracking of the detected objects
    body_fitting: false # Enable/disable body fitting for 'HUMAN_BODY_X' models
    mc_people: true # Enable/disable the detection of persons for 'MULTI_CLASS_BOX_X' models
    mc_vehicle: true # Enable/disable the detection of vehicles for 'MULTI_CLASS_BOX_X' models
    mc_bag: true # Enable/disable the detection of bags for 'MULTI_CLASS_BOX_X' models
    mc_animal: true # Enable/disable the detection of animals for 'MULTI_CLASS_BOX_X' models
    mc_electronics: true # Enable/disable the detection of electronic devices for 'MULTI_CLASS_BOX_X' models
    mc_fruit_vegetable: true # Enable/disable the detection of fruits and vegetables for 'MULTI_CLASS_BOX_X' models
    mc_sport: true # Enable/disable the detection of sport-related objects for 'MULTI_CLASS_BOX_X' models

```

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 13, 2023, 10:13am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/4 "2023-01-13T10:13:31Z")

</div>

This means that the threads of the ZED node are running at lower frequencies than expected.

Can you start the `Runtime Monitor` plugin in `rqt`and post a screenshot?

[https://www.stereolabs.com/docs/ros/zed-node/#diagnostic](https://www.stereolabs.com/docs/ros/zed-node/#diagnostic)

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 13, 2023, 11:08am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/6 "2023-01-13T11:08:49Z")

</div>

Sharing screenshot of resource monitor

 ![Screenshot 2023-01-13 at 4.32.34 PM](https://community.stereolabs.com/uploads/default/original/1X/e4f75bb00774159c18889ad7e3572e790d83ef35.png)

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 13, 2023, 11:56am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/7 "2023-01-13T11:56:41Z")

</div>

As I suspected there is something strange. The frequency is too low.

What is the CPU of your device?  
Did you modify the YAML files to disable TF broadcasting?

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 13, 2023, 4:30pm UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/8 "2023-01-13T16:30:46Z")

</div>

it’s an intel i7. I use a docker image to run it, would that interfere? I don’t think the tf broadcast settings was edited in the yaml file. It’s the same file above right?

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 16, 2023, 8:40am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/9 "2023-01-16T08:40:03Z")

</div>

No, it’s not the same file. TF publishing is controlled by parameters in the `common.yaml` file.

We expect the ZED node to execute at higher frequencies even in a docker image, so there’s something other wrongs with your configuration.

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 16, 2023, 11:04am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/10 "2023-01-16T11:04:58Z")

</div>

that is the setting right? I don’t think these are changed

```auto
pos_tracking:
    pos_tracking_enabled: true # True to enable positional tracking from start
    publish_tf: true # publish `odom -> base_link` TF
    publish_map_tf: true # publish `map -> odom` TF
    map_frame: 'map' # main frame
    odometry_frame: 'odom' # odometry frame
    area_memory_db_path: 'zed_area_memory.area' # file loaded when the node starts to restore the "known visual features" map. 
    save_area_memory_db_on_exit: false # save the "known visual features" map when the node is correctly closed to the path indicated by `area_memory_db_path`
    area_memory: true # Enable to detect loop closure
    floor_alignment: false # Enable to automatically calculate camera/floor offset
    initial_base_pose: [0.0,0.0,0.0, 0.0,0.0,0.0] # Initial position of the `base_frame` -> [X, Y, Z, R, P, Y]
    init_odom_with_first_valid_pose: true # Enable to initialize the odometry with the first valid pose
    path_pub_rate: 2.0 # Camera trajectory publishing frequency
    path_max_count: -1 # use '-1' for unlimited path size
    two_d_mode: false # Force navigation on a plane. If true the Z value will be fixed to "fixed_z_value", roll and pitch to zero
    fixed_z_value: 0.00 # Value to be used for Z coordinate if `two_d_mode` is true    

```

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 16, 2023, 11:27am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/11 "2023-01-16T11:27:35Z")

</div>

Yes, that seems correct.

Can you post the full file, please?

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 16, 2023, 11:35am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/12 "2023-01-16T11:35:06Z")

</div>

```auto
# params/common.yaml
# Common parameters to Stereolabs ZED and ZED mini cameras
---

# Dynamic parameters cannot have a namespace
brightness: 4 # Dynamic
contrast: 4 # Dynamic
hue: 0 # Dynamic
saturation: 4 # Dynamic
sharpness: 4 # Dynamic
gamma: 8 # Dynamic - Requires SDK >=v3.1
auto_exposure_gain: true # Dynamic
gain: 100 # Dynamic - works only if `auto_exposure_gain` is false
exposure: 100 # Dynamic - works only if `auto_exposure_gain` is false
auto_whitebalance: true # Dynamic
whitebalance_temperature: 42 # Dynamic - works only if `auto_whitebalance` is false
depth_confidence: 30 # Dynamic
depth_texture_conf: 100 # Dynamic
pub_frame_rate: 30.0 # Dynamic - frequency of publishing of video and depth data
point_cloud_freq: 3.0 # Dynamic - frequency of the pointcloud publishing (equal or less to `grab_frame_rate` value)

general:
    camera_name: zed # A name for the camera (can be different from camera model and node name and can be overwritten by the launch file)
    zed_id: 0
    serial_number: 0
    resolution: 2 # '0': HD2K, '1': HD1080, '2': HD720, '3': VGA
    grab_frame_rate: 15 # Frequency of frame grabbing for internal SDK operations
    gpu_id: -1
    base_frame: 'base_link' # must be equal to the frame_id used in the URDF file
    verbose: true # Enable info message by the ZED SDK
    svo_compression: 2 # `0`: LOSSLESS, `1`: AVCHD, `2`: HEVC
    self_calib: true # enable/disable self calibration at starting
    camera_flip: false

video:
    img_downsample_factor: 1.0 # Resample factor for images [0.01,1.0] The SDK works with native image sizes, but publishes rescaled image.
    extrinsic_in_camera_frame: true # if `false` extrinsic parameter in `camera_info` will use ROS native frame (X FORWARD, Z UP) instead of the camera frame (Z FORWARD, Y DOWN) [`true` use old behavior as for version < v3.1]

depth:
    quality: 4 # '0': NONE, '1': PERFORMANCE, '2': QUALITY, '3': ULTRA, '4': NEURAL
    sensing_mode: 0 # '0': STANDARD, '1': FILL (not use FILL for robotic applications)
    depth_stabilization: 1 # `0`: disabled, `1`: enabled
    openni_depth_mode: false # 'false': 32bit float meters, 'true': 16bit uchar millimeters
    depth_downsample_factor: 0.1 # Resample factor for depth data matrices [0.01,1.0] The SDK works with native data sizes, but publishes rescaled matrices (depth map, point cloud, ...)

pos_tracking:
    pos_tracking_enabled: true # True to enable positional tracking from start
    publish_tf: true # publish `odom -> base_link` TF
    publish_map_tf: true # publish `map -> odom` TF
    map_frame: 'map' # main frame
    odometry_frame: 'odom' # odometry frame
    area_memory_db_path: 'zed_area_memory.area' # file loaded when the node starts to restore the "known visual features" map. 
    save_area_memory_db_on_exit: false # save the "known visual features" map when the node is correctly closed to the path indicated by `area_memory_db_path`
    area_memory: true # Enable to detect loop closure
    floor_alignment: false # Enable to automatically calculate camera/floor offset
    initial_base_pose: [0.0,0.0,0.0, 0.0,0.0,0.0] # Initial position of the `base_frame` -> [X, Y, Z, R, P, Y]
    init_odom_with_first_valid_pose: true # Enable to initialize the odometry with the first valid pose
    path_pub_rate: 2.0 # Camera trajectory publishing frequency
    path_max_count: -1 # use '-1' for unlimited path size
    two_d_mode: false # Force navigation on a plane. If true the Z value will be fixed to "fixed_z_value", roll and pitch to zero
    fixed_z_value: 0.00 # Value to be used for Z coordinate if `two_d_mode` is true    

mapping:
    mapping_enabled: false # True to enable mapping and fused point cloud publication
    resolution: 0.05 # maps resolution in meters [0.01f, 0.2f]
    max_mapping_range: -1 # maximum depth range while mapping in meters (-1 for automatic calculation) [2.0, 20.0]
    fused_pointcloud_freq: 1.0 # frequency of the publishing of the fused colored point cloud
    clicked_point_topic: '/clicked_point' # Topic published by Rviz when a point of the cloud is clicked. Used for plane detection

```

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 16, 2023, 11:41am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/13 "2023-01-16T11:41:13Z")

</div>

I see a problem:  
`pub_frame_rate: 30.0`  
`grab_frame_rate: 15`

`pub_frame_rate` cannot be higher than `grab_frame_rate`.

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 16, 2023, 11:43am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/14 "2023-01-16T11:43:02Z")

</div>

Oh okay, will try to change it. But would’nt that also fail if I run on the base? Because the publish rate is slow in docker only.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 16, 2023, 11:44am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/15 "2023-01-16T11:44:40Z")

</div>

Normally, it’s automatically set to the correct value, so trunked to 15 in your case.

But I’m trying to figure out what could be the problem, so I want to exclude every possible evident cause.

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 16, 2023, 12:10pm UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/16 "2023-01-16T12:10:06Z")

</div>

Okay, will try to change the param and make the docker image.  
Sharing an observation from the docker logs

```auto
[0m[INFO] [1673867574.171469982]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867574.171518537]: Expected cycle time: 0.005000000 - Real cycle time: 0.603893522e[0m
e[0m[INFO] [1673867575.378130536]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867575.378177267]: Expected cycle time: 0.005000000 - Real cycle time: 0.602604613e[0m
e[0m[INFO] [1673867576.585563091]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867576.585623908]: Expected cycle time: 0.005000000 - Real cycle time: 0.603392070e[0m
e[0m[INFO] [1673867577.792944510]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867577.792998099]: Expected cycle time: 0.005000000 - Real cycle time: 0.602539430e[0m
e[0m[INFO] [1673867579.002674534]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867579.002732404]: Expected cycle time: 0.005000000 - Real cycle time: 0.603781447e[0m
e[0m[INFO] [1673867580.207671643]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867580.207729132]: Expected cycle time: 0.005000000 - Real cycle time: 0.602256746e[0m
e[0m[INFO] [1673867581.424095618]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867581.424155452]: Expected cycle time: 0.005000000 - Real cycle time: 0.613185718e[0m
e[0m[INFO] [1673867582.632845106]: Sensors thread is not synchronized with the Sensors ratee[0m
e[0m[INFO] [1673867582.632893111]: Expected cycle time: 0.005000000 - Real cycle time: 0.603786288e[0m
e[0m[INFO] [1673867583.840120012]: Sensors thread is not synchronized with the Sensors ratee[e[33m[WARN] [1673867587.461998547]: Sensors data publishing takes longer (0.603190560 sec) than requested by the Sensors rate (0.005000000 sec). Please consider to lower the 'max_pub_rate' setting or to reduce the power requirements reducing the resolutions.e[0m
e[33m[WARN] [1673867588.766701133]: Elaboration takes longer (0.305413 sec) than requested by the FPS rate (0.066666667 sec). Please consider to lower the 'frame_rate' setting or to reduce the power requirements reducing the resolutions.e[0m
e[33m[WARN] [1673867597.724399641]: Sensors data publishing takes longer (0.603122047 sec) than requested by the Sensors rate (0.005000000 sec). Please consider to lower the 'max_pub_rate' setting or to reduce the power requirements reducing the resolutions.e[0m
e[33m[WARN] [1673867598.848223347]: Elaboration takes longer (0.305377 sec) than requested by the FPS rate (0.066666667 sec). Please consider to lower the 'frame_rate' setting or to reduce the power requirements reducing the resolutions.e[0m
0m

```

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 17, 2023, 8:56am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/17 "2023-01-17T08:56:47Z")

</div>

I’ve set the grab\_frame\_rate same as pub\_frame\_rate at 15 hz. Haven’t seen any improvement in it though.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 17, 2023, 10:03am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/18 "2023-01-17T10:03:30Z")

</div>

Do you have the opportunity to test it outside Docker?

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 17, 2023, 11:38am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/19 "2023-01-17T11:38:56Z")

</div>

It works perfectly outside docker. Camera at 30 hz and magnetometer at 50.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [January 18, 2023, 8:03am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/20 "2023-01-18T08:03:32Z")

</div>

In this case, you must understand why your machine has Docker degraded performance.

---

<div class="post-metadata">

**Author:** ![ap07](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@ap07](https://community.stereolabs.com/u/ap07)\
**Post date:** [January 19, 2023, 5:44am UTC](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007/21 "2023-01-19T05:44:13Z")

</div>

@Myzhar  
I saw another thing missing in the docker roslaunch. Is this essential for operation?

```auto
ERROR: cannot launch node of type [robot_state_publisher/robot_state_publisher]: robot_state_publisher

```

[Next page](https://community.stereolabs.com/t/zed-2i-imu-ros-topic-frequency-low-1-6-1-8-hz/2007.md?page=2)
