carla-simulator / carla-autoware

Integration of AutoWare AV software with the CARLA simulator
MIT License
255 stars 86 forks source link

Executing Roslaunch commands inside a running container #146

Open tecena opened 2 years ago

tecena commented 2 years ago

Hi,

I am trying to run autoware with carla. Autoware is running as a container in linux machine. now after starting the container, with the following commands

docker run -d -it --rm --volume=$(pwd)/autoware-contents:/home/autoware/autoware-contents:ro --env="DISPLAY=${DISPLAY}" --privileged --net=host $RUNTIME carla-autoware:latest, the container is up

now I want to launch my launch files to start the auotware nodes using roslaunch carla_autoware_agent carla_autoware_agent.launch town:=Town04 synchronous_mode:=true with out entering into the container so I tried to run with docker exec, I am getting the following error OCI runtime exec failed: exec failed: unable to start container process: exec: "roslaunch": executable file not found in $PATH: unknown

How do I run the roslaunch command in a linux machine without entering into the container either using shell script.

jpsndrs commented 2 years ago

Hi @tecena,

When the docker is running, you can send it a command similar to this docker ps | grep -Eo '([0-9]|[a-z]){12}' | xargs -I %% docker exec --user autoware --env-file='$DIR_WHERE_YOUR_ENV_LIST_IS/env-list' %% roslaunch carla_autoware_agent carla_autoware_agent.launch town:=Town04 synchronous_mode:=true and to over come the error you will need to specify the environment variables. To do that, echo out the env variables from the docker container to a file and transfer to your host from which you will be running the above command. Let me know how you go!... Good luck!