can't run ros commands via subprocess

asked 2022-11-20 11:05:28 -0500

omeras gravatar image

Hello, I try to write subprocess script but each time I try to write ros related commands I occur following an error. for example, when I try to run

subprocess.Popen("roscore", shell=True)

I get

/bin/sh: 1: roscore: not found

in .bashrc I added the following lines:

source /opt/ros/noetic/setup.bash source ~/catkin_ws/devel/setup.bash

I think that somehow I need to source the subprocess too but Im not quite sure how because when I run

subprocess.Popen([".", "/opt/ros/noetic/setup.bash"], shell=True)

It goes without errors but I still get errors when I try to run ros related commands.

thanks.

edit retag flag offensive close merge delete