| Crates.io | bevy_urdf |
| lib.rs | bevy_urdf |
| version | 0.4.3 |
| created_at | 2025-03-21 08:14:36.659342+00 |
| updated_at | 2025-09-02 14:11:57.123439+00 |
| description | Import robots from URDF files and run simulation with rapier. |
| homepage | |
| repository | https://github.com/stillonearth/bevy_urdf |
| max_upload_size | |
| id | 1600270 |
| size | 22,515,589 |
A Bevy plugin for importing robots from URDF files and running physics simulations. Ground vehicles use Rapier physics, while drones are simulated using integrated dynamics models.
A Bevy plugin for loading and simulating robots from URDF files.
[dependencies]
bevy_urdf = "0.4"
use bevy::prelude::*;
use bevy_urdf::{UrdfPlugin, StlPlugin, ObjPlugin};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins((UrdfPlugin, StlPlugin, ObjPlugin))
.run();
}
use bevy_urdf::{LoadRobot, RobotLoaded, SpawnRobot, RobotType};
fn setup(mut load_robot_events: EventWriter<LoadRobot>) {
load_robot_events.send(LoadRobot {
urdf_path: "robots/robot.urdf".to_string(),
mesh_dir: "assets/robots".to_string(),
});
}
fn spawn_robot(
mut robot_loaded_events: EventReader<RobotLoaded>,
mut spawn_robot_events: EventWriter<SpawnRobot>,
) {
for event in robot_loaded_events.read() {
spawn_robot_events.send(SpawnRobot {
handle: event.handle.clone(),
mesh_dir: event.mesh_dir.clone(),
robot_type: RobotType::NotDrone, // or UAV, UUV, Manipulator
});
}
}
Motor Velocities (ground robots)
ControlMotorVelocities {
handle: robot_handle,
velocities: vec![1.0, -1.0, 0.5],
}
Motor Positions (manipulators)
ControlMotorPositions {
handle: robot_handle,
positions: vec![0.5, 1.2, -0.3],
motor_props: motor_properties,
}
Thrusts (drones)
ControlThrusts {
handle: robot_handle,
thrusts: vec![10.0, 10.0, 10.0, 10.0],
}
Sensor Reading
SensorsRead {
handle: robot_handle,
transforms: link_transforms,
joint_angles: current_angles,
}
meshes/part.stlpackage:// URIscargo run --example uav --release
cargo run --example uuv --release
cargo run --example quadruped --release
cargo run --example manipulator --release