-
Notifications
You must be signed in to change notification settings - Fork 0
[#23896] Create tools for inpection (ros2 cli) #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: danipiza <[email protected]>
Signed-off-by: danipiza <[email protected]>
cferreiragonz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review just checking the code. We can consider creating some tests to check all tools.
I am concerned about the optional input parameters. I don't know how all LLMs will treat them.
I will re-review after reviewing Textualize PR
src/vulcanai/console/console.py
Outdated
| if user_input.strip().lower() in ("exit", "quit"): | ||
| break | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete
src/vulcanai/console/console.py
Outdated
| self.logger = VulcanAILogger.log_manager | ||
| self.stream_task = None | ||
|
|
||
| #self.loop = asyncio.get_running_loop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete if unused
src/vulcanai/console/console.py
Outdated
| from vulcanai.console.logger import VulcanAILogger | ||
|
|
||
| import asyncio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import asyncio with the other basic import like os and argparse (alphabetical order) and reuse the vulcanai.console.logger existing import --> from vulcanai.console.logger import console, VulcanAILogger
| except Exception: | ||
| pass | ||
|
|
||
| current_path = os.path.dirname(os.path.abspath(__file__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be careful with this. __file__ will point to the installation path if installed without using -e argument when installing the package. So we need to either install the default_tools.py file in the same relative path from the installed file or to find another method to add the tools. Maybe we can install them as a module with the package and just load them directly
src/vulcanai/console/utils.py
Outdated
| import sys | ||
|
|
||
| import time | ||
|
|
||
| import rclpy | ||
|
|
||
| import subprocess | ||
|
|
||
| import asyncio | ||
| import os | ||
| from typing import List, Optional | ||
|
|
||
| import threading | ||
|
|
||
|
|
||
| # used to remove possible errors in textual terminal | ||
| # Subscribed to [/turtle1/pose] -> Subscribed to \[/turtle1/pose] | ||
| from textual.markup import escape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import sys | |
| import time | |
| import rclpy | |
| import subprocess | |
| import asyncio | |
| import os | |
| from typing import List, Optional | |
| import threading | |
| # used to remove possible errors in textual terminal | |
| # Subscribed to [/turtle1/pose] -> Subscribed to \[/turtle1/pose] | |
| from textual.markup import escape | |
| from typing import List, Optional | |
| import asyncio | |
| import os | |
| import rclpy | |
| import subprocess | |
| import sys | |
| import threading | |
| import time | |
| # To remove possible errors in textual terminal | |
| # Subscribed to [/turtle1/pose] -> Subscribed to \[/turtle1/pose] | |
| from textual.markup import escape |
src/vulcanai/tools/default_tools.py
Outdated
| command = kwargs.get("command", None) # optional explicit subcommand | ||
| topic_name = kwargs.get("topic_name", None) | ||
| msg_type = kwargs.get("msg_type", None) | ||
| # streaming commands variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # streaming commands variables | |
| # Streaming commands variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applies elsewhere
src/vulcanai/tools/default_tools.py
Outdated
| text=True | ||
| ) | ||
|
|
||
| # add the output of the command to the dictionary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # add the output of the command to the dictionary | |
| # Add the output of the command to the dictionary |
Applies elsewhere
src/vulcanai/tools/default_tools.py
Outdated
|
|
||
| # -- unknown ------------------------------------------------------------ | ||
| else: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/vulcanai/tools/default_tools.py
Outdated
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/vulcanai/tools/default_tools.py
Outdated
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: danipiza <[email protected]>
New commands
- ros2 node Commands: info Output information about a node list Output a list of available nodes - ros2 topic Commands: bw Display bandwidth used by topic delay Display delay of topic from timestamp in header echo Output messages from a topic find Output a list of available topics of a given type hz Print the average receiving rate to screen info Print information about a topic list Output a list of available topics pub Publish a message to a topic type Print a topic's type - ros2 service Commands: call Call a service echo Echo a service find Output a list of available services of a given type info Print information about a service list Output a list of available services type Output a service's type - ros2 action Commands: info Print information about an action list Output a list of action names send_goal Send an action goal type Print a action's type echo Echo a action find Find actions from type - ros2 param Commands: delete Delete parameter describe Show descriptive information about declared parameters dump Show all of the parameters of a node in a YAML file format get Get parameter list Output a list of available parameters load Load parameter file for a node set Set parameterStream-able commands examples: