Spaces:
Runtime error
Runtime error
initial commit
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- DockerfileAdded+35
- README.md+77-5
- bun.lockbAdded+3
- components.jsonAdded+20
- eslint.config.jsAdded+29
- index.htmlAdded+24
- package.jsonAdded+88
- postcss.config.jsAdded+6
- public/favicon.icoAdded
- public/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.pngAdded
- public/placeholder.svgAdded
- public/robots.txtAdded+14
- public/so-101-urdf/CMakeLists.txtAdded+38
- public/so-101-urdf/README.mdAdded+41
- public/so-101-urdf/config/joint_names_so_arm_urdf.yamlAdded+1
- public/so-101-urdf/joints_properties.xmlAdded+12
- public/so-101-urdf/meshes/base_motor_holder_so101_v1.stlAdded+3
- public/so-101-urdf/meshes/base_so101_v2.stlAdded+3
- public/so-101-urdf/meshes/motor_holder_so101_base_v1.stlAdded+3
- public/so-101-urdf/meshes/motor_holder_so101_wrist_v1.stlAdded+3
- public/so-101-urdf/meshes/moving_jaw_so101_v1.stlAdded+3
- public/so-101-urdf/meshes/rotation_pitch_so101_v1.stlAdded+3
- public/so-101-urdf/meshes/sts3215_03a_no_horn_v1.stlAdded+3
- public/so-101-urdf/meshes/sts3215_03a_v1.stlAdded+3
- public/so-101-urdf/meshes/under_arm_so101_v1.stlAdded+3
- public/so-101-urdf/meshes/upper_arm_so101_v1.stlAdded+3
- public/so-101-urdf/meshes/waveshare_mounting_plate_so101_v2.stlAdded+3
- public/so-101-urdf/meshes/wrist_roll_follower_so101_v1.stlAdded+3
- public/so-101-urdf/meshes/wrist_roll_pitch_so101_v2.stlAdded+3
- public/so-101-urdf/package.xmlAdded+26
- public/so-101-urdf/urdf/so101_new_calib.urdfAdded+435
- src/.gitignoreAdded+1
- src/App.cssAdded+42
- src/App.tsxAdded+40
- src/components/UrdfProcessorInitializer.tsxAdded+40
- src/components/UrdfViewer.tsxAdded+236
- src/components/control/CommandBar.tsxAdded+81
- src/components/control/MetricsPanel.tsxAdded+190
- src/components/control/RobotArm.tsxAdded+40
- src/components/control/VisualizerPanel.tsxAdded+69
- src/components/test/WebSocketTest.tsxAdded+131
- src/components/ui/accordion.tsxAdded+56
- src/components/ui/alert-dialog.tsxAdded+139
- src/components/ui/alert.tsxAdded+59
- src/components/ui/aspect-ratio.tsxAdded+5
- src/components/ui/avatar.tsxAdded+48
- src/components/ui/badge.tsxAdded+36
- src/components/ui/breadcrumb.tsxAdded+115
- src/components/ui/button.tsxAdded+56
- src/components/ui/calendar.tsxAdded+64
1234567891011121314151617181920212223242526272829303132333435FROM node:18-alpine
# Use the existing node user (usually UID 1000)# Set up environment variables for the node userENV HOME=/home/node \ PATH=/home/node/.local/bin:$PATH
# Create and set up app directory owned by node user# Go to user's home directory first to ensure it existsWORKDIR $HOMERUN mkdir -p $HOME/app && \ chown -R node:node $HOME/app && \ chmod -R 755 $HOME/app # Set initial permissionsWORKDIR $HOME/app
# Switch to the node userUSER node
# Copy package files (owned by node)COPY --chown=node:node package*.json ./
# Install dependenciesRUN npm install
# Copy the entire viewer directory (owned by node)COPY --chown=node:node . .
# Build the applicationRUN npm run build
# Expose portEXPOSE 7860
# Start the applicationCMD ["npm", "run", "preview", "--", "--port", "7860", "--host"]123456789101112---title: LeLabemoji: 🌍colorFrom: pinkcolorTo: purplesdk: dockerpinned: falselicense: mitshort_description: Simple Interface to use LeRobot---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---title: LeLabemoji: ⚡colorFrom: yellowcolorTo: redsdk: dockerapp_port: 7860pinned: falseshort_description: Simple Interface to use LeRobot---# Welcome to your Lovable project## Project info**URL**: https://lovable.dev/projects/58aee4a4-2f51-49a3-a4d9-56d3d66140b4## How can I edit this code?There are several ways of editing your application.**Use Lovable**Simply visit the [Lovable Project](https://lovable.dev/projects/58aee4a4-2f51-49a3-a4d9-56d3d66140b4) and start prompting.Changes made via Lovable will be committed automatically to this repo.**Use your preferred IDE**If you want to work locally using your own IDE, you can clone this repo and push changes. Pushed changes will also be reflected in Lovable.The only requirement is having Node.js & npm installed - [install with nvm](https://github.com/nvm-sh/nvm#installing-and-updating)Follow these steps:```sh# Step 1: Clone the repository using the project's Git URL.git clone <YOUR_GIT_URL># Step 2: Navigate to the project directory.cd <YOUR_PROJECT_NAME># Step 3: Install the necessary dependencies.npm i# Step 4: Start the development server with auto-reloading and an instant preview.npm run dev```**Edit a file directly in GitHub**- Navigate to the desired file(s).- Click the "Edit" button (pencil icon) at the top right of the file view.- Make your changes and commit the changes.**Use GitHub Codespaces**- Navigate to the main page of your repository.- Click on the "Code" button (green button) near the top right.- Select the "Codespaces" tab.- Click on "New codespace" to launch a new Codespace environment.- Edit files directly within the Codespace and commit and push your changes once you're done.## What technologies are used for this project?This project is built with:- Vite- TypeScript- React- shadcn-ui- Tailwind CSS## How can I deploy this project?Simply open [Lovable](https://lovable.dev/projects/58aee4a4-2f51-49a3-a4d9-56d3d66140b4) and click on Share -> Publish.## Can I connect a custom domain to my Lovable project?Yes, you can!To connect a domain, navigate to Project > Settings > Domains and click Connect Domain.Read more here: [Setting up a custom domain](https://docs.lovable.dev/tips-tricks/custom-domain#step-by-step-guide)
123version https://git-lfs.github.com/spec/v1oid sha256:e9ef82613bb5c109eaa4b79a4432e742b40c028b8841047e5af1bd2941e15d91size 2289801234567891011121314151617181920{ "$schema": "https://ui.shadcn.com/schema.json", "style": "default", "rsc": false, "tsx": true, "tailwind": { "config": "tailwind.config.ts", "css": "src/index.css", "baseColor": "slate", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }}1234567891011121314151617181920212223242526272829import js from "@eslint/js";import globals from "globals";import reactHooks from "eslint-plugin-react-hooks";import reactRefresh from "eslint-plugin-react-refresh";import tseslint from "typescript-eslint";
export default tseslint.config( { ignores: ["dist"] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], files: ["**/*.{ts,tsx}"], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, ], "@typescript-eslint/no-unused-vars": "off", }, });123456789101112131415161718192021222324<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>robot-insight-control-panel</title> <meta name="description" content="Lovable Generated Project" /> <meta name="author" content="Lovable" />
<meta property="og:title" content="robot-insight-control-panel" /> <meta property="og:description" content="Lovable Generated Project" /> <meta property="og:type" content="website" /> <meta property="og:image" content="https://lovable.dev/opengraph-image-p98pqg.png" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:site" content="@lovable_dev" /> <meta name="twitter:image" content="https://lovable.dev/opengraph-image-p98pqg.png" /> </head>
<body> <div id="root"></div> <script type="module" src="/src/main.tsx"></script> </body></html>12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788{ "name": "vite_react_shadcn_ts", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "build:dev": "vite build --mode development", "lint": "eslint .", "preview": "vite preview" }, "dependencies": { "@hookform/resolvers": "^3.9.0", "@radix-ui/react-accordion": "^1.2.0", "@radix-ui/react-alert-dialog": "^1.1.1", "@radix-ui/react-aspect-ratio": "^1.1.0", "@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-checkbox": "^1.1.1", "@radix-ui/react-collapsible": "^1.1.0", "@radix-ui/react-context-menu": "^2.2.1", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-hover-card": "^1.1.1", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-menubar": "^1.1.1", "@radix-ui/react-navigation-menu": "^1.2.0", "@radix-ui/react-popover": "^1.1.1", "@radix-ui/react-progress": "^1.1.0", "@radix-ui/react-radio-group": "^1.2.0", "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slider": "^1.2.0", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-switch": "^1.1.0", "@radix-ui/react-tabs": "^1.1.0", "@radix-ui/react-toast": "^1.2.1", "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.4", "@react-three/drei": "^9.122.0", "@react-three/fiber": "^8.18.0", "@tanstack/react-query": "^5.56.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.0", "date-fns": "^3.6.0", "embla-carousel-react": "^8.3.0", "input-otp": "^1.2.4", "jszip": "^3.10.1", "lucide-react": "^0.462.0", "next-themes": "^0.3.0", "react": "^18.3.1", "react-day-picker": "^8.10.1", "react-dom": "^18.3.1", "react-hook-form": "^7.53.0", "react-resizable-panels": "^2.1.3", "react-router-dom": "^6.26.2", "recharts": "^2.12.7", "sonner": "^1.5.0", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "three": "^0.177.0", "urdf-loader": "^0.12.6", "vaul": "^0.9.3", "zod": "^3.23.8" }, "devDependencies": { "@eslint/js": "^9.9.0", "@tailwindcss/typography": "^0.5.15", "@types/node": "^22.5.5", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react-swc": "^3.5.0", "autoprefixer": "^10.4.20", "eslint": "^9.9.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0", "eslint-plugin-react-refresh": "^0.4.9", "globals": "^15.9.0", "lovable-tagger": "^1.1.7", "postcss": "^8.4.47", "tailwindcss": "^3.4.11", "typescript": "^5.5.3", "typescript-eslint": "^8.0.1", "vite": "^5.4.1" }}123456export default { plugins: { tailwindcss: {}, autoprefixer: {}, },}1234567891011121314User-agent: GooglebotAllow: /
User-agent: BingbotAllow: /
User-agent: TwitterbotAllow: /
User-agent: facebookexternalhitAllow: /
User-agent: *Allow: /1234567891011121314151617181920212223242526272829303132333435363738cmake_minimum_required(VERSION 3.10.2)
project(so_arm_description)
find_package(ament_cmake REQUIRED)find_package(urdf REQUIRED)
# Install the mesh files from SO101/assetsinstall( DIRECTORY SO101/assets/ DESTINATION share/${PROJECT_NAME}/meshes FILES_MATCHING PATTERN "*.stl")
# Install URDF filesinstall( DIRECTORY urdf/ DESTINATION share/${PROJECT_NAME}/urdf FILES_MATCHING PATTERN "*.urdf")
# Install other directoriesinstall( DIRECTORY meshes config launch DESTINATION share/${PROJECT_NAME} OPTIONAL)
ament_package()
1234567891011121314151617181920212223242526272829303132333435363738394041# SO-ARM ROS2 URDF Package
A complete ROS2 package for the SO-ARM101 robotic arm with URDF description.
## 📋 Overview
This package provides a complete ROS2 implementation for the SO-ARM101 robotic arm, including:- URDF robot description with visual and collision meshes- RViz visualization with pre-configured displays- Launch files for easy robot visualization- Integration with MoveIt for motion planning- Joint state publishers for interactive control
## 🎯 Original Sourcehttps://github.com/TheRobotStudio/SO-ARM100/tree/main/Simulation/SO101
## 🚀 Key Improvements Made
### 1. **Complete ROS2 Package Structure**- ✅ Proper `package.xml` with all necessary dependencies- ✅ CMakeLists.txt for ROS2 build system- ✅ Organized directory structure following ROS2 conventions
### 2. **Enhanced Visualization**- ✅ Fixed mesh file paths for proper package integration
### Build Instructions1. Clone this repository into your ROS2 workspace: ```bash cd ~/your_ros2_ws/src git clone <your-repo-url> so_arm_description ```
2. Build the package: ```bash cd ~/your_ros2_ws colcon build --packages-select so_arm_description source install/setup.bash ```1controller_joint_names: ['', 'Rotation', 'Pitch', 'Elbow', 'Wrist_Pitch', 'Wrist_Roll', 'Jaw', ]123456789101112<default> <default class="sts3215"> <geom contype="0" conaffinity="0"/> <joint damping="0.60" frictionloss="0.052" armature="0.028"/> <position kp="17.8" kv="0.0" forcerange="-3.35 3.35"/> </default> <default class="backlash"> <!-- +/- 0.5° of backlash --> <joint damping="0.01" frictionloss="0" armature="0.01" limited="true" range="-0.008726646259971648 0.008726646259971648"/> </default></default>123version https://git-lfs.github.com/spec/v1oid sha256:8cd2f241037ea377af1191fffe0dd9d9006beea6dcc48543660ed41647072424size 1877084123version https://git-lfs.github.com/spec/v1oid sha256:bb12b7026575e1f70ccc7240051f9d943553bf34e5128537de6cd86fae33924dsize 471584123version https://git-lfs.github.com/spec/v1oid sha256:31242ae6fb59d8b15c66617b88ad8e9bded62d57c35d11c0c43a70d2f4caa95bsize 1129384123version https://git-lfs.github.com/spec/v1oid sha256:887f92e6013cb64ea3a1ab8675e92da1e0beacfd5e001f972523540545e08011size 1052184123version https://git-lfs.github.com/spec/v1oid sha256:785a9dded2f474bc1d869e0d3dae398a3dcd9c0c345640040472210d2861fa9dsize 1413584123version https://git-lfs.github.com/spec/v1oid sha256:9be900cc2a2bf718102841ef82ef8d2873842427648092c8ed2ca1e2ef4ffa34size 883684123version https://git-lfs.github.com/spec/v1oid sha256:75ef3781b752e4065891aea855e34dc161a38a549549cd0970cedd07eae6f887size 865884123version https://git-lfs.github.com/spec/v1oid sha256:a37c871fb502483ab96c256baf457d36f2e97afc9205313d9c5ab275ef941cd0size 954084123version https://git-lfs.github.com/spec/v1oid sha256:d01d1f2de365651dcad9d6669e94ff87ff7652b5bb2d10752a66a456a86dbc71size 1975884123version https://git-lfs.github.com/spec/v1oid sha256:475056e03a17e71919b82fd88ab9a0b898ab50164f2a7943652a6b2941bb2d4fsize 1303484123version https://git-lfs.github.com/spec/v1oid sha256:e197e24005a07d01bbc06a8c42311664eaeda415bf859f68fa247884d0f1a6e9size 62784123version https://git-lfs.github.com/spec/v1oid sha256:4b17b410a12d64ec39554abc3e8054d8a97384b2dc4a8d95a5ecb2a93670f5f4size 1439884123version https://git-lfs.github.com/spec/v1oid sha256:6c7ec5525b4d8b9e397a30ab4bb0037156a5d5f38a4adf2c7d943d6c56eda5aesize 26997841234567891011121314151617181920212223242526<?xml version="1.0"?><?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?><package format="3"> <name>so_arm_description</name> <version>1.0.0</version> <description>SO-ARM101 URDF Resources</description>
<author email="contact@lycheeai-hub.com">LycheeAI</author>
<maintainer email="contact@lycheeai-hub.com">LycheeAI</maintainer>
<license>BSD</license> <buildtool_depend>ament_cmake</buildtool_depend> <depend>urdf</depend> <exec_depend>robot_state_publisher</exec_depend> <exec_depend>joint_state_publisher</exec_depend> <exec_depend>joint_state_publisher_gui</exec_depend> <exec_depend>rviz2</exec_depend> <exec_depend>xacro</exec_depend> <export> <build_type>ament_cmake</build_type> </export></package> 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435<?xml version='1.0' encoding='utf-8'?><!-- Generated using onshape-to-robot --><!-- Onshape https://cad.onshape.com/documents/7715cc284bb430fe6dab4ffd/w/4fd0791b683777b02f8d975a/e/826c553ede3b7592eb9ca800 --><robot name="so101_new_calib">
<!-- Materials --> <material name="3d_printed"> <color rgba="1.0 0.82 0.12 1.0"/> </material> <material name="sts3215"> <color rgba="0.1 0.1 0.1 1.0"/> </material>
<!-- Link base --> <link name="base"> <inertial> <origin xyz="0.020739 0.00204287 0.065966" rpy="0 0 0"/> <mass value="0.147"/> <inertia ixx="0.000136117" ixy="4.59787e-07" ixz="9.75275e-08" iyy="0.000114686" iyz="-4.97151e-06" izz="0.000130364"/> </inertial> <!-- Part base_motor_holder_so101_v1 --> <visual> <origin xyz="0.0206915 0.0221255 0.0300817" rpy="1.5708 -1.23909e-16 2.33147e-15"/> <geometry> <mesh filename="package://so_arm_description/meshes/base_motor_holder_so101_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="0.0206915 0.0221255 0.0300817" rpy="1.5708 -1.23909e-16 2.33147e-15"/> <geometry> <mesh filename="package://so_arm_description/meshes/base_motor_holder_so101_v1.stl"/> </geometry> </collision> <!-- Part base_so101_v2 --> <visual> <origin xyz="0.0207909 0.0221255 0.0300817" rpy="1.5708 -0 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/base_so101_v2.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="0.0207909 0.0221255 0.0300817" rpy="1.5708 -0 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/base_so101_v2.stl"/> </geometry> </collision> <!-- Part sts3215_03a_v1 --> <visual> <origin xyz="0.0207909 -0.0105745 0.0761817" rpy="-2.20282e-15 2.77556e-17 -1.5708"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> <material name="sts3215"/> </visual> <collision> <origin xyz="0.0207909 -0.0105745 0.0761817" rpy="-2.20282e-15 2.77556e-17 -1.5708"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> </collision> <!-- Part waveshare_mounting_plate_so101_v2 --> <visual> <origin xyz="0.0205915 0.0467435 0.0798817" rpy="1.5708 -1.21716e-14 2.33147e-15"/> <geometry> <mesh filename="package://so_arm_description/meshes/waveshare_mounting_plate_so101_v2.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="0.0205915 0.0467435 0.0798817" rpy="1.5708 -1.21716e-14 2.33147e-15"/> <geometry> <mesh filename="package://so_arm_description/meshes/waveshare_mounting_plate_so101_v2.stl"/> </geometry> </collision> </link>
<!-- Link shoulder --> <link name="shoulder"> <inertial> <origin xyz="-0.0307604 -1.66727e-05 -0.0252713" rpy="0 0 0"/> <mass value="0.100006"/> <inertia ixx="8.3759e-05" ixy="7.55525e-08" ixz="-1.16342e-06" iyy="8.10403e-05" iyz="1.54663e-07" izz="2.39783e-05"/> </inertial> <!-- Part sts3215_03a_v1_2 --> <visual> <origin xyz="-0.0303992 0.000422241 -0.0417" rpy="1.5708 1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> <material name="sts3215"/> </visual> <collision> <origin xyz="-0.0303992 0.000422241 -0.0417" rpy="1.5708 1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> </collision> <!-- Part motor_holder_so101_base_v1 --> <visual> <origin xyz="-0.0675992 -0.000177759 0.0158499" rpy="1.5708 -1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/motor_holder_so101_base_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="-0.0675992 -0.000177759 0.0158499" rpy="1.5708 -1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/motor_holder_so101_base_v1.stl"/> </geometry> </collision> <!-- Part rotation_pitch_so101_v1 --> <visual> <origin xyz="0.0122008 2.22413e-05 0.0464" rpy="-1.5708 -0 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/rotation_pitch_so101_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="0.0122008 2.22413e-05 0.0464" rpy="-1.5708 -0 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/rotation_pitch_so101_v1.stl"/> </geometry> </collision> </link>
<!-- Link upper_arm --> <link name="upper_arm"> <inertial> <origin xyz="-0.0898471 -0.00838224 0.0184089" rpy="0 0 0"/> <mass value="0.103"/> <inertia ixx="4.08002e-05" ixy="-1.97819e-05" ixz="-4.03016e-08" iyy="0.000147318" iyz="8.97326e-09" izz="0.000142487"/> </inertial> <!-- Part sts3215_03a_v1_3 --> <visual> <origin xyz="-0.11257 -0.0155 0.0187" rpy="-3.14159 -6.8695e-16 -1.5708"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> <material name="sts3215"/> </visual> <collision> <origin xyz="-0.11257 -0.0155 0.0187" rpy="-3.14159 -6.8695e-16 -1.5708"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> </collision> <!-- Part upper_arm_so101_v1 --> <visual> <origin xyz="-0.065085 0.012 0.0182" rpy="3.14159 -9.35612e-32 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/upper_arm_so101_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="-0.065085 0.012 0.0182" rpy="3.14159 -9.35612e-32 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/upper_arm_so101_v1.stl"/> </geometry> </collision> </link>
<!-- Link lower_arm --> <link name="lower_arm"> <inertial> <origin xyz="-0.0980701 0.00324376 0.0182831" rpy="0 0 0"/> <mass value="0.104"/> <inertia ixx="2.87438e-05" ixy="7.41152e-06" ixz="1.26409e-06" iyy="0.000159844" iyz="-4.90188e-08" izz="0.00014529"/> </inertial> <!-- Part under_arm_so101_v1 --> <visual> <origin xyz="-0.0648499 -0.032 0.0182" rpy="-3.14159 -0 3.9443e-31"/> <geometry> <mesh filename="package://so_arm_description/meshes/under_arm_so101_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="-0.0648499 -0.032 0.0182" rpy="-3.14159 -0 3.9443e-31"/> <geometry> <mesh filename="package://so_arm_description/meshes/under_arm_so101_v1.stl"/> </geometry> </collision> <!-- Part motor_holder_so101_wrist_v1 --> <visual> <origin xyz="-0.0648499 -0.032 0.018" rpy="-3.14159 4.73317e-30 7.88861e-31"/> <geometry> <mesh filename="package://so_arm_description/meshes/motor_holder_so101_wrist_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="-0.0648499 -0.032 0.018" rpy="-3.14159 4.73317e-30 7.88861e-31"/> <geometry> <mesh filename="package://so_arm_description/meshes/motor_holder_so101_wrist_v1.stl"/> </geometry> </collision> <!-- Part sts3215_03a_v1_4 --> <visual> <origin xyz="-0.1224 0.0052 0.0187" rpy="-3.14159 -3.58047e-15 -3.14159"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> <material name="sts3215"/> </visual> <collision> <origin xyz="-0.1224 0.0052 0.0187" rpy="-3.14159 -3.58047e-15 -3.14159"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> </collision> </link>
<!-- Link wrist --> <link name="wrist"> <inertial> <origin xyz="-0.000103312 -0.0386143 0.0281156" rpy="0 0 0"/> <mass value="0.079"/> <inertia ixx="3.68263e-05" ixy="1.7893e-08" ixz="-5.28128e-08" iyy="2.5391e-05" iyz="3.6412e-06" izz="2.1e-05"/> </inertial> <!-- Part sts3215_03a_no_horn_v1 --> <visual> <origin xyz="5.55112e-17 -0.0424 0.0306" rpy="1.5708 1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_no_horn_v1.stl"/> </geometry> <material name="sts3215"/> </visual> <collision> <origin xyz="5.55112e-17 -0.0424 0.0306" rpy="1.5708 1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_no_horn_v1.stl"/> </geometry> </collision> <!-- Part wrist_roll_pitch_so101_v2 --> <visual> <origin xyz="0 -0.028 0.0181" rpy="-1.5708 -1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/wrist_roll_pitch_so101_v2.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="0 -0.028 0.0181" rpy="-1.5708 -1.5708 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/wrist_roll_pitch_so101_v2.stl"/> </geometry> </collision> </link>
<!-- Link gripper --> <link name="gripper"> <inertial> <origin xyz="0.000213627 0.000245138 -0.025187" rpy="0 0 0"/> <mass value="0.087"/> <inertia ixx="2.75087e-05" ixy="-3.35241e-07" ixz="-5.7352e-06" iyy="4.33657e-05" iyz="-5.17847e-08" izz="3.45059e-05"/> </inertial> <!-- Part sts3215_03a_v1_5 --> <visual> <origin xyz="0.0077 0.0001 -0.0234" rpy="-1.5708 -5.55112e-17 -1.38213e-14"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> <material name="sts3215"/> </visual> <collision> <origin xyz="0.0077 0.0001 -0.0234" rpy="-1.5708 -5.55112e-17 -1.38213e-14"/> <geometry> <mesh filename="package://so_arm_description/meshes/sts3215_03a_v1.stl"/> </geometry> </collision> <!-- Part wrist_roll_follower_so101_v1 --> <visual> <origin xyz="5.55112e-17 -0.000218214 0.000949706" rpy="-3.14159 -5.55112e-17 -9.17912e-24"/> <geometry> <mesh filename="package://so_arm_description/meshes/wrist_roll_follower_so101_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="5.55112e-17 -0.000218214 0.000949706" rpy="-3.14159 -5.55112e-17 -9.17912e-24"/> <geometry> <mesh filename="package://so_arm_description/meshes/wrist_roll_follower_so101_v1.stl"/> </geometry> </collision> </link>
<!-- Link jaw --> <link name="jaw"> <inertial> <origin xyz="-0.00157495 -0.0300244 0.0192755" rpy="0 0 0"/> <mass value="0.012"/> <inertia ixx="6.61427e-06" ixy="-3.19807e-07" ixz="-5.90717e-09" iyy="1.89032e-06" iyz="-1.09945e-07" izz="5.28738e-06"/> </inertial> <!-- Part moving_jaw_so101_v1 --> <visual> <origin xyz="-5.55112e-17 -1.94746e-17 0.0189" rpy="9.53145e-17 -4.66093e-24 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/moving_jaw_so101_v1.stl"/> </geometry> <material name="3d_printed"/> </visual> <collision> <origin xyz="-5.55112e-17 -1.94746e-17 0.0189" rpy="9.53145e-17 -4.66093e-24 0"/> <geometry> <mesh filename="package://so_arm_description/meshes/moving_jaw_so101_v1.stl"/> </geometry> </collision> </link>
<!-- Joint from gripper to jaw --> <joint name="Jaw" type="revolute"> <origin xyz="0.0202 0.0188 -0.0234" rpy="1.5708 -5.14108e-17 -1.38655e-14"/> <parent link="gripper"/> <child link="jaw"/> <axis xyz="0 0 1"/> <limit effort="10" velocity="10" lower="-0.174533" upper="1.74533"/> </joint>
<transmission name="6_trans"> <type>transmission_interface/SimpleTransmission</type> <joint name="Jaw"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> </joint> <actuator name="motor6"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
<!-- Joint from wrist to gripper --> <joint name="Wrist_Roll" type="revolute"> <origin xyz="0 -0.0611 0.0181" rpy="1.5708 -9.38083e-08 3.14159"/> <parent link="wrist"/> <child link="gripper"/> <axis xyz="0 0 1"/> <limit effort="10" velocity="10" lower="-2.79253" upper="2.79253"/> </joint>
<transmission name="5_trans"> <type>transmission_interface/SimpleTransmission</type> <joint name="Wrist_Roll"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> </joint> <actuator name="motor5"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
<!-- Joint from lower_arm to wrist --> <joint name="Wrist_Pitch" type="revolute"> <origin xyz="-0.1349 0.0052 1.65232e-16" rpy="3.2474e-15 2.86219e-15 -1.5708"/> <parent link="lower_arm"/> <child link="wrist"/> <axis xyz="0 0 1"/> <limit effort="10" velocity="10" lower="-1.65806" upper="1.65806"/> </joint>
<transmission name="4_trans"> <type>transmission_interface/SimpleTransmission</type> <joint name="Wrist_Pitch"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> </joint> <actuator name="motor4"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
<!-- Joint from upper_arm to lower_arm --> <joint name="Elbow" type="revolute"> <origin xyz="-0.11257 -0.028 2.46331e-16" rpy="-1.22818e-15 5.75928e-16 1.5708"/> <parent link="upper_arm"/> <child link="lower_arm"/> <axis xyz="0 0 1"/> <limit effort="10" velocity="10" lower="-1.74533" upper="1.5708"/> </joint>
<transmission name="3_trans"> <type>transmission_interface/SimpleTransmission</type> <joint name="Elbow"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> </joint> <actuator name="motor3"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
<!-- Joint from shoulder to upper_arm --> <joint name="Pitch" type="revolute"> <origin xyz="-0.0303992 -0.0182778 -0.0542" rpy="-1.5708 -1.5708 0"/> <parent link="shoulder"/> <child link="upper_arm"/> <axis xyz="0 0 1"/> <limit effort="10" velocity="10" lower="-1.74533" upper="1.74533"/> </joint>
<transmission name="2_trans"> <type>transmission_interface/SimpleTransmission</type> <joint name="Pitch"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> </joint> <actuator name="motor2"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
<!-- Joint from base to shoulder --> <joint name="Rotation" type="revolute"> <origin xyz="0.0207909 -0.0230745 0.0948817" rpy="-3.14159 6.03684e-16 1.5708"/> <parent link="base"/> <child link="shoulder"/> <axis xyz="0 0 1"/> <limit effort="10" velocity="10" lower="-1.91986" upper="1.91986"/> </joint>
<transmission name="1_trans"> <type>transmission_interface/SimpleTransmission</type> <joint name="Rotation"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> </joint> <actuator name="motor1"> <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
</robot>1node_modules/123456789101112131415161718192021222324252627282930313233343536373839404142#root { max-width: 1280px; margin: 0 auto; padding: 2rem; text-align: center;}
.logo { height: 6em; padding: 1.5em; will-change: filter; transition: filter 300ms;}.logo:hover { filter: drop-shadow(0 0 2em #646cffaa);}.logo.react:hover { filter: drop-shadow(0 0 2em #61dafbaa);}
@keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}
@media (prefers-reduced-motion: no-preference) { a:nth-of-type(2) .logo { animation: logo-spin infinite 20s linear; }}
.card { padding: 2em;}
.read-the-docs { color: #888;}12345678910111213141516171819202122232425262728293031323334353637383940import { Toaster } from "@/components/ui/toaster";import { Toaster as Sonner } from "@/components/ui/sonner";import { TooltipProvider } from "@/components/ui/tooltip";import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { BrowserRouter, Routes, Route } from "react-router-dom";import Index from "./pages/Index";import NotFound from "./pages/NotFound";import Landing from "./pages/Landing";import TeleoperationPage from "./pages/Teleoperation";import Recording from "./pages/Recording";import Calibration from "./pages/Calibration";import Training from "./pages/Training";import { UrdfProvider } from "./contexts/UrdfContext";
const queryClient = new QueryClient();
const App = () => ( <QueryClientProvider client={queryClient}> <TooltipProvider> <Toaster /> <Sonner /> <UrdfProvider> <BrowserRouter> <Routes> <Route path="/" element={<Landing />} /> <Route path="/control" element={<Index />} /> <Route path="/teleoperation" element={<TeleoperationPage />} /> <Route path="/recording" element={<Recording />} /> <Route path="/calibration" element={<Calibration />} /> <Route path="/training" element={<Training />} /> {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} <Route path="*" element={<NotFound />} /> </Routes> </BrowserRouter> </UrdfProvider> </TooltipProvider> </QueryClientProvider>);
export default App;12345678910111213141516171819202122232425262728293031323334353637383940import React, { useEffect, useMemo } from "react";import { useUrdf } from "@/hooks/useUrdf";
/** * Component that only handles initializing the URDF processor * This component doesn't render anything visible, just initializes the processor */const UrdfProcessorInitializer: React.FC = () => { const { registerUrdfProcessor } = useUrdf();
// Create the URDF processor const urdfProcessor = useMemo( () => ({ loadUrdf: (urdfPath: string) => { console.log("📂 URDF path set:", urdfPath); // This will be handled by the actual viewer component return urdfPath; }, setUrlModifierFunc: (func: (url: string) => string) => { console.log("🔗 URL modifier function set"); return func; }, getPackage: () => { return ""; }, }), [] );
// Register the URDF processor with the context useEffect(() => { console.log("🔧 Registering URDF processor"); registerUrdfProcessor(urdfProcessor); }, [registerUrdfProcessor, urdfProcessor]);
// This component doesn't render anything return null;};
export default UrdfProcessorInitializer;123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236import React, { useEffect, useRef, useState, useMemo, useCallback,} from "react";import { cn } from "@/lib/utils";
import URDFManipulator from "urdf-loader/src/urdf-manipulator-element.js";import { useUrdf } from "@/hooks/useUrdf";import { useRealTimeJoints } from "@/hooks/useRealTimeJoints";import { createUrdfViewer, setupMeshLoader, setupJointHighlighting, setupModelLoading, URDFViewerElement,} from "@/lib/urdfViewerHelpers";
// Register the URDFManipulator as a custom element if it hasn't been alreadyif (typeof window !== "undefined" && !customElements.get("urdf-viewer")) { customElements.define("urdf-viewer", URDFManipulator);}
// Extend the interface for the URDF viewer element to include background propertyinterface UrdfViewerElement extends HTMLElement { background?: string; setJointValue?: (jointName: string, value: number) => void;}
const UrdfViewer: React.FC = () => { const containerRef = useRef<HTMLDivElement>(null); const [highlightedJoint, setHighlightedJoint] = useState<string | null>(null); const { registerUrdfProcessor, alternativeUrdfModels, isDefaultModel } = useUrdf();
// Add state for animation control useState<boolean>(isDefaultModel); const cleanupAnimationRef = useRef<(() => void) | null>(null); const viewerRef = useRef<URDFViewerElement | null>(null); const hasInitializedRef = useRef<boolean>(false);
// Real-time joint updates via WebSocket const { isConnected: isWebSocketConnected } = useRealTimeJoints({ viewerRef, enabled: isDefaultModel, // Only enable WebSocket for default model });
// Add state for custom URDF path const [customUrdfPath, setCustomUrdfPath] = useState<string | null>(null); const [urlModifierFunc, setUrlModifierFunc] = useState< ((url: string) => string) | null >(null);
const packageRef = useRef<string>("");
// Implement UrdfProcessor interface for drag and drop const urdfProcessor = useMemo( () => ({ loadUrdf: (urdfPath: string) => { setCustomUrdfPath(urdfPath); }, setUrlModifierFunc: (func: (url: string) => string) => { setUrlModifierFunc(() => func); }, getPackage: () => { return packageRef.current; }, }), [] );
// Register the URDF processor with the global drag and drop context useEffect(() => { registerUrdfProcessor(urdfProcessor); }, [registerUrdfProcessor, urdfProcessor]);
// Create URL modifier function for default model const defaultUrlModifier = useCallback((url: string) => { console.log(`🔗 defaultUrlModifier called with: ${url}`);
// Handle various package:// URL formats for the default SO-101 model if (url.startsWith("package://so_arm_description/meshes/")) { const modifiedUrl = url.replace( "package://so_arm_description/meshes/", "/so-101-urdf/meshes/" ); console.log(`🔗 Modified URL (package): ${modifiedUrl}`); return modifiedUrl; }
// Handle case where package path might be partially resolved if (url.includes("so_arm_description/meshes/")) { const modifiedUrl = url.replace( /.*so_arm_description\/meshes\//, "/so-101-urdf/meshes/" ); console.log(`🔗 Modified URL (partial): ${modifiedUrl}`); return modifiedUrl; }
// Handle the specific problematic path pattern we're seeing in logs if (url.includes("/so-101-urdf/so_arm_description/meshes/")) { const modifiedUrl = url.replace( "/so-101-urdf/so_arm_description/meshes/", "/so-101-urdf/meshes/" ); console.log(`🔗 Modified URL (problematic path): ${modifiedUrl}`); return modifiedUrl; }
// Handle relative paths that might need mesh folder prefix if ( url.endsWith(".stl") && !url.startsWith("/") && !url.startsWith("http") ) { const modifiedUrl = `/so-101-urdf/meshes/${url}`; console.log(`🔗 Modified URL (relative): ${modifiedUrl}`); return modifiedUrl; }
console.log(`🔗 Unmodified URL: ${url}`); return url; }, []);
// Main effect to create and setup the viewer only once useEffect(() => { if (!containerRef.current) return;
// Create and configure the URDF viewer element const viewer = createUrdfViewer(containerRef.current, true); viewerRef.current = viewer; // Store reference to the viewer
// Setup mesh loading function with appropriate URL modifier const activeUrlModifier = isDefaultModel ? defaultUrlModifier : urlModifierFunc; setupMeshLoader(viewer, activeUrlModifier);
// Determine which URDF to load - fixed path to match the actual available file const urdfPath = isDefaultModel ? "/so-101-urdf/urdf/so101_new_calib.urdf" : customUrdfPath || "";
// Set the package path for the default model if (isDefaultModel) { packageRef.current = "/"; // Set to root so we can handle full path resolution in URL modifier }
// Setup model loading if a path is available let cleanupModelLoading = () => {}; if (urdfPath) { cleanupModelLoading = setupModelLoading( viewer, urdfPath, packageRef.current, setCustomUrdfPath, alternativeUrdfModels ); }
// Setup joint highlighting const cleanupJointHighlighting = setupJointHighlighting( viewer, setHighlightedJoint );
// Setup animation event handler for the default model or when hasAnimation is true const onModelProcessed = () => { hasInitializedRef.current = true; if ("setJointValue" in viewer) { // Clear any existing animation if (cleanupAnimationRef.current) { cleanupAnimationRef.current(); cleanupAnimationRef.current = null; } } };
viewer.addEventListener("urdf-processed", onModelProcessed);
// Return cleanup function return () => { if (cleanupAnimationRef.current) { cleanupAnimationRef.current(); cleanupAnimationRef.current = null; } hasInitializedRef.current = false; cleanupJointHighlighting(); cleanupModelLoading(); viewer.removeEventListener("urdf-processed", onModelProcessed); }; }, [isDefaultModel, customUrdfPath, urlModifierFunc, defaultUrlModifier]);
return ( <div className={cn( "w-full h-full transition-all duration-300 ease-in-out relative", "bg-gradient-to-br from-gray-900 to-gray-800" )} > <div ref={containerRef} className="w-full h-full" />
{/* Joint highlight indicator */} {highlightedJoint && ( <div className="absolute bottom-4 right-4 bg-black/70 text-white px-3 py-2 rounded-md text-sm font-mono z-10"> Joint: {highlightedJoint} </div> )}
{/* WebSocket connection status */} {isDefaultModel && ( <div className="absolute top-4 right-4 z-10"> <div className={`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono ${ isWebSocketConnected ? "bg-green-900/70 text-green-300" : "bg-red-900/70 text-red-300" }`} > <div className={`w-2 h-2 rounded-full ${ isWebSocketConnected ? "bg-green-400" : "bg-red-400" }`} /> {isWebSocketConnected ? "Live Robot Data" : "Disconnected"} </div> </div> )} </div> );};
export default UrdfViewer;123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
import React from 'react';import { Mic, MicOff, Send, Camera } from 'lucide-react';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';
interface CommandBarProps { command: string; setCommand: (command: string) => void; handleSendCommand: () => void; isVoiceActive: boolean; setIsVoiceActive: (isActive: boolean) => void; showCamera: boolean; setShowCamera: (show: boolean) => void; handleEndSession: () => void;}
const CommandBar: React.FC<CommandBarProps> = ({ command, setCommand, handleSendCommand, isVoiceActive, setIsVoiceActive, showCamera, setShowCamera, handleEndSession}) => { return ( <div className="bg-gray-900 p-4 space-y-4"> <div className="flex flex-col sm:flex-row gap-4 items-center max-w-4xl mx-auto w-full"> <Input value={command} onChange={(e) => setCommand(e.target.value)} placeholder="Tell the robot what to do..." className="flex-1 bg-gray-800 border-gray-600 text-white placeholder-gray-400 text-lg py-3" onKeyPress={(e) => e.key === 'Enter' && handleSendCommand()} /> <Button onClick={handleSendCommand} className="bg-orange-500 hover:bg-orange-600 px-6 py-3 self-stretch sm:self-auto" > <Send strokeWidth={1.5} /> Send </Button> </div>
<div className="flex justify-center items-center gap-6"> <div className="flex flex-wrap justify-center gap-2 sm:gap-4"> <Button onClick={() => setIsVoiceActive(!isVoiceActive)} className={`px-6 py-2 ${ isVoiceActive ? 'bg-gray-600 text-white hover:bg-gray-500' : 'bg-gray-800 text-gray-300 hover:bg-gray-700' }`} > {isVoiceActive ? <Mic strokeWidth={1.5} /> : <MicOff strokeWidth={1.5} />} Voice Command </Button>
<Button onClick={() => setShowCamera(!showCamera)} className={`px-6 py-2 ${ showCamera ? 'bg-gray-600 text-white hover:bg-gray-500' : 'bg-gray-800 text-gray-300 hover:bg-gray-700' }`} > <Camera strokeWidth={1.5} /> Show Camera </Button>
<Button onClick={handleEndSession} className="bg-red-600 hover:bg-red-700 px-6 py-2" > End Session </Button> </div> </div> </div> );};
export default CommandBar;123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
import React, { useEffect, useRef } from 'react';import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';import { Camera, MicOff } from 'lucide-react';
interface MetricsPanelProps { activeTab: 'SENSORS' | 'MOTORS'; setActiveTab: (tab: 'SENSORS' | 'MOTORS') => void; sensorData: any[]; motorData: any[]; hasPermissions: boolean; streamRef: React.RefObject<MediaStream | null>; isVoiceActive: boolean; micLevel: number;}
const MetricsPanel: React.FC<MetricsPanelProps> = ({ activeTab, setActiveTab, sensorData, motorData, hasPermissions, streamRef, isVoiceActive, micLevel,}) => { const sensorVideoRef = useRef<HTMLVideoElement>(null);
useEffect(() => { if (activeTab === 'SENSORS' && hasPermissions && sensorVideoRef.current && streamRef.current) { if (sensorVideoRef.current.srcObject !== streamRef.current) { sensorVideoRef.current.srcObject = streamRef.current; } } }, [activeTab, hasPermissions, streamRef]);
return ( <div className="w-full lg:w-1/2 p-2 sm:p-4"> <div className="bg-gray-900 rounded-lg p-4 h-full flex flex-col"> {/* Tab Headers */} <div className="flex mb-4"> <button onClick={() => setActiveTab('MOTORS')} className={`px-6 py-2 rounded-t-lg text-sm sm:text-base ${ activeTab === 'MOTORS' ? 'bg-orange-500 text-white' : 'bg-gray-700 text-gray-300 hover:bg-gray-600' }`} > MOTORS </button> <button onClick={() => setActiveTab('SENSORS')} className={`px-6 py-2 rounded-t-lg ml-2 text-sm sm:text-base ${ activeTab === 'SENSORS' ? 'bg-orange-500 text-white' : 'bg-gray-700 text-gray-300 hover:bg-gray-600' }`} > SENSORS </button> </div>
{/* Chart Content */} <div className="flex-1 overflow-y-auto"> {activeTab === 'SENSORS' && ( <div className="space-y-4"> {/* Webcam Feed */} <div className="border border-gray-800 rounded p-2 flex flex-col h-64"> <h3 className="text-sm text-white font-medium mb-2">Live Camera Feed</h3> {hasPermissions ? ( <div className="flex-1 bg-black rounded overflow-hidden"> <video ref={sensorVideoRef} autoPlay muted playsInline className="w-full h-full object-contain" /> </div> ) : ( <div className="flex-1 flex items-center justify-center bg-black rounded"> <div className="text-center"> <Camera className="w-12 h-12 mx-auto text-gray-500 mb-2" /> <p className="text-gray-400">Camera permission not granted.</p> </div> </div> )} </div>
{/* Mic Detection & Other Sensors */} <div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> <div className="border border-gray-800 rounded p-2 flex flex-col justify-center min-h-[120px]"> <h3 className="text-sm text-center text-white font-medium mb-2">Voice Activity</h3> {hasPermissions ? ( <div className="flex-1 flex flex-col items-center justify-center gap-2 text-center"> <div className="flex items-end h-10 gap-px w-full justify-center"> {[...Array(15)].map((_, i) => { const barIsActive = isVoiceActive && i < (micLevel / 120 * 15); return ( <div key={i} className={`w-1.5 rounded-full transition-colors duration-75 ${barIsActive ? 'bg-orange-500' : 'bg-gray-700'}`} style={{ height: `${(i / 15 * 60) + 20}%` }} /> ); })} </div> <p className="text-xs text-gray-300"> {isVoiceActive ? "Voice commands active" : "Voice commands muted"} </p> </div> ) : ( <div className="flex-1 flex items-center justify-center bg-black rounded"> <div className="text-center"> <MicOff className="w-8 h-8 mx-auto text-gray-500 mb-2" /> <p className="text-gray-400">Microphone permission not granted.</p> </div> </div> )} </div>
{/* Sensor Charts */} {['sensor3', 'sensor4'].map((sensor, index) => ( <div key={sensor} className="border border-gray-800 rounded p-2 flex flex-col h-auto min-h-[120px]"> <h3 className="text-sm text-white font-medium mb-2">Sensor {index + 3}</h3> <ResponsiveContainer width="100%" height="90%"> <LineChart data={sensorData}> <CartesianGrid strokeDasharray="3 3" stroke="#374151" /> <XAxis hide /> <YAxis fontSize={12} stroke="#9CA3AF" /> <Tooltip contentStyle={{ backgroundColor: '#1F2937', border: '1px solid #374151', color: '#fff' }} /> <Line type="monotone" dataKey={sensor} stroke={index % 2 === 1 ? '#ff6b35' : '#ffdd44'} strokeWidth={2} dot={false} /> </LineChart> </ResponsiveContainer> </div> ))} </div> </div> )}
{activeTab === 'MOTORS' && ( <div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> {['motor1', 'motor2', 'motor3', 'motor4', 'motor5', 'motor6'].map((motor, index) => ( <div key={motor} className="border border-gray-800 rounded p-2 h-40"> <h3 className="text-sm text-white font-medium mb-2">Motor {index + 1}</h3> <ResponsiveContainer width="100%" height="80%"> <LineChart data={motorData}> <CartesianGrid strokeDasharray="3 3" stroke="#374151" /> <XAxis hide /> <YAxis fontSize={12} stroke="#9CA3AF" /> <Tooltip contentStyle={{ backgroundColor: '#1F2937', border: '1px solid #374151', color: '#fff' }} /> <Line type="monotone" dataKey={motor} stroke={index % 2 === 0 ? '#ff6b35' : '#ffdd44'} strokeWidth={2} dot={false} /> </LineChart> </ResponsiveContainer> </div> ))} </div> )} </div> </div> </div> );};
export default MetricsPanel;12345678910111213141516171819202122232425262728293031323334353637383940
import React from 'react';
const RobotArm = () => { return ( <group> {/* Base */} <mesh position={[0, -0.25, 0]}> <cylinderGeometry args={[1, 1, 0.5]} /> <meshPhongMaterial color="#333333" /> </mesh> {/* First joint */} <mesh position={[0, 0.5, 0]}> <boxGeometry args={[0.3, 1.5, 0.3]} /> <meshPhongMaterial color="#ff6b35" /> </mesh> {/* Second segment */} <mesh position={[0.9, 1.2, 0]} rotation={[0, 0, 0.3]}> <boxGeometry args={[1.8, 0.25, 0.25]} /> <meshPhongMaterial color="#ffdd44" /> </mesh> {/* Third segment */} <mesh position={[1.8, 1.7, 0]} rotation={[0, 0, -0.5]}> <boxGeometry args={[1.2, 0.2, 0.2]} /> <meshPhongMaterial color="#ff6b35" /> </mesh> {/* End effector */} <mesh position={[2.3, 1.3, 0]}> <boxGeometry args={[0.3, 0.3, 0.15]} /> <meshPhongMaterial color="#ffdd44" /> </mesh> </group> );};
export default RobotArm;123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869import React from "react";import { Button } from "@/components/ui/button";import { ArrowLeft } from "lucide-react";import { cn } from "@/lib/utils";import UrdfViewer from "../UrdfViewer";import UrdfProcessorInitializer from "../UrdfProcessorInitializer";
interface VisualizerPanelProps { onGoBack: () => void; className?: string;}
const VisualizerPanel: React.FC<VisualizerPanelProps> = ({ onGoBack, className,}) => { return ( <div className={cn( "w-full lg:w-1/2 p-2 sm:p-4 space-y-4 flex flex-col", className )} > <div className="bg-gray-900 rounded-lg p-4 flex-1 flex flex-col"> <div className="flex items-center justify-between mb-4"> <div className="flex items-center gap-3"> <img src="/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png" alt="LiveLab Logo" className="h-8 w-8" /> <h2 className="text-xl font-bold text-white">LiveLab</h2> </div> <Button variant="ghost" size="icon" onClick={onGoBack} className="text-gray-400 hover:text-white hover:bg-gray-800" > <ArrowLeft className="h-5 w-5" /> </Button> </div> <div className="flex-1 bg-black rounded border border-gray-800 min-h-[50vh] lg:min-h-0"> {/* <Canvas camera={{ position: [5, 3, 5], fov: 50 }}> <ambientLight intensity={0.4} /> <directionalLight position={[10, 10, 5]} intensity={1} /> <RobotArm /> <OrbitControls enablePan={true} enableZoom={true} enableRotate={true} /> </Canvas> */} <UrdfProcessorInitializer /> <UrdfViewer /> </div> </div>
<div className="grid grid-cols-2 lg:grid-cols-4 gap-2"> {[1, 2, 3, 4].map((cam) => ( <div key={cam} className="aspect-video bg-gray-900 rounded border border-gray-700 flex items-center justify-center" > <span className="text-gray-400 text-sm">Camera {cam}</span> </div> ))} </div> </div> );};
export default VisualizerPanel;123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131import React, { useState, useEffect } from "react";import { Button } from "@/components/ui/button";
interface JointData { type: "joint_update"; joints: Record<string, number>; timestamp: number;}
const WebSocketTest: React.FC = () => { const [isConnected, setIsConnected] = useState(false); const [lastMessage, setLastMessage] = useState<JointData | null>(null); const [connectionStatus, setConnectionStatus] = useState<string>("Disconnected"); const [ws, setWs] = useState<WebSocket | null>(null);
const connect = () => { // First test server health fetch("http://localhost:8000/health") .then((response) => response.json()) .then((data) => { console.log("Server health:", data);
// Now try WebSocket connection const websocket = new WebSocket("ws://localhost:8000/ws/joint-data");
websocket.onopen = () => { console.log("WebSocket connected"); setIsConnected(true); setConnectionStatus("Connected"); setWs(websocket); };
websocket.onmessage = (event) => { try { const data: JointData = JSON.parse(event.data); setLastMessage(data); console.log("Received joint data:", data); } catch (error) { console.error("Error parsing message:", error); } };
websocket.onclose = (event) => { console.log("WebSocket closed:", event.code, event.reason); setIsConnected(false); setConnectionStatus(`Closed (${event.code})`); setWs(null); };
websocket.onerror = (error) => { console.error("WebSocket error:", error); setConnectionStatus("Error"); }; }) .catch((error) => { console.error("Server health check failed:", error); setConnectionStatus("Server unreachable"); }); };
const disconnect = () => { if (ws) { ws.close(); } };
useEffect(() => { return () => { if (ws) { ws.close(); } }; }, [ws]);
return ( <div className="p-4 bg-gray-900 text-white rounded-lg"> <h3 className="text-lg font-bold mb-4">WebSocket Connection Test</h3>
<div className="space-y-4"> <div className="flex items-center gap-4"> <div className={`w-3 h-3 rounded-full ${ isConnected ? "bg-green-500" : "bg-red-500" }`} /> <span>Status: {connectionStatus}</span> </div>
<div className="flex gap-2"> <Button onClick={connect} disabled={isConnected}> Connect </Button> <Button onClick={disconnect} disabled={!isConnected} variant="outline" > Disconnect </Button> </div>
{lastMessage && ( <div className="bg-gray-800 p-3 rounded"> <h4 className="font-semibold mb-2">Last Joint Data:</h4> <div className="text-sm font-mono"> <div> Timestamp:{" "} {new Date(lastMessage.timestamp * 1000).toLocaleTimeString()} </div> <div className="mt-2">Joints:</div> {Object.entries(lastMessage.joints).map(([joint, value]) => ( <div key={joint} className="ml-4"> {joint}: {value.toFixed(4)} rad ( {((value * 180) / Math.PI).toFixed(2)}°) </div> ))} </div> </div> )}
<div className="text-sm text-gray-400"> <div>Expected URL: ws://localhost:8000/ws/joint-data</div> <div>Make sure your FastAPI server is running!</div> </div> </div> </div> );};
export default WebSocketTest;1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import * as React from "react"import * as AccordionPrimitive from "@radix-ui/react-accordion"import { ChevronDown } from "lucide-react"
import { cn } from "@/lib/utils"
const Accordion = AccordionPrimitive.Root
const AccordionItem = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Item>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>>(({ className, ...props }, ref) => ( <AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />))AccordionItem.displayName = "AccordionItem"
const AccordionTrigger = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Trigger>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>>(({ className, children, ...props }, ref) => ( <AccordionPrimitive.Header className="flex"> <AccordionPrimitive.Trigger ref={ref} className={cn( "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className )} {...props} > {children} <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" /> </AccordionPrimitive.Trigger> </AccordionPrimitive.Header>))AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
const AccordionContent = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Content>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>>(({ className, children, ...props }, ref) => ( <AccordionPrimitive.Content ref={ref} className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down" {...props} > <div className={cn("pb-4 pt-0", className)}>{children}</div> </AccordionPrimitive.Content>))
AccordionContent.displayName = AccordionPrimitive.Content.displayName
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139import * as React from "react"import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
import { cn } from "@/lib/utils"import { buttonVariants } from "@/components/ui/button"
const AlertDialog = AlertDialogPrimitive.Root
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
const AlertDialogPortal = AlertDialogPrimitive.Portal
const AlertDialogOverlay = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Overlay>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Overlay className={cn( "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className )} {...props} ref={ref} />))AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
const AlertDialogContent = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Content>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>>(({ className, ...props }, ref) => ( <AlertDialogPortal> <AlertDialogOverlay /> <AlertDialogPrimitive.Content ref={ref} className={cn( "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className )} {...props} /> </AlertDialogPortal>))AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
const AlertDialogHeader = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col space-y-2 text-center sm:text-left", className )} {...props} />)AlertDialogHeader.displayName = "AlertDialogHeader"
const AlertDialogFooter = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className )} {...props} />)AlertDialogFooter.displayName = "AlertDialogFooter"
const AlertDialogTitle = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Title>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold", className)} {...props} />))AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
const AlertDialogDescription = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Description>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />))AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName
const AlertDialogAction = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Action>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />))AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
const AlertDialogCancel = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Cancel>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Cancel ref={ref} className={cn( buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className )} {...props} />))AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel,}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import * as React from "react"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const alertVariants = cva( "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", { variants: { variant: { default: "bg-background text-foreground", destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", }, }, defaultVariants: { variant: "default", }, })
const Alert = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>>(({ className, variant, ...props }, ref) => ( <div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />))Alert.displayName = "Alert"
const AlertTitle = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => ( <h5 ref={ref} className={cn("mb-1 font-medium leading-none tracking-tight", className)} {...props} />))AlertTitle.displayName = "AlertTitle"
const AlertDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn("text-sm [&_p]:leading-relaxed", className)} {...props} />))AlertDescription.displayName = "AlertDescription"
export { Alert, AlertTitle, AlertDescription }12345import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
const AspectRatio = AspectRatioPrimitive.Root
export { AspectRatio }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import * as React from "react"import * as AvatarPrimitive from "@radix-ui/react-avatar"
import { cn } from "@/lib/utils"
const Avatar = React.forwardRef< React.ElementRef<typeof AvatarPrimitive.Root>, React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>>(({ className, ...props }, ref) => ( <AvatarPrimitive.Root ref={ref} className={cn( "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className )} {...props} />))Avatar.displayName = AvatarPrimitive.Root.displayName
const AvatarImage = React.forwardRef< React.ElementRef<typeof AvatarPrimitive.Image>, React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>>(({ className, ...props }, ref) => ( <AvatarPrimitive.Image ref={ref} className={cn("aspect-square h-full w-full", className)} {...props} />))AvatarImage.displayName = AvatarPrimitive.Image.displayName
const AvatarFallback = React.forwardRef< React.ElementRef<typeof AvatarPrimitive.Fallback>, React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>>(({ className, ...props }, ref) => ( <AvatarPrimitive.Fallback ref={ref} className={cn( "flex h-full w-full items-center justify-center rounded-full bg-muted", className )} {...props} />))AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
export { Avatar, AvatarImage, AvatarFallback }123456789101112131415161718192021222324252627282930313233343536import * as React from "react"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const badgeVariants = cva( "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", { variants: { variant: { default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", outline: "text-foreground", }, }, defaultVariants: { variant: "default", }, })
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) { return ( <div className={cn(badgeVariants({ variant }), className)} {...props} /> )}
export { Badge, badgeVariants }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115import * as React from "react"import { Slot } from "@radix-ui/react-slot"import { ChevronRight, MoreHorizontal } from "lucide-react"
import { cn } from "@/lib/utils"
const Breadcrumb = React.forwardRef< HTMLElement, React.ComponentPropsWithoutRef<"nav"> & { separator?: React.ReactNode }>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)Breadcrumb.displayName = "Breadcrumb"
const BreadcrumbList = React.forwardRef< HTMLOListElement, React.ComponentPropsWithoutRef<"ol">>(({ className, ...props }, ref) => ( <ol ref={ref} className={cn( "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className )} {...props} />))BreadcrumbList.displayName = "BreadcrumbList"
const BreadcrumbItem = React.forwardRef< HTMLLIElement, React.ComponentPropsWithoutRef<"li">>(({ className, ...props }, ref) => ( <li ref={ref} className={cn("inline-flex items-center gap-1.5", className)} {...props} />))BreadcrumbItem.displayName = "BreadcrumbItem"
const BreadcrumbLink = React.forwardRef< HTMLAnchorElement, React.ComponentPropsWithoutRef<"a"> & { asChild?: boolean }>(({ asChild, className, ...props }, ref) => { const Comp = asChild ? Slot : "a"
return ( <Comp ref={ref} className={cn("transition-colors hover:text-foreground", className)} {...props} /> )})BreadcrumbLink.displayName = "BreadcrumbLink"
const BreadcrumbPage = React.forwardRef< HTMLSpanElement, React.ComponentPropsWithoutRef<"span">>(({ className, ...props }, ref) => ( <span ref={ref} role="link" aria-disabled="true" aria-current="page" className={cn("font-normal text-foreground", className)} {...props} />))BreadcrumbPage.displayName = "BreadcrumbPage"
const BreadcrumbSeparator = ({ children, className, ...props}: React.ComponentProps<"li">) => ( <li role="presentation" aria-hidden="true" className={cn("[&>svg]:size-3.5", className)} {...props} > {children ?? <ChevronRight />} </li>)BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
const BreadcrumbEllipsis = ({ className, ...props}: React.ComponentProps<"span">) => ( <span role="presentation" aria-hidden="true" className={cn("flex h-9 w-9 items-center justify-center", className)} {...props} > <MoreHorizontal className="h-4 w-4" /> <span className="sr-only">More</span> </span>)BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis,}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import * as React from "react"import { Slot } from "@radix-ui/react-slot"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { variant: { default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, size: { default: "h-10 px-4 py-2", sm: "h-9 rounded-md px-3", lg: "h-11 rounded-md px-8", icon: "h-10 w-10", }, }, defaultVariants: { variant: "default", size: "default", }, })
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> { asChild?: boolean}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button" return ( <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} /> ) })Button.displayName = "Button"
export { Button, buttonVariants }12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import * as React from "react";import { ChevronLeft, ChevronRight } from "lucide-react";import { DayPicker } from "react-day-picker";
import { cn } from "@/lib/utils";import { buttonVariants } from "@/components/ui/button";
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
function Calendar({ className, classNames, showOutsideDays = true, ...props}: CalendarProps) { return ( <DayPicker showOutsideDays={showOutsideDays} className={cn("p-3", className)} classNames={{ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", month: "space-y-4", caption: "flex justify-center pt-1 relative items-center", caption_label: "text-sm font-medium", nav: "space-x-1 flex items-center", nav_button: cn( buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100" ), nav_button_previous: "absolute left-1", nav_button_next: "absolute right-1", table: "w-full border-collapse space-y-1", head_row: "flex", head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]", row: "flex w-full mt-2", cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20", day: cn( buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100" ), day_range_end: "day-range-end", day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", day_today: "bg-accent text-accent-foreground", day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30", day_disabled: "text-muted-foreground opacity-50", day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground", day_hidden: "invisible", ...classNames, }} components={{ IconLeft: ({ ..._props }) => <ChevronLeft className="h-4 w-4" />, IconRight: ({ ..._props }) => <ChevronRight className="h-4 w-4" />, }} {...props} /> );}Calendar.displayName = "Calendar";
export { Calendar };DockerfileAdded+35
README.md+77-5
bun.lockbAdded+3
components.jsonAdded+20
eslint.config.jsAdded+29
index.htmlAdded+24
package.jsonAdded+88
postcss.config.jsAdded+6
public/favicon.icoAdded
public/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.pngAdded

public/placeholder.svgAdded
public/robots.txtAdded+14
public/so-101-urdf/CMakeLists.txtAdded+38
public/so-101-urdf/README.mdAdded+41
public/so-101-urdf/config/joint_names_so_arm_urdf.yamlAdded+1
public/so-101-urdf/joints_properties.xmlAdded+12
public/so-101-urdf/meshes/base_motor_holder_so101_v1.stlAdded+3
public/so-101-urdf/meshes/base_so101_v2.stlAdded+3
public/so-101-urdf/meshes/motor_holder_so101_base_v1.stlAdded+3
public/so-101-urdf/meshes/motor_holder_so101_wrist_v1.stlAdded+3
public/so-101-urdf/meshes/moving_jaw_so101_v1.stlAdded+3
public/so-101-urdf/meshes/rotation_pitch_so101_v1.stlAdded+3
public/so-101-urdf/meshes/sts3215_03a_no_horn_v1.stlAdded+3
public/so-101-urdf/meshes/sts3215_03a_v1.stlAdded+3
public/so-101-urdf/meshes/under_arm_so101_v1.stlAdded+3
public/so-101-urdf/meshes/upper_arm_so101_v1.stlAdded+3
public/so-101-urdf/meshes/waveshare_mounting_plate_so101_v2.stlAdded+3
public/so-101-urdf/meshes/wrist_roll_follower_so101_v1.stlAdded+3
public/so-101-urdf/meshes/wrist_roll_pitch_so101_v2.stlAdded+3
public/so-101-urdf/package.xmlAdded+26
public/so-101-urdf/urdf/so101_new_calib.urdfAdded+435
src/.gitignoreAdded+1
src/App.cssAdded+42
src/App.tsxAdded+40
src/components/UrdfProcessorInitializer.tsxAdded+40
src/components/UrdfViewer.tsxAdded+236
src/components/control/CommandBar.tsxAdded+81
src/components/control/MetricsPanel.tsxAdded+190
src/components/control/RobotArm.tsxAdded+40
src/components/control/VisualizerPanel.tsxAdded+69
src/components/test/WebSocketTest.tsxAdded+131
src/components/ui/accordion.tsxAdded+56
src/components/ui/alert-dialog.tsxAdded+139
src/components/ui/alert.tsxAdded+59
src/components/ui/aspect-ratio.tsxAdded+5
src/components/ui/avatar.tsxAdded+48
src/components/ui/badge.tsxAdded+36
src/components/ui/breadcrumb.tsxAdded+115
src/components/ui/button.tsxAdded+56
src/components/ui/calendar.tsxAdded+64