Giter Site home page Giter Site logo

ros2.fish's Introduction

ros2.fish

Integrate ROS2 with the fish-shell, and add interactive goodies to make you robotics workflow a little more fluid.

Requirements

  • fish ^3.6.0 enhanced the capabilities of abbr which this plugin makes use of.

Installation

Using fisher

fisher install kpbaks/ros2.fish

ros2.fish's People

Contributors

kpbaks avatar craftit avatar

Stargazers

牧羊犬真Q avatar Zartris avatar Markus Kvello avatar  avatar  avatar Jens avatar

Watchers

 avatar

ros2.fish's Issues

ros2 control support

With the ros2 control library, it adds the following terminal commands:
Currently supported commands are

  • ros2 control list_controllers
  • ros2 control list_controller_types
  • ros2 control list_hardware_components
  • ros2 control list_hardware_interfaces
  • ros2 control load_controller
  • ros2 control reload_controller_libraries
  • ros2 control set_controller_state
  • ros2 control switch_controllers
  • ros2 control unload_controller
  • ros2 control view_controller_chains

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

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

Completion Error

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

Running source on startup of terminal in comparison to manually sourcing.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.