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
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.
Environment: Ros2 dashing Ubuntu 18.04LTS Realsense D435i
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
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 :)