smarts.core.chassis module
- class smarts.core.chassis.AckermannChassis(pose: Pose, bullet_client: bc.BulletClient, vehicle_dynamics_filepath: str | None = '/home/docs/checkouts/readthedocs.org/user_builds/smarts/envs/latest/lib/python3.8/site-packages/smarts/assets/vehicles/dynamics_model/generic_sedan.urdf', tire_parameters_filepath: str | None = None, friction_map: Sequence[Dict[str, Any]] | None = None, controller_parameters: Dict[str, Any] = {'derivative_activation': 1, 'final_heading_error_derivative_gain': 3.1, 'final_heading_gain': 0.15, 'final_lateral_error_derivative_gain': 0.3, 'final_lateral_gain': 4.65, 'final_steering_filter_constant': 23.5, 'initial_look_ahead_distant': 6, 'speed_reduction_activation': 1, 'throttle_filter_constant': 22.5, 'traction_gain': 6, 'velocity_damping_gain': 0.001, 'velocity_gain': 5.1, 'velocity_integral_gain': 0, 'windup_gain': 0.01}, chassis_parameters: Dict[str, Any] = {'chassis_aero_force_gain': 0.63, 'max_brake_gain': 10000, 'max_btorque': 1400, 'max_steering': 12.56, 'max_torque': 1600, 'max_turn_radius': 2.2, 'steering_gear_ratio': 17.4, 'wheel_radius': 0.31265}, initial_speed: float | None = None)[source]
Control a vehicle by applying forces on its joints. The joints and links are defined by a URDF file.
- property approx_max_speed
This is the scientifically discovered maximum speed of this vehicle model
- property bullet_client
The bullet physics simulator.
- property bullet_id: str
The physics id of the chassis physics body.
- property contact_points
The contact point of the chassis.
- control(throttle=0, brake=0, steering=0)[source]
Apply throttle [0, 1], brake [0, 1], and steering [-1, 1] values for this time-step.
- property controller_parameters
The current controller parameters for this chassis.
- property dimensions
The fitted front aligned dimensions of the chassis.
- property front_rear_axle_CG_distance
The axle offsets from the vehicle base.
- property front_rear_stiffness
The front and rear stiffness values of the tires on this chassis.
- property front_track_width
The track width between the front wheels.
- property longitudinal_lateral_speed
Returns speed in m/s.
- property mass_and_inertia
The mass and inertia values of this chassis.
- property max_btorque
The maximum break torque.
- property max_steering_wheel
Maximum steering output for the current gear ratio.
- property max_torque
The maximum throttle torque.
- property rear_track_width
The track width between the back wheels.
- set_pose(pose: Pose)[source]
Use with caution since it disrupts the physics simulation. Sets the pose of the chassis.
- property speed: float
Returns speed in m/s.
- state_override(dt: float, force_pose: Pose, linear_velocity: ndarray | None = None, angular_velocity: ndarray | None = None)[source]
Use with care! In essence, this is tinkering with the physics of the world, and may have unintended behavioral or performance consequences.
- property steering
Current steering value in radians.
- property steering_ratio
The steering gear ratio
- property velocity_vectors
Returns linear velocity vector in m/s and angular velocity in rad/sec.
- property wheel_radius
The wheel radius of the wheels on the chassis.
- property yaw_rate: float
Returns 2-D rotational speed in rad/sec.
- class smarts.core.chassis.BoxChassis(pose: Pose, speed: float, dimensions: Dimensions, bullet_client: bc.BulletClient)[source]
Control a vehicle by setting its absolute position and heading. The collision shape of the vehicle is a box of the provided dimensions.
- property bullet_id: str
The physics id of the chassis physics body.
- property contact_points: Sequence
The contact point of the chassis.
- property dimensions: Dimensions
The fitted front aligned dimensions of the chassis.
- set_pose(pose: Pose)[source]
Use with caution since it disrupts the physics simulation. Sets the pose of the chassis.
- property speed: float
The speed of the chassis in the facing direction of the chassis.
- state_override(dt: float, force_pose: Pose, linear_velocity: ndarray | None = None, angular_velocity: ndarray | None = None)[source]
Use with care! In essence, this is tinkering with the physics of the world, and may have unintended behavioral or performance consequences.
- property steering
The steering value of the chassis in radians [-math.pi, math.pi].
- property velocity_vectors
Returns linear velocity vector in m/s and angular velocity in rad/sec.
- property yaw_rate: float | None
The turning rate of the chassis in radians.
- class smarts.core.chassis.Chassis[source]
Represents a vehicle chassis.
- property bullet_id: str
The physics id of the chassis physics body.
- property contact_points: Sequence
The contact point of the chassis.
- property dimensions: Dimensions
The fitted front aligned dimensions of the chassis.
- set_pose(pose: Pose)[source]
Use with caution since it disrupts the physics simulation. Sets the pose of the chassis.
- property speed: float
The speed of the chassis in the facing direction of the chassis.
- state_override(dt: float, force_pose: Pose, linear_velocity: ndarray | None = None, angular_velocity: ndarray | None = None)[source]
Use with care! In essence, this is tinkering with the physics of the world, and may have unintended behavioral or performance consequences.
- property steering: float
The steering value of the chassis in radians [-math.pi, math.pi].
- property to_polygon: Polygon
Convert the chassis to a 2D shape.
- property velocity_vectors: Tuple[ndarray, ndarray]
Returns linear velocity vector in m/s and angular velocity in rad/sec.
- property yaw_rate: float
The turning rate of the chassis in radians.