Running ROS bridge with ISAAC Sim docker container

For access to the ROS bridge, do i need to add it to the command line for the docker container on launch?

sudo docker run --entrypoint ./runapp.sh --gpus all -e "ACCEPT_EULA=Y" --network=host --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro -v ~/catkin_ws:/root/catkin_ws -e DISPLAY=unix${DISPLAY} nvcr.io/nvidia/isaac-sim:2020.1_ea

ansfer.
2020-09-03 19:11:57 [24,502ms] [Info] [rtx.resourcemanager.plugin] Added dataSource connection for prefix 'omni'
2020-09-03 19:12:31 [58,197ms] [Error] [carb] [Plugin: libomni.isaac.ros_bridge.plugin.so] Could not load the dynamic library from /isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/bin/linux-x86_64/release/libomni.isaac.ros_bridge.plugin.so. Error: libapr-1.so.0: cannot open shared object file: No such file or directory
2020-09-03 19:12:31 [58,179ms] [Info] [omni.ext.plugin] [ext: omni.isaac.ros_bridge] startup
2020-09-03 19:12:31 [58,181ms] [Info] [omni.ext.plugin] Attempting to load plugins. Folder: '/isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/bin/linux-x86_64/release' Filename: '*.plugin'
2020-09-03 19:12:31 [58,181ms] [Info] [carb] Searching plugins in folder: /isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/bin/linux-x86_64/release
2020-09-03 19:12:31 [58,197ms] [Warning] [carb] Potential plugin preload failed: /isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/bin/linux-x86_64/release/libomni.isaac.ros_bridge.plugin.so
2020-09-03 19:12:31 [58,211ms] [Info] [carb] Searching plugins in folder: /isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/
2020-09-03 19:12:31 [58,212ms] [Error] [carb.scripting-python.plugin] RuntimeError: Failed to acquire interface: omni::isaac::ros_bridge::RosBridge (pluginName: nullptr)

At:
  /isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/omni/isaac/ros_bridge/scripts/extension.py(18): on_startup
  /isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/plugins/bindings-python/omni/ext/_internal.py(121): _startup_ext
  /isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/plugins/bindings-python/omni/ext/_internal.py(133): startup_all_extensions_in_module
  /isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/plugins/bindings-python/omni/ext/_internal.py(166): startup_all_extensions_in_module
  /isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release(3): <module>

2020-09-03 19:12:31 [58,212ms] [Error] [omni.ext.plugin] Failed to process python module extension: /isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge

Hi, the container might be missing a lib. Can try the bash in container then install the lib and try again?

sudo docker run -it --entrypoint bash --gpus all -e "ACCEPT_EULA=Y" --network=host --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro -v ~/catkin_ws:/root/catkin_ws -e DISPLAY=unix${DISPLAY} nvcr.io/nvidia/isaac-sim:2020.1_ea
apt-get update && apt-get install libapr1
./runapp.sh

I face the same problem.
@wegunterjr were you able to run the ros_bridge inside the docker image?

@Sheikh_Dawood I installed libapr1 as you said. However, shouldn’t the third step be “./runheadless.sh”, since it’s inside the docker container.
Nevertheless, I tried both. And both create the same errors:
/isaac-sim/_build/linux-x86_64/release/isaac-sim.sh: line 4: 1454 Segmentation fault (core dumped) "$SCRIPT_DIR/../../target-deps/kit_sdk_release/_build/linux-x86_64/release/omniverse-kit" --merge-config="$SCRIPT_DIR//experiences/isaac-sim.json" $@
and
/isaac-sim/_build/linux-x86_64/release/isaac-sim-headless.sh: line 4: 1193 Segmentation fault (core dumped) "$SCRIPT_DIR/../../target-deps/kit_sdk_release/_build/linux-x86_64/release/omniverse-kit" --merge-config="$SCRIPT_DIR//experiences/isaac-sim-headless.json" --no-window $@

The errors are probably due to the fact, that the service is already running as soon as one starts the container…

When saving the state of the container and starting again or when just reloading the Isaac-ros-bridge extension in Kit, following error occurs:
'ascii' codec can't decode byte 0xed in position .....
Which can be solved by adding following three lines in “_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/omni/isaac/ros_bridge/scripts/extension.py”

import sys
reload(sys)
sys.setdefaultencoding("utf-8")

After fixing this locale-error, following error occurs:

2020-11-16 17:18:51 [1,319,024ms] [Error] [carb.python] Extension python module: 'omni.isaac.ros_bridge.scripts.samples.rostopics' in '/isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/.' failed to load.
2020-11-16 17:18:51 [1,319,024ms] [Error] [carb.python] Failed to import python module omni.isaac.ros_bridge.scripts.samples.rosservices from /isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/.. Error: 'omni.isaac.ros_bridge'. Traceback:
Traceback (most recent call last):
  File "/isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/plugins/bindings-python/omni/ext/impl/_internal.py", line 131, in _custom_importer
    return _import_public(folder, module_name)
  File "/isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/plugins/bindings-python/omni/ext/impl/_internal.py", line 109, in _import_public
    module = import_module(module_name)
  File "/isaac-sim/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/plugins/bindings-python/omni/ext/impl/_internal.py", line 56, in import_module
    return importlib.import_module(name)
  File "/isaac-sim/_build/target-deps/kit_sdk_release/_build/target-deps/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 951, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 894, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1157, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1123, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 994, in __iter__
  File "<frozen importlib._bootstrap_external>", line 982, in _recalculate
  File "<frozen importlib._bootstrap_external>", line 978, in _get_parent_path
KeyError: 'omni.isaac.ros_bridge'

2020-11-16 17:18:51 [1,319,024ms] [Error] [carb.python] Extension python module: 'omni.isaac.ros_bridge.scripts.samples.rosservices' in '/isaac-sim/_build/linux-x86_64/release/exts/omni.isaac.ros_bridge/.' failed to load.

For me this all seems like the python-environment isn’t setup correctly in the docker-image. Without knowing the whole build-process this seems to be a never ending rabbit-hole, I can’t fix on my own ;)
@Sheikh_Dawood could you find out if ros_bridge is intended to work inside docker at the moment/if it was already tested? Is there maybe a specific image available?

Hi, currently, we do not support ros_bridge out-of-the-box with a container. We are still looking into a way to get this working easily.

I think for now, you have to manage the python environment and maybe point the ROS to the Isaac Sim python path.

You can run the container without automatically starting Isaac Sim by using this flag:

-it --entrypoint bash

Next, you can set up the environment before running ./runapp.sh or ./runheadless.sh. See https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/setup.html#running-windowed-container

Hi @Sheikh_Dawood

Is there a way to specify the xmlrpc_port (XMLRPC node) and the tcpros_port (TCPROS server) ports for the n__OmniIsaacRosBridge ROS node? I did a search but couldn’t find anything in the human readable files…