Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Serial number and other minor bugs #170

Open
victordlee opened this issue Nov 17, 2020 · 0 comments
Open

Serial number and other minor bugs #170

victordlee opened this issue Nov 17, 2020 · 0 comments

Comments

@victordlee
Copy link

I spent an hour debugging this ROS2 driver and found several issues that may help other users in using this driver.

This is for the foxy build (aka refactor branch) and running with Ubuntu 20.04 LTS librealsense libraries.

  1. To run the ros2 node in foxy, the readme is out of date and should use (note the parameter files, new path to yaml and remaping):
ros2 run realsense_node realsense_node --ros-args --params-file `ros2 pkg prefix realsense_examples`/share/realsense_examples/config/d435i.yaml --remap __ns:=/d435i
  1. Serial number seems like an integer but it isn't. For my device, I had an extra '0' at the front of my serial number and this causes the yaml parameter to integer to string conversion to fail (it basically overflows).

Existing code in rs_factory.cpp :

void RealSenseNodeFactory::init()
{
  auto param_desc = rcl_interfaces::msg::ParameterDescriptor();
  param_desc.read_only = true;
  auto param_value = declare_parameter("serial_no");
  if (param_value.get_type() == rclcpp::PARAMETER_NOT_SET) {
    RCLCPP_INFO(
      this->get_logger(), "Device's serial number is not set, enabling the default device!");
  } else {
    serial_no_ = std::to_string(param_value.get<rclcpp::PARAMETER_INTEGER>());
  }

should be this (to support serial numbers with 0 in front)

serial_no_ = param_value.get<rclcpp::PARAMETER_STRING>();

and the yaml configuration needs quotes around the serial number to make this all work:

/d435i:
  camera:
    ros__parameters:
      serial_no: "040322073442"
       #040322073442 # d435i
  1. The "terminate called after throwing an instance of 'rs2::error'" error
    I ran in to an issue with this driver giving me this error :
~/ros/intel_ws$ ros2 run realsense_node realsense_node --ros-args --params-file `ros2 pkg prefix realsense_examples`/share/realsense_examples/config/d435i.yaml --remap __ns:=/d435i
[INFO] [1605627960.648295262] [d435i.camera]: Device with serial number 040322073442 was found.
[INFO] [1605627960.648547895] [d435i.camera]: Create a node for D435i Camera
terminate called after throwing an instance of 'rs2::error'
  what():  Couldn't resolve requests

After weeding through the code, I have concluded that its basically telling me that the configuration that I have selected in the YAML file is either not supported, incorrectly configured or you don't have enough bandwidth on your USB to support this configuration. In any case, they could have come up with a better error message. In my case, my configuration was overwhelming a USB 2.1 connection. So, I disabled a couple of streams that I didn't need (like infra1) and it works fine.

I still don't know if this driver works fully but I have gotten something out of rqt that looks alright. I'll update this post if I find more stuff.

Stay safe.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant