5 releases

new 0.1.5 Nov 13, 2024
0.1.4 Nov 12, 2024
0.1.2 May 28, 2024
0.1.1 Apr 9, 2024

#4 in Simulation

Download history 16/week @ 2024-07-29 19/week @ 2024-09-23 24/week @ 2024-09-30 32/week @ 2024-10-07 240/week @ 2024-10-14 532/week @ 2024-10-21 451/week @ 2024-10-28 473/week @ 2024-11-04 440/week @ 2024-11-11

1,928 downloads per month

BSD-3-Clause

205KB
3K SLoC

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.

Dependencies

~0.5–2.1MB
~34K SLoC