ros-drivers / ros2_ouster_drivers

ROS2 Drivers for the Ouster OS-0, OS-1, and OS-2 Lidars
https://ouster.com/
Apache License 2.0
139 stars 79 forks source link

Failed to configure tins sniffer however ethernet device is valid #80

Closed CFZeon closed 3 years ago

CFZeon commented 3 years ago

I'm trying to replay a pcap to capture with ros2 bag. However, I get this error image which is weird considering how ifconfig shows that it is working fine image

SteveMacenski commented 3 years ago

CC @MattSYoung

MattSYoung commented 3 years ago

Hi there @CFZeon, I'm not sure what your exact problem is, as I can't reproduce this issue on my PC without more information. So let's try to get some more info out of the Tins API - can you please go to Line 189 of src/sensor.cpp and change that line

FROM:

_tins_sniffer_pointer = std::make_unique<Tins::Sniffer>(eth_device, _sniffer_config);

TO:

  try { 
    _tins_sniffer_pointer = std::make_unique<Tins::Sniffer>(eth_device, _sniffer_config);
  } catch (const std::exception & e) {
    std::cout << "Tins error is: " << e.what() << std::endl;
  }

Re-compile and re-run etc, then post the result back here. You should see something like [ouster_tins_driver-1] Tins error is: SIOCGIFHWADDR: No such device

CFZeon commented 3 years ago

Hi @MattSYoung the tins error that showed was image

MattSYoung commented 3 years ago

Sounds like a permissions error. Are you using a virtual environment such as Docker or WSL by any chance?

Try re-running the launch file with sudo, that might give the Ouster driver the permissions it needs to access the ethernet device.

CFZeon commented 3 years ago

That did the trick! Thank you so much. It did not occur to me that it was a perms issue.

MattSYoung commented 3 years ago

No worries, glad it solved your problem!