pub mod rules;
#[cxx::bridge(namespace = "maliput::api")]
pub mod ffi {
struct ConstLanePtr {
pub lane: *const Lane,
}
struct MutIntersectionPtr {
pub intersection: *mut Intersection,
}
struct ConstLaneSRangeRef<'a> {
pub lane_s_range: &'a LaneSRange,
}
unsafe extern "C++" {
include!("api/api.h");
#[namespace = "maliput::math"]
type Vector3 = crate::math::ffi::Vector3;
#[namespace = "maliput::math"]
type Quaternion = crate::math::ffi::Quaternion;
#[namespace = "maliput::math"]
type Matrix3 = crate::math::ffi::Matrix3;
#[namespace = "maliput::math"]
type RollPitchYaw = crate::math::ffi::RollPitchYaw;
#[namespace = "maliput::api::rules"]
type RoadRulebook = crate::api::rules::ffi::RoadRulebook;
#[namespace = "maliput::api::rules"]
type TrafficLightBook = crate::api::rules::ffi::TrafficLightBook;
#[namespace = "maliput::api"]
type RoadNetwork;
fn road_geometry(self: &RoadNetwork) -> *const RoadGeometry;
fn intersection_book(self: Pin<&mut RoadNetwork>) -> *mut IntersectionBook;
fn traffic_light_book(self: &RoadNetwork) -> *const TrafficLightBook;
fn rulebook(self: &RoadNetwork) -> *const RoadRulebook;
type RoadGeometry;
fn RoadGeometry_id(road_geometry: &RoadGeometry) -> String;
fn num_junctions(self: &RoadGeometry) -> i32;
fn linear_tolerance(self: &RoadGeometry) -> f64;
fn angular_tolerance(self: &RoadGeometry) -> f64;
fn num_branch_points(self: &RoadGeometry) -> i32;
fn RoadGeometry_ToRoadPosition(
rg: &RoadGeometry,
inertial_position: &InertialPosition,
) -> UniquePtr<RoadPositionResult>;
fn RoadGeometry_GetLane(rg: &RoadGeometry, lane_id: &String) -> ConstLanePtr;
fn RoadGeometry_GetLanes(rg: &RoadGeometry) -> UniquePtr<CxxVector<ConstLanePtr>>;
fn RoadGeometry_GetSegment(rg: &RoadGeometry, segment_id: &String) -> *const Segment;
fn RoadGeometry_GetJunction(rg: &RoadGeometry, junction_id: &String) -> *const Junction;
fn RoadGeometry_GetBranchPoint(rg: &RoadGeometry, branch_point_id: &String) -> *const BranchPoint;
type LanePosition;
fn LanePosition_new(s: f64, r: f64, h: f64) -> UniquePtr<LanePosition>;
fn s(self: &LanePosition) -> f64;
fn r(self: &LanePosition) -> f64;
fn h(self: &LanePosition) -> f64;
fn set_s(self: Pin<&mut LanePosition>, s: f64);
fn set_r(self: Pin<&mut LanePosition>, r: f64);
fn set_h(self: Pin<&mut LanePosition>, h: f64);
fn srh(self: &LanePosition) -> &Vector3;
fn set_srh(self: Pin<&mut LanePosition>, srh: &Vector3);
fn LanePosition_to_str(lane_pos: &LanePosition) -> String;
type InertialPosition;
fn InertialPosition_new(x: f64, y: f64, z: f64) -> UniquePtr<InertialPosition>;
fn x(self: &InertialPosition) -> f64;
fn y(self: &InertialPosition) -> f64;
fn z(self: &InertialPosition) -> f64;
fn set_x(self: Pin<&mut InertialPosition>, x: f64);
fn set_y(self: Pin<&mut InertialPosition>, y: f64);
fn set_z(self: Pin<&mut InertialPosition>, z: f64);
fn xyz(self: &InertialPosition) -> &Vector3;
fn set_xyz(self: Pin<&mut InertialPosition>, xyz: &Vector3);
fn length(self: &InertialPosition) -> f64;
fn Distance(self: &InertialPosition, other: &InertialPosition) -> f64;
fn InertialPosition_to_str(inertial_pos: &InertialPosition) -> String;
fn InertialPosition_operator_eq(lhs: &InertialPosition, rhs: &InertialPosition) -> bool;
fn InertialPosition_operator_sum(lhs: &InertialPosition, rhs: &InertialPosition)
-> UniquePtr<InertialPosition>;
fn InertialPosition_operator_sub(lhs: &InertialPosition, rhs: &InertialPosition)
-> UniquePtr<InertialPosition>;
fn InertialPosition_operator_mul_scalar(lhs: &InertialPosition, scalar: f64) -> UniquePtr<InertialPosition>;
type Lane;
fn to_left(self: &Lane) -> *const Lane;
fn to_right(self: &Lane) -> *const Lane;
fn index(self: &Lane) -> i32;
fn length(self: &Lane) -> f64;
fn Contains(self: &Lane, lane_position: &LanePosition) -> bool;
fn segment(self: &Lane) -> *const Segment;
fn Lane_id(lane: &Lane) -> String;
fn Lane_lane_bounds(lane: &Lane, s: f64) -> UniquePtr<RBounds>;
fn Lane_segment_bounds(lane: &Lane, s: f64) -> UniquePtr<RBounds>;
fn Lane_elevation_bounds(lane: &Lane, s: f64, r: f64) -> UniquePtr<HBounds>;
fn Lane_GetOrientation(lane: &Lane, lane_position: &LanePosition) -> UniquePtr<Rotation>;
fn Lane_ToInertialPosition(lane: &Lane, lane_position: &LanePosition) -> UniquePtr<InertialPosition>;
fn Lane_ToLanePosition(lane: &Lane, inertial_position: &InertialPosition) -> UniquePtr<LanePositionResult>;
fn Lane_ToSegmentPosition(lane: &Lane, inertial_position: &InertialPosition) -> UniquePtr<LanePositionResult>;
fn Lane_GetBranchPoint(lane: &Lane, start: bool) -> *const BranchPoint;
fn Lane_GetConfluentBranches(lane: &Lane, start: bool) -> *const LaneEndSet;
fn Lane_GetOngoingBranches(lane: &Lane, start: bool) -> *const LaneEndSet;
fn Lane_GetDefaultBranch(lane: &Lane, start: bool) -> UniquePtr<LaneEnd>;
fn Lane_EvalMotionDerivatives(
lane: &Lane,
lane_position: &LanePosition,
sigma_v: f64,
rho_v: f64,
eta_v: f64,
) -> UniquePtr<LanePosition>;
type Segment;
fn num_lanes(self: &Segment) -> i32;
fn junction(self: &Segment) -> *const Junction;
fn lane(self: &Segment, index: i32) -> *const Lane;
fn Segment_id(segment: &Segment) -> String;
type Junction;
fn road_geometry(self: &Junction) -> *const RoadGeometry;
fn num_segments(self: &Junction) -> i32;
fn segment(self: &Junction, index: i32) -> *const Segment;
fn Junction_id(junction: &Junction) -> String;
type RoadPosition;
unsafe fn RoadPosition_new(lane: *const Lane, lane_pos: &LanePosition) -> UniquePtr<RoadPosition>;
fn RoadPosition_ToInertialPosition(road_position: &RoadPosition) -> UniquePtr<InertialPosition>;
fn RoadPosition_lane(road_position: &RoadPosition) -> *const Lane;
fn RoadPosition_pos(road_position: &RoadPosition) -> UniquePtr<LanePosition>;
type RoadPositionResult;
fn RoadPositionResult_road_position(result: &RoadPositionResult) -> UniquePtr<RoadPosition>;
fn RoadPositionResult_nearest_position(result: &RoadPositionResult) -> UniquePtr<InertialPosition>;
fn RoadPositionResult_distance(result: &RoadPositionResult) -> f64;
type LanePositionResult;
fn LanePositionResult_road_position(result: &LanePositionResult) -> UniquePtr<LanePosition>;
fn LanePositionResult_nearest_position(result: &LanePositionResult) -> UniquePtr<InertialPosition>;
fn LanePositionResult_distance(result: &LanePositionResult) -> f64;
type Rotation;
fn Rotation_new() -> UniquePtr<Rotation>;
fn Rotation_from_quat(q: &Quaternion) -> UniquePtr<Rotation>;
fn Rotation_from_rpy(rpy: &RollPitchYaw) -> UniquePtr<Rotation>;
fn roll(self: &Rotation) -> f64;
fn pitch(self: &Rotation) -> f64;
fn yaw(self: &Rotation) -> f64;
fn quat(self: &Rotation) -> &Quaternion;
fn Distance(self: &Rotation, other: &Rotation) -> f64;
fn Rotation_set_quat(r: Pin<&mut Rotation>, q: &Quaternion);
fn Rotation_rpy(r: &Rotation) -> UniquePtr<RollPitchYaw>;
fn Rotation_matrix(r: &Rotation) -> UniquePtr<Matrix3>;
fn Rotation_Apply(r: &Rotation, ip: &InertialPosition) -> UniquePtr<InertialPosition>;
fn Rotation_Reverse(r: &Rotation) -> UniquePtr<Rotation>;
type RBounds;
fn min(self: &RBounds) -> f64;
fn max(self: &RBounds) -> f64;
type HBounds;
fn min(self: &HBounds) -> f64;
fn max(self: &HBounds) -> f64;
type SRange;
fn SRange_new(s0: f64, s1: f64) -> UniquePtr<SRange>;
fn s0(self: &SRange) -> f64;
fn s1(self: &SRange) -> f64;
fn set_s0(self: Pin<&mut SRange>, s0: f64);
fn set_s1(self: Pin<&mut SRange>, s1: f64);
fn size(self: &SRange) -> f64;
fn WithS(self: &SRange) -> bool;
fn Intersects(self: &SRange, other: &SRange, tolerance: f64) -> bool;
fn Contains(self: &SRange, s_range: &SRange, tolerance: f64) -> bool;
fn SRange_GetIntersection(s_range: &SRange, other: &SRange, tolerance: f64) -> UniquePtr<SRange>;
type LaneSRange;
fn LaneSRange_new(lane_id: &String, s_range: &SRange) -> UniquePtr<LaneSRange>;
fn length(self: &LaneSRange) -> f64;
fn Intersects(self: &LaneSRange, other: &LaneSRange, tolerance: f64) -> bool;
fn Contains(self: &LaneSRange, lane_s_range: &LaneSRange, tolerance: f64) -> bool;
fn LaneSRange_lane_id(lane_s_range: &LaneSRange) -> String;
fn LaneSRange_s_range(lane_s_range: &LaneSRange) -> UniquePtr<SRange>;
fn LaneSRange_GetIntersection(
lane_s_range: &LaneSRange,
other: &LaneSRange,
tolerance: f64,
) -> UniquePtr<LaneSRange>;
type LaneSRoute;
fn LaneSRoute_new(ranges: &CxxVector<ConstLaneSRangeRef>) -> UniquePtr<LaneSRoute>;
fn length(self: &LaneSRoute) -> f64;
fn Intersects(self: &LaneSRoute, other: &LaneSRoute, tolerance: f64) -> bool;
fn ranges(self: &LaneSRoute) -> &CxxVector<LaneSRange>;
type LaneEnd;
unsafe fn LaneEnd_new(lane: *const Lane, start: bool) -> UniquePtr<LaneEnd>;
fn LaneEnd_lane(lane_end: &LaneEnd) -> *const Lane;
fn LaneEnd_is_start(lane_end: &LaneEnd) -> bool;
type LaneEndSet;
fn size(self: &LaneEndSet) -> i32;
fn get(self: &LaneEndSet, index: i32) -> &LaneEnd;
type BranchPoint;
fn BranchPoint_id(branch_point: &BranchPoint) -> String;
fn road_geometry(self: &BranchPoint) -> *const RoadGeometry;
fn GetConfluentBranches(self: &BranchPoint, end: &LaneEnd) -> *const LaneEndSet;
fn GetOngoingBranches(self: &BranchPoint, end: &LaneEnd) -> *const LaneEndSet;
fn GetASide(self: &BranchPoint) -> *const LaneEndSet;
fn GetBSide(self: &BranchPoint) -> *const LaneEndSet;
fn BranchPoint_GetDefaultBranch(branch_point: &BranchPoint, end: &LaneEnd) -> UniquePtr<LaneEnd>;
type Intersection;
fn Intersection_id(intersection: &Intersection) -> String;
type IntersectionBook;
fn IntersectionBook_GetIntersection(book: Pin<&mut IntersectionBook>, id: &String) -> MutIntersectionPtr;
fn IntersectionBook_GetIntersections(
book: Pin<&mut IntersectionBook>,
) -> UniquePtr<CxxVector<MutIntersectionPtr>>;
}
impl UniquePtr<RoadNetwork> {}
impl UniquePtr<LanePosition> {}
}