How to run a single node as root [ROS2]
Hello, I am trying to set up a ROS2 (foxy) node to run as root (with sudo). The node is running high frequency, low level operations on the RT-Linux kernel - thus the need for root access.
I've been trying to run the node as root but the other nodes (and also tools like ros2 topic echo) don't seem to communicate with each other. Echo doesn't print anything, and callbacks on my node's are not triggered. I've tried to set up ROS_DOMAIN_ID, also sourced .bashrc and /opt/ros/foxy/setup.bash nut neither of these things seem to solve the problem.
The last thing that I've tried was creating a script that executed:
sudo bash -c "export ROS_DOMAIN_ID=69 && source install/setup.bash && source /home/robot/.bashrc && ros2 launch ros2_bringup robot.launch.py"
Has anyone done something like that? Is there any step that I'm missing? Googling doesn't really show up anything helpfull.