intel / ros2_intel_realsense

This project is deprecated and no more maintained. Please visit https://github.com/IntelRealSense/realsense-ros for ROS2 wrapper.
Apache License 2.0
139 stars 95 forks source link

Device or resource busy Error #177

Open guni9191 opened 2 years ago

guni9191 commented 2 years ago

Environment: Ros2 dashing Ubuntu 18.04LTS Realsense D435i

  1. At first I installed binary package and sometimes get errors like this: what(): get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Device or resource busy

  2. To access the source code I have built this from source. In realsense_camera_node.cpp, inside onInit() function, I have added sleep_for after setupDevice() and setupPublishers(). It seems like the setup process is somehow too fast for the hardware.

virtual void onInit() { getParameters(); setupDevice(); rclcpp::sleep_for(std::chrono::nanoseconds(2000000000)); setupPublishers(); rclcpp::sleep_for(std::chrono::nanoseconds(2000000000)); setupStreams(); rclcpp::sleep_for(std::chrono::nanoseconds(2000000000)); timer_ = this->create_wall_timer(std::chrono::seconds(1), std::bind(&RealSenseCameraNode::publishStaticTransforms, this)); RCLCPP_INFO(logger_, "RealSense Node Is Up!"); }

And it does not produce error. This is only a temporary fix for me. Hope that this bug is fixed soon :)