Crate rubullet[−][src]
Expand description
A Rust interface for Bullet physics inspired by PyBullet.
Example
use std::{thread, time::Duration}; use anyhow::Result; use nalgebra::{Isometry3, Vector3}; use rubullet::*; fn main() -> Result<()> { let mut physics_client = PhysicsClient::connect(Mode::Gui)?; physics_client.set_additional_search_path("../rubullet-sys/bullet3/libbullet3/data")?; physics_client.set_gravity(Vector3::new(0.0, 0.0, -10.0)); let _plane_id = physics_client.load_urdf("plane.urdf", None)?; let cube_start_position = Isometry3::translation(0.0, 0.0, 1.0); let box_id = physics_client.load_urdf( "r2d2.urdf", UrdfOptions { base_transform: cube_start_position, ..Default::default() }, )?; for _ in 0..10000 { physics_client.step_simulation()?; thread::sleep(Duration::from_micros(4167)); } let cube_transform = physics_client.get_base_transform(box_id)?; println!("{}", cube_transform); Ok(()) }
Re-exports
pub use image; | |
pub use nalgebra; |
Modules
logging_utils | Contains methods and types which are useful for logging |
Structs
Aabb | axis-aligned minimum bounding box |
ActivationState | |
AddDebugLineOptions | Represents options for |
AddDebugTextOptions | Represents options for |
BodyId | The unique ID for a body within a physics server. |
BodyInfo | Contains the body name and base name of a Body. BodyInfo is returned by get_body_info |
CameraImageOptions | Options for |
ChangeConstraintOptions | contains the parameters for |
ChangeDynamicsOptions | Dynamics options for the |
ChangeVisualShapeOptions | This struct keeps the information to change a visual shape with the change_visual_shape method. |
CollisionId | The unique ID for a Collision Shape. |
ConstraintId | The unique ID for a constraint. |
ConstraintInfo | contains the parameters for |
ContactPoint | Is the result of the get_closest_points and get_contact_points methods. |
DebugVisualizerCameraInfo | Contains the state of the Gui camera.
Is returned by |
DynamicsInfo | Contains information about the mass, center of mass, friction and other properties of the base and links.
Is returned by |
Error | |
Images | Stores the images from |
InverseKinematicsNullSpaceParameters | Parameters for Inverse Kinematics using the Nullspace |
InverseKinematicsParameters | Parameters for the |
InverseKinematicsParametersBuilder | creates |
ItemId | The unique ID for a User Debug Parameter Item |
Jacobian | Specifies a jacobian with 6 rows. The jacobian is split into a linear part and an angular part. |
JointInfo | Contains basic information about a joint like its type and name. It can be obtained via
|
JointState | Represents the current state of a joint. It can be retrieved via |
KeyboardEvent | Represents a key press Event |
LinkState | Describes the State of a Link |
LoadModelFlags | Use flag for loading the model. Flags can be combined with the |
LogFlags | |
LogId | The unique ID for a Logging Object. |
MouseButtonState | Represents the different possible states of a mouse button |
MultiBodyOptions | Specifies all options for create_multi_body.
Most of the the time you are probably fine using |
OverlappingObject | Is the result of |
PhysicsClient | Connection to a physics server. |
PhysicsEngineParameters | See |
PhysicsServer | A PhysicsServer is actually a PhysicsClient which is run as a TCP Server and with
all methods apart from |
RayHitInfo | |
RayTestBatchOptions | Options for |
RayTestOptions | Options for |
RendererAuxFlags | flags for camera rendering |
ResetFlags | Experimental flags, best to ignore. |
SdfOptions | Options for loading models from an SDF file into the physics server. |
SetPhysicsEngineParameterOptions | Options for the |
SoftBodyOptions | options for |
StateId | The unique ID for a State Object. |
StateLoggingOptions | |
TextureId | The unique ID for a Texture |
UrdfOptions | Options for loading a URDF into the physics server. |
Velocity | Contains the cartesian velocity stored as Vector with 6 elements (x,y,z,wx,wy,wz). |
VisualId | The unique ID for a Visual Shape |
VisualShapeData | Contains information about the visual shape of a body. It is returned by get_visual_shape_data |
VisualShapeFlags | Experimental flags, best to ignore. |
VisualShapeOptions | VisualShape options are for the create_visual_shape function to specify additional options like the color. |
Enums
BodyType | |
ConstraintSolverType | |
ControlCommand | The ControlCommand specifies how the robot should move (Position Control, Velocity Control, Torque Control)
Each type of ControlCommand has its own set of Parameters. The Position mode for example takes a desired joint
position as input. It can be used in |
ControlCommandArray | Can be used in |
DebugVisualizerFlag | Flags for |
ExternalForceFrame | Frame for |
GeometricCollisionShape | Collision shape which can be put the create_collision_shape method |
GeometricVisualShape | Visual shapes to put into the create_visual_shape method together with VisualShapeOptions |
IkSolver | Specifies which Inverse Kinematics Solver to use in
|
JointFeedbackMode | Specifies joint feedback frame. Is used in
|
JointType | An enum to represent different types of joints |
LoggingType | |
Mode | Ways to connect to physics clients. |
MouseEvent | Mouse Events can either be a “Move” or a “Button” event. A “Move” event is when the mouse is moved in the OpenGL window and a “Button” even is when a mouse button is clicked. |
Renderer | |
ServerMode | Choose which type of server you want. |