.. _install: ============= Get started ============= This guide provides step-by-step instructions to set up the necessary environment for your project, including CUDA, Docker, dependencies, and system execution. --- Host PC Installation =================== GPU Driver Installation ------------------------ **Prerequisites:** - Ubuntu version **20.04 or later** (22.04 recommended) Steps to Install CUDA Drivers: 1. Add the official graphics drivers repository: .. code-block:: bash sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update reboot 2. After rebooting, open **Software & Updates** → **Additional Drivers** and select the appropriate driver for your GPU. 3. Apply the changes and reboot the system: .. code-block:: bash reboot Dependencies Installation ------------------------- .. code-block:: bash sudo update sudo apt install terminator htop -y sudo apt install python3-dev python3-venv python-pip -y Docker and nvidia docker toolkit Installation -------------------- https://docs.docker.com/engine/install/ubuntu/ https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html Add some custom useful alias (Optional) ---------------------------------------- .. code-block:: bash # utils alias chown_keti='sudo chown -R keti .' alias sb='source ~/.bashrc' alias eb='sudo gedit ~/.bashrc' alias nb='nano ~/.bashrc' alias about_pc='lsb_release -a' alias create_py_simple_pkg='cookiecutter https://github.com/mtbui2010/python_pkg_simple_template.git' alias vscode='sudo code --no-sandbox --user-data-dir ~/.vscode_cache' alias run_pyvir='source ~/.pyvir/bin/activate' #docker alias docker_start='sudo docker start' alias docker_stop='sudo docker stop' alias docker_run='sudo docker run -it' alias docker_watch='sudo watch docker ps -a' alias image_watch='sudo watch docker image ls -a' alias image_rm='sudo docker image rm' #functions dockerexec() { xhost local: & sudo docker start "$@" & sudo docker exec -it "$@" /bin/bash } dockerrm() { sudo docker stop "$@" && sudo docker rm "$@" } gitpush() { local date_str=$(date +%Y%m%d) git add . .gitignore && git commit -m "$date_str - $*" && git push } rund() { local container_name="$1" local ros_domain_id="$2" shift 2 # Allow local GUI access xhost +local: # Start the container sudo docker start "$container_name" # Execute the command inside the container sudo docker exec -it "$container_name" bash -c " source ~/.bashrc source /opt/ros/humble/setup.bash source ~/ros2_ws/install/setup.bash export ROS_DOMAIN_ID=$ros_domain_id $*" } Install and configure SSH and FTP server (Optional) -------------------------------------------------- .. code-block:: bash sudo apt install terminator htop openssh-server vsftpd -y sudo ufw allow ssh sudo systemctl start ssh Configure FTP .. code-block:: bash #!/bin/bash set -e FTP_DIR="/media/keti/workdir" FTP_USER="keti" echo "🛠 Backing up original config..." sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak echo "📝 Writing new vsftpd config..." sudo tee /etc/vsftpd.conf > /dev/null < - ``: Share directory with source codes [default: None, no sahred folder] Clone the following repositories to set up the necessary dependencies: .. code-block:: bash git clone https://github.com/keti-ai/pyrecognition.git git clone https://github.com/keti-ai/pyconnect.git git clone https://github.com/keti-ai/pyinterfaces.git Install the repositories as editable Python packages: .. code-block:: bash pip install -e pyrecognition pip install -e pyconnect pip install -e pyinterfaces Install ssh and sshfs server (optional) .. code-block:: bash sudo apt update sudo apt install openssh-server sudo systemctl start ssh sudo systemctl enable ssh sudo apt install sshfs Edge and Control PCs Container Installation =================== 0. Git credential: .. code-block:: bash git config --global credential.helper store To set up a Docker containerized environment for your project, follow these steps: 1. Build containers - Build the Docker image with the required specifications: .. code-block:: bash ./build_image.sh --ubuntu= --cuda= --ros= Replace ``, ``, and `` with your specific environment settings. Support versions: - Ubuntu20.04, 22.04 (default) - CUDA 11.1.1, 11.7.1, 12.1.0, 12.4.1, 12.6.3(default) - ROS2: foxy, humble (default) - Create and run a Docker container: .. code-block:: bash ./build_container.sh --ubuntu= --cuda= --ros= --name= --share-dir= - ``: Name of the container [default: name of ubuntu and cuda version , e.g u22cu12] - ``: Share directory with source code [default: None, no sahred folder] Clone the following repositories to set up the necessary dependencies: .. code-block:: bash git clone https://github.com/keti-ai/carerobotapp.git git clone https://github.com/keti-ai/pyconnect.git git clone https://github.com/keti-ai/pyinterfaces.git git clone https://github.com/keti-ai/pydevice.git OR mount ssh driver from server PC: .. code-block:: bash sudo nano /etc/fstab append sshfs#$SERVER_USER@$SERVER_IP:SERVER_DIR $CLIENT_MOUNT_DIR fuse defaults,_netdev,allow_other,IdentityFile=/home/$CLIENT_USER/.ssh/id_rsa 0 0 save and close sudo mount -a Install the repositories as editable Python packages: .. code-block:: bash pip install -e carerobotapp pip install -e pyconnect pip install -e pyinterfaces pip install -e pydevice Install ROS Interfaces - Create a symbolic link to `rosinterfaces` inside the ROS2 workspace: .. code-block:: bash cd ~/ros2_ws/src ln -s $ROSINTERFACES_PATH . - Build the ROS package: .. code-block:: bash cd ~/ros2_ws colcon build --packages-select rosinterfaces .. _system_exec: System Execution =================== Step 1. Edge PC: Run Robot and Device Server ------------------------------------------- .. code-block:: bash robot # Initializes robot arm, elevator, head, etc. femto # Runs the Femto camera hand # Runs the wrist camera Step 2. Server PC: Run LLM/VLM Servers ------------------------------------ Ollama Server Execution: .. code-block:: bash sudo docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama sudo docker exec -it ollama /bin/bash VLM Server Execution: .. code-block:: bash python3 -m pyrecognition.run_server server_type=tcp port=8805 detector=groundedsam_grasp,fastsam,groundingdino,audio,mask2grasps,groundedsam,fastsam_grasp Step 3. Control PC: Run Control Nodes in different Terminal Window -------------------------------- Terminal 1 — Skill Serve .. code-block:: bash python -m carerobotapp.node_skill_servers Terminal 2 — Task Manager .. code-block:: bash python3 -m carerobotapp.node_taskmanager Terminal 3 — WebRTC Server (remote browser control) .. code-block:: bash python -m carerobotapp.node_prompt_webrtc_server # Open http://: in a browser Terminal 4 - Extra Device Server (wrist camera, optional) .. code-block:: bash python -m carerobotapp.node_extra_device_server Configuration Files ---------------------- Configurations `carerobotapp.configs` directory. Make configuration file .. code-block:: bash Copy and Edit configs/robot_10.py -> configs/robot_$ROBOT_DOMAIN_ID.py Edit configs/tasks.py: from carerobotapp.configs.robot_10 -> carerobotapp.configs.robot_$ROBOT_DOMAIN_ID Confirure html .. code-block:: bash Copy and Edit html/text_entries_pangyo.py -> configs/text_entries_$ROBOT_DOMAIN_ID.py Edit offerUrl -> https://$ROBOT_IP:8443/offer