#include <jog_calcs.h>
Public Member Functions | |
bool | isInitialized () |
Check if the robot state is being updated and the end effector transform is known. More... | |
JogCalcs (const JogArmParameters ¶meters, const robot_model_loader::RobotModelLoaderPtr &model_loader_ptr) | |
void | startMainLoop (JogArmShared &shared_variables) |
Protected Member Functions | |
bool | addJointIncrements (sensor_msgs::JointState &output, const Eigen::VectorXd &increments) const |
void | applyVelocityScaling (JogArmShared &shared_variables, 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... | |
bool | cartesianJogCalcs (geometry_msgs::TwistStamped &cmd, JogArmShared &shared_variables) |
Do jogging calculations for Cartesian twist commands. More... | |
trajectory_msgs::JointTrajectory | composeJointTrajMessage (sensor_msgs::JointState &joint_state) const |
Compose the outgoing JointTrajectory message. More... | |
bool | convertDeltasToOutgoingCmd () |
Convert joint deltas to an outgoing JointTrajectory command. This happens for joint commands and Cartesian commands. More... | |
void | enforceSRDFAccelVelLimits (Eigen::ArrayXd &delta_theta) |
Scale the delta theta to match joint velocity/acceleration limits. More... | |
bool | enforceSRDFPositionLimits (trajectory_msgs::JointTrajectory &new_joint_traj) |
Avoid overshooting joint limits. More... | |
void | insertRedundantPointsIntoTrajectory (trajectory_msgs::JointTrajectory &trajectory, int count) const |
Gazebo simulations have very strict message timestamp requirements. Satisfy Gazebo by stuffing multiple messages into one. More... | |
bool | jointJogCalcs (const control_msgs::JointJog &cmd, JogArmShared &shared_variables) |
Do jogging calculations for direct commands to a joint. More... | |
void | lowPassFilterPositions (sensor_msgs::JointState &joint_state) |
Smooth position commands with a lowpass filter. More... | |
void | publishStatus () const |
Publish the status of the jogger to a ROS topic. More... | |
void | removeDimension (Eigen::MatrixXd &matrix, Eigen::VectorXd &delta_x, unsigned int row_to_remove) |
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 | suddenHalt (trajectory_msgs::JointTrajectory &joint_traj) |
Suddenly halt for a joint limit or other critical issue. Is handled differently for position vs. velocity control. More... | |
void | suddenHalt (Eigen::ArrayXd &delta_theta) |
void | updateCachedStatus (JogArmShared &shared_variables) |
Update the stashed status so it can be retrieved asynchronously. More... | |
bool | updateJoints (JogArmShared &shared_variables) |
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 &jacobian, const Eigen::MatrixXd &pseudo_inverse) |
Possibly calculate a velocity scaling factor, due to proximity of singularity and direction of motion. More... | |
Protected Attributes | |
ros::Rate | default_sleep_rate_ |
Eigen::ArrayXd | delta_theta_ |
const int | gazebo_redundant_message_count_ = 30 |
sensor_msgs::JointState | incoming_joint_state_ |
sensor_msgs::JointState | internal_joint_state_ |
std::atomic< bool > | is_initialized_ |
const moveit::core::JointModelGroup * | joint_model_group_ |
std::map< std::string, std::size_t > | joint_state_name_map_ |
moveit::core::RobotStatePtr | kinematic_state_ |
ros::NodeHandle | nh_ |
uint | num_joints_ |
sensor_msgs::JointState | original_joint_state_ |
trajectory_msgs::JointTrajectory | outgoing_command_ |
JogArmParameters | parameters_ |
std::vector< LowPassFilter > | position_filters_ |
Eigen::ArrayXd | prev_joint_velocity_ |
StatusCode | status_ = NO_WARNING |
ros::Publisher | status_pub_ |
Eigen::Isometry3d | tf_moveit_to_cmd_frame_ |
Definition at line 56 of file jog_calcs.h.
moveit_jog_arm::JogCalcs::JogCalcs | ( | const JogArmParameters & | parameters, |
const robot_model_loader::RobotModelLoaderPtr & | model_loader_ptr | ||
) |
Definition at line 47 of file jog_calcs.cpp.
|
protected |
Definition at line 815 of file jog_calcs.cpp.
|
protected |
Slow motion down if close to singularity or collision.
shared_variables | data shared between threads, tells how close we are to collision |
delta_theta | motion command, used in calculating new_joint_tray |
singularity_scale | tells how close we are to a singularity |
Definition at line 477 of file jog_calcs.cpp.
|
protected |
Convert an incremental position command to joint velocity message.
Definition at line 441 of file jog_calcs.cpp.
|
protected |
Do jogging calculations for Cartesian twist commands.
Definition at line 253 of file jog_calcs.cpp.
|
protected |
Compose the outgoing JointTrajectory message.
Definition at line 449 of file jog_calcs.cpp.
|
protected |
Convert joint deltas to an outgoing JointTrajectory command. This happens for joint commands and Cartesian commands.
Definition at line 391 of file jog_calcs.cpp.
|
protected |
Scale the delta theta to match joint velocity/acceleration limits.
Definition at line 565 of file jog_calcs.cpp.
|
protected |
Avoid overshooting joint limits.
Definition at line 639 of file jog_calcs.cpp.
|
protected |
Gazebo simulations have very strict message timestamp requirements. Satisfy Gazebo by stuffing multiple messages into one.
Definition at line 422 of file jog_calcs.cpp.
bool moveit_jog_arm::JogCalcs::isInitialized | ( | ) |
Check if the robot state is being updated and the end effector transform is known.
Definition at line 247 of file jog_calcs.cpp.
|
protected |
Do jogging calculations for direct commands to a joint.
Definition at line 357 of file jog_calcs.cpp.
|
protected |
Smooth position commands with a lowpass filter.
Definition at line 433 of file jog_calcs.cpp.
|
protected |
Publish the status of the jogger to a ROS topic.
Definition at line 678 of file jog_calcs.cpp.
|
protected |
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 834 of file jog_calcs.cpp.
|
protected |
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 750 of file jog_calcs.cpp.
|
protected |
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 780 of file jog_calcs.cpp.
void moveit_jog_arm::JogCalcs::startMainLoop | ( | JogArmShared & | shared_variables | ) |
Definition at line 67 of file jog_calcs.cpp.
|
protected |
Suddenly halt for a joint limit or other critical issue. Is handled differently for position vs. velocity control.
Definition at line 694 of file jog_calcs.cpp.
|
protected |
Definition at line 687 of file jog_calcs.cpp.
|
protected |
Update the stashed status so it can be retrieved asynchronously.
Definition at line 385 of file jog_calcs.cpp.
|
protected |
Parse the incoming joint msg for the joints of our MoveGroup.
Definition at line 716 of file jog_calcs.cpp.
|
protected |
Possibly calculate a velocity scaling factor, due to proximity of singularity and direction of motion.
Definition at line 498 of file jog_calcs.cpp.
|
protected |
Definition at line 185 of file jog_calcs.h.
|
protected |
Definition at line 176 of file jog_calcs.h.
|
protected |
Definition at line 181 of file jog_calcs.h.
|
protected |
Definition at line 163 of file jog_calcs.h.
|
protected |
Definition at line 163 of file jog_calcs.h.
|
protected |
Definition at line 72 of file jog_calcs.h.
|
protected |
Definition at line 156 of file jog_calcs.h.
|
protected |
Definition at line 164 of file jog_calcs.h.
|
protected |
Definition at line 158 of file jog_calcs.h.
|
protected |
Definition at line 69 of file jog_calcs.h.
|
protected |
Definition at line 183 of file jog_calcs.h.
|
protected |
Definition at line 163 of file jog_calcs.h.
|
protected |
Definition at line 165 of file jog_calcs.h.
|
protected |
Definition at line 173 of file jog_calcs.h.
|
protected |
Definition at line 167 of file jog_calcs.h.
|
protected |
Definition at line 177 of file jog_calcs.h.
|
protected |
Definition at line 171 of file jog_calcs.h.
|
protected |
Definition at line 169 of file jog_calcs.h.
|
protected |
Definition at line 179 of file jog_calcs.h.