No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.

linux_isolate_process package from linux_isolate_process repo

linux_isolate_process

Package Summary

Tags No category tags.
Version 0.0.2
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/adityapande-1995/linux_isolate_process.git
VCS Type git
VCS Version main
Last Updated 2024-01-31
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

A tool to isolate ros2 nodes

Additional Links

No additional links.

Maintainers

  • adityapande

Authors

No additional authors.

linux_isolate_process

Isolates any given process using the unshare() system call. Suited for ROS, though can work for any process. Since the system call is linux specific, this would not work on Windows. This can be really useful for running a large number of tests in parallel wihtout having them interacting with each other.

This is similar to ROS domain IDs, though domain IDs are limited by the number of ports you have, and this approach is more scalable.

Originally added in drake-ros

Installation

This is a python ROS2 package, and requires colcon to be installed.

1. From source

mkdir ~/my_ws
cd ~/my_ws ; mkdir src ; cd src
git clone https://github.com/adityapande-1995/linux_isolate_process
cd ~/my_ws
colcon build

Usage

1. This command can now be used as a commandline tool:

source ~/my_ws/install/setup.bash
python3 -m linux_isolate_process <your command>

# For e.g., to get a bash shell that is isolated
python3 -m linux_isolate_process /bin/bash

For example, to run an isolated talker (Note : any ros nodes inside the bash -c "(<command>)" will be able to talk to each other) :

python3 -m linux_isolate_process /bin/bash -c "ros2 run demo_nodes_cpp talker"

If you open another terminal and run a listener normally, using

ros2 run demo_nodes_cpp listener

it will not receive any of the messages published by the talker. However, if you run the talker and listener in the same process, they will be able to talk to each other. That is, this should work perfectly fine :

python3 -m linux_isolate_process /bin/bash -c "ros2 run demo_nodes_cpp talker & ros2 run demo_nodes_cpp listener"

The talker and listener in this case are "isolated together", and hence can talk to each other.

2. This can also be used as a module, to isolate the current process:

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import linux_isolate_process as i
>>> i.create_linux_namespaces()
True
>>> # Any ros2 nodes run here would be isolated

CHANGELOG

Changelog for package linux_isolate_process

0.0.2 (2024-01-29)

  • 0.0.1
  • Removed entry points
  • Added main
  • Updated readme
  • Update README.md
  • Updated package.xml
  • Changed to a ROS package
  • Updated name
  • Updated project name
  • Updated toml
  • Update pyproject.toml
  • Update setup.py
  • Update README.md
  • Update README.md
  • Update README.md
  • Added toml file
  • Create LICENSE
  • Changed name of the tool to linux_isolate_process
  • Update README.md
  • Update README.md
  • Update README.md
  • Can use as a module
  • Check os before execution
  • Update isolate.py
  • Update README.md
  • Update README.md
  • Added the basic script
  • Initial commit
  • Contributors: Aditya Pande

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Package Dependencies

System Dependencies

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged linux_isolate_process at Robotics Stack Exchange

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.