unitreerobotics / unilidar_sdk

SDK for Unitree L1 LiDAR
BSD 3-Clause "New" or "Revised" License
59 stars 23 forks source link

terminate called after throwing an instance of 'serial::IOException' what(): IO Exception (13): Permission denied, file /home/mlb/ut_workspace/202207_unitree_selfmade_lidar/unitree_lidar_sdk/unitree_lidar_sdk/src/serial/impl/unix.cc, line 151. #1

Closed Jazzzey closed 1 year ago

Jazzzey commented 1 year ago

ROS1编译完驱动,运行报错,如下所示: terminate called after throwing an instance of 'serial::IOException' what(): IO Exception (13): Permission denied, file /home/mlb/ut_workspace/202207_unitree_selfmade_lidar/unitree_lidar_sdk/unitree_lidar_sdk/src/serial/impl/unix.cc, line 151.

lingbomeng commented 1 year ago

In Linux, accessing a serial port device requires the appropriate permissions. If your C++ program does not have sufficient permissions to access the serial port device, you will get a "Permission denied" error.

To solve this error, you can use the following command to add the current user to the dialout group:

sudo usermod -a -G dialout $USER

After adding the user to the dialout group, you need to log out and log back in for the changes to take effect.