{"library":"ros-typescript-generator","title":"ROS TypeScript Generator","description":"ros-typescript-generator is a Command Line Interface (CLI) tool designed to generate TypeScript interfaces and enums directly from ROS (Robot Operating System) message (`.msg`), service (`.srv`), and action (`.action`) definition files. Currently at version 1.10.0, this package sees active development with several minor releases annually, often introducing new features and bug fixes. A key differentiator is its focus on generating pure TypeScript types without any runtime dependencies or classes in the output, making it an ideal choice for frontend applications or any project requiring only type definitions. It supports both ROS1 and ROS2 message formats and offers configurable output options like type prefixes, namespaces, and 'smart enums', setting it apart from alternatives that might include Node.js-specific runtime components.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install ros-typescript-generator"],"cli":{"name":"ros-typescript-generator","version":null}},"imports":["import { generate } from 'ros-typescript-generator'","import { CliConfig } from 'ros-typescript-generator'","import { RosVersion } from 'ros-typescript-generator'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"{\n  \"output\": \"./generated/ros_msgs.ts\",\n  \"rosVersion\": 2,\n  \"typePrefix\": \"IRosType\",\n  \"useNamespaces\": false,\n  \"smartEnums\": true,\n  \"input\": [\n    {\n      \"namespace\": \"std_msgs\",\n      \"path\": \"/opt/ros/iron/share/std_msgs\"\n    },\n    {\n      \"namespace\": \"geometry_msgs\",\n      \"path\": \"/opt/ros/iron/share/geometry_msgs\"\n    }\n  ]\n}\n\n// 1. Save the above JSON content into a file named `ros-ts-generator-config.json` in your project root.\n\n// 2. Run the generator using npx:\nnpx ros-typescript-generator --config ros-ts-generator-config.json\n\n// 3. Example of how to use the generated types in your TypeScript project (e.g., in `src/app.ts`):\n// import { IRosTypeStdMsgsHeader } from './generated/ros_msgs';\n\n// const myHeader: IRosTypeStdMsgsHeader = {\n//   seq: 10,\n//   stamp: { sec: 1678886400, nanosec: 500000000 },\n//   frame_id: 'robot_base'\n// };\n\n// console.log('Generated ROS Header:', myHeader);\n","lang":"typescript","description":"Demonstrates the typical CLI usage by providing a sample configuration file and the command to run the generator, along with a brief illustration of using the resulting TypeScript types.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}