Hello zed community
I am working on Jetson Orin. I am running zed_wrapper zed2.launch.py inside docker container.
I want to run object detection, I don’t see /zed/zed_node/obj_det topic when runnning the above command.
I changed the object_detection.od_enabled to true in config.yaml and can see it is true on console output but still don’t see object_detection topic published.
Lastly I ran service call for enable_object_detection.
I face this issue
ros2 service call /zed/zed_node/enable_obj_det std_srvs/srv/SetBool ‘{data: true}’
requester: making request: std_srvs.srv.SetBool_Request(data=True)
response:
std_srvs.srv.SetBool_Response(success=False, message=‘Error occurred starting Object Detection. See log for more info’)
Hi @Shubham_23
welcome to the StereoLabs community.
The first time you start the object detection module in a Docker image the ROS 2 Wrapper must download and optimize the AI model, so until this task is completed you cannot see any topic published.
I recommend following this guide to add persistence to the Docker image, otherwise, the optimization task must be performed each time the image is started:
Is it possible that I record the zed node (in rosbag) while in docker and I have the AI models already downloaded on my local system and then run the data (Rosbag) and get the object detection results?
This is not possible. The rosbag cannot be used as an input for the ZED ROS 2 Wrapper.
You can instead record SVO files and use them as an input for the wrapper.
I recommend not running RVIZ2 on a Jetson because it’s a high demanding software and can make the overall system unstable.
Can you verify if the crash happens even if you launch RVIZ2 on another PC on the same network?
You can install only the zed-ros2-examples repository on the other PC and use this command to start RVIZ2 without starting the ZED node:
As per your recommendation I am trying to start object detection on zed2 (which is inside docker) running on Jetson Orin Nano.
I am using:
ros2 service call /zed/zed_node/enable_obj_det std_srvs/srv/SetBool “{data: true}”
requester: making request: std_srvs.srv.SetBool_Request(data=True)
response:
std_srvs.srv.SetBool_Response(success=False, message='Error occurred starting Object Detection. See log for more info')
The first time that you start the Object Detection module with a new AI model the host device must download and optimize it.
On the Jetson Orin Nano this task can require many minutes.
I recommend you manually optimize the AI models that you want to use manually before running the ROS node:
To get the AI models, I think I should remove skip_tools and rm -rf /usr/local/zed/resources/* to get all the models while building zed docker image. Can you elaborate more if this seems the correct path?
Under the Volumes section. Can you elaborate a how to go about mounting Object Detection AI module if I plan on downloading and optimizing only one AI model manually?
It’s correct concerning rm -rf /usr/local/zed/resources/*, not completely correct concerning skip_tools.
I do not recommend downloading and optimizing the AI model inside a Docker Image.
The tools will make the docker image size bigger.
You can use the ZED_Diagnostic commands to download and optimize the AI model on the host and put the relative files in the shared folder that will be visible from inside the running docker image.
You must simply put the files of the downloaded model and the optimized model in the shared folder on the host.
For example, on my machine, for Object Detection Medium, the files are objects_medium_3.2.model
and .objects_medium_3.2.model_optimized-ebgbl-1-89-12010-8801-8600-13-192-36864-48-100-512-46-00
Please note that if you optimize a model on an host, you cannot move it to another host if it does not have the same identical hardware and software configuration (OS, ZED SDK, CUDA, GPU model)
No EGL Display
nvbufsurftransform: Could not get EGL display connection
[ERROR] (/builds/sl/ZEDKit/lib/src/sl_input/mmapi/R354/NvV4l2Element.cpp:63) <enc_16375> Could not open device '/dev/nvhost-msenc': Cannot allocate memory
[ZED][Encoding] Critical Error : No Video Enc [enc_16375]
Segmentation fault (core dumped)
In my previous approach using my own docker file and running ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zed2. Despite changing common.yaml parameter object_detection.od_enabled=true and linking AI module to zed_resources. I don’t see /zed/zed_node/obj_det/ published.