mrpt.obs

mrpt.obs — Python bindings for MRPT sensor observations and actions.

Package Contents

class mrpt.obs.CAction

C++ API: class mrpt::obs::CAction

Bases: mrpt.serialization.CSerializable

timestamp: datetime.timedelta
GetRuntimeClass() → mrpt.rtti.TRuntimeClassId
class mrpt.obs.CActionCollection

C++ API: class mrpt::obs::CActionCollection

Bases: mrpt.serialization.CSerializable

clear() → None
get(arg0: int) → CAction
getBestMovementEstimation() → CActionRobotMovement2D

Returns the CActionRobotMovement2D with the best estimation method, or None

insert(arg0: CAction) → None
size() → int
class mrpt.obs.CActionRobotMovement2D

C++ API: class mrpt::obs::CActionRobotMovement2D

Bases: CAction

class TDrawSampleMotionModel(value: int)

Members:

mmGaussian

mmThrun

property name: str
property value: int
mmGaussian: ClassVar[CActionRobotMovement2D]
mmThrun: ClassVar[CActionRobotMovement2D]
class TEstimationMethod(value: int)

Members:

emOdometry

emScan2DMatching

property name: str
property value: int
emOdometry: ClassVar[CActionRobotMovement2D]
emScan2DMatching: ClassVar[CActionRobotMovement2D]
class TMotionModelOptions
class TOptions_GaussianModel
class TOptions_GaussianModel(a1: float, a2: float, a3: float, a4: float, minStdXY: float, minStdPHI: float)
a1: float
a2: float
a3: float
a4: float
minStdPHI: float
minStdXY: float
class TOptions_ThrunModel
additional_std_XY: float
additional_std_phi: float
alfa1_rot_rot: float
alfa2_rot_trans: float
alfa3_trans_trans: float
alfa4_trans_rot: float
nParticlesCount: int
gaussianModel: CActionRobotMovement2D
modelSelection: CActionRobotMovement2D
thrunModel: CActionRobotMovement2D
property poseChange: mrpt.poses.CPosePDF

The 2D pose change probabilistic estimation (a CPosePDF)

property rawOdometryIncrementReading: mrpt.poses.CPose2D

Raw odometry reading (increment since last step)

emOdometry: ClassVar[CActionRobotMovement2D]
emScan2DMatching: ClassVar[CActionRobotMovement2D]
estimationMethod: CActionRobotMovement2D
hasVelocities: bool
mmGaussian: ClassVar[CActionRobotMovement2D]
mmThrun: ClassVar[CActionRobotMovement2D]
motionModelConfiguration: CActionRobotMovement2D
velocityLocal: mrpt.math.TTwist2D
GetRuntimeClass() → mrpt.rtti.TRuntimeClassId
computeFromOdometry(odometryIncrement: mrpt.poses.CPose2D, options: CActionRobotMovement2D) → None

Computes poseChange from an odometry increment and a motion model

drawSingleSample() → mrpt.poses.CPose2D

Draws a sample from the motion model

class mrpt.obs.CActionRobotMovement3D

C++ API: class mrpt::obs::CActionRobotMovement3D

Bases: CAction

class TMotionModelOptions
class TOptions_6DOFModel
a1: float
a10: float
a2: float
a3: float
a4: float
a5: float
a6: float
a7: float
a8: float
a9: float
additional_std_XYZ: float
additional_std_angle: float
nParticlesCount: int
mm6DOFModel: CActionRobotMovement3D
property poseChange: mrpt.poses.CPose3DPDFGaussian

Pose change as a CPose3DPDFGaussian

rawOdometryIncrementReading: mrpt.poses.CPose3D
computeFromOdometry(odometryIncrement: mrpt.poses.CPose3D, options: CActionRobotMovement3D) → None

Computes poseChange from an odometry increment and a motion model

class mrpt.obs.CObservation

C++ API: class mrpt::obs::CObservation

Bases: mrpt.serialization.CSerializable

sensorLabel: str
timestamp: datetime.timedelta
GetRuntimeClass() → mrpt.rtti.TRuntimeClassId
getSensorPose() → mrpt.poses.CPose3D

Returns the sensor pose (6D) relative to the robot

getTimeStamp() → datetime.timedelta
load() → None

Loads externally-stored data (e.g. images), if any

unload() → None

Frees externally-stored data from memory, if any

class mrpt.obs.CObservation2DRangeScan

C++ API: class mrpt::obs::CObservation2DRangeScan

Bases: CObservation

property aperture: float

Field-of-view in radians

property maxRange: float

Maximum sensor range in meters

property rightToLeft: bool

Scan direction: True=CCW, False=CW

property sensorPose: mrpt.poses.CPose3D

Sensor 6D pose relative to robot base

getScanRange(arg0: int) → float
getScanRangeValidity(arg0: int) → bool
getScanRangesAsNumpy() → numpy.ndarray

Returns all scan ranges as a 1D float32 numpy array

getScanSize() → int
getValidRangesAsNumpy() → numpy.ndarray

Returns validity flags as a 1D bool numpy array

resizeScan(arg0: int) → None
setScanRange(arg0: int, arg1: float) → None
setScanRangeValidity(arg0: int, arg1: bool) → None
class mrpt.obs.CObservation3DRangeScan

C++ API: class mrpt::obs::CObservation3DRangeScan

Bases: CObservation

property cameraParams: mrpt.img.TCamera

Depth camera intrinsics

property cameraParamsIntensity: mrpt.img.TCamera

Intensity camera intrinsics

property rangeUnits: float

Meters per unit in the raw range image

property range_is_depth: bool

True: ranges are depth (Z); False: distances along each pixel ray

confidenceImage: mrpt.img.CImage
hasConfidenceImage: bool
hasIntensityImage: bool
hasPoints3D: bool
hasRangeImage: bool
intensityImage: mrpt.img.CImage
maxRange: float
relativePoseIntensityWRTDepth: mrpt.poses.CPose3D
sensorPose: mrpt.poses.CPose3D
stdError: float
getPoints3DAsNumpy() → numpy.ndarray

Returns the 3D points as an Nx3 float32 array (see unprojectInto())

getRangeImageAsNumpy() → numpy.ndarray

Returns the range image as an HxW float32 array, in meters (0 = invalid)

getRangeImageRawAsNumpy() → numpy.ndarray

Returns the raw range image as an HxW uint16 array (multiply by rangeUnits for meters)

getScanSize() → int

Number of 3D points (if hasPoints3D)

setRangeImageFromNumpy(ranges: numpy.ndarray) → None

Sets the range image from an HxW array of ranges in meters. NaN or infinite values are stored as 0 (invalid).

unprojectInto(params: T3DPointsProjectionParams = ...) → None

Computes the 3D points (points3D_*) from the range image and camera intrinsics

class mrpt.obs.CObservationGPS

C++ API: class mrpt::obs::CObservationGPS

Bases: CObservation

property covariance_enu: mrpt.math.CMatrixDouble33 | None

Optional 3x3 ENU position covariance (m^2), or None

fix_type: GnssFixType
has_satellite_timestamp: bool
originalReceivedTimestamp: datetime.timedelta
sensorPose: mrpt.poses.CPose3D
clear() → None

Removes all GNSS messages

getGGA() → gnss.Message_NMEA_GGA | None

Returns a copy of the NMEA GGA message, or None

getRMC() → gnss.Message_NMEA_RMC | None

Returns a copy of the NMEA RMC message, or None

hasGGA() → bool

True if the observation has an NMEA GGA message

hasRMC() → bool

True if the observation has an NMEA RMC message

setGGA(msg: gnss.Message_NMEA_GGA) → None

Stores (or replaces) the NMEA GGA message

setRMC(msg: gnss.Message_NMEA_RMC) → None

Stores (or replaces) the NMEA RMC message

class mrpt.obs.CObservationIMU

C++ API: class mrpt::obs::CObservationIMU

Bases: CObservation

get(arg0: Any) → float
getRawMeasurementsAsNumpy() → numpy.ndarray

Returns raw IMU measurements as 1D float64 numpy array

set(arg0: Any, arg1: float) → None
class mrpt.obs.CObservationImage

C++ API: class mrpt::obs::CObservationImage

Bases: CObservation

cameraParams: mrpt.img.TCamera
cameraPose: mrpt.poses.CPose3D
image: mrpt.img.CImage
class mrpt.obs.CObservationOdometry

C++ API: class mrpt::obs::CObservationOdometry

Bases: CObservation

odometry: mrpt.poses.CPose2D
class mrpt.obs.CObservationRobotPose

C++ API: class mrpt::obs::CObservationRobotPose

Bases: CObservation

pose: mrpt.poses.CPose3DPDFGaussian
class mrpt.obs.CRawlog

C++ API: class mrpt::obs::CRawlog

Bases: mrpt.serialization.CSerializable

class TEntryType(value: int)

Members:

etSensoryFrame

etActionCollection

etObservation

etOther

property name: str
property value: int
etActionCollection: ClassVar[CRawlog]
etObservation: ClassVar[CRawlog]
etOther: ClassVar[CRawlog]
etSensoryFrame: ClassVar[CRawlog]
etActionCollection: ClassVar[CRawlog]
etObservation: ClassVar[CRawlog]
etOther: ClassVar[CRawlog]
etSensoryFrame: ClassVar[CRawlog]
static ReadFromArchive(archive: mrpt.serialization.CArchive, entry: int = 0) → tuple

Reads the next entry from a rawlog stream (see mrpt.io.archiveFrom()). Returns (readOk, nextEntryIndex, actions, sensoryFrame, observation): either (actions, sensoryFrame) or observation are None, depending on the rawlog format. readOk is False at the end of the stream.

clear() → None
static detectImagesDirectory(rawlogFilename: str) → str

Returns the directory of externally-stored images for a given rawlog file

empty() → bool
getAsAction(index: int) → CActionCollection

Returns entry i as a CActionCollection. Raises if it has a different type.

getAsGeneric(index: int) → mrpt.serialization.CSerializable

Returns entry i, whatever its type

getAsObservation(index: int) → CObservation

Returns entry i as a CObservation. Raises if it has a different type.

getAsObservations(index: int) → CSensoryFrame

Returns entry i as a CSensoryFrame. Raises if it has a different type.

getCommentText() → str

Returns the embedded comment text, if any

getType(index: int) → CRawlog
insert(obj: mrpt.serialization.CSerializable) → None

Appends an object (CSensoryFrame, CActionCollection, CObservation, …). The object is stored by reference, not copied.

loadFromRawLogFile(fileName: str, non_obs_objects_are_legal: bool = False) → bool

Loads a .rawlog file (possibly compressed). Returns False on error.

remove(index: int) → None
saveToRawLogFile(fileName: str) → bool

Saves to a .rawlog file. Returns False on error.

setCommentText(text: str) → None
size() → int
class mrpt.obs.CSensoryFrame

C++ API: class mrpt::obs::CSensoryFrame

Bases: mrpt.serialization.CSerializable

clear() → None
insert(arg0: CObservation) → None
size() → int
class mrpt.obs.CSimpleMap

Bases: mrpt.serialization.CSerializable

class Keyframe
class Keyframe(pose: mrpt.poses.CPose3DPDF, sf: CSensoryFrame, localTwist: mrpt.math.TTwist3D | None = None)
localTwist: mrpt.math.TTwist3D | None
pose: mrpt.poses.CPose3DPDF
sf: CSensoryFrame
changeCoordinatesOrigin(newOrigin: mrpt.poses.CPose3D) → None

Transforms all keyframe poses so the old origin becomes newOrigin

clear() → None
empty() → bool
get(index: int) → CSimpleMap
insert(pose: mrpt.poses.CPose3DPDF, sf: CSensoryFrame, localTwist: mrpt.math.TTwist3D | None = None) → None
insert(keyframe: CSimpleMap) → None
loadFromFile(fileName: str) → bool

Loads a .simplemap file (possibly compressed). Returns False on error.

remove(index: int) → None
saveToFile(fileName: str) → bool

Saves to a .simplemap file. Returns False on error.

size() → int
class mrpt.obs.GnssFixType(value: int)

Members:

UNKNOWN

NO_FIX

AUTONOMOUS

SBAS

GBAS

DGPS

RTK_FLOAT

RTK_FIXED

PPP

DEAD_RECKONING

SIMULATION

property name: str
property value: int
AUTONOMOUS: ClassVar[GnssFixType]
DEAD_RECKONING: ClassVar[GnssFixType]
DGPS: ClassVar[GnssFixType]
GBAS: ClassVar[GnssFixType]
NO_FIX: ClassVar[GnssFixType]
PPP: ClassVar[GnssFixType]
RTK_FIXED: ClassVar[GnssFixType]
RTK_FLOAT: ClassVar[GnssFixType]
SBAS: ClassVar[GnssFixType]
SIMULATION: ClassVar[GnssFixType]
UNKNOWN: ClassVar[GnssFixType]
class mrpt.obs.T3DPointsProjectionParams

C++ API: struct mrpt::obs::T3DPointsProjectionParams

MAKE_ORGANIZED: bool
decimation: int
layer: str
robotPoseInTheWorld: mrpt.poses.CPose3D | None
takeIntoAccountSensorPoseOnRobot: bool
class mrpt.obs.TIMUDataIndex(value: int)

Members:

IMU_X_ACC

IMU_Y_ACC

IMU_Z_ACC

IMU_YAW_VEL

IMU_WZ

IMU_PITCH_VEL

IMU_WY

IMU_ROLL_VEL

IMU_WX

IMU_X_VEL

IMU_Y_VEL

IMU_Z_VEL

IMU_YAW

IMU_PITCH

IMU_ROLL

IMU_X

IMU_Y

IMU_Z

IMU_MAG_X

IMU_MAG_Y

IMU_MAG_Z

IMU_PRESSURE

IMU_ALTITUDE

IMU_TEMPERATURE

IMU_ORI_QUAT_X

IMU_ORI_QUAT_Y

IMU_ORI_QUAT_Z

IMU_ORI_QUAT_W

IMU_YAW_VEL_GLOBAL

IMU_PITCH_VEL_GLOBAL

IMU_ROLL_VEL_GLOBAL

IMU_X_ACC_GLOBAL

IMU_Y_ACC_GLOBAL

IMU_Z_ACC_GLOBAL

property name: str
property value: int
IMU_ALTITUDE: ClassVar[TIMUDataIndex]
IMU_MAG_X: ClassVar[TIMUDataIndex]
IMU_MAG_Y: ClassVar[TIMUDataIndex]
IMU_MAG_Z: ClassVar[TIMUDataIndex]
IMU_ORI_QUAT_W: ClassVar[TIMUDataIndex]
IMU_ORI_QUAT_X: ClassVar[TIMUDataIndex]
IMU_ORI_QUAT_Y: ClassVar[TIMUDataIndex]
IMU_ORI_QUAT_Z: ClassVar[TIMUDataIndex]
IMU_PITCH: ClassVar[TIMUDataIndex]
IMU_PITCH_VEL: ClassVar[TIMUDataIndex]
IMU_PITCH_VEL_GLOBAL: ClassVar[TIMUDataIndex]
IMU_PRESSURE: ClassVar[TIMUDataIndex]
IMU_ROLL: ClassVar[TIMUDataIndex]
IMU_ROLL_VEL: ClassVar[TIMUDataIndex]
IMU_ROLL_VEL_GLOBAL: ClassVar[TIMUDataIndex]
IMU_TEMPERATURE: ClassVar[TIMUDataIndex]
IMU_WX: ClassVar[TIMUDataIndex]
IMU_WY: ClassVar[TIMUDataIndex]
IMU_WZ: ClassVar[TIMUDataIndex]
IMU_X: ClassVar[TIMUDataIndex]
IMU_X_ACC: ClassVar[TIMUDataIndex]
IMU_X_ACC_GLOBAL: ClassVar[TIMUDataIndex]
IMU_X_VEL: ClassVar[TIMUDataIndex]
IMU_Y: ClassVar[TIMUDataIndex]
IMU_YAW: ClassVar[TIMUDataIndex]
IMU_YAW_VEL: ClassVar[TIMUDataIndex]
IMU_YAW_VEL_GLOBAL: ClassVar[TIMUDataIndex]
IMU_Y_ACC: ClassVar[TIMUDataIndex]
IMU_Y_ACC_GLOBAL: ClassVar[TIMUDataIndex]
IMU_Y_VEL: ClassVar[TIMUDataIndex]
IMU_Z: ClassVar[TIMUDataIndex]
IMU_Z_ACC: ClassVar[TIMUDataIndex]
IMU_Z_ACC_GLOBAL: ClassVar[TIMUDataIndex]
IMU_Z_VEL: ClassVar[TIMUDataIndex]
class mrpt.obs.TMapGenericParams

Bases: mrpt.config.CLoadableOptions, mrpt.serialization.CSerializable

enableObservationInsertion: bool
enableObservationLikelihood: bool
enableSaveAs3DObject: bool
class mrpt.obs.TMetricMapInitializer

Bases: mrpt.config.CLoadableOptions

genericMapParams: TMapGenericParams
static factory(mapClassName: str) → TMetricMapInitializer

Creates the definition of a map by its class name, e.g. ‘COccupancyGridMap2D’. Requires importing mrpt.maps first, which registers the map types.

getMetricMapClassName() → str

Returns the C++ class name of the map this definition creates

class mrpt.obs.TSetOfMetricMapInitializers

Bases: mrpt.config.CLoadableOptions

clear() → None
push_back(mapDefinition: TMetricMapInitializer) → None
size() → int