I have a shell script which starts a simulation environment (ROS together with Underwater Simulation) on Ubuntu 12.04. In order to use the simulation environment in general ones component needs to communicate with the environment via TCP/IP.
If I start the script for the simulation on a standard terminal the simulation environment starts like it's supposed to. It also binds to a previously defined IP address, no errors or warning. I can work with it without any limitation. Now here comes my problem: I need to start the simulation in a detached screen (do to requirements). I use
screen -d -m -S UWSim bash -c 'export $USER=~ ; ~/uwsim_ws/uwsim_starter.sh'
I need to set the USER
variable which is not set by default in a screen, otherwise the script doesn't find other subscripts of ROS. After executing the command above, at some point during the startup of ROS I get the following error:
...
Traceback (most recent call last):
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
...
Due to this error my components can't connect to the simulation. As I already mentioned: everything works perfectly when started in a standard terminal. My guess is that there are some export
's missing. I already compared all exports in the terminal with the exports in the screen (this led me to set the USER
variable), without any success.