ros-realtime / ros-realtime-rpi4-image

An image for the Raspberry Pi 4 with ROS 2 and Linux RT preinstalled
Apache License 2.0
224 stars 41 forks source link

Real time with new user "x" #70

Closed mataruzz closed 1 year ago

mataruzz commented 1 year ago

Hello, I'm using your real time patch on my Raspberry 3B+. The installation didn't give me any problem.

The problem came when I tried to create a new user "x". Now, I'm not able to access to the gpio pins anymore. Get the privilege to access the pins is not a big deal, if not that when running my scripts with user "x" the real time is not happening anymore. It does happened only if I enter in sudo mode (e.g, sudo -s).

How can I set the new user "x" to be set similar as the sudo, giving at least the possibility to work in real time?

Thank you

shuhaowu commented 1 year ago

This is likely because you didn't add the user to the appropriate groups. Check out this article. It applies to Debian which is probably the same as Ubuntu.

This is not an issue with the image.

shuhaowu commented 1 year ago

Also keep in mind that only the ubuntu user (and root of course) is setup with real time permissions. You'll have to repeat that for your own user if you want another user.

mataruzz commented 1 year ago

Ok, thank you. Do you know any reference link I can follow to setup the new user with real time permission?

LanderU commented 1 year ago

@mataruzz, you can add your user to the security limits config https://github.com/ros-realtime/ros-realtime-rpi4-image/blob/3c2024fc5f8acafd6e3e5fee8c47ab9524375a6e/image_builder/data/jammy-rt/rootfs/etc/security/limits.d/20-ubuntu-rt.conf, similar to this one.

LanderU commented 1 year ago

Or add your user to ubuntu group.

mataruzz commented 1 year ago

Thank you so much for you quick answer. The security limit config file was exactly what I was looking for.