ROS is a common platform for robot development. Normally it has some descent document, but not for rosbash. It is stated in the document that
rosbashpackage includes limited support for
tcshby way of sourcing the
rostcshfiles respectively. We currently do not provide documentation on these shells, though much of the functionality is similar to the bash shell extensions.
Instead of sourcing
source /opt/ros/lunar/setup.bash as is told in the official document, go to your
~/.config/fish/config.fish file (which is essentially
.bashrc for bash), add the following line:
To source your workspace, you can’t just source the file in
devel/setup.bash since it’s written in shell script that fish do not understand. Instead, install bass as a bridge between fish and shell script. I recommend using fisherman for installing bass.
Now every time you need to source your workspace, run this:
I got you. Why sourcing scripts manually when everything can be automated? Let’s use fish’s excellent hook functionality to source the files for us.
Place the following file in
~/.config/fish/conf.d, you can name it
catkin.autosource.fish or whatever
The script monitor the variable
PWD, which is the location you’re at, if it changes, search for the
.catkin_workspace file (which in the workspace when you create it). If it finds the file, the source it for you.