stereolabs / zed-ros2-examples

A collection of examples and tutorials to illustrate how to better use the ZED cameras in the ROS2 framework
https://www.stereolabs.com/docs/ros2/
Apache License 2.0
34 stars 29 forks source link

Issue specifying `avg_win_size` when using zed_topic_benchmark #20

Closed BradySheehan closed 1 year ago

BradySheehan commented 1 year ago

Preliminary Checks

Description

Using the humble zed 3.8 sdk docker image, stereolabs/zed:3.8-devel-cuda11.7-ubuntu22.04, I am unable to specify or set after the fact the avg_win_size parameter specified here https://github.com/stereolabs/zed-ros2-examples/tree/master/tools#parameters.

Steps to Reproduce

  1. Start process advertising topic desired to benchmark
  2. Try any combination of specifying the avg_win_size param on the commandline as a launch argument or try specifying it with a ros2 param set call
  3. a. ros2 run zed_topic_benchmark zed_topic_benchmark --ros-args -p topic_name:=/zed2i/zed_node/rgb/image_rect_color avg_win_size:=15 throws an "unknown ros arguments" error
  4. b ros2 param set /topic_benchmark avg_win_size 15 returns "parameter cannot be set because it is read only"

Expected Result

I expected to be able to specify via launch arguments or modifying the parameter after launch the avg_win_size variable.

Actual Result

ros2 run zed_topic_benchmark zed_topic_benchmark --ros-args -p topic_name:=/zed2i/zed_node/rgb/image_rect_color avg_win_size:=15 throws an "unknown ros arguments" error

ros2 param set /topic_benchmark avg_win_size 15 returns "parameter cannot be set because it is read only"

ZED Camera model

ZED2i

Environment

- Ubuntu 22.04.1 LTS​
- 16gb of ram​
- Intel® 9th/ 8th-Gen Core™ hexa-core 35W/ 65W LGA1151 CPU
- running Stereolabs 3.8 sdk docker container
- using zed2i polarized sensor

Anything else?

No response

swiz23 commented 1 year ago

It looks like you need to specify the '-p' flag before each param you are trying to set. For example, the following command should work.

ros2 run zed_topic_benchmark zed_topic_benchmark --ros-args -p topic_name:=/zed2i/zed_node/rgb/image_rect_color -p avg_win_size:=50

See https://docs.ros.org/en/humble/How-To-Guides/Node-arguments.html#setting-parameters-directly-from-the-command-line for reference.

Myzhar commented 1 year ago

Yes, it's indeed required. It's not required instead when you set a parameter of a launch file.

BradySheehan commented 1 year ago

Awesome, thanks @swiz23 and @Myzhar . This works for me.