rs_opw_kinematics

Module tool

Source
Expand description

Provides tool and base for the robot. Both Tool and Base take arbitrary implementation of Kinematics and are such implementations themselves. Hence, they can be cascaded, like base, having the robot, that robot having a tool:

use std::sync::Arc;
use nalgebra::{Isometry3, Translation3, UnitQuaternion};
use rs_opw_kinematics::kinematic_traits::{Joints, Kinematics, Pose};
use rs_opw_kinematics::kinematics_impl::OPWKinematics;
use rs_opw_kinematics::parameters::opw_kinematics::Parameters;
let robot_alone = OPWKinematics::new(Parameters::staubli_tx2_160l());

// Half meter high pedestal
let pedestal = 0.5;
let base_translation = Isometry3::from_parts(
  Translation3::new(0.0, 0.0, pedestal).into(),
  UnitQuaternion::identity(),
);

let robot_with_base = rs_opw_kinematics::tool::Base {
  robot: Arc::new(robot_alone),
  base: base_translation,
};

// Tool extends 1 meter in the Z direction, envisioning something like sword
let sword = 1.0;
let tool_translation = Isometry3::from_parts(
  Translation3::new(0.0, 0.0, sword).into(),
  UnitQuaternion::identity(),
);

// Create the Tool instance with the transformation
let robot_complete = rs_opw_kinematics::tool::Tool {
  robot: Arc::new(robot_with_base),
  tool: tool_translation,
};

let joints: Joints = [0.0, 0.1, 0.2, 0.3, 0.0, 0.5]; // Joints are alias of [f64; 6]
let tcp_pose: Pose = robot_complete.forward(&joints);
println!("The sword tip is at: {:?}", tcp_pose);

Structs§

Base
Defines the fixed base that can hold the robot. The base moves the robot to its installed location, providing also rotation if required (physical robots work well and may be installed upside down, or at some angle like 45 degrees). Base itself fully implements the Kinematics, providing both inverse and forward kinematics for the robot on a base.
Gantry
A platform for a robot that can ride in x, y and z directions. This way it is less restricted than LinearAxis but tasks focusing with moving in one dimension only may prefer abstracting which dimension it is.
LinearAxis
Tool
Defines the fixed tool that can be attached to the last joint (joint 6) of robot. The tool moves with the robot, providing additional translation and, if needed, rotation. The tool itself fully implements the Kinematics, providing both inverse and forward kinematics for the robot with a tool (with “pose” being assumed as the position and rotation of the tip of the tool (tool center point).