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 |
#4 in Simulation
1,833 downloads per month
205KB
3K
SLoC
maliput
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.6–2.2MB
~34K SLoC