5 releases

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

#7 in Simulation

Download history 1/week @ 2024-09-17 19/week @ 2024-09-24 25/week @ 2024-10-01 40/week @ 2024-10-08 330/week @ 2024-10-15 532/week @ 2024-10-22 547/week @ 2024-10-29 288/week @ 2024-11-05 471/week @ 2024-11-12 498/week @ 2024-11-19 308/week @ 2024-11-26 413/week @ 2024-12-03

1,701 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.2MB
~34K SLoC