ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Sourcing setup.bash in ROS2 foxy

asked 2020-06-12 18:06:48 -0500

hazevedosa gravatar image

Hi all. After installing ROS2 foxy in Ubuntu 20.04 from "fat' archive (binaries), when I try to source /opt/ros/foxy/setup.bash, ros2 is not recognized:

$ source /opt/ros/foxy/setup.bash

$ ros2

ros2: command not found

However, I can source /ros2_foxy/ros2-linux/setup.bash:

$ source ~/ros2_foxy/ros2-linux/setup.bash

$ ros2

usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...

Is there any issues with my configuration? Or is foxy intended to be sourced only from ~/ros2_foxy/ros2-linux/setup.bash?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-15 12:32:41 -0500

jacobperron gravatar image

The directory /opt/ros/foxy comes from installing Foxy from Debian packages. If, instead, you installed Foxy from the fat archive, then sourcing the setup.bash file from the extracted location is all you should have to do. I.e. you don't have to source /opt/ros/foxy/setup.bash, instead source ~/ros2_foxy/ros2-linux/setup.bash is equivalent.

edit flag offensive delete link more


Ok, but does that mean that the directory /opt/ros/foxy should not be present after my installation? Because it is there...

hazevedosa gravatar image hazevedosa  ( 2020-06-15 13:29:06 -0500 )edit

I wouldn't expect the directory /opt/ros/foxy to exist unless you installed a Foxy Debian package (e.g. apt install ros-foxy-*).

jacobperron gravatar image jacobperron  ( 2020-06-15 13:52:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-06-12 18:06:48 -0500

Seen: 3,100 times

Last updated: Jun 15 '20