#include <servo_calcs.h>
Public Member Functions | |
void | changeRobotLinkCommandFrame (const std::string &new_command_frame) |
Change the controlled link. Often, this is the end effector This must be a link on the robot since MoveIt tracks the transform (not tf) More... | |
bool | getCommandFrameTransform (Eigen::Isometry3d &transform) |
bool | getCommandFrameTransform (geometry_msgs::TransformStamped &transform) |
bool | getEEFrameTransform (Eigen::Isometry3d &transform) |
bool | getEEFrameTransform (geometry_msgs::TransformStamped &transform) |
ServoCalcs (ros::NodeHandle &nh, ServoParameters ¶meters, const planning_scene_monitor::PlanningSceneMonitorPtr &planning_scene_monitor) | |
void | setPaused (bool paused) |
Pause or unpause processing servo commands while keeping the timers alive. More... | |
void | start () |
Start the timer where we do work and publish outputs. More... | |
~ServoCalcs () | |
Private Member Functions | |
bool | addJointIncrements (sensor_msgs::JointState &output, const Eigen::VectorXd &increments) const |
void | applyVelocityScaling (Eigen::ArrayXd &delta_theta, double singularity_scale) |
void | calculateJointVelocities (sensor_msgs::JointState &joint_state, const Eigen::ArrayXd &delta_theta) |
Convert an incremental position command to joint velocity message. More... | |
void | calculateSingleIteration () |
Do calculations for a single iteration. Publish one outgoing command. More... | |
bool | cartesianServoCalcs (geometry_msgs::TwistStamped &cmd, trajectory_msgs::JointTrajectory &joint_trajectory) |
Do servoing calculations for Cartesian twist commands. More... | |
bool | changeControlDimensions (moveit_msgs::ChangeControlDimensions::Request &req, moveit_msgs::ChangeControlDimensions::Response &res) |
Service callback for changing servoing dimensions (e.g. ignore rotation about X) More... | |
bool | changeDriftDimensions (moveit_msgs::ChangeDriftDimensions::Request &req, moveit_msgs::ChangeDriftDimensions::Response &res) |
void | collisionVelocityScaleCB (const std_msgs::Float64ConstPtr &msg) |
void | composeJointTrajMessage (const sensor_msgs::JointState &joint_state, trajectory_msgs::JointTrajectory &joint_trajectory) const |
Compose the outgoing JointTrajectory message. More... | |
bool | convertDeltasToOutgoingCmd (trajectory_msgs::JointTrajectory &joint_trajectory) |
Convert joint deltas to an outgoing JointTrajectory command. This happens for joint commands and Cartesian commands. More... | |
bool | enforcePositionLimits (sensor_msgs::JointState &joint_state) |
Avoid overshooting joint limits. More... | |
void | enforceVelLimits (Eigen::ArrayXd &delta_theta) |
Scale the delta theta to match joint velocity/acceleration limits. More... | |
void | insertRedundantPointsIntoTrajectory (trajectory_msgs::JointTrajectory &joint_trajectory, int count) const |
Gazebo simulations have very strict message timestamp requirements. Satisfy Gazebo by stuffing multiple messages into one. More... | |
void | jointCmdCB (const control_msgs::JointJogConstPtr &msg) |
bool | jointServoCalcs (const control_msgs::JointJog &cmd, trajectory_msgs::JointTrajectory &joint_trajectory) |
Do servoing calculations for direct commands to a joint. More... | |
void | jointStateCB (const sensor_msgs::JointStateConstPtr &msg) |
void | lowPassFilterPositions (sensor_msgs::JointState &joint_state) |
Smooth position commands with a lowpass filter. More... | |
void | mainCalcLoop () |
Run the main calculation loop. More... | |
void | removeDimension (Eigen::MatrixXd &matrix, Eigen::VectorXd &delta_x, unsigned int row_to_remove) |
void | resetLowPassFilters (const sensor_msgs::JointState &joint_state) |
Set the filters to the specified values. More... | |
bool | resetServoStatus (std_srvs::Empty::Request &req, std_srvs::Empty::Response &res) |
Service callback to reset Servo status, e.g. so the arm can move again after a collision. More... | |
Eigen::VectorXd | scaleCartesianCommand (const geometry_msgs::TwistStamped &command) const |
If incoming velocity commands are from a unitless joystick, scale them to physical units. Also, multiply by timestep to calculate a position change. More... | |
Eigen::VectorXd | scaleJointCommand (const control_msgs::JointJog &command) const |
If incoming velocity commands are from a unitless joystick, scale them to physical units. Also, multiply by timestep to calculate a position change. More... | |
void | stop () |
Stop the currently running thread. More... | |
void | suddenHalt (trajectory_msgs::JointTrajectory &joint_trajectory) |
Suddenly halt for a joint limit or other critical issue. Is handled differently for position vs. velocity control. More... | |
void | twistStampedCB (const geometry_msgs::TwistStampedConstPtr &msg) |
void | updateJoints () |
Parse the incoming joint msg for the joints of our MoveGroup. More... | |
double | velocityScalingFactorForSingularity (const Eigen::VectorXd &commanded_velocity, const Eigen::JacobiSVD< Eigen::MatrixXd > &svd, const Eigen::MatrixXd &pseudo_inverse) |
Possibly calculate a velocity scaling factor, due to proximity of singularity and direction of motion. More... | |
Friends | |
class | ServoFixture |
Definition at line 105 of file servo_calcs.h.
moveit_servo::ServoCalcs::ServoCalcs | ( | ros::NodeHandle & | nh, |
ServoParameters & | parameters, | ||
const planning_scene_monitor::PlanningSceneMonitorPtr & | planning_scene_monitor | ||
) |
Definition at line 87 of file servo_calcs.cpp.
moveit_servo::ServoCalcs::~ServoCalcs | ( | ) |
Definition at line 157 of file servo_calcs.cpp.
|
private |
Definition at line 984 of file servo_calcs.cpp.
|
private |
Slow motion down if close to singularity or collision.
delta_theta | motion command, used in calculating new_joint_tray |
singularity_scale | tells how close we are to a singularity |
Definition at line 670 of file servo_calcs.cpp.
|
private |
Convert an incremental position command to joint velocity message.
Definition at line 635 of file servo_calcs.cpp.
|
private |
Do calculations for a single iteration. Publish one outgoing command.
Definition at line 268 of file servo_calcs.cpp.
|
private |
Do servoing calculations for Cartesian twist commands.
Definition at line 434 of file servo_calcs.cpp.
|
private |
Service callback for changing servoing dimensions (e.g. ignore rotation about X)
Definition at line 1112 of file servo_calcs.cpp.
|
private |
Allow drift in certain dimensions. For example, may allow the wrist to rotate freely. This can help avoid singularities.
request | the service request |
response | the service response |
Definition at line 1098 of file servo_calcs.cpp.
void moveit_servo::ServoCalcs::changeRobotLinkCommandFrame | ( | const std::string & | new_command_frame | ) |
Change the controlled link. Often, this is the end effector This must be a link on the robot since MoveIt tracks the transform (not tf)
Definition at line 1137 of file servo_calcs.cpp.
|
private |
Definition at line 1093 of file servo_calcs.cpp.
|
private |
Compose the outgoing JointTrajectory message.
Definition at line 643 of file servo_calcs.cpp.
|
private |
Convert joint deltas to an outgoing JointTrajectory command. This happens for joint commands and Cartesian commands.
Definition at line 572 of file servo_calcs.cpp.
|
private |
Avoid overshooting joint limits.
Definition at line 783 of file servo_calcs.cpp.
|
private |
Scale the delta theta to match joint velocity/acceleration limits.
Definition at line 759 of file servo_calcs.cpp.
bool moveit_servo::ServoCalcs::getCommandFrameTransform | ( | Eigen::Isometry3d & | transform | ) |
Get the MoveIt planning link transform. The transform from the MoveIt planning frame to robot_link_command_frame
transform | the transform that will be calculated |
Definition at line 1020 of file servo_calcs.cpp.
bool moveit_servo::ServoCalcs::getCommandFrameTransform | ( | geometry_msgs::TransformStamped & | transform | ) |
Definition at line 1029 of file servo_calcs.cpp.
bool moveit_servo::ServoCalcs::getEEFrameTransform | ( | Eigen::Isometry3d & | transform | ) |
Get the End Effector link transform. The transform from the MoveIt planning frame to EE link
transform | the transform that will be calculated |
Definition at line 1043 of file servo_calcs.cpp.
bool moveit_servo::ServoCalcs::getEEFrameTransform | ( | geometry_msgs::TransformStamped & | transform | ) |
Definition at line 1052 of file servo_calcs.cpp.
|
private |
Gazebo simulations have very strict message timestamp requirements. Satisfy Gazebo by stuffing multiple messages into one.
Definition at line 602 of file servo_calcs.cpp.
|
private |
Definition at line 1079 of file servo_calcs.cpp.
|
private |
Do servoing calculations for direct commands to a joint.
Definition at line 546 of file servo_calcs.cpp.
|
private |
|
private |
Smooth position commands with a lowpass filter.
Definition at line 615 of file servo_calcs.cpp.
|
private |
Run the main calculation loop.
Definition at line 228 of file servo_calcs.cpp.
|
private |
Remove the Jacobian row and the delta-x element of one Cartesian dimension, to take advantage of task redundancy
matrix | The Jacobian matrix. |
delta_x | Vector of Cartesian delta commands, should be the same size as matrix.rows() |
row_to_remove | Dimension that will be allowed to drift, e.g. row_to_remove = 2 allows z-translation drift. |
Definition at line 1004 of file servo_calcs.cpp.
|
private |
Set the filters to the specified values.
Definition at line 625 of file servo_calcs.cpp.
|
private |
Service callback to reset Servo status, e.g. so the arm can move again after a collision.
Definition at line 1126 of file servo_calcs.cpp.
|
private |
If incoming velocity commands are from a unitless joystick, scale them to physical units. Also, multiply by timestep to calculate a position change.
Definition at line 923 of file servo_calcs.cpp.
|
private |
If incoming velocity commands are from a unitless joystick, scale them to physical units. Also, multiply by timestep to calculate a position change.
Definition at line 953 of file servo_calcs.cpp.
void moveit_servo::ServoCalcs::setPaused | ( | bool | paused | ) |
Pause or unpause processing servo commands while keeping the timers alive.
Definition at line 1132 of file servo_calcs.cpp.
void moveit_servo::ServoCalcs::start | ( | ) |
Start the timer where we do work and publish outputs.
Definition at line 162 of file servo_calcs.cpp.
|
private |
Stop the currently running thread.
Definition at line 207 of file servo_calcs.cpp.
|
private |
Suddenly halt for a joint limit or other critical issue. Is handled differently for position vs. velocity control.
Definition at line 829 of file servo_calcs.cpp.
|
private |
Definition at line 1065 of file servo_calcs.cpp.
|
private |
Parse the incoming joint msg for the joints of our MoveGroup.
Definition at line 864 of file servo_calcs.cpp.
|
private |
Possibly calculate a velocity scaling factor, due to proximity of singularity and direction of motion.
Definition at line 694 of file servo_calcs.cpp.
|
friend |
Definition at line 181 of file servo_calcs.h.
|
private |
Definition at line 362 of file servo_calcs.h.
|
private |
Definition at line 344 of file servo_calcs.h.
|
private |
Definition at line 376 of file servo_calcs.h.
|
private |
Definition at line 349 of file servo_calcs.h.
|
private |
Definition at line 326 of file servo_calcs.h.
|
private |
Definition at line 365 of file servo_calcs.h.
|
private |
Definition at line 373 of file servo_calcs.h.
|
private |
Definition at line 348 of file servo_calcs.h.
|
private |
Definition at line 368 of file servo_calcs.h.
|
private |
Definition at line 318 of file servo_calcs.h.
|
private |
Definition at line 317 of file servo_calcs.h.
|
private |
Definition at line 316 of file servo_calcs.h.
|
private |
Definition at line 390 of file servo_calcs.h.
|
mutableprivate |
Definition at line 379 of file servo_calcs.h.
|
private |
Definition at line 333 of file servo_calcs.h.
|
private |
Definition at line 343 of file servo_calcs.h.
|
private |
Definition at line 360 of file servo_calcs.h.
|
private |
Definition at line 324 of file servo_calcs.h.
|
private |
Definition at line 322 of file servo_calcs.h.
|
private |
Definition at line 334 of file servo_calcs.h.
|
private |
Definition at line 341 of file servo_calcs.h.
|
private |
Definition at line 338 of file servo_calcs.h.
|
private |
Definition at line 383 of file servo_calcs.h.
Definition at line 385 of file servo_calcs.h.
|
private |
Definition at line 387 of file servo_calcs.h.
|
private |
Definition at line 386 of file servo_calcs.h.
Definition at line 384 of file servo_calcs.h.
|
private |
Definition at line 382 of file servo_calcs.h.
|
private |
Definition at line 391 of file servo_calcs.h.
|
private |
Definition at line 297 of file servo_calcs.h.
|
private |
Definition at line 370 of file servo_calcs.h.
|
private |
Definition at line 361 of file servo_calcs.h.
|
private |
Definition at line 333 of file servo_calcs.h.
|
private |
Definition at line 347 of file servo_calcs.h.
|
private |
Definition at line 300 of file servo_calcs.h.
|
private |
Definition at line 358 of file servo_calcs.h.
|
private |
Definition at line 303 of file servo_calcs.h.
|
private |
Definition at line 336 of file servo_calcs.h.
|
private |
Definition at line 366 of file servo_calcs.h.
|
private |
Definition at line 350 of file servo_calcs.h.
|
private |
Definition at line 357 of file servo_calcs.h.
|
private |
Definition at line 345 of file servo_calcs.h.
|
private |
Definition at line 354 of file servo_calcs.h.
|
private |
Definition at line 381 of file servo_calcs.h.
|
private |
Definition at line 380 of file servo_calcs.h.
|
private |
Definition at line 353 of file servo_calcs.h.
|
private |
Definition at line 359 of file servo_calcs.h.
|
private |
Definition at line 321 of file servo_calcs.h.
|
private |
Definition at line 342 of file servo_calcs.h.
|
private |
Definition at line 313 of file servo_calcs.h.
|
private |
Definition at line 310 of file servo_calcs.h.
|
private |
Definition at line 346 of file servo_calcs.h.
|
private |
Definition at line 307 of file servo_calcs.h.