Skip to content
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

Getting no module 'rclpy' when trying to run Agent Studio on 'nano_llm' container with current codebase #66

Open
kevindowling opened this issue Jan 19, 2025 · 0 comments

Comments

@kevindowling
Copy link

kevindowling commented Jan 19, 2025

This is more of an FYI than issue. I took what may be a detour other people may go down and find this useful.

Run the container image replacing the nano_llm with the current codebase:
jetson-containers run --env HUGGINGFACE_TOKEN=hf_mytoken --volume ./nano_llm:/opt/NanoLLM/nano_llm $(autotag nano_llm) python3 -m nano_llm.studio

You'll get an error:
ModuleNotFoundError: No module named 'rclpy'

Did some digging and copied the vanilla nano_llm image codebase to my local:

docker cp container:/opt/NanoLLM/nano_llm ./nano_llm

Found that the plugins/robotics/ros_connector.py was empty:

#!/usr/bin/env python3
from nano_llm import Plugin

class ROS2Connector(Plugin):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

The ros_connector hasn't been implemented in this image yet.

Reading through the issues it looks like there may be some containers that have this implemented. But I was able to get Agent Studio to run by installing the dependencies.

Here's the step by step if Ubuntu 22.04:

  • Setup sources and add ROS 2 apt repo for Humble
sudo apt update && sudo apt install -y curl gnupg2 lsb-release

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
  • Install rclpy and Related ROS 2 Packages
sudo apt update
sudo apt install -y ros-humble-rclpy ros-humble-ros-base
  • Source the ROS 2 Setup File
source /opt/ros/humble/setup.bash
  • Test the import
python3 -c "import rclpy; print('rclpy imported successfully')"

Hopefully that saves someone else a few minutes. Thanks Dusty for this awesome project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant