maliput

Crates.iomaliput
lib.rsmaliput
version0.1.3
sourcesrc
created_at2024-04-08 22:04:16.949359
updated_at2024-11-04 21:31:52.070907
descriptionRust API for maliput
homepage
repositoryhttps://github.com/maliput/maliput-rs
max_upload_size
id1201534
size748,669
Santiago Lopez (Santoi)

documentation

https://maliput.github.io/maliput-rs/maliput

README

maliput

github crates.io docs.rs build status

Creates Rustacean API for maliput. It is implemented on top of maliput-sys package.

Note: What is maliput? Refer to https://maliput.readthedocs.org.

Description

maliput provides a Rust API implemented on top of FFI bindings provided by maliput-sys package.

Usage

fn main() {
    use maliput::api::RoadNetwork;
    use std::collections::HashMap;

    // Get location of odr resources
    let package_location = std::env::var("CARGO_MANIFEST_DIR").unwrap();
    let xodr_path = format!("{}/data/xodr/TShapeRoad.xodr", package_location);

    let road_network_properties = HashMap::from([
        ("road_geometry_id", "my_rg_from_rust"),
        ("opendrive_file", xodr_path.as_str()),
    ]);

    let road_network = RoadNetwork::new("maliput_malidrive", &road_network_properties);
    let road_geometry = road_network.road_geometry();

    // Excercise the RoadGeometry API.
    println!("linear_tolerance: {}", road_geometry.linear_tolerance());
    println!("angular_tolerance: {}", road_geometry.angular_tolerance());
    println!("num_junctions: {}", road_geometry.num_junctions());

    let lanes = road_geometry.get_lanes();
    println!("num_lanes: {}", lanes.len());
    println!("lanes: ");
    for lane in lanes {
        println!("\tlane id: {}", lane.id());
    }
}

Examples

  • Load maliput::api::RoadNetwork and perform some basic queries against the Road Geometry.
    cargo run --example road_geometry
    

Benches

  • Evaluate the execution of maliput::api::RoadGeometry::to_road_position method.
    cargo bench to_road_position
    

License

Licensed under BSD 3-Clause.

Commit count: 67

cargo fmt