ASAM OSI Types provides TypeScript type definitions for the Open Simulation Interface (OSI) specification. OSI facilitates the interoperability of simulation environments in automated driving and advanced driver-assistance systems (ADAS) development.
- Comprehensive TypeScript type definitions for the OSI specification.
- Simplifies development by enabling static type checking in TypeScript.
- Maintains compatibility with the official OSI schema versions.
- Designed for use in simulation and modeling projects involving OSI.
Install the package using npm or yarn:
npm install asam-osi-typesor
yarn add asam-osi-typesHere are the available commands and scripts for working with the project:
npm run buildor
yarn buildCompiles the TypeScript code into JavaScript. The compiled output is stored in the dist/ folder.
npm run setupor
yarn setupInstalls the OSI dependencies
npm run generateor
yarn generateGenerates protobuf files
npm run lintor
yarn lintLints the project using ESLint to enforce consistent code style.
npm run testor
yarn testRuns the test suite to ensure the code functions as expected.
npm run cleanor
yarn cleanRemoves the build output (dist/) and cleans up the workspace.
npm run formator
yarn formatFormats the codebase using Prettier to maintain consistent styling.
Here’s how to use the provided type definitions in a TypeScript project:
import { OsiMessage } from "@lichtblick/asam-osi-types";
// Example: Define an OSI Message
const message: OsiMessage = {
header: {
timestamp: {
seconds: 1627500000,
nanos: 123456789,
},
frame_id: "example-frame",
},
content: {
exampleField: "value",
},
};
console.log(message);OsiMessage: Represents the base message format in OSI.Header: Metadata for OSI messages, including timestamps and IDs.Timestamp: Specifies time information.
For detailed type definitions, explore the source files in the src folder.
To test the package locally, build the project and run the following command to create a symbolic link for the package
npm linkCreate a local typescript test project with an index.ts file
mkdir test-project && cd $_ && touch index.tsInitialize project
npm init -yLink test project with the package
npm link asam-osi-typesImport types into the test-project
import * as types from "asam-osi-types";The versioning for the project is handeled automatically via the github actions CI/CD workflow, it will always reflect the current version of the OSI repository.
Local versioning can be applied to the project through the package.json file, but it will not be reflected in the npm package metadata since it is overwritten when publishing.
Contributions are welcome! Here's how you can help:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name. - Commit your changes:
git commit -m 'Add feature-name'. - Push to the branch:
git push origin feature-name. - Submit a pull request.
Please ensure all code adheres to the Mozilla Public License 2.0 and follows the repository's coding standards.
This project is licensed under the Mozilla Public License 2.0. For more details, see the LICENSE file.