ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I don't know whether this is the cause of your trouble, but: ros_entrypoint.sh
is not a file to source.
It's a wrapper shell script that source
s the correct setup.bash
for you and then invokes whatever you passed it in that new environment (from osrf/docker_images/ros/indigo/ubuntu/trusty/ros-core/ros_entrypoint.sh):
#!/bin/bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
This file is then configured as the ENTRYPOINT
of your Docker container, and will be run / prefixed everytime you spin up a container.
2 | No.2 Revision |
I don't know whether this is the cause of your trouble, but: ros_entrypoint.sh
is not a file to source.
It's a wrapper shell script that source
s the correct setup.bash
for you and then invokes whatever you passed it in that new environment (from osrf/docker_images/ros/indigo/ubuntu/trusty/ros-core/ros_entrypoint.sh):
#!/bin/bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
This file is then configured as the ENTRYPOINT
of your Docker container, and will be run / prefixed everytime you spin up a container.
In a way, when you run the following:
$ docker run -it --rm ros:indigo rostopic echo /some_topic
it does this (inside the container):
$ /entrypoint.sh rostopic echo /some_topic
Which then first source
s /opt/ros/indigo/setup.bash
(as this is an Indigo image) and then runs rostopic echo /some_topic
in that same bash
session.
3 | No.3 Revision |
I don't know whether this is the cause of your trouble, but: The problem here is most likely that ros_entrypoint.sh
is not a file to source.
It's a wrapper shell script that source
s the correct setup.bash
for you and then invokes whatever you passed it in that new environment (from osrf/docker_images/ros/indigo/ubuntu/trusty/ros-core/ros_entrypoint.sh):
#!/bin/bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
This file is then configured as the ENTRYPOINT
of your Docker container, and will be run / prefixed everytime you spin up a container.
In a way, when you run the following:
$ docker run -it --rm ros:indigo rostopic echo /some_topic
it does this (inside the container):
$ /entrypoint.sh rostopic echo /some_topic
Which then first source
s /opt/ros/indigo/setup.bash
(as this is an Indigo image) and then runs rostopic echo /some_topic
in that same bash
session.
According to bash-hackers.org/commands/builtin/exec, exec
replaces the current shell and will terminate if it cannot execute what you ask it to.
If you source
the file, it could be that you actually end up in the exec
line, which after asking it to cd
to a non-existing directory terminates and as the Docker session now has no active programs any more, it also exits, leaving you at the bash prompt of your host's terminal.
4 | No.4 Revision |
The problem here is most likely that tl;dr: ros_entrypoint.sh
is not a file to source.
It's a wrapper shell script that source
s the correct setup.bash
for you and then invokes whatever you passed it in that new environment (from osrf/docker_images/ros/indigo/ubuntu/trusty/ros-core/ros_entrypoint.sh):
#!/bin/bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
This file is then configured as the ENTRYPOINT
of your Docker container, and will be run / prefixed everytime you spin up a container.
In a way, when you run the following:
$ docker run -it --rm ros:indigo rostopic echo /some_topic
it does this (inside the container):
$ /entrypoint.sh rostopic echo /some_topic
Which then first source
s /opt/ros/indigo/setup.bash
(as this is an Indigo image) and then runs rostopic echo /some_topic
in that same bash
session.
According to bash-hackers.org/commands/builtin/exec, exec
replaces the current shell and will terminate if it cannot execute what you ask it to.
If you source
the file, it could be that you actually end up in the exec
line, which after asking it to cd
to a non-existing directory terminates and as the Docker session now has no active programs any more, it also exits, leaving you at the bash prompt of your host's terminal.
5 | No.5 Revision |
tl;dr: ros_entrypoint.sh
is not a file to source.
It's a wrapper shell script that source
s the correct setup.bash
for you and then invokes whatever you passed it in that new environment (from osrf/docker_images/ros/indigo/ubuntu/trusty/ros-core/ros_entrypoint.sh):
#!/bin/bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
This file is then configured as the ENTRYPOINT
of your Docker container, and will be run / prefixed everytime you spin up a container.
In a way, when you run the following:
$ docker run -it --rm ros:indigo rostopic echo /some_topic
it does this (inside the container):
$ /entrypoint.sh rostopic echo /some_topic
Which then first source
s /opt/ros/indigo/setup.bash
(as this is an Indigo image) and then runs rostopic echo /some_topic
in that same bash
session.
According to bash-hackers.org/commands/builtin/exec, exec
replaces the current shell and will terminate if it cannot execute what you ask it to.
If you source
the file, it could be that you actually end up in the exec
line, which after asking it to cd
to a non-existing directory terminates and as the Docker session now has no active programs any more, it also exits, leaving you at the bash prompt of your host's terminal.
6 | No.6 Revision |
tl;dr: ros_entrypoint.sh
is not a file to source.
It's a wrapper shell script that source
s the correct setup.bash
for you and then invokes whatever you passed it in that new environment (from osrf/docker_images/ros/indigo/ubuntu/trusty/ros-core/ros_entrypoint.sh):
#!/bin/bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
This file is then configured as the ENTRYPOINT
of your Docker container, and will be run / prefixed everytime you spin up a container.
In a way, when you run the following:
$ docker run -it --rm ros:indigo rostopic echo /some_topic
it does this (inside the container):
/entrypoint.sh rostopic echo /some_topic
Which then first source
s /opt/ros/indigo/setup.bash
(as this is an Indigo image) and then runs rostopic echo /some_topic
in that same environment.bash
session.
According to bash-hackers.org/commands/builtin/exec, exec
replaces the current shell and will terminate if it cannot execute what you ask it to.
If you source
the file, it could be that you actually end up in the exec
line, which after asking it to cd
to a non-existing directory terminates and as the Docker session now has no active programs any more, it also exits, leaving you at the bash prompt of your host's terminal.