[−][src]Struct k::SerialChain
Kinematic chain without any branch.
All joints are connected sequentially.
Implementations
impl<T> SerialChain<T> where
T: RealField + SubsetOf<f64>,
[src]
T: RealField + SubsetOf<f64>,
pub fn new_unchecked(inner: Chain<T>) -> Self
[src]
Convert Chain into SerialChain without any check
If the input Chain has any branches it causes serious bugs.
pub fn try_new(inner: Chain<T>) -> Option<Self>
[src]
Convert Chain into SerialChain
If the input Chain has any branches it fails.
Examples
let node = k::NodeBuilder::<f32>::new().into_node(); let chain = k::Chain::from_root(node); assert!(k::SerialChain::try_new(chain).is_some());
let node0 = k::NodeBuilder::<f32>::new().into_node(); let node1 = k::NodeBuilder::new().into_node(); let node2 = k::NodeBuilder::new().into_node(); node1.set_parent(&node0); node2.set_parent(&node0); let chain = k::Chain::from_root(node0); assert!(k::SerialChain::try_new(chain).is_none());
pub fn from_end(end_joint: &Node<T>) -> SerialChain<T>
[src]
Create SerialChain from the end Node
Examples
let node = k::NodeBuilder::<f32>::new().into_node(); let s_chain = k::SerialChain::from_end(&node);
pub fn unwrap(self) -> Chain<T>
[src]
Safely unwrap and returns inner Chain
instance
pub fn end_transform(&self) -> Isometry3<T>
[src]
Calculate transform of the end joint
Methods from Deref<Target = Chain<T>>
pub fn set_origin(&self, pose: Isometry3<T>)
[src]
Set the Chain
's origin
Examples
use k::*; let l0 = Node::new(Joint::new("fixed0", JointType::Fixed)); let l1 = Node::new(Joint::new("fixed1", JointType::Fixed)); l1.set_parent(&l0); let c = Chain::<f32>::from_end(&l1); let mut o = c.origin(); assert!(o.translation.vector[0].abs() < 0.000001); o.translation.vector[0] = 1.0; c.set_origin(o); assert!((o.translation.vector[0] - 1.0).abs() < 0.000001);
pub fn origin(&self) -> Isometry3<T>
[src]
Get the Chain
's origin
pub fn iter(&self) -> impl Iterator<Item = &Node<T>>
[src]
Iterate for all joint nodes
The order is from parent to children. You can assume that parent is already iterated.
Examples
use k::*; let l0 = Node::new(Joint::new("fixed0", JointType::Fixed)); let l1 = Node::new(Joint::new("fixed1", JointType::Fixed)); l1.set_parent(&l0); let tree = Chain::<f64>::from_root(l0); let names = tree.iter().map(|node| node.joint().name.to_owned()).collect::<Vec<_>>(); assert_eq!(names.len(), 2); assert_eq!(names[0], "fixed0"); assert_eq!(names[1], "fixed1");
pub fn iter_joints(&self) -> impl Iterator<Item = JointRefGuard<'_, T>>
[src]
Iterate for movable joints
Fixed joints are ignored. If you want to manipulate on Fixed,
use iter()
instead of iter_joints()
pub fn iter_links(&self) -> impl Iterator<Item = LinkRefGuard<'_, T>>
[src]
Iterate for links
pub fn dof(&self) -> usize
[src]
Calculate the degree of freedom
Examples
use k::*; let l0 = NodeBuilder::new() .joint_type(JointType::Fixed) .finalize() .into(); let l1 : Node<f64> = NodeBuilder::new() .joint_type(JointType::Rotational{axis: Vector3::y_axis()}) .finalize() .into(); l1.set_parent(&l0); let tree = Chain::from_root(l0); assert_eq!(tree.dof(), 1);
pub fn find(&self, joint_name: &str) -> Option<&Node<T>>
[src]
Find the joint by name
Examples
use k::*; let l0 = Node::new(NodeBuilder::new() .name("fixed") .finalize()); let l1 = Node::new(NodeBuilder::new() .name("pitch1") .translation(Translation3::new(0.0, 0.1, 0.0)) .joint_type(JointType::Rotational{axis: Vector3::y_axis()}) .finalize()); l1.set_parent(&l0); let tree = Chain::from_root(l0); let j = tree.find("pitch1").unwrap(); j.set_joint_position(0.5).unwrap(); assert_eq!(j.joint_position().unwrap(), 0.5);
pub fn joint_positions(&self) -> Vec<T>
[src]
Get the positions of the joints
FixedJoint
is ignored. the length is the same with dof()
pub fn set_joint_positions(&self, positions_vec: &[T]) -> Result<(), Error>
[src]
Set the positions of the joints
FixedJoints
are ignored. the input number must be equal with dof()
pub fn set_joint_positions_clamped(&self, positions_vec: &[T])
[src]
Set the clamped positions of the joints
This function is safe, in contrast to set_joint_positions_unchecked
.
pub fn set_joint_positions_unchecked(&self, positions_vec: &[T])
[src]
Fast, but without check, dangerous set_joint_positions
pub fn update_transforms(&self) -> Vec<Isometry3<T>>
[src]
Update world_transform() of the joints
pub fn update_velocities(&self) -> Vec<Velocity<T>>
[src]
Update world_velocity() of the joints
pub fn update_link_transforms(&self)
[src]
Update transforms of the links
Trait Implementations
impl<T> Clone for SerialChain<T> where
T: RealField + SubsetOf<f64>,
[src]
T: RealField + SubsetOf<f64>,
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + RealField> Debug for SerialChain<T>
[src]
impl<T> Deref for SerialChain<T> where
T: RealField,
[src]
T: RealField,
type Target = Chain<T>
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[src]
impl<T> Display for SerialChain<T> where
T: RealField + SubsetOf<f64>,
[src]
T: RealField + SubsetOf<f64>,
Auto Trait Implementations
impl<T> RefUnwindSafe for SerialChain<T>
impl<T> Send for SerialChain<T> where
T: Scalar,
T: Scalar,
impl<T> Sync for SerialChain<T> where
T: Scalar,
T: Scalar,
impl<T> Unpin for SerialChain<T>
impl<T> UnwindSafe for SerialChain<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,