Spaces:
Running
Running
File size: 2,042 Bytes
9d3c32a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
/**
* Shared type definitions for Urdf parsing from supabase edge function
*/
export interface UrdfData {
name?: string;
description?: string;
mass?: number;
dofs?: number;
joints?: {
revolute?: number;
prismatic?: number;
continuous?: number;
fixed?: number;
other?: number;
};
links?: {
name?: string;
mass?: number;
}[];
materials?: {
name?: string;
percentage?: number;
}[];
}
/**
* Interface representing a Urdf file model
*/
export interface UrdfFileModel {
/**
* Path to the Urdf file
*/
path: string;
/**
* Blob URL for accessing the file
*/
blobUrl: string;
/**
* Name of the model extracted from the file path
*/
name?: string;
}
/**
* Joint animation configuration interface
*/
export interface JointAnimationConfig {
/** Joint name in the Urdf */
name: string;
/** Animation type (sine, linear, etc.) */
type: "sine" | "linear" | "constant";
/** Minimum value for the joint */
min: number;
/** Maximum value for the joint */
max: number;
/** Speed multiplier for the animation (lower = slower) */
speed: number;
/** Phase offset in radians */
offset: number;
/** Whether angles are in degrees (will be converted to radians) */
isDegrees?: boolean;
/** For more complex movements, a custom function that takes time and returns a value between 0 and 1 */
customEasing?: (time: number) => number;
}
/**
* Robot animation configuration interface
*/
export interface RobotAnimationConfig {
/** Array of joint configurations */
joints: JointAnimationConfig[];
/** Global speed multiplier */
speedMultiplier?: number;
}
export interface AnimationRequest {
robotName: string;
urdfContent: string;
description: string; // Natural language description of the desired animation
}
export interface ContentItem {
id: string;
title: string;
imageUrl: string;
description?: string;
categories: string[];
urdfPath: string;
}
export interface Category {
id: string;
name: string;
}
|