Integrate ROS2 with the fish-shell, and add interactive goodies to make you robotics workflow a little more fluid.
- fish ^3.6.0 enhanced the capabilities of
abbr
which this plugin makes use of.
Using fisher
fisher install kpbaks/ros2.fish
Integrate ROS2 with the fish-shell, and add interactive goodies to make you robotics workflow a little more fluid.
License: MIT License
Integrate ROS2 with the fish-shell, and add interactive goodies to make you robotics workflow a little more fluid.
abbr
which this plugin makes use of.Using fisher
fisher install kpbaks/ros2.fish
With the ros2 control library, it adds the following terminal commands:
Currently supported commands are
However as they are not support (yet) in this repo, if you try to autocomplete these, it will change the whole line to something else.
Error while installing.
~/.config/fish/conf.d/ros2.fish (line 30): 'return' outside of function definition not status is-interactive; and return ^ from sourcing file ~/.config/fish/conf.d/ros2.fish called on line 189 of file ~/.config/fish/functions/fisher.fish in function 'fisher' with arguments 'install kpbs5/ros2.fish' source: Error while reading file “~/.config/fish/conf.d/ros2.fish” Installed 1 plugin/s
Hello
Thanks for sharing your work!
Completion works until "ros2 command packet" (e.g. ros2 launch joy)
The next TAB throws this error:
ros2 launch joy Command 'path' not found, did you mean: command 'mpath' from deb libmodule-path-perl (0.19-1.1) command 'patch' from deb patch (2.7.6-7build2) command 'xpath' from deb libxml-xpath-perl (1.44-1) command 'pat' from deb dist (1:3.5-236-1) command 'path6' from deb ipv6toolkit (2.0+ds.1-1) Try: sudo apt install <deb name> ~/.config/fish/completions/ros2.fish (line 1): path basename $file ^ in command substitution called on line 114 of file ~/.config/fish/completions/ros2.fish in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution ~/.config/fish/completions/ros2.fish (line 114): Unknown command printf '%s\t%s\n' (path basename $file) $pkg ^ in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution Command 'path' not found, did you mean: command 'xpath' from deb libxml-xpath-perl (1.44-1) command 'mpath' from deb libmodule-path-perl (0.19-1.1) command 'pat' from deb dist (1:3.5-236-1) command 'path6' from deb ipv6toolkit (2.0+ds.1-1) command 'patch' from deb patch (2.7.6-7build2) Try: sudo apt install <deb name> ~/.config/fish/completions/ros2.fish (line 1): path basename $file ^ in command substitution called on line 114 of file ~/.config/fish/completions/ros2.fish in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution ~/.config/fish/completions/ros2.fish (line 114): Unknown command printf '%s\t%s\n' (path basename $file) $pkg ^ in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution Command 'path' not found, did you mean: command 'xpath' from deb libxml-xpath-perl (1.44-1) command 'pat' from deb dist (1:3.5-236-1) command 'mpath' from deb libmodule-path-perl (0.19-1.1) command 'patch' from deb patch (2.7.6-7build2) command 'path6' from deb ipv6toolkit (2.0+ds.1-1) Try: sudo apt install <deb name> ~/.config/fish/completions/ros2.fish (line 1): path basename $file ^ in command substitution called on line 114 of file ~/.config/fish/completions/ros2.fish in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution ~/.config/fish/completions/ros2.fish (line 114): Unknown command printf '%s\t%s\n' (path basename $file) $pkg ^ in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution Command 'path' not found, did you mean: command 'path6' from deb ipv6toolkit (2.0+ds.1-1) command 'pat' from deb dist (1:3.5-236-1) command 'patch' from deb patch (2.7.6-7build2) command 'xpath' from deb libxml-xpath-perl (1.44-1) command 'mpath' from deb libmodule-path-perl (0.19-1.1) Try: sudo apt install <deb name> ~/.config/fish/completions/ros2.fish (line 1): path basename $file ^ in command substitution called on line 114 of file ~/.config/fish/completions/ros2.fish in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution ~/.config/fish/completions/ros2.fish (line 114): Unknown command printf '%s\t%s\n' (path basename $file) $pkg ^ in function '__fish_ros2_print_launch_files_in_package' with arguments 'joy' in command substitution
Super big fan of what you have done here! Im super super thankful for this! So first of all thank you! :D <3
I had installed ros by building it from source, and so i had to change like two specific points for the entry points for the ros2 bin.
And currently i am unsure if i am pointing to the correct bin.
If I manually source the built ./install/local_setup.bash with bass source ./install/local_setup.bash
then when I run ros2 everything works perfectly fine, and tabs work, etc.
But if I let the fish file source it, no errors pop up during the sourcing, but as soon as I run any ros2 command I get this as an error
Traceback (most recent call last):
File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 397, in from_name
return next(cls.discover(name=name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/relmnicoder/ros2_humble/install/ros2cli/bin/ros2", line 33, in <module>
sys.exit(load_entry_point('ros2cli', 'console_scripts', 'ros2')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/relmnicoder/ros2_humble/install/ros2cli/bin/ros2", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 861, in distribution
return Distribution.from_name(distribution_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 399, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for ros2cli
Would you possibly have any clue as to why that would be?
Just incase, the only parts that I modified are the parts where it references /opt/ros/humble into /home/relmnicoder/ros2_humble
and the ROS_DISTRO i just commented everything out except for set -gx ROS_DISTRO humble
.
And since the bin doesn't exist in the same place as if when you install it through the packages I use set -g __fish_ros2 /home/relmnicoder/ros2_humble/install/ros2cli/bin/ros2
.
That is one I am unsure if it is the correct thing to reference, especially since the error talks about ros2cli, but like I said, if I manually source later on then it just works, so I am a bit confused.
Once again Thank you, and if you don't know or this is a whole other issue that is fine too!
I sort of halfway wanted a reason just to say thanks for the fish scripts :D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.