Struct rubullet::LinkState [−][src]
pub struct LinkState { pub world_pose: Isometry3<f64>, pub local_inertial_pose: Isometry3<f64>, pub world_link_frame_pose: Isometry3<f64>, pub world_velocity: Option<Velocity>, }
Expand description
Describes the State of a Link
Kind of Frames
world_frame
- center of masslocal_intertial_frame
- offset to the CoM expressed in the URDF link frameworld_link_frame
- URDF link frame
Relationships between Frames
urdfLinkFrame = comLinkFrame * localInertialFrame.inverse()
use rubullet::{PhysicsClient, UrdfOptions}; use nalgebra::Isometry3; use rubullet::Mode::Direct; use anyhow::Result; fn main() -> Result<()> { let mut client = PhysicsClient::connect(Direct)?; client.set_additional_search_path( "../rubullet-sys/bullet3/libbullet3/examples/pybullet/gym/pybullet_data", )?; let panda_id = client.load_urdf("franka_panda/panda.urdf", UrdfOptions::default())?; let link_state = client.get_link_state(panda_id, 11, true, true)?; // urdfLinkFrame = comLinkFrame * localInertialFrame.inverse() let urdf_frame = link_state.world_pose * link_state.local_inertial_pose.inverse(); // print both frames to see that they are about the same println!("{}", link_state.world_link_frame_pose); println!("{}", urdf_frame); // as they are both almost the same calculating the difference: // urdfLinkFrame.inverse() * world_link_frame_pose // should return something very close the identity matrix I. let identity = urdf_frame.inverse() * link_state.world_link_frame_pose; assert!(identity.translation.vector.norm() < 1e-7); assert!(identity.rotation.angle() < 1e-7); Ok(()) }
See also
Fields
world_pose: Isometry3<f64>
Cartesian pose of the center of mass
local_inertial_pose: Isometry3<f64>
local offset of the inertial frame (center of mass) express in the URDF link frame
world_link_frame_pose: Isometry3<f64>
world pose of the URDF link frame
world_velocity: Option<Velocity>
Cartesian world linear velocity.
Implementations
conveniently returns the linear world velocity or an error if the velocity was not calculated
for the LinkState. Be sure to set compute_link_velocity
to true in
get_link_state()
conveniently returns the angular world velocity or an error if the velocity was not calculated
for the LinkState. Be sure to set compute_link_velocity
to true in
get_link_state()
conveniently returns the world velocity or an error if the velocity was not calculated
for the LinkState. Be sure to set compute_link_velocity
to true in
get_link_state()
conveniently returns the world velocity vector (x,y,z,wx,w,wz) or an error if the velocity was not calculated
for the LinkState. Be sure to set compute_link_velocity
to true in
get_link_state()
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LinkState
impl UnwindSafe for LinkState
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
pub fn vzip(self) -> V