All Projects → grepthat → libOpenDRIVE

grepthat / libOpenDRIVE

Licence: Apache-2.0 License
Small, lightweight C++ library for handling OpenDRIVE files

Programming Languages

C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to libOpenDRIVE

osm2xodr
converter for OpenStreetMaps to OpenDrive roads - for use with Carla or other things
Stars: ✭ 90 (-13.46%)
Mutual labels:  opendrive, xodr
ad-xolib
C++ library for Parsing OpenScenario (1.1.1) & OpenDrive files (1.7) ASAM Specifications
Stars: ✭ 56 (-46.15%)
Mutual labels:  opendrive, xodr
cat-o-licious
Cat game written in Go
Stars: ✭ 100 (-3.85%)
Mutual labels:  webassembly
block-aligner
SIMD-accelerated library for computing global and X-drop affine gap penalty sequence-to-sequence or sequence-to-profile alignments using an adaptive block-based algorithm.
Stars: ✭ 58 (-44.23%)
Mutual labels:  webassembly
brainfuck2wasm
A brainfuck-to-WebAssembly compiler
Stars: ✭ 36 (-65.38%)
Mutual labels:  webassembly
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (-29.81%)
Mutual labels:  webassembly
cabasa
Haxe Framework for WebAssembly
Stars: ✭ 30 (-71.15%)
Mutual labels:  webassembly
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-68.27%)
Mutual labels:  webassembly
warpy
WebAssembly interpreter in RPython
Stars: ✭ 54 (-48.08%)
Mutual labels:  webassembly
node-wasi
WASI for Node.js
Stars: ✭ 64 (-38.46%)
Mutual labels:  webassembly
shorelark
Simulation of life & evolution
Stars: ✭ 109 (+4.81%)
Mutual labels:  webassembly
eosio-demo1-election
My experiment on EOSIO blockchain to develop an election Smart Contract. I also develop a webapp which interacts with the blockchain.
Stars: ✭ 17 (-83.65%)
Mutual labels:  webassembly
widgets playground
Showcase example for https://github.com/therecipe/qt
Stars: ✭ 50 (-51.92%)
Mutual labels:  webassembly
fast-base64
Fastest base64 on the web, with Wasm + SIMD
Stars: ✭ 23 (-77.88%)
Mutual labels:  webassembly
Uno.Themes
This library is designed to help you use the material design system with the Uno Platform
Stars: ✭ 112 (+7.69%)
Mutual labels:  webassembly
WasmEdge-go
The GO language SDK and API for WasmEdge
Stars: ✭ 62 (-40.38%)
Mutual labels:  webassembly
gearoenix
Cross-platform C++ 3D game engine.
Stars: ✭ 33 (-68.27%)
Mutual labels:  webassembly
Sharpen
(Demo) A v-dom "diff" engine based on WebAssembly, aim to build efficient and fluent web apps.
Stars: ✭ 20 (-80.77%)
Mutual labels:  webassembly
samlang
Sam's Programming Language
Stars: ✭ 22 (-78.85%)
Mutual labels:  webassembly
kotlin-gradle-templates
Quick start kotlin gradle DSL
Stars: ✭ 50 (-51.92%)
Mutual labels:  webassembly

libOpenDRIVE

libOpenDRIVE is a lightweight, fast C++ library providing OpenDRIVE file parsing and 3D model generation.

It's dependency-free, small and includes a web-based viewer. It can be easily integrated in other projects and can be compiled to a WebAssembly library. A core function is the parsing of OpenDRIVE files and the generation of 3D models. The library targets OpenDRIVE version 1.4.

Example

Here's an example of how code using libOpenDRIVE looks; it opens an xodr file, iterates over the elements of the road network and generates lanes meshes.

#include "OpenDriveMap.h"
#include "Lanes.h"
#include "Road.h"

#include <memory>
#include <stdio.h>

int main(void)
{
    odr::OpenDriveMap odr("data.xodr");
    for (std::shared_ptr<odr::Road> road : odr.get_roads())
    {
        printf("road: %s, length: %.2f\n", road->id.c_str(), road->length);
        for (std::shared_ptr<odr::LaneSection> lanesec : road->get_lanesections())
        {
            for (std::shared_ptr<odr::Lane> lane : lanesec->get_lanes())
            {
                auto lane_mesh = lane->get_mesh(lanesec->s0, lanesec->get_end(), 0.1);
            }
        }
    }
    return 0;
}

Viewer

To use the included viewer first build the WebAssembly library and then run a webserver in the Viewer/ directory (e.g. python3 -m http.server). Or you can test the viewer online.

viewer-demo

Build

To build the library simply run:

mkdir build && cd build
cmake ..
make

This also builds an executable to test the library:

./build/test-xodr Viewer/data.xodr

WebAssembly

Install emsdk and run the following commands to build the WebAssembly library:

mkdir build && cd build
emcmake cmake ..
emmake make

cp ModuleOpenDrive.* ../Viewer

Javascript Example

fetch("./data.xodr").then((file_data) => {
    file_data.text().then((file_text) => {
        odr_map_config = {
            with_lateralProfile : PARAMS.lateralProfile,
            with_laneHeight : PARAMS.laneHeight,
            with_road_objects : false,
            center_map : true,
            abs_z_for_for_local_road_obj_outline : true
        };
        ModuleOpenDrive['FS_createDataFile'](".", "data.xodr", file_text, true, true);
        OpenDriveMap = new ModuleOpenDrive.OpenDriveMap("./data.xodr", odr_map_config);
    });
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].