From 1f0ca19f21e4fad8b68ce9ce7cb07794fef8a2b5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Sep 2024 18:35:52 +0200 Subject: [PATCH] Extended ad protocol classes small cleanup --- PythonAPI/carla/source/carla/ad/__init__.pyi | 149 +++---- PythonAPI/carla/source/carla/ad/map/point.pyi | 393 +----------------- .../carla/source/carla/ad/map/restriction.pyi | 199 +-------- .../carla/source/carla/ad/rss/situation.pyi | 127 +----- PythonAPI/carla/source/carla/ad/rss/state.pyi | 65 +-- .../source/carla/ad/rss/unstructured.pyi | 128 +----- PythonAPI/carla/source/carla/ad/rss/world.pyi | 62 +-- 7 files changed, 105 insertions(+), 1018 deletions(-) diff --git a/PythonAPI/carla/source/carla/ad/__init__.pyi b/PythonAPI/carla/source/carla/ad/__init__.pyi index 662612a56c9..f5a08b0fa81 100644 --- a/PythonAPI/carla/source/carla/ad/__init__.pyi +++ b/PythonAPI/carla/source/carla/ad/__init__.pyi @@ -4,7 +4,7 @@ Warning: some functions and attributes are still missing. """ -from typing import Iterable, Iterator, Protocol, TypeVar, type_check_only +from typing import Iterable, Iterator, Protocol, TypeVar, overload, type_check_only from typing_extensions import Self @@ -21,135 +21,110 @@ __all__ = [ _T = TypeVar('_T') -@type_check_only -class _FloatLike(Protocol): - def __float__(self) -> float: ... - - def __add__(self, other: float | Self) -> Self: ... - - def __iadd__(self, other: float | Self) -> Self: ... - - def __truediv__(self, other: float | Self) -> Self: ... - - def __sub__(self, other: float | Self) -> Self: ... - - def __isub(self, other: float | Self) -> Self: ... - - def __lt__(self, other: float | Self) -> bool: ... - - def __le__(self, other: float | Self) -> bool: ... - - def __ge__(self, other: float | Self) -> bool: ... - - def __gt__(self, other: float | Self) -> bool: ... - - def __eq__(self, value: object) -> bool: ... - - @type_check_only class _Vector(Protocol[_T]): - def __getitem__(self, index: int) -> _T: + @overload + def __getitem__(self, index: slice, /) -> list[_T]: ... + + @overload + def __getitem__(self, index: int, /) -> _T: ... - def __delitem__(self, index: int): + def __delitem__(self, index: int, /): ... - def __setitem__(self, index: int, value: _T) -> None: - ... + @overload + def __setitem__(self, arg2: slice, value: Iterable[_T], /) -> None: ... + + @overload + def __setitem__(self, index: int, value: _T, /) -> None: ... def __len__(self) -> int: ... - def append(self, item: _T) -> None: - ... - - def count(self, item: _T) -> int: - ... - - def extend(self, iterable: Iterable[_T]) -> None: + def append(self, item: _T, /) -> None: ... - def index(self, item: _T) -> int: + def extend(self, iterable: Iterable[_T], /) -> None: ... - def insert(self, index: int, item: _T) -> None: + def insert(self, index: int, item: _T, /) -> None: ... def reverse(self) -> None: ... - def __contains__(self, item: object) -> bool: + def __contains__(self, item: object, /) -> bool: ... def __iter__(self) -> Iterator[_T]: ... + +@type_check_only +class _VectorSequence(_Vector[_T], Protocol): + """ + Adds `count` and `index` methods. + """ + + def count(self, item: _T, /) -> int: + ... -class _Calculable(Protocol): + def index(self, item: _T, /) -> int: + ... + +@type_check_only +class _Assignable(Protocol): - cMaxValue: float - cMinValue: float - cPrecisionValue: float + def assign(self, other: Self) -> Self: ... - @classmethod - def getMin(cls) -> Self: - pass +@type_check_only +class _FloatLike(Protocol): + def __float__(self) -> float: ... - @classmethod - def getMax(cls) -> Self: - pass + def __add__(self, other: float | Self) -> Self: ... - @classmethod - def getPrecision(cls) -> Self: - pass + def __iadd__(self, other: float | Self) -> Self: ... - def Valid(self) -> bool: - pass + def __truediv__(self, other: float | Self) -> Self: ... - def ensureValid(self, value: Self) -> Self: - pass + def __sub__(self, other: float | Self) -> Self: ... - def ensureValidNonZero(self, value: Self) -> Self: - pass + def __isub(self, other: float | Self) -> Self: ... - def assign(self, other: Self) -> None: - pass + def __lt__(self, other: float | Self) -> bool: ... - def __truediv__(self, other: Self) -> Self: - pass + def __le__(self, other: float | Self) -> bool: ... + + def __mul__(self, other: Self) -> Self: ... - def __sub__(self, other: Self) -> Self: - pass + def __ge__(self, other: float | Self) -> bool: ... - def __isub__(self, other: Self) -> None: - pass + def __gt__(self, other: float | Self) -> bool: ... - def __le__(self, other: Self) -> bool: - pass + def __eq__(self, value: object) -> bool: ... - def __lt__(self, other: Self) -> bool: - pass +@type_check_only +class _Calculable(_Assignable, _FloatLike, Protocol): - def __mul__(self, other: Self) -> Self: - pass + cMaxValue: float + cMinValue: float + cPrecisionValue: float - def __ne__(self, other: Self) -> bool: - pass + @classmethod + def getMin(cls) -> Self: ... - def __add__(self, other: Self) -> Self: - pass + @classmethod + def getMax(cls) -> Self: ... - def __eq__(self, other: Self) -> bool: - pass + @classmethod + def getPrecision(cls) -> Self: ... - def __float__(self) -> float: - pass + @property + def Valid(self) -> bool: ... - def __ge__(self, other: Self) -> bool: - pass + def ensureValid(self, value: Self) -> Self: ... - def __gt__(self, other: Self) -> bool: - pass + def ensureValidNonZero(self, value: Self) -> Self: ... - def __hash__(self) -> int: - pass + def __hash__(self) -> int: ... diff --git a/PythonAPI/carla/source/carla/ad/map/point.pyi b/PythonAPI/carla/source/carla/ad/map/point.pyi index ca62f0b5f85..06dd35d8abf 100644 --- a/PythonAPI/carla/source/carla/ad/map/point.pyi +++ b/PythonAPI/carla/source/carla/ad/map/point.pyi @@ -4,76 +4,11 @@ import ad from . import * -class Altitude: - @property - def Valid(self) -> bool: ... - - def assign(self, arg1: Altitude, other: Altitude) -> Altitude: - """ - - assign( (Altitude)arg1, (Altitude)other) -> Altitude : - - C++ signature : - ad::map::point::Altitude {lvalue} assign(ad::map::point::Altitude {lvalue},ad::map::point::Altitude) - """ - ... - +class Altitude(ad._Calculable): cMaxValue = 1.7976931348623157e+308 - cMinValue = -1.7976931348623157e+308 - cPrecisionValue = 0.001 - def ensureValid(self, arg1: Altitude) -> None: - """ - - ensureValid( (Altitude)arg1) -> None : - - C++ signature : - void ensureValid(ad::map::point::Altitude {lvalue}) - """ - ... - - def ensureValidNonZero(self, arg1: Altitude) -> None: - """ - - ensureValidNonZero( (Altitude)arg1) -> None : - - C++ signature : - void ensureValidNonZero(ad::map::point::Altitude {lvalue}) - """ - ... - - def getMax(self) -> Altitude: - """ - - getMax() -> Altitude : - - C++ signature : - ad::map::point::Altitude getMax() - """ - ... - - def getMin(self) -> Altitude: - """ - - getMin() -> Altitude : - - C++ signature : - ad::map::point::Altitude getMin() - """ - ... - - def getPrecision(self) -> Altitude: - """ - - getPrecision() -> Altitude : - - C++ signature : - ad::map::point::Altitude getPrecision() - """ - ... - class BoundingSphere: def assign(self, arg1: BoundingSphere, other: BoundingSphere) -> BoundingSphere: """ @@ -289,136 +224,13 @@ class CoordinateTransform: """ ... -class ECEFCoordinate: - @property - def Valid(self) -> bool: ... - - def assign(self, arg1: ECEFCoordinate, other: ECEFCoordinate) -> ECEFCoordinate: - """ - - assign( (ECEFCoordinate)arg1, (ECEFCoordinate)other) -> ECEFCoordinate : - - C++ signature : - ad::map::point::ECEFCoordinate {lvalue} assign(ad::map::point::ECEFCoordinate {lvalue},ad::map::point::ECEFCoordinate) - """ - ... - +class ECEFCoordinate(ad._Calculable ): cMaxValue = 1000000000.0 - cMinValue = -1000000000.0 - cPrecisionValue = 0.001 - def ensureValid(self, arg1: ECEFCoordinate) -> None: - """ - - ensureValid( (ECEFCoordinate)arg1) -> None : - - C++ signature : - void ensureValid(ad::map::point::ECEFCoordinate {lvalue}) - """ - ... - - def ensureValidNonZero(self, arg1: ECEFCoordinate) -> None: - """ - - ensureValidNonZero( (ECEFCoordinate)arg1) -> None : - - C++ signature : - void ensureValidNonZero(ad::map::point::ECEFCoordinate {lvalue}) - """ - ... - - def getMax(self) -> ECEFCoordinate: - """ - - getMax() -> ECEFCoordinate : - - C++ signature : - ad::map::point::ECEFCoordinate getMax() - """ - ... - - def getMin(self) -> ECEFCoordinate: - """ - - getMin() -> ECEFCoordinate : - - C++ signature : - ad::map::point::ECEFCoordinate getMin() - """ - ... - - def getPrecision(self) -> ECEFCoordinate: - """ - - getPrecision() -> ECEFCoordinate : - - C++ signature : - ad::map::point::ECEFCoordinate getPrecision() - """ - ... - -class ECEFEdge: - def append(self, arg1: ECEFEdge, arg2: ECEFPoint) -> None: - """ - - append( (ECEFEdge)arg1, (ECEFPoint)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::map::point::ECEFPoint) - """ - ... - - def count(self, arg1: ECEFEdge, arg2: ECEFPoint) -> int: - """ - - count( (ECEFEdge)arg1, (ECEFPoint)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::map::point::ECEFPoint) - """ - ... - - def extend(self, arg1: ECEFEdge, arg2: object) -> None: - """ - - extend( (ECEFEdge)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def index(self, arg1: ECEFEdge, arg2: ECEFPoint) -> int: - """ - - index( (ECEFEdge)arg1, (ECEFPoint)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::map::point::ECEFPoint) - """ - ... - - def insert(self, arg1: ECEFEdge, arg2: int, arg3: ECEFPoint) -> None: - """ - - insert( (ECEFEdge)arg1, (int)arg2, (ECEFPoint)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::map::point::ECEFPoint) - """ - ... - - def reverse(self, arg1: ECEFEdge) -> None: - """ - - reverse( (ECEFEdge)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... +class ECEFEdge(ad._VectorSequence[ECEFPoint]): + ... class ECEFHeading: def assign(self, arg1: ECEFHeading, other: ECEFHeading) -> ECEFHeading: @@ -460,137 +272,13 @@ class ECEFPoint: @property def z(self) -> ECEFCoordinate: ... -class ENUCoordinate(ad._FloatLike): - - @property - def Valid(self) -> bool: ... - - def assign(self, arg1: ENUCoordinate, other: ENUCoordinate) -> ENUCoordinate: - """ - - assign( (ENUCoordinate)arg1, (ENUCoordinate)other) -> ENUCoordinate : - - C++ signature : - ad::map::point::ENUCoordinate {lvalue} assign(ad::map::point::ENUCoordinate {lvalue},ad::map::point::ENUCoordinate) - """ - ... - +class ENUCoordinate(ad._Calculable): cMaxValue = 1000000.0 - cMinValue = -1000000.0 - cPrecisionValue = 0.001 - def ensureValid(self, arg1: ENUCoordinate) -> None: - """ - - ensureValid( (ENUCoordinate)arg1) -> None : - - C++ signature : - void ensureValid(ad::map::point::ENUCoordinate {lvalue}) - """ - ... - - def ensureValidNonZero(self, arg1: ENUCoordinate) -> None: - """ - - ensureValidNonZero( (ENUCoordinate)arg1) -> None : - - C++ signature : - void ensureValidNonZero(ad::map::point::ENUCoordinate {lvalue}) - """ - ... - - def getMax(self) -> ENUCoordinate: - """ - - getMax() -> ENUCoordinate : - - C++ signature : - ad::map::point::ENUCoordinate getMax() - """ - ... - - def getMin(self) -> ENUCoordinate: - """ - - getMin() -> ENUCoordinate : - - C++ signature : - ad::map::point::ENUCoordinate getMin() - """ - ... - - def getPrecision(self) -> ENUCoordinate: - """ - - getPrecision() -> ENUCoordinate : - - C++ signature : - ad::map::point::ENUCoordinate getPrecision() - """ - ... - -class ENUEdge: - def append(self, arg1: ENUEdge, arg2: ENUPoint) -> None: - """ - - append( (ENUEdge)arg1, (ENUPoint)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::map::point::ENUPoint) - """ - ... - - def count(self, arg1: ENUEdge, arg2: ENUPoint) -> int: - """ - - count( (ENUEdge)arg1, (ENUPoint)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::map::point::ENUPoint) - """ - ... - - def extend(self, arg1: ENUEdge, arg2: object) -> None: - """ - - extend( (ENUEdge)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def index(self, arg1: ENUEdge, arg2: ENUPoint) -> int: - """ - - index( (ENUEdge)arg1, (ENUPoint)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::map::point::ENUPoint) - """ - ... - - def insert(self, arg1: ENUEdge, arg2: int, arg3: ENUPoint) -> None: - """ - - insert( (ENUEdge)arg1, (int)arg2, (ENUPoint)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::map::point::ENUPoint) - """ - ... - - def reverse(self, arg1: ENUEdge) -> None: - """ - - reverse( (ENUEdge)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... +class ENUEdge(ad._VectorSequence[ENUPoint]): + ... class ENUEdgeCache: def assign(self, arg1: ENUEdgeCache, other: ENUEdgeCache) -> ENUEdgeCache: @@ -609,78 +297,13 @@ class ENUEdgeCache: @property def enuVersion(self) -> int: ... -class ENUHeading(ad._FloatLike): - def __float__(self) -> float: ... - - @property - def Valid(self) -> bool: ... - - def assign(self, arg1: ENUHeading, other: ENUHeading) -> ENUHeading: - """ - - assign( (ENUHeading)arg1, (ENUHeading)other) -> ENUHeading : - - C++ signature : - ad::map::point::ENUHeading {lvalue} assign(ad::map::point::ENUHeading {lvalue},ad::map::point::ENUHeading) - """ - ... - +class ENUHeading(ad._Calculable): cMaxValue = 1.7976931348623157e+308 cMinValue = -1.7976931348623157e+308 cPrecisionValue = 0.0001 - def ensureValid(self, arg1: ENUHeading) -> None: - """ - - ensureValid( (ENUHeading)arg1) -> None : - - C++ signature : - void ensureValid(ad::map::point::ENUHeading {lvalue}) - """ - ... - - def ensureValidNonZero(self, arg1: ENUHeading) -> None: - """ - - ensureValidNonZero( (ENUHeading)arg1) -> None : - - C++ signature : - void ensureValidNonZero(ad::map::point::ENUHeading {lvalue}) - """ - ... - - def getMax(self) -> ENUHeading: - """ - - getMax() -> ENUHeading : - - C++ signature : - ad::map::point::ENUHeading getMax() - """ - ... - - def getMin(self) -> ENUHeading: - """ - - getMin() -> ENUHeading : - - C++ signature : - ad::map::point::ENUHeading getMin() - """ - ... - - def getPrecision(self) -> ENUHeading: - """ - - getPrecision() -> ENUHeading : - - C++ signature : - ad::map::point::ENUHeading getPrecision() - """ - ... - class ENUPoint(ad._FloatLike): def assign(self, arg1: ENUPoint, other: ENUPoint) -> ENUPoint: """ diff --git a/PythonAPI/carla/source/carla/ad/map/restriction.pyi b/PythonAPI/carla/source/carla/ad/map/restriction.pyi index ae0fc7bf314..e3f497318fe 100644 --- a/PythonAPI/carla/source/carla/ad/map/restriction.pyi +++ b/PythonAPI/carla/source/carla/ad/map/restriction.pyi @@ -1,3 +1,4 @@ +from libcarla import _CarlaEnum import ad class Restriction: @@ -20,66 +21,8 @@ class Restriction: @property def roadUserTypes(self) -> RoadUserTypeList: ... -class RestrictionList: - def append(self, arg1: RestrictionList, arg2: Restriction) -> None: - """ - - append( (RestrictionList)arg1, (Restriction)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::map::restriction::Restriction) - """ - ... - - def count(self, arg1: RestrictionList, arg2: Restriction) -> int: - """ - - count( (RestrictionList)arg1, (Restriction)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::map::restriction::Restriction) - """ - ... - - def extend(self, arg1: RestrictionList, arg2: object) -> None: - """ - - extend( (RestrictionList)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def index(self, arg1: RestrictionList, arg2: Restriction) -> int: - """ - - index( (RestrictionList)arg1, (Restriction)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::map::restriction::Restriction) - """ - ... - - def insert(self, arg1: RestrictionList, arg2: int, arg3: Restriction) -> None: - """ - - insert( (RestrictionList)arg1, (int)arg2, (Restriction)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::map::restriction::Restriction) - """ - ... - - def reverse(self, arg1: RestrictionList) -> None: - """ - - reverse( (RestrictionList)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... +class RestrictionList(ad._VectorSequence[Restriction]): + ... class Restrictions: def assign(self, arg1: Restrictions, other: Restrictions) -> Restrictions: @@ -98,7 +41,7 @@ class Restrictions: @property def disjunctions(self) -> RestrictionList: ... -class RoadUserType(int): +class RoadUserType(int, _CarlaEnum): BICYCLE = 7 BUS = 3 @@ -123,76 +66,8 @@ class RoadUserType(int): UNKNOWN = 1 -class RoadUserTypeList: - def append(self, arg1: RoadUserTypeList, arg2: RoadUserType) -> None: - """ - - append( (RoadUserTypeList)arg1, (RoadUserType)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::map::restriction::RoadUserType) - """ - ... - - def count(self, arg1: RoadUserTypeList, arg2: RoadUserType) -> int: - """ - - count( (RoadUserTypeList)arg1, (RoadUserType)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::map::restriction::RoadUserType) - """ - ... - - def extend(self, arg1: RoadUserTypeList, arg2: object) -> None: - """ - - extend( (RoadUserTypeList)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def index(self, arg1: RoadUserTypeList, arg2: RoadUserType) -> int: - """ - - index( (RoadUserTypeList)arg1, (RoadUserType)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::map::restriction::RoadUserType) - """ - ... - - def insert(self, arg1: RoadUserTypeList, arg2: int, arg3: RoadUserType) -> None: - """ - - insert( (RoadUserTypeList)arg1, (int)arg2, (RoadUserType)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::map::restriction::RoadUserType) - """ - ... - - def reverse(self, arg1: RoadUserTypeList) -> None: - """ - - reverse( (RoadUserTypeList)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... - - def sort(self, arg1: RoadUserTypeList) -> None: - """ - - sort( (RoadUserTypeList)arg1) -> None : - - C++ signature : - void sort(std::vector > {lvalue}) - """ - ... +class RoadUserTypeList(ad._VectorSequence[RoadUserType]): + ... class SpeedLimit: def assign(self, arg1: SpeedLimit, other: SpeedLimit) -> SpeedLimit: @@ -211,66 +86,8 @@ class SpeedLimit: @property def speedLimit(self) -> ad.physics.Speed: ... -class SpeedLimitList: - def append(self, arg1: SpeedLimitList, arg2: SpeedLimit) -> None: - """ - - append( (SpeedLimitList)arg1, (SpeedLimit)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::map::restriction::SpeedLimit) - """ - ... - - def count(self, arg1: SpeedLimitList, arg2: SpeedLimit) -> int: - """ - - count( (SpeedLimitList)arg1, (SpeedLimit)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::map::restriction::SpeedLimit) - """ - ... - - def extend(self, arg1: SpeedLimitList, arg2: object) -> None: - """ - - extend( (SpeedLimitList)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def index(self, arg1: SpeedLimitList, arg2: SpeedLimit) -> int: - """ - - index( (SpeedLimitList)arg1, (SpeedLimit)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::map::restriction::SpeedLimit) - """ - ... - - def insert(self, arg1: SpeedLimitList, arg2: int, arg3: SpeedLimit) -> None: - """ - - insert( (SpeedLimitList)arg1, (int)arg2, (SpeedLimit)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::map::restriction::SpeedLimit) - """ - ... - - def reverse(self, arg1: SpeedLimitList) -> None: - """ - - reverse( (SpeedLimitList)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... +class SpeedLimitList(ad._VectorSequence[SpeedLimit]): + ... class VehicleDescriptor: def assign(self, arg1: VehicleDescriptor, other: VehicleDescriptor) -> VehicleDescriptor: diff --git a/PythonAPI/carla/source/carla/ad/rss/situation.pyi b/PythonAPI/carla/source/carla/ad/rss/situation.pyi index 6195e9f51c6..ed406a38854 100644 --- a/PythonAPI/carla/source/carla/ad/rss/situation.pyi +++ b/PythonAPI/carla/source/carla/ad/rss/situation.pyi @@ -1,8 +1,10 @@ -from libcarla import ad +import ad +from ad import _Assignable +from libcarla import _CarlaEnum from . import * -class LateralRelativePosition(int): +class LateralRelativePosition(int, _CarlaEnum): AtLeft = 0 AtRight = 4 @@ -13,7 +15,7 @@ class LateralRelativePosition(int): OverlapRight = 3 -class LongitudinalRelativePosition(int): +class LongitudinalRelativePosition(int, _CarlaEnum): AtBack = 4 InFront = 0 @@ -24,16 +26,7 @@ class LongitudinalRelativePosition(int): OverlapFront = 1 -class RelativePosition: - def assign(self, arg1: RelativePosition, other: RelativePosition) -> RelativePosition: - """ - - assign( (RelativePosition)arg1, (RelativePosition)other) -> RelativePosition : - - C++ signature : - ad::rss::situation::RelativePosition {lvalue} assign(ad::rss::situation::RelativePosition {lvalue},ad::rss::situation::RelativePosition) - """ - ... +class RelativePosition(_Assignable): @property def lateralDistance(self) -> ad.physics.Distance: ... @@ -47,16 +40,7 @@ class RelativePosition: @property def longitudinalPosition(self) -> LongitudinalRelativePosition: ... -class Situation: - def assign(self, arg1: Situation, other: Situation) -> Situation: - """ - - assign( (Situation)arg1, (Situation)other) -> Situation : - - C++ signature : - ad::rss::situation::Situation {lvalue} assign(ad::rss::situation::Situation {lvalue},ad::rss::situation::Situation) - """ - ... +class Situation(_Assignable): @property def egoVehicleState(self) -> VehicleState: ... @@ -76,16 +60,7 @@ class Situation: @property def situationType(self) -> SituationType: ... -class SituationSnapshot: - def assign(self, arg1: SituationSnapshot, other: SituationSnapshot) -> SituationSnapshot: - """ - - assign( (SituationSnapshot)arg1, (SituationSnapshot)other) -> SituationSnapshot : - - C++ signature : - ad::rss::situation::SituationSnapshot {lvalue} assign(ad::rss::situation::SituationSnapshot {lvalue},ad::rss::situation::SituationSnapshot) - """ - ... +class SituationSnapshot(_Assignable): @property def defaultEgoVehicleRssDynamics(self) -> world.RssDynamics: ... @@ -96,7 +71,7 @@ class SituationSnapshot: @property def timeIndex(self) -> int: ... -class SituationType(int): +class SituationType(int, _CarlaEnum): IntersectionEgoHasPriority = 3 IntersectionObjectHasPriority = 4 @@ -111,77 +86,10 @@ class SituationType(int): Unstructured = 6 -class SituationVector(ad._Vector[Situation]): - def append(self, arg1: SituationVector, arg2: Situation) -> None: - """ - - append( (SituationVector)arg1, (Situation)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::rss::situation::Situation) - """ - ... - - def count(self, arg1: SituationVector, arg2: Situation) -> int: - """ - - count( (SituationVector)arg1, (Situation)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::rss::situation::Situation) - """ - ... - - def extend(self, arg1: SituationVector, arg2: object) -> None: - """ - - extend( (SituationVector)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... +class SituationVector(ad._VectorSequence[Situation]): + ... - def index(self, arg1: SituationVector, arg2: Situation) -> int: - """ - - index( (SituationVector)arg1, (Situation)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::rss::situation::Situation) - """ - ... - - def insert(self, arg1: SituationVector, arg2: int, arg3: Situation) -> None: - """ - - insert( (SituationVector)arg1, (int)arg2, (Situation)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::rss::situation::Situation) - """ - ... - - def reverse(self, arg1: SituationVector) -> None: - """ - - reverse( (SituationVector)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... - -class VehicleState: - def assign(self, arg1: VehicleState, other: VehicleState) -> VehicleState: - """ - - assign( (VehicleState)arg1, (VehicleState)other) -> VehicleState : - - C++ signature : - ad::rss::situation::VehicleState {lvalue} assign(ad::rss::situation::VehicleState {lvalue},ad::rss::situation::VehicleState) - """ - ... +class VehicleState(_Assignable): @property def distanceToEnterIntersection(self) -> ad.physics.Distance: ... @@ -207,16 +115,7 @@ class VehicleState: @property def velocity(self) -> VelocityRange: ... -class VelocityRange: - def assign(self, arg1: VelocityRange, other: VelocityRange) -> VelocityRange: - """ - - assign( (VelocityRange)arg1, (VelocityRange)other) -> VelocityRange : - - C++ signature : - ad::rss::situation::VelocityRange {lvalue} assign(ad::rss::situation::VelocityRange {lvalue},ad::rss::situation::VelocityRange) - """ - ... +class VelocityRange(_Assignable): @property def speedLat(self) -> ad.physics.SpeedRange: ... diff --git a/PythonAPI/carla/source/carla/ad/rss/state.pyi b/PythonAPI/carla/source/carla/ad/rss/state.pyi index 1ef80a95190..fa1ea79093a 100644 --- a/PythonAPI/carla/source/carla/ad/rss/state.pyi +++ b/PythonAPI/carla/source/carla/ad/rss/state.pyi @@ -303,73 +303,16 @@ class RssStateSnapshot(): @property def unstructuredSceneEgoInformation(self) -> UnstructuredSceneStateInformation: ... -class RssStateVector(ad._Vector[RssState]): - def append(self, arg1: RssStateVector, arg2: RssState) -> None: - ''' - - append( (RssStateVector)arg1, (RssState)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::rss::state::RssState) - ''' - ... - - def count(self, arg1: RssStateVector, arg2: RssState) -> int: - ''' - - count( (RssStateVector)arg1, (RssState)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::rss::state::RssState) - ''' - ... - - def extend(self, arg1: RssStateVector, arg2: object) -> None: - ''' - - extend( (RssStateVector)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - ''' - ... - - def index(self, arg1: RssStateVector, arg2: RssState) -> int: - ''' - - index( (RssStateVector)arg1, (RssState)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::rss::state::RssState) - ''' - ... +class RssStateVector(ad._VectorSequence[RssState]): + ... - def insert(self, arg1: RssStateVector, arg2: int, arg3: RssState) -> None: - ''' - - insert( (RssStateVector)arg1, (int)arg2, (RssState)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::rss::state::RssState) - ''' - ... - - def reverse(self, arg1: RssStateVector) -> None: - ''' - - reverse( (RssStateVector)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - ''' - ... - -class UnstructuredSceneResponse(int,): +class UnstructuredSceneResponse(int, _CarlaEnum): None = 0 # type: ignore # is named None in the C++ code ContinueForward = 1 DriveAway = 2 Brake = 3 + class UnstructuredSceneRssState(): @property def alphaLon(self) -> world.LongitudinalRssAccelerationValues: ... diff --git a/PythonAPI/carla/source/carla/ad/rss/unstructured.pyi b/PythonAPI/carla/source/carla/ad/rss/unstructured.pyi index 089c8644b33..3c60cdbab5a 100644 --- a/PythonAPI/carla/source/carla/ad/rss/unstructured.pyi +++ b/PythonAPI/carla/source/carla/ad/rss/unstructured.pyi @@ -1,3 +1,5 @@ +from ad import _Vector + class DebugDrawing: class DebugLine: @@ -81,125 +83,11 @@ class DebugDrawing: """ ... -class vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_: - def append(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_, arg2: DebugDrawing.DebugLine) -> None: - """ - - append( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_)arg1, (DebugLine)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::rss::unstructured::DebugDrawing::DebugLine) - """ - ... - - def extend(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_, arg2: object) -> None: - """ - - extend( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def insert(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_, arg2: int, arg3: DebugDrawing.DebugLine) -> None: - """ - - insert( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_)arg1, (int)arg2, (DebugLine)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::rss::unstructured::DebugDrawing::DebugLine) - """ - ... - - def reverse(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_) -> None: - """ - - reverse( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... - -class vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_: - def append(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_, arg2: DebugDrawing.DebugPoint) -> None: - """ - - append( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_)arg1, (DebugPoint)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::rss::unstructured::DebugDrawing::DebugPoint) - """ - ... - - def extend(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_, arg2: object) -> None: - """ - - extend( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def insert(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_, arg2: int, arg3: DebugDrawing.DebugPoint) -> None: - """ - - insert( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_)arg1, (int)arg2, (DebugPoint)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::rss::unstructured::DebugDrawing::DebugPoint) - """ - ... - - def reverse(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_) -> None: - """ - - reverse( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_)arg1) -> None : +class vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugLine_greater_(_Vector[DebugDrawing.DebugLine]): + ... - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... - -class vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_: - def append(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_, arg2: DebugDrawing.DebugPolygon) -> None: - """ - - append( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_)arg1, (DebugPolygon)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::rss::unstructured::DebugDrawing::DebugPolygon) - """ - ... +class vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPoint_greater_(_Vector[DebugDrawing.DebugPoint]): + ... - def extend(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_, arg2: object) -> None: - """ - - extend( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def insert(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_, arg2: int, arg3: DebugDrawing.DebugPolygon) -> None: - """ - - insert( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_)arg1, (int)arg2, (DebugPolygon)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::rss::unstructured::DebugDrawing::DebugPolygon) - """ - ... - - def reverse(self, arg1: vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_) -> None: - """ - - reverse( (vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... +class vector_less_ad_scope_rss_scope_unstructured_scope_DebugDrawing_scope_DebugPolygon_greater_(_Vector[DebugDrawing.DebugPolygon]): + ... diff --git a/PythonAPI/carla/source/carla/ad/rss/world.pyi b/PythonAPI/carla/source/carla/ad/rss/world.pyi index 8d28a562263..508fceeaf38 100644 --- a/PythonAPI/carla/source/carla/ad/rss/world.pyi +++ b/PythonAPI/carla/source/carla/ad/rss/world.pyi @@ -461,66 +461,8 @@ class Scene: @property def situationType(self) -> situation.SituationType: ... -class SceneVector(ad._Vector[Scene]): - def append(self, arg2: Scene) -> None: - """ - - append( (SceneVector)arg1, (Scene)arg2) -> None : - - C++ signature : - void append(std::vector > {lvalue},ad::rss::world::Scene) - """ - ... - - def count(self, arg2: Scene) -> int: - """ - - count( (SceneVector)arg1, (Scene)arg2) -> int : - - C++ signature : - unsigned long count(std::vector > {lvalue},ad::rss::world::Scene) - """ - ... - - def extend(self, arg2: object) -> None: - """ - - extend( (SceneVector)arg1, (object)arg2) -> None : - - C++ signature : - void extend(std::vector > {lvalue},boost::python::api::object) - """ - ... - - def index(self, arg2: Scene) -> int: - """ - - index( (SceneVector)arg1, (Scene)arg2) -> int : - - C++ signature : - unsigned long index(std::vector > {lvalue},ad::rss::world::Scene) - """ - ... - - def insert(self, arg2: int, arg3: Scene) -> None: - """ - - insert( (SceneVector)arg1, (int)arg2, (Scene)arg3) -> None : - - C++ signature : - void insert(std::vector > {lvalue},long,ad::rss::world::Scene) - """ - ... - - def reverse(self) -> None: - """ - - reverse( (SceneVector)arg1) -> None : - - C++ signature : - void reverse(std::vector > {lvalue}) - """ - ... +class SceneVector(ad._VectorSequence[Scene]): + ... class UnstructuredSettings: def assign(self, other: UnstructuredSettings) -> UnstructuredSettings: