rsbullet 0.4.0

Compiles bullet3 and exposes rust bindings to the C API
docs.rs failed to build rsbullet-0.4.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rsbullet-0.3.11

Readme

This project is a fork of the rubullet project. As the original repository has not been updated for over five years, further maintenance, updates, and customization requirements are being carried out here. The readme file of the original warehouse can be found README_ORIGIN.md.

Compared to the 100 APIs implemented in the original library, we have additionally implemented all the APIs in pybullet 3.2.7. This enables you to smoothly migrate from pybullet to rsbullet, simply by changing the API names to snake_case. you can read API documentation in the RSBULLET_API_REFERENCE.md.

Overview

PhysicsClient : do everything PyBullet can do

In Rsbullet you can use the PhysicsClient to get features similar to those in PyBullet:

  • Create a PhysicsClient in Direct, Gui or other modes
  • Load models from URDF, SDF, MuJoCo or Bullet files
  • Create own models within the simulation
  • Control robots in position, velocity or torque mode
  • Calculate inverse dynamics, inverse kinematics, jacobians and mass matrices
  • Render camera images
  • Read information about links and joints
  • Change dynamics of a body
  • Create GUI sliders, buttons or put debugging text or lines in the simulation
  • Get keyboard and mouse events
  • Create and manage constraints
  • Logging
  • Saving states and loading states
  • Set physics engine parameters
  • Collision Detection Queries
  • Deformables and Cloth
  • Everything MultiDOF related
  • Virtual Reality
  • Plugins

We have prepared a series of examples which can be referred to examples.Some of the examples are exactly the same as those in pubullet, which can serve as a standard reference for your migration.

Rsbullet : more features. User-friendly, Simple-interface, Abstraction and More Rustly

Furthermore, we have provided RsBullet to achieve functions that Pybullet does not have, in order to fully adapt to the features and convenience brought by Rust.

A examples of Rsbullet features:

use libjaka::JakaMini2;
use robot_behavior::behavior::*;
use rsbullet::{Mode, RsBullet};

fn main() -> Result<()> {
    let mut physics = RsBullet::new(Mode::Gui)?;
    physics
        .set_additional_search_path("E:\\yixing\\code\\Robot-Exp\\drives\\asserts")?
        .set_gravity([0., 0., -10.])?
        .set_step_time(Duration::from_secs_f64(1. / 240.))?;

    let mut robot_1 = physics
        .robot_builder::<JakaMini2>("robot_1")
        .base([0.0, 0.2, 0.0])
        .base_fixed(true)
        .load()?;

    // a s-curve motion
    robot_1 = robot_1
        .with_joint_vel([5.; 6])
        .with_joint_acc([2.; 6]);
    Motion::move_to::<JointSpace<6>>(&mut robot_1, [0.; 6])?;
    
    loop {
        physics.step()?;
        sleep(Duration::from_secs_f64(0.01));
    }
}

In Pybullet, to control a robot, you need to get the robot's unique ID first, and then call various functions with the ID as a parameter. In Rsbullet, you can directly create a robot object through the robot_builder method of Rsbullet, and then call the robot's methods in robot_behavior to control it. The robot object will automatically manage its own ID internally, making it more convenient to use.

Enjoy it!

Build-time example assets

Set BULLET_SKIP_ASSET_EXPORT=1 for checks, CI, or builds that do not need example assets copied into the user data directory. Otherwise the build script creates the bullet asset directory only when it is absent. Existing directories, files, and symlinks at that path are preserved; builds never clear them.

Optional roplat rhythm

The default rsbullet build exposes the simulator and robot APIs without compiling roplat. Enable features = ["roplat"] to use SimRhythm. Tokio remains a normal dependency because robot motion futures also use its timers. The feature changes integration availability, not simulator stepping semantics.

cargo check -p rsbullet --no-default-features --features roplat --lib

The current Git source prepares rsbullet / rsbullet-core 0.4.0 and rsbullet_sys 0.3.2; these versions have not been uploaded to crates.io. The previously published 0.3.11 package must not be assumed to contain this feature. For an application, select the reviewed Git revision of this repository and enable roplat.

The manifest retains complete dependency declarations so the RsBullet repository can be built independently of the parent drives workspace.