DroneEntity(无人机实体)#

class genesis.engine.entities.rigid_entity.drone_entity.DroneEntity(scene: Scene, solver: RigidSolver, idx: int, desc: RigidEntityDescription)[source]#

Bases: RigidEntity

set_propellers_rpm(propellers_rpm)[source]#

Set the RPM (revolutions per minute) for each propeller in the drone.

Parameters:

propellers_rpm (array-like or torch.Tensor) – A tensor or array of shape (n_propellers,) or (n_envs, n_propellers) specifying the desired RPM values for each propeller. Must be non-negative.

Raises:

RuntimeError – If the method is called more than once per simulation step, or if the input shape does not match the number of propellers, or contains negative values.

update_propeller_vgeoms()[source]#

Update the visual geometry of the propellers for animation based on their current rotation.

This method is a no-op if animation is disabled due to missing visual geometry.

property model#

The model type of the drone.

property KF#

The drone’s thrust coefficient.

property KM#

The drone’s moment coefficient.

property n_propellers#

The number of propellers on the drone.

The index of the center-of-mass (COM) link of the drone.

property propellers_idx#

The indices of the drone’s propeller links.

property propellers_spin#

The spin direction for each propeller.