mrpt.kinematics
mrpt.kinematics — Vehicle kinematic models and simulators.
- Provides:
CVehicleVelCmd_DiffDriven : Velocity command for differential-drive robots
CVehicleVelCmd_Holo : Velocity command for holonomic robots
CVehicleSimulVirtualBase : Abstract base for vehicle simulators
CVehicleSimul_DiffDriven : Differential-drive robot simulator
CVehicleSimul_Holo : Holonomic robot simulator
Example — simulate a diff-drive robot:
import mrpt.kinematics as kin
import mrpt.math
robot = kin.CVehicleSimul_DiffDriven()
robot.movementCommand(lin_vel=0.5, ang_vel=0.1)
for _ in range(100):
robot.simulateOneTimeStep(dt=0.01)
pose = robot.getCurrentGTPose()
print(f"Pose: ({pose.x:.3f}, {pose.y:.3f}, {pose.phi:.3f})")
Package Contents
- class mrpt.kinematics.CVehicleSimulVirtualBase
C++ API: class mrpt::kinematics::CVehicleSimulVirtualBase
- getCurrentGTPose() mrpt.math.TPose2D
Get current ground-truth pose (x, y, phi)
- getCurrentOdometricPose() mrpt.math.TPose2D
Get current odometric (noisy) pose (x, y, phi)
- setCurrentGTPose(pose: mrpt.math.TPose2D) None
- setCurrentOdometricPose(pose: mrpt.math.TPose2D) None
- simulateOneTimeStep(dt: float) None
Advance simulation by dt seconds
- class mrpt.kinematics.CVehicleSimul_DiffDriven
C++ API: class mrpt::kinematics::CVehicleSimul_DiffDriven
Bases:
CVehicleSimulVirtualBase- movementCommand(lin_vel: float, ang_vel: float) None
Set velocity command: linear (m/s) and angular (rad/s)
- class mrpt.kinematics.CVehicleSimul_Holo
C++ API: class mrpt::kinematics::CVehicleSimul_Holo
Bases:
CVehicleSimulVirtualBase- sendVelRampCmd(vel: float, dir: float, ramp_time: float, rot_speed: float) None
Send a velocity ramp command to the holonomic robot
- class mrpt.kinematics.CVehicleVelCmd_DiffDriven
C++ API: class mrpt::kinematics::CVehicleVelCmd_DiffDriven
- property ang_vel: float
Angular velocity (rad/s)
- property lin_vel: float
Linear velocity (m/s)
- isStopCmd() bool
- setToStop() None
- class mrpt.kinematics.CVehicleVelCmd_Holo
C++ API: class mrpt::kinematics::CVehicleVelCmd_Holo
CVehicleVelCmd_Holo(vel: float, dir_local: float, ramp_time: float, rot_speed: float)
- property dir_local: float
Direction relative to robot heading (radians)
- property ramp_time: float
Blending time (seconds)
- property rot_speed: float
Rotational speed for heading correction (rad/s)
- property vel: float
Linear speed (m/s)
- isStopCmd() bool
- setToStop() None