ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosserial: Permission denied

asked 2018-09-11 09:50:18 -0500

lorenznew gravatar image

hello,

I had to re-install my Ubuntu 16.04 with kinetic for some reasons. How ever, I tried to re-install all the work I've done before on the project. All the workspaces where saved in my onwcloud, so i thought it should be an easy thing to do. Wrong :)

As I tried just to recompile the workspace with catkin_make everything failed an i tried to build from a new and clean workspace. There is a node that uses some serial communication,so i need to add the rosserial pkg to my system. First try by sudo apt-get install ros-kinetic-serial. then I did catkin_make. Everything fine so far. BUT when i start the node with rosrun an exeption ocoured:

IO Exception (13): Permission denied, file /tmp/binarydeb/ros-kinetic-serial-1.2.1/src/impl/unix.cc, line 151.

Just to check, i manually install the serial-pkg in my workspace and build both mith catkin. Now ther ist that error:

IO Exception (13): Permission denied, file /home/eddie/owncloud/eddie_ws/src/serial/src/impl/unix.cc, line 151.

which is basicly the same.

The piece of code with this revers to ist that: (l.151 is the default case)

void
Serial::SerialImpl::open ()
{
  if (port_.empty ()) {
    throw invalid_argument ("Empty port is invalid.");
  }
  if (is_open_ == true) {
    throw SerialException ("Serial port already open.");
  }

  fd_ = ::open (port_.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);

  if (fd_ == -1) {
    switch (errno) {
    case EINTR:
      // Recurse because this is a recoverable error.
      open ();
      return;
    case ENFILE:
    case EMFILE:
      THROW (IOException, "Too many file handles open.");
    default:
      THROW (IOException, errno);
    }
  }

  reconfigurePort();
  is_open_ = true;
}

Does anyone has any ideas? thank you all! p.s. the hole thing worked very good before the re installation.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2018-09-11 10:31:20 -0500

gvdhoorn gravatar image

You most likely had a udev file that set the correct permissions on your serial port so your user had read/write access.

Or on your old installation your user account was a member of the dialout group. See #q189457 for what is probably a related question.

edit flag offensive delete link more

Comments

WOW! nice! Thank you! I found the solution thanks to your comment! Just need to do: sudo adduser <second_user> dialout and restart the PC. Thanks!!

lorenznew gravatar image lorenznew  ( 2018-09-12 03:36:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-09-11 09:50:18 -0500

Seen: 3,527 times

Last updated: Sep 11 '18