Function arci::copy_joint_positions

source ·
pub fn copy_joint_positions(
    from_joint_names: &[String],
    from_positions: &[f64],
    to_joint_names: &[String],
    to_positions: &mut [f64],
) -> Result<(), Error>
Expand description

§To copy joint name and position between from and to

Copy position of same joint name. This function returns Ok() or Err().

§When this function through Error?

length of joint names and positions is difference.

§Sample code

use arci::copy_joint_positions;

let from_positions = vec![2.1_f64, 4.8, 1.0, 6.5];
let from_joint_names = vec![
String::from("part1"),
String::from("part2"),
String::from("part3"),
String::from("part4"),
];

let mut to_positions = vec![3.3_f64, 8.1];
let to_joint_names = vec![
String::from("part4"),
String::from("part1"),
];

copy_joint_positions(
&from_joint_names,
&from_positions,
&to_joint_names,
&mut to_positions,
).unwrap();