Public Member Functions | Private Member Functions | Private Attributes | List of all members
moveit::core::RobotState Class Reference

Representation of a robot's state. This includes position, velocity, acceleration and effort. More...

#include <robot_state.h>

Public Member Functions

void computeAABB (std::vector< double > &aabb)
 Compute an axis-aligned bounding box that contains the current state. The format for aabb is (minx, maxx, miny, maxy, minz, maxz) More...
 
void computeAABB (std::vector< double > &aabb) const
 Compute an axis-aligned bounding box that contains the current state. The format for aabb is (minx, maxx, miny, maxy, minz, maxz) More...
 
const Eigen::Isometry3d & getFrameInfo (const std::string &frame_id, const LinkModel *&robot_link, bool &frame_found) const
 Get the transformation matrix from the model frame (root of model) to the frame identified by frame_id. More...
 
const Eigen::Isometry3d & getFrameTransform (const std::string &frame_id, bool *frame_found=nullptr)
 Get the transformation matrix from the model frame (root of model) to the frame identified by frame_id. More...
 
const Eigen::Isometry3d & getFrameTransform (const std::string &frame_id, bool *frame_found=nullptr) const
 Get the transformation matrix from the model frame (root of model) to the frame identified by frame_id. More...
 
const JointModelgetJointModel (const std::string &joint) const
 Get the model of a particular joint. More...
 
const JointModelGroupgetJointModelGroup (const std::string &group) const
 Get the model of a particular joint group. More...
 
const LinkModelgetLinkModel (const std::string &link) const
 Get the model of a particular link. More...
 
random_numbers::RandomNumberGeneratorgetRandomNumberGenerator ()
 Return the instance of a random number generator. More...
 
void getRobotMarkers (visualization_msgs::MarkerArray &arr, const std::vector< std::string > &link_names, bool include_attached=false)
 Get a MarkerArray that fully describes the robot markers for a given robot. Update the state first. More...
 
void getRobotMarkers (visualization_msgs::MarkerArray &arr, const std::vector< std::string > &link_names, bool include_attached=false) const
 Get a MarkerArray that fully describes the robot markers for a given robot. More...
 
void getRobotMarkers (visualization_msgs::MarkerArray &arr, const std::vector< std::string > &link_names, const std_msgs::ColorRGBA &color, const std::string &ns, const ros::Duration &dur, bool include_attached=false)
 Get a MarkerArray that fully describes the robot markers for a given robot. Update the state first. More...
 
void getRobotMarkers (visualization_msgs::MarkerArray &arr, const std::vector< std::string > &link_names, const std_msgs::ColorRGBA &color, const std::string &ns, const ros::Duration &dur, bool include_attached=false) const
 Get a MarkerArray that fully describes the robot markers for a given robot. More...
 
const RobotModelConstPtr & getRobotModel () const
 Get the robot model this state is constructed for. More...
 
std::string getStateTreeString () const
 
std::size_t getVariableCount () const
 Get the number of variables that make up this state. More...
 
const std::vector< std::string > & getVariableNames () const
 Get the names of the variables that make up this state, in the order they are stored in memory. More...
 
bool knowsFrameTransform (const std::string &frame_id) const
 Check if a transformation matrix from the model frame (root of model) to frame frame_id is known. More...
 
RobotStateoperator= (const RobotState &other)
 Copy operator. More...
 
void printDirtyInfo (std::ostream &out=std::cout) const
 
void printStateInfo (std::ostream &out=std::cout) const
 
void printStatePositions (std::ostream &out=std::cout) const
 
void printStatePositionsWithJointLimits (const moveit::core::JointModelGroup *jmg, std::ostream &out=std::cout) const
 Output to console the current state of the robot's joint limits. More...
 
void printTransform (const Eigen::Isometry3d &transform, std::ostream &out=std::cout) const
 
void printTransforms (std::ostream &out=std::cout) const
 
 RobotState (const RobotModelConstPtr &robot_model)
 A state can be constructed from a specified robot model. No values are initialized. Call setToDefaultValues() if a state needs to provide valid information. More...
 
 RobotState (const RobotState &other)
 Copy constructor. More...
 
bool setToIKSolverFrame (Eigen::Isometry3d &pose, const kinematics::KinematicsBaseConstPtr &solver)
 Transform pose from the robot model's base frame to the reference frame of the IK solver. More...
 
bool setToIKSolverFrame (Eigen::Isometry3d &pose, const std::string &ik_frame)
 Transform pose from the robot model's base frame to the reference frame of the IK solver. More...
 
 ~RobotState ()
 
Getting and setting variable position
double * getVariablePositions ()
 Get a raw pointer to the positions of the variables stored in this state. Use carefully. If you change these values externally you need to make sure you trigger a forced update for the state by calling update(true). More...
 
const double * getVariablePositions () const
 Get a raw pointer to the positions of the variables stored in this state. More...
 
void setVariablePositions (const double *position)
 It is assumed positions is an array containing the new positions for all variables in this state. Those values are copied into the state. More...
 
void setVariablePositions (const std::vector< double > &position)
 It is assumed positions is an array containing the new positions for all variables in this state. Those values are copied into the state. More...
 
void setVariablePositions (const std::map< std::string, double > &variable_map)
 Set the positions of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariablePositions (const std::map< std::string, double > &variable_map, std::vector< std::string > &missing_variables)
 Set the positions of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set. More...
 
void setVariablePositions (const std::vector< std::string > &variable_names, const std::vector< double > &variable_position)
 Set the positions of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set. More...
 
void setVariablePosition (const std::string &variable, double value)
 Set the position of a single variable. An exception is thrown if the variable name is not known. More...
 
void setVariablePosition (int index, double value)
 Set the position of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable) More...
 
double getVariablePosition (const std::string &variable) const
 Get the position of a particular variable. An exception is thrown if the variable is not known. More...
 
double getVariablePosition (int index) const
 Get the position of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed
More...
 
Getting and setting variable velocity
bool hasVelocities () const
 By default, if velocities are never set or initialized, the state remembers that there are no velocities set. This is useful to know when serializing or copying the state. More...
 
double * getVariableVelocities ()
 Get raw access to the velocities of the variables that make up this state. The values are in the same order as reported by getVariableNames() More...
 
const double * getVariableVelocities () const
 Get const access to the velocities of the variables that make up this state. The values are in the same order as reported by getVariableNames() More...
 
void zeroVelocities ()
 Set all velocities to 0.0. More...
 
void setVariableVelocities (const double *velocity)
 Given an array with velocity values for all variables, set those values as the velocities in this state. More...
 
void setVariableVelocities (const std::vector< double > &velocity)
 Given an array with velocity values for all variables, set those values as the velocities in this state. More...
 
void setVariableVelocities (const std::map< std::string, double > &variable_map)
 Set the velocities of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariableVelocities (const std::map< std::string, double > &variable_map, std::vector< std::string > &missing_variables)
 Set the velocities of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set. More...
 
void setVariableVelocities (const std::vector< std::string > &variable_names, const std::vector< double > &variable_velocity)
 Set the velocities of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariableVelocity (const std::string &variable, double value)
 Set the velocity of a variable. If an unknown variable name is specified, an exception is thrown. More...
 
void setVariableVelocity (int index, double value)
 Set the velocity of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable) More...
 
double getVariableVelocity (const std::string &variable) const
 Get the velocity of a particular variable. An exception is thrown if the variable is not known. More...
 
double getVariableVelocity (int index) const
 Get the velocity of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed
More...
 
void dropVelocities ()
 Remove velocities from this state (this differs from setting them to zero) More...
 
Getting and setting variable acceleration
bool hasAccelerations () const
 By default, if accelerations are never set or initialized, the state remembers that there are no accelerations set. This is useful to know when serializing or copying the state. If hasAccelerations() reports true, hasEffort() will certainly report false. More...
 
double * getVariableAccelerations ()
 Get raw access to the accelerations of the variables that make up this state. The values are in the same order as reported by getVariableNames(). The area of memory overlaps with effort (effort and acceleration should not be set at the same time) More...
 
const double * getVariableAccelerations () const
 Get const raw access to the accelerations of the variables that make up this state. The values are in the same order as reported by getVariableNames() More...
 
void zeroAccelerations ()
 Set all accelerations to 0.0. More...
 
void setVariableAccelerations (const double *acceleration)
 Given an array with acceleration values for all variables, set those values as the accelerations in this state. More...
 
void setVariableAccelerations (const std::vector< double > &acceleration)
 Given an array with acceleration values for all variables, set those values as the accelerations in this state. More...
 
void setVariableAccelerations (const std::map< std::string, double > &variable_map)
 Set the accelerations of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariableAccelerations (const std::map< std::string, double > &variable_map, std::vector< std::string > &missing_variables)
 Set the accelerations of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set. More...
 
void setVariableAccelerations (const std::vector< std::string > &variable_names, const std::vector< double > &variable_acceleration)
 Set the accelerations of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariableAcceleration (const std::string &variable, double value)
 Set the acceleration of a variable. If an unknown variable name is specified, an exception is thrown. More...
 
void setVariableAcceleration (int index, double value)
 Set the acceleration of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable) More...
 
double getVariableAcceleration (const std::string &variable) const
 Get the acceleration of a particular variable. An exception is thrown if the variable is not known. More...
 
double getVariableAcceleration (int index) const
 Get the acceleration of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed
More...
 
void dropAccelerations ()
 Remove accelerations from this state (this differs from setting them to zero) More...
 
Getting and setting variable effort
bool hasEffort () const
 By default, if effort is never set or initialized, the state remembers that there is no effort set. This is useful to know when serializing or copying the state. If hasEffort() reports true, hasAccelerations() will certainly report false. More...
 
double * getVariableEffort ()
 Get raw access to the effort of the variables that make up this state. The values are in the same order as reported by getVariableNames(). The area of memory overlaps with accelerations (effort and acceleration should not be set at the same time) More...
 
const double * getVariableEffort () const
 Get const raw access to the effort of the variables that make up this state. The values are in the same order as reported by getVariableNames(). More...
 
void zeroEffort ()
 Set all effort values to 0.0. More...
 
void setVariableEffort (const double *effort)
 Given an array with effort values for all variables, set those values as the effort in this state. More...
 
void setVariableEffort (const std::vector< double > &effort)
 Given an array with effort values for all variables, set those values as the effort in this state. More...
 
void setVariableEffort (const std::map< std::string, double > &variable_map)
 Set the effort of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariableEffort (const std::map< std::string, double > &variable_map, std::vector< std::string > &missing_variables)
 Set the effort of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set. More...
 
void setVariableEffort (const std::vector< std::string > &variable_names, const std::vector< double > &variable_acceleration)
 Set the effort of a set of variables. If unknown variable names are specified, an exception is thrown. More...
 
void setVariableEffort (const std::string &variable, double value)
 Set the effort of a variable. If an unknown variable name is specified, an exception is thrown. More...
 
void setVariableEffort (int index, double value)
 Set the effort of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable) More...
 
double getVariableEffort (const std::string &variable) const
 Get the effort of a particular variable. An exception is thrown if the variable is not known. More...
 
double getVariableEffort (int index) const
 Get the effort of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed
More...
 
void dropEffort ()
 Remove effort values from this state (this differs from setting them to zero) More...
 
void dropDynamics ()
 Reduce RobotState to kinematic information (remove velocity, acceleration and effort, if present) More...
 
void invertVelocity ()
 Invert velocity if present. More...
 
Getting and setting joint positions, velocities, accelerations and effort for a single joint

The joint might be multi-DOF, i.e. require more than one variable to set. See setVariablePositions(), setVariableVelocities(), setVariableEffort() to handle multiple joints.

void setJointPositions (const std::string &joint_name, const double *position)
 
void setJointPositions (const std::string &joint_name, const std::vector< double > &position)
 
void setJointPositions (const JointModel *joint, const std::vector< double > &position)
 
void setJointPositions (const JointModel *joint, const double *position)
 
void setJointPositions (const std::string &joint_name, const Eigen::Isometry3d &transform)
 
void setJointPositions (const JointModel *joint, const Eigen::Isometry3d &transform)
 
void setJointVelocities (const JointModel *joint, const double *velocity)
 
void setJointEfforts (const JointModel *joint, const double *effort)
 
const double * getJointPositions (const std::string &joint_name) const
 
const double * getJointPositions (const JointModel *joint) const
 
const double * getJointVelocities (const std::string &joint_name) const
 
const double * getJointVelocities (const JointModel *joint) const
 
const double * getJointAccelerations (const std::string &joint_name) const
 
const double * getJointAccelerations (const JointModel *joint) const
 
const double * getJointEffort (const std::string &joint_name) const
 
const double * getJointEffort (const JointModel *joint) const
 
Getting and setting group positions
void setJointGroupPositions (const std::string &joint_group_name, const double *gstate)
 Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupPositions (const std::string &joint_group_name, const std::vector< double > &gstate)
 Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupPositions (const JointModelGroup *group, const std::vector< double > &gstate)
 Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupPositions (const JointModelGroup *group, const double *gstate)
 Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupPositions (const std::string &joint_group_name, const Eigen::VectorXd &values)
 Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupPositions (const JointModelGroup *group, const Eigen::VectorXd &values)
 Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupActivePositions (const JointModelGroup *group, const std::vector< double > &gstate)
 Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupActivePositions (const std::string &joint_group_name, const std::vector< double > &gstate)
 Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupActivePositions (const JointModelGroup *group, const Eigen::VectorXd &values)
 Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupActivePositions (const std::string &joint_group_name, const Eigen::VectorXd &values)
 Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group. More...
 
void copyJointGroupPositions (const std::string &joint_group_name, std::vector< double > &gstate) const
 For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupPositions (const std::string &joint_group_name, double *gstate) const
 For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupPositions (const JointModelGroup *group, std::vector< double > &gstate) const
 For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupPositions (const JointModelGroup *group, double *gstate) const
 For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupPositions (const std::string &joint_group_name, Eigen::VectorXd &values) const
 For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupPositions (const JointModelGroup *group, Eigen::VectorXd &values) const
 For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
Getting and setting group velocities
void setJointGroupVelocities (const std::string &joint_group_name, const double *gstate)
 Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupVelocities (const std::string &joint_group_name, const std::vector< double > &gstate)
 Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupVelocities (const JointModelGroup *group, const std::vector< double > &gstate)
 Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupVelocities (const JointModelGroup *group, const double *gstate)
 Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupVelocities (const std::string &joint_group_name, const Eigen::VectorXd &values)
 Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupVelocities (const JointModelGroup *group, const Eigen::VectorXd &values)
 Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void copyJointGroupVelocities (const std::string &joint_group_name, std::vector< double > &gstate) const
 For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupVelocities (const std::string &joint_group_name, double *gstate) const
 For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupVelocities (const JointModelGroup *group, std::vector< double > &gstate) const
 For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupVelocities (const JointModelGroup *group, double *gstate) const
 For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupVelocities (const std::string &joint_group_name, Eigen::VectorXd &values) const
 For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupVelocities (const JointModelGroup *group, Eigen::VectorXd &values) const
 For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
Getting and setting group accelerations
void setJointGroupAccelerations (const std::string &joint_group_name, const double *gstate)
 Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupAccelerations (const std::string &joint_group_name, const std::vector< double > &gstate)
 Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupAccelerations (const JointModelGroup *group, const std::vector< double > &gstate)
 Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupAccelerations (const JointModelGroup *group, const double *gstate)
 Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupAccelerations (const std::string &joint_group_name, const Eigen::VectorXd &values)
 Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void setJointGroupAccelerations (const JointModelGroup *group, const Eigen::VectorXd &values)
 Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group. More...
 
void copyJointGroupAccelerations (const std::string &joint_group_name, std::vector< double > &gstate) const
 For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupAccelerations (const std::string &joint_group_name, double *gstate) const
 For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupAccelerations (const JointModelGroup *group, std::vector< double > &gstate) const
 For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupAccelerations (const JointModelGroup *group, double *gstate) const
 For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupAccelerations (const std::string &joint_group_name, Eigen::VectorXd &values) const
 For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
void copyJointGroupAccelerations (const JointModelGroup *group, Eigen::VectorXd &values) const
 For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer. More...
 
Setting from Inverse Kinematics
bool setFromIK (const JointModelGroup *group, const geometry_msgs::Pose &pose, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const geometry_msgs::Pose &pose, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIK (const JointModelGroup *group, const geometry_msgs::Pose &pose, const std::string &tip, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const geometry_msgs::Pose &pose, const std::string &tip, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIK (const JointModelGroup *group, const Eigen::Isometry3d &pose, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const Eigen::Isometry3d &pose, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIK (const JointModelGroup *group, const Eigen::Isometry3d &pose, const std::string &tip, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const Eigen::Isometry3d &pose, const std::string &tip, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIK (const JointModelGroup *group, const Eigen::Isometry3d &pose, const std::string &tip, const std::vector< double > &consistency_limits, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const Eigen::Isometry3d &pose, const std::string &tip, const std::vector< double > &consistency_limits, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIK (const JointModelGroup *group, const EigenSTL::vector_Isometry3d &poses, const std::vector< std::string > &tips, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 Warning: This function inefficiently copies all transforms around. If the group consists of a set of sub-groups that are each a chain and a solver is available for each sub-group, then the joint values can be set by computing inverse kinematics. The poses are assumed to be in the reference frame of the kinematic model. The poses are assumed to be in the same order as the order of the sub-groups in this group. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const EigenSTL::vector_Isometry3d &poses, const std::vector< std::string > &tips, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIK (const JointModelGroup *group, const EigenSTL::vector_Isometry3d &poses, const std::vector< std::string > &tips, const std::vector< std::vector< double >> &consistency_limits, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 Warning: This function inefficiently copies all transforms around. If the group consists of a set of sub-groups that are each a chain and a solver is available for each sub-group, then the joint values can be set by computing inverse kinematics. The poses are assumed to be in the reference frame of the kinematic model. The poses are assumed to be in the same order as the order of the sub-groups in this group. Returns true on success. More...
 
bool setFromIK (const JointModelGroup *group, const EigenSTL::vector_Isometry3d &poses, const std::vector< std::string > &tips, const std::vector< std::vector< double >> &consistency_limits, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromIKSubgroups (const JointModelGroup *group, const EigenSTL::vector_Isometry3d &poses, const std::vector< std::string > &tips, const std::vector< std::vector< double >> &consistency_limits, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 setFromIK for multiple poses and tips (end effectors) when no solver exists for the jmg that can solver for non-chain kinematics. In this case, we divide the group into subgroups and do IK solving individually More...
 
bool setFromIKSubgroups (const JointModelGroup *group, const EigenSTL::vector_Isometry3d &poses, const std::vector< std::string > &tips, const std::vector< std::vector< double >> &consistency_limits, unsigned int, double timeout=0.0, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 
bool setFromDiffIK (const JointModelGroup *group, const Eigen::VectorXd &twist, const std::string &tip, double dt, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn())
 Set the joint values from a Cartesian velocity applied during a time dt. More...
 
bool setFromDiffIK (const JointModelGroup *group, const geometry_msgs::Twist &twist, const std::string &tip, double dt, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn())
 Set the joint values from a Cartesian velocity applied during a time dt. More...
 
double computeCartesianPath (const JointModelGroup *group, std::vector< RobotStatePtr > &traj, const LinkModel *link, const Eigen::Vector3d &direction, bool global_reference_frame, double distance, double max_step, double jump_threshold_factor, const GroupStateValidityCallbackFn &validCallback=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 Compute the sequence of joint values that correspond to a straight Cartesian path for a particular group. More...
 
double computeCartesianPath (const JointModelGroup *group, std::vector< RobotStatePtr > &traj, const LinkModel *link, const Eigen::Isometry3d &target, bool global_reference_frame, double max_step, double jump_threshold_factor, const GroupStateValidityCallbackFn &validCallback=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 Compute the sequence of joint values that correspond to a straight Cartesian path, for a particular group. More...
 
double computeCartesianPath (const JointModelGroup *group, std::vector< RobotStatePtr > &traj, const LinkModel *link, const EigenSTL::vector_Isometry3d &waypoints, bool global_reference_frame, double max_step, double jump_threshold_factor, const GroupStateValidityCallbackFn &validCallback=GroupStateValidityCallbackFn(), const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions())
 Compute the sequence of joint values that perform a general Cartesian path. More...
 
bool getJacobian (const JointModelGroup *group, const LinkModel *link, const Eigen::Vector3d &reference_point_position, Eigen::MatrixXd &jacobian, bool use_quaternion_representation=false) const
 Compute the Jacobian with reference to a particular point on a given link, for a specified group. More...
 
bool getJacobian (const JointModelGroup *group, const LinkModel *link, const Eigen::Vector3d &reference_point_position, Eigen::MatrixXd &jacobian, bool use_quaternion_representation=false)
 Compute the Jacobian with reference to a particular point on a given link, for a specified group. More...
 
Eigen::MatrixXd getJacobian (const JointModelGroup *group, const Eigen::Vector3d &reference_point_position=Eigen::Vector3d(0.0, 0.0, 0.0)) const
 Compute the Jacobian with reference to the last link of a specified group. If the group is not a chain, an exception is thrown. More...
 
Eigen::MatrixXd getJacobian (const JointModelGroup *group, const Eigen::Vector3d &reference_point_position=Eigen::Vector3d(0.0, 0.0, 0.0))
 Compute the Jacobian with reference to the last link of a specified group. If the group is not a chain, an exception is thrown. More...
 
void computeVariableVelocity (const JointModelGroup *jmg, Eigen::VectorXd &qdot, const Eigen::VectorXd &twist, const LinkModel *tip) const
 Given a twist for a particular link (tip), compute the corresponding velocity for every variable and store it in qdot. More...
 
void computeVariableVelocity (const JointModelGroup *jmg, Eigen::VectorXd &qdot, const Eigen::VectorXd &twist, const LinkModel *tip)
 Given a twist for a particular link (tip), compute the corresponding velocity for every variable and store it in qdot. More...
 
bool integrateVariableVelocity (const JointModelGroup *jmg, const Eigen::VectorXd &qdot, double dt, const GroupStateValidityCallbackFn &constraint=GroupStateValidityCallbackFn())
 Given the velocities for the variables in this group (qdot) and an amount of time (dt), update the current state using the Euler forward method. If the constraint specified is satisfied, return true, otherwise return false. More...
 
Getting and setting whole states
void setVariableValues (const sensor_msgs::JointState &msg)
 
void setToDefaultValues ()
 Set all joints to their default positions. The default position is 0, or if that is not within bounds then half way between min and max bound.
More...
 
bool setToDefaultValues (const JointModelGroup *group, const std::string &name)
 Set the joints in group to the position name defined in the SRDF. More...
 
bool setToDefaultValues (const std::string &group_name, const std::string &state_name)
 
void setToRandomPositions ()
 Set all joints to random values. Values will be within default bounds. More...
 
void setToRandomPositions (random_numbers::RandomNumberGenerator &rng)
 Set all joints to random values using the specified random number generator. Values will be within default bounds. More...
 
void setToRandomPositions (const JointModelGroup *group)
 Set all joints in group to random values. Values will be within default bounds. More...
 
void setToRandomPositions (const JointModelGroup *group, random_numbers::RandomNumberGenerator &rng)
 Set all joints in group to random values using a specified random number generator. Values will be within default bounds. More...
 
void setToRandomPositionsNearBy (const JointModelGroup *group, const RobotState &seed, double distance)
 Set all joints in group to random values near the value in seed. distance is the maximum amount each joint value will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds. More...
 
void setToRandomPositionsNearBy (const JointModelGroup *group, const RobotState &seed, double distance, random_numbers::RandomNumberGenerator &rng)
 Set all joints in group to random values near the value in seed, using a specified random number generator. distance is the maximum amount each joint value will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds. More...
 
void setToRandomPositionsNearBy (const JointModelGroup *group, const RobotState &seed, const std::vector< double > &distances)
 Set all joints in group to random values near the value in seed. distances MUST have the same size as group.getActiveJointModels(). Each value in distances is the maximum amount the corresponding active joint in group will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds. More...
 
void setToRandomPositionsNearBy (const JointModelGroup *group, const RobotState &seed, const std::vector< double > &distances, random_numbers::RandomNumberGenerator &rng)
 Set all joints in group to random values near the value in seed, using a specified random number generator. distances MUST have the same size as group.getActiveJointModels(). Each value in distances is the maximum amount the corresponding active joint in group will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds. More...
 
Updating and getting transforms
void updateCollisionBodyTransforms ()
 Update the transforms for the collision bodies. This call is needed before calling collision checking. If updating link transforms or joint transorms is needed, the corresponding updates are also triggered. More...
 
void updateLinkTransforms ()
 Update the reference frame transforms for links. This call is needed before using the transforms of links for coordinate transforms. More...
 
void update (bool force=false)
 Update all transforms. More...
 
void updateStateWithLinkAt (const std::string &link_name, const Eigen::Isometry3d &transform, bool backward=false)
 Update the state after setting a particular link to the input global transform pose. More...
 
void updateStateWithLinkAt (const LinkModel *link, const Eigen::Isometry3d &transform, bool backward=false)
 Update the state after setting a particular link to the input global transform pose. More...
 
const moveit::core::LinkModelgetRigidlyConnectedParentLinkModel (const std::string &frame, Eigen::Isometry3d *transform=nullptr, const moveit::core::JointModelGroup *jmg=nullptr) const
 Get the latest link upwards the kinematic tree which is only connected via fixed joints. More...
 
const Eigen::Isometry3d & getGlobalLinkTransform (const std::string &link_name)
 Get the link transform w.r.t. the root link (model frame) of the RobotModel. This is typically the root link of the URDF unless a virtual joint is present. Checks the cache and if there are any dirty (non-updated) transforms, first updates them as needed. A related, more comprehensive function is |getFrameTransform|, which additionally to link frames also searches for attached object frames and their subframes. More...
 
const Eigen::Isometry3d & getGlobalLinkTransform (const LinkModel *link)
 
const Eigen::Isometry3d & getGlobalLinkTransform (const std::string &link_name) const
 
const Eigen::Isometry3d & getGlobalLinkTransform (const LinkModel *link) const
 
const Eigen::Isometry3d & getCollisionBodyTransform (const std::string &link_name, std::size_t index)
 Get the link transform w.r.t. the root link (model frame) of the RobotModel. This is typically the root link of the URDF unless a virtual joint is present. Checks the cache and if there are any dirty (non-updated) transforms, first updates them as needed. More...
 
const Eigen::Isometry3d & getCollisionBodyTransform (const LinkModel *link, std::size_t index)
 
const Eigen::Isometry3d & getCollisionBodyTransform (const std::string &link_name, std::size_t index) const
 
const Eigen::Isometry3d & getCollisionBodyTransform (const LinkModel *link, std::size_t index) const
 
const Eigen::Isometry3d & getJointTransform (const std::string &joint_name)
 
const Eigen::Isometry3d & getJointTransform (const JointModel *joint)
 
const Eigen::Isometry3d & getJointTransform (const std::string &joint_name) const
 
const Eigen::Isometry3d & getJointTransform (const JointModel *joint) const
 
bool dirtyJointTransform (const JointModel *joint) const
 
bool dirtyLinkTransforms () const
 
bool dirtyCollisionBodyTransforms () const
 
bool dirty () const
 Returns true if anything in this state is dirty. More...
 
Computing distances
double distance (const RobotState &other) const
 Return the sum of joint distances to "other" state. Only considers active joints. More...
 
double distance (const RobotState &other, const JointModelGroup *joint_group) const
 Return the sum of joint distances to "other" state. Only considers active joints. More...
 
double distance (const RobotState &other, const JointModel *joint) const
 Return the sum of joint distances to "other" state. Only considers active joints. More...
 
void interpolate (const RobotState &to, double t, RobotState &state) const
 
void interpolate (const RobotState &to, double t, RobotState &state, const JointModelGroup *joint_group) const
 
void interpolate (const RobotState &to, double t, RobotState &state, const JointModel *joint) const
 
void enforceBounds ()
 
void enforceBounds (const JointModelGroup *joint_group)
 
void enforceBounds (const JointModel *joint)
 
void enforcePositionBounds (const JointModel *joint)
 
void harmonizePositions ()
 Call harmonizePosition() for all joints / all joints in group / given joint. More...
 
void harmonizePositions (const JointModelGroup *joint_group)
 
void harmonizePosition (const JointModel *joint)
 
void enforceVelocityBounds (const JointModel *joint)
 
bool satisfiesBounds (double margin=0.0) const
 
bool satisfiesBounds (const JointModelGroup *joint_group, double margin=0.0) const
 
bool satisfiesBounds (const JointModel *joint, double margin=0.0) const
 
bool satisfiesPositionBounds (const JointModel *joint, double margin=0.0) const
 
bool satisfiesVelocityBounds (const JointModel *joint, double margin=0.0) const
 
std::pair< double, const JointModel * > getMinDistanceToPositionBounds () const
 Get the minimm distance from this state to the bounds. The minimum distance and the joint for which this minimum is achieved are returned. More...
 
std::pair< double, const JointModel * > getMinDistanceToPositionBounds (const JointModelGroup *group) const
 Get the minimm distance from a group in this state to the bounds. The minimum distance and the joint for which this minimum is achieved are returned. More...
 
std::pair< double, const JointModel * > getMinDistanceToPositionBounds (const std::vector< const JointModel * > &joints) const
 Get the minimm distance from a set of joints in the state to the bounds. The minimum distance and the joint for which this minimum is achieved are returned. More...
 
bool isValidVelocityMove (const RobotState &other, const JointModelGroup *group, double dt) const
 Check that the time to move between two waypoints is sufficient given velocity limits and time step. More...
 
Managing attached bodies
void attachBody (std::unique_ptr< AttachedBody > attached_body)
 Add an attached body to this state. More...
 
void attachBody (AttachedBody *attached_body)
 Add an attached body to this state. Ownership of the memory for the attached body is assumed by the state. More...
 
void attachBody (const std::string &id, const Eigen::Isometry3d &pose, const std::vector< shapes::ShapeConstPtr > &shapes, const EigenSTL::vector_Isometry3d &shape_poses, const std::set< std::string > &touch_links, const std::string &link_name, const trajectory_msgs::JointTrajectory &detach_posture=trajectory_msgs::JointTrajectory(), const moveit::core::FixedTransformsMap &subframe_poses=moveit::core::FixedTransformsMap())
 Add an attached body to a link. More...
 
void attachBody (const std::string &id, const Eigen::Isometry3d &pose, const std::vector< shapes::ShapeConstPtr > &shapes, const EigenSTL::vector_Isometry3d &shape_poses, const std::vector< std::string > &touch_links, const std::string &link_name, const trajectory_msgs::JointTrajectory &detach_posture=trajectory_msgs::JointTrajectory(), const moveit::core::FixedTransformsMap &subframe_poses=moveit::core::FixedTransformsMap())
 Add an attached body to a link. More...
 
void getAttachedBodies (std::vector< const AttachedBody * > &attached_bodies) const
 Get all bodies attached to the model corresponding to this state. More...
 
void getAttachedBodies (std::vector< const AttachedBody * > &attached_bodies, const JointModelGroup *group) const
 Get all bodies attached to a particular group the model corresponding to this state. More...
 
void getAttachedBodies (std::vector< const AttachedBody * > &attached_bodies, const LinkModel *link_model) const
 Get all bodies attached to a particular link in the model corresponding to this state. More...
 
bool clearAttachedBody (const std::string &id)
 Remove the attached body named id. Return false if the object was not found (and thus not removed). Return true on success. More...
 
void clearAttachedBodies (const LinkModel *link)
 Clear the bodies attached to a specific link. More...
 
void clearAttachedBodies (const JointModelGroup *group)
 Clear the bodies attached to a specific group. More...
 
void clearAttachedBodies ()
 Clear all attached bodies. This calls delete on the AttachedBody instances, if needed. More...
 
const AttachedBodygetAttachedBody (const std::string &name) const
 Get the attached body named name. Return NULL if not found. More...
 
bool hasAttachedBody (const std::string &id) const
 Check if an attached body named id exists in this state. More...
 
void setAttachedBodyUpdateCallback (const AttachedBodyCallback &callback)
 

Private Member Functions

void allocMemory ()
 
bool checkCollisionTransforms () const
 This function is only called in debug mode. More...
 
bool checkJointTransforms (const JointModel *joint) const
 This function is only called in debug mode. More...
 
bool checkLinkTransforms () const
 This function is only called in debug mode. More...
 
void copyFrom (const RobotState &other)
 
void getMissingKeys (const std::map< std::string, double > &variable_map, std::vector< std::string > &missing_variables) const
 
void getStateTreeJointString (std::ostream &ss, const JointModel *jm, const std::string &pfx0, bool last) const
 
void initTransforms ()
 
void markAcceleration ()
 
void markDirtyJointTransforms (const JointModel *joint)
 
void markDirtyJointTransforms (const JointModelGroup *group)
 
void markEffort ()
 
void markVelocity ()
 
void updateLinkTransformsInternal (const JointModel *start)
 
void updateMimicJoint (const JointModel *joint)
 
void updateMimicJoint (const std::vector< const JointModel * > &mim)
 Update a set of joints that are certain to be mimicking other joints. More...
 
void updateMimicJoints (const JointModelGroup *group)
 Update all mimic joints within group. More...
 

Private Attributes

double * acceleration_
 
std::map< std::string, std::unique_ptr< AttachedBody > > attached_body_map_
 All attached bodies that are part of this state, indexed by their name. More...
 
AttachedBodyCallback attached_body_update_callback_
 This event is called when there is a change in the attached bodies for this state; The event specifies the body that changed and whether it was just attached or about to be detached. More...
 
const JointModeldirty_collision_body_transforms_
 
unsigned char * dirty_joint_transforms_
 
const JointModeldirty_link_transforms_
 
double * effort_
 
Eigen::Isometry3d * global_collision_body_transforms_
 Transforms from model frame to collision bodies. More...
 
Eigen::Isometry3d * global_link_transforms_
 Transforms from model frame to link frame for each link. More...
 
bool has_acceleration_
 
bool has_effort_
 
bool has_velocity_
 
void * memory_
 
double * position_
 
random_numbers::RandomNumberGeneratorrng_
 For certain operations a state needs a random number generator. However, it may be slightly expensive to allocate the random number generator if many state instances are generated. For this reason, the generator is allocated on a need basis, by the getRandomNumberGenerator() function. Never use the rng_ member directly, but call getRandomNumberGenerator() instead. More...
 
RobotModelConstPtr robot_model_
 
Eigen::Isometry3d * variable_joint_transforms_
 Local transforms of all joints. More...
 
double * velocity_
 

Detailed Description

Representation of a robot's state. This includes position, velocity, acceleration and effort.

At the lowest level, a state is a collection of variables. Each variable has a name and can have position, velocity, acceleration and effort associated to it. Effort and acceleration share the memory area for efficiency reasons (one should not set both acceleration and effort in the same state and expect things to work). Often variables correspond to joint names as well (joints with one degree of freedom have one variable), but joints with multiple degrees of freedom have more variables. Operations are allowed at variable level, joint level (see JointModel) and joint group level (see JointModelGroup).

For efficiency reasons a state computes forward kinematics in a lazy fashion. This can sometimes lead to problems if the update() function was not called on the state.

Definition at line 155 of file robot_state.h.

Constructor & Destructor Documentation

◆ RobotState() [1/2]

moveit::core::RobotState::RobotState ( const RobotModelConstPtr &  robot_model)

A state can be constructed from a specified robot model. No values are initialized. Call setToDefaultValues() if a state needs to provide valid information.

Definition at line 125 of file robot_state.cpp.

◆ ~RobotState()

moveit::core::RobotState::~RobotState ( )

Definition at line 151 of file robot_state.cpp.

◆ RobotState() [2/2]

moveit::core::RobotState::RobotState ( const RobotState other)

Copy constructor.

Definition at line 144 of file robot_state.cpp.

Member Function Documentation

◆ allocMemory()

void moveit::core::RobotState::allocMemory ( )
private

Definition at line 159 of file robot_state.cpp.

◆ attachBody() [1/4]

void moveit::core::RobotState::attachBody ( AttachedBody attached_body)

Add an attached body to this state. Ownership of the memory for the attached body is assumed by the state.

This only adds the given body to this RobotState instance. It does not change anything about other representations of the object elsewhere in the system. So if the body represents an object in a collision_detection::World (like from a planning_scene::PlanningScene), you will likely need to remove the corresponding object from that world to avoid having collisions detected against it.

Note
This version of the function (taking an AttachedBody pointer) does not copy the AttachedBody object, it just uses it directly. The AttachedBody object stores its position data internally. This means you should never attach a single AttachedBody instance to multiple RobotState instances, or the body positions will get corrupted. You need to make a fresh copy of the AttachedBody object for each RobotState you attach it to.

Definition at line 1098 of file robot_state.cpp.

◆ attachBody() [2/4]

void moveit::core::RobotState::attachBody ( const std::string &  id,
const Eigen::Isometry3d &  pose,
const std::vector< shapes::ShapeConstPtr > &  shapes,
const EigenSTL::vector_Isometry3d shape_poses,
const std::set< std::string > &  touch_links,
const std::string &  link_name,
const trajectory_msgs::JointTrajectory &  detach_posture = trajectory_msgs::JointTrajectory(),
const moveit::core::FixedTransformsMap subframe_poses = moveit::core::FixedTransformsMap() 
)

Add an attached body to a link.

Parameters
idThe string id associated with the attached body
poseThe pose associated with the attached body
shapesThe shapes that make up the attached body
shape_posesThe transforms between the object pose and the attached body's shapes
touch_linksThe set of links that the attached body is allowed to touch
link_nameThe link to attach to
detach_postureThe posture of the gripper when placing the object
subframe_posesTransforms to points of interest on the object (can be used as end effector link)

This only adds the given body to this RobotState instance. It does not change anything about other representations of the object elsewhere in the system. So if the body represents an object in a collision_detection::World (like from a planning_scene::PlanningScene), you will likely need to remove the corresponding object from that world to avoid having collisions detected against it.

Definition at line 1103 of file robot_state.cpp.

◆ attachBody() [3/4]

void moveit::core::RobotState::attachBody ( const std::string &  id,
const Eigen::Isometry3d &  pose,
const std::vector< shapes::ShapeConstPtr > &  shapes,
const EigenSTL::vector_Isometry3d shape_poses,
const std::vector< std::string > &  touch_links,
const std::string &  link_name,
const trajectory_msgs::JointTrajectory &  detach_posture = trajectory_msgs::JointTrajectory(),
const moveit::core::FixedTransformsMap subframe_poses = moveit::core::FixedTransformsMap() 
)
inline

Add an attached body to a link.

Parameters
idThe string id associated with the attached body
poseThe pose associated with the attached body
shapesThe shapes that make up the attached body
shape_posesThe transforms between the object pose and the attached body's shapes
touch_linksThe set of links that the attached body is allowed to touch
link_nameThe link to attach to
detach_postureThe posture of the gripper when placing the object
subframe_posesTransforms to points of interest on the object (can be used as end effector link)

This only adds the given body to this RobotState instance. It does not change anything about other representations of the object elsewhere in the system. So if the body represents an object in a collision_detection::World (like from a planning_scene::PlanningScene), you will likely need to remove the corresponding object from that world to avoid having collisions detected against it.

Definition at line 1776 of file robot_state.h.

◆ attachBody() [4/4]

void moveit::core::RobotState::attachBody ( std::unique_ptr< AttachedBody attached_body)

Add an attached body to this state.

This only adds the given body to this RobotState instance. It does not change anything about other representations of the object elsewhere in the system. So if the body represents an object in a collision_detection::World (like from a planning_scene::PlanningScene), you will likely need to remove the corresponding object from that world to avoid having collisions detected against it.

Definition at line 1087 of file robot_state.cpp.

◆ checkCollisionTransforms()

bool moveit::core::RobotState::checkCollisionTransforms ( ) const
private

This function is only called in debug mode.

Definition at line 274 of file robot_state.cpp.

◆ checkJointTransforms()

bool moveit::core::RobotState::checkJointTransforms ( const JointModel joint) const
private

This function is only called in debug mode.

Definition at line 254 of file robot_state.cpp.

◆ checkLinkTransforms()

bool moveit::core::RobotState::checkLinkTransforms ( ) const
private

This function is only called in debug mode.

Definition at line 264 of file robot_state.cpp.

◆ clearAttachedBodies() [1/3]

void moveit::core::RobotState::clearAttachedBodies ( )

Clear all attached bodies. This calls delete on the AttachedBody instances, if needed.

Definition at line 1137 of file robot_state.cpp.

◆ clearAttachedBodies() [2/3]

void moveit::core::RobotState::clearAttachedBodies ( const JointModelGroup group)

Clear the bodies attached to a specific group.

Definition at line 1162 of file robot_state.cpp.

◆ clearAttachedBodies() [3/3]

void moveit::core::RobotState::clearAttachedBodies ( const LinkModel link)

Clear the bodies attached to a specific link.

Definition at line 1147 of file robot_state.cpp.

◆ clearAttachedBody()

bool moveit::core::RobotState::clearAttachedBody ( const std::string &  id)

Remove the attached body named id. Return false if the object was not found (and thus not removed). Return true on success.

Definition at line 1177 of file robot_state.cpp.

◆ computeAABB() [1/2]

void moveit::core::RobotState::computeAABB ( std::vector< double > &  aabb)
inline

Compute an axis-aligned bounding box that contains the current state. The format for aabb is (minx, maxx, miny, maxy, minz, maxz)

Definition at line 1823 of file robot_state.h.

◆ computeAABB() [2/2]

void moveit::core::RobotState::computeAABB ( std::vector< double > &  aabb) const

Compute an axis-aligned bounding box that contains the current state. The format for aabb is (minx, maxx, miny, maxy, minz, maxz)

Definition at line 2129 of file robot_state.cpp.

◆ computeCartesianPath() [1/3]

double moveit::core::RobotState::computeCartesianPath ( const JointModelGroup group,
std::vector< RobotStatePtr > &  traj,
const LinkModel link,
const Eigen::Isometry3d &  target,
bool  global_reference_frame,
double  max_step,
double  jump_threshold_factor,
const GroupStateValidityCallbackFn validCallback = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

Compute the sequence of joint values that correspond to a straight Cartesian path, for a particular group.

In contrast to the previous function, the Cartesian path is specified as a target frame to be reached (target) for the origin of a robot link (link). The target frame is assumed to be either in a global reference frame or in the local reference frame of the link. In the latter case (global_reference_frame is false) the target is rotated accordingly. All other comments from the previous function apply.

NOTE: As of ROS-Melodic these are deprecated and should not be used

Definition at line 2107 of file robot_state.cpp.

◆ computeCartesianPath() [2/3]

double moveit::core::RobotState::computeCartesianPath ( const JointModelGroup group,
std::vector< RobotStatePtr > &  traj,
const LinkModel link,
const Eigen::Vector3d direction,
bool  global_reference_frame,
double  distance,
double  max_step,
double  jump_threshold_factor,
const GroupStateValidityCallbackFn validCallback = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

Compute the sequence of joint values that correspond to a straight Cartesian path for a particular group.

The Cartesian path to be followed is specified as a direction of motion (direction, unit vector) for the origin The Cartesian path to be followed is specified as a direction of motion (direction, unit vector) for the origin of a robot link (link). The direction is assumed to be either in a global reference frame or in the local reference frame of the link. In the latter case (global_reference_frame is false) the direction is rotated accordingly. The link needs to move in a straight line, following the specified direction, for the desired distance. The resulting joint values are stored in the vector traj, one by one. The maximum distance in Cartesian space between consecutive points on the resulting path is specified in the MaxEEFStep struct which provides two fields: translation and rotation. If a validCallback is specified, this is passed to the internal call to setFromIK(). In case of IK failure, the computation of the path stops and the value returned corresponds to the distance that was computed and for which corresponding states were added to the path. At the end of the function call, the state of the group corresponds to the last attempted Cartesian pose.

During the computation of the trajectory, it is usually preferred if consecutive joint values do not 'jump' by a large amount in joint space, even if the Cartesian distance between the corresponding points is small as expected. To account for this, the jump_threshold struct is provided, which comprises three fields: jump_threshold_factor, revolute_jump_threshold and prismatic_jump_threshold. If either revolute_jump_threshold or prismatic_jump_threshold are non-zero, we test for absolute jumps. If jump_threshold_factor is non-zero, we test for relative jumps. Otherwise (all params are zero), jump detection is disabled.

For relative jump detection, the average joint-space distance between consecutive points in the trajectory is computed. If any individual joint-space motion delta is larger then this average distance by a factor of jump_threshold_factor, this step is considered a failure and the returned path is truncated up to just before the jump.

For absolute jump thresholds, if any individual joint-space motion delta is larger then revolute_jump_threshold for revolute joints or prismatic_jump_threshold for prismatic joints then this step is considered a failure and the returned path is truncated up to just before the jump.

NOTE: As of ROS-Melodic these are deprecated and should not be used

Definition at line 2096 of file robot_state.cpp.

◆ computeCartesianPath() [3/3]

double moveit::core::RobotState::computeCartesianPath ( const JointModelGroup group,
std::vector< RobotStatePtr > &  traj,
const LinkModel link,
const EigenSTL::vector_Isometry3d waypoints,
bool  global_reference_frame,
double  max_step,
double  jump_threshold_factor,
const GroupStateValidityCallbackFn validCallback = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

Compute the sequence of joint values that perform a general Cartesian path.

In contrast to the previous functions, the Cartesian path is specified as a set of waypoints to be sequentially reached for the origin of a robot link (link). The waypoints are transforms given either in a global reference frame or in the local reference frame of the link at the immediately preceeding waypoint. The link needs to move in a straight line between two consecutive waypoints. All other comments apply.

NOTE: As of ROS-Melodic these are deprecated and should not be used

Definition at line 2118 of file robot_state.cpp.

◆ computeVariableVelocity() [1/2]

void moveit::core::RobotState::computeVariableVelocity ( const JointModelGroup jmg,
Eigen::VectorXd qdot,
const Eigen::VectorXd twist,
const LinkModel tip 
)
inline

Given a twist for a particular link (tip), compute the corresponding velocity for every variable and store it in qdot.

Definition at line 1321 of file robot_state.h.

◆ computeVariableVelocity() [2/2]

void moveit::core::RobotState::computeVariableVelocity ( const JointModelGroup jmg,
Eigen::VectorXd qdot,
const Eigen::VectorXd twist,
const LinkModel tip 
) const

Given a twist for a particular link (tip), compute the corresponding velocity for every variable and store it in qdot.

Definition at line 1498 of file robot_state.cpp.

◆ copyFrom()

void moveit::core::RobotState::copyFrom ( const RobotState other)
private

Definition at line 215 of file robot_state.cpp.

◆ copyJointGroupAccelerations() [1/6]

void moveit::core::RobotState::copyJointGroupAccelerations ( const JointModelGroup group,
double *  gstate 
) const

For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 711 of file robot_state.cpp.

◆ copyJointGroupAccelerations() [2/6]

void moveit::core::RobotState::copyJointGroupAccelerations ( const JointModelGroup group,
Eigen::VectorXd values 
) const

For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 721 of file robot_state.cpp.

◆ copyJointGroupAccelerations() [3/6]

void moveit::core::RobotState::copyJointGroupAccelerations ( const JointModelGroup group,
std::vector< double > &  gstate 
) const
inline

For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 980 of file robot_state.h.

◆ copyJointGroupAccelerations() [4/6]

void moveit::core::RobotState::copyJointGroupAccelerations ( const std::string &  joint_group_name,
double *  gstate 
) const
inline

For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 970 of file robot_state.h.

◆ copyJointGroupAccelerations() [5/6]

void moveit::core::RobotState::copyJointGroupAccelerations ( const std::string &  joint_group_name,
Eigen::VectorXd values 
) const
inline

For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 994 of file robot_state.h.

◆ copyJointGroupAccelerations() [6/6]

void moveit::core::RobotState::copyJointGroupAccelerations ( const std::string &  joint_group_name,
std::vector< double > &  gstate 
) const
inline

For a given group, copy the acceleration values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 957 of file robot_state.h.

◆ copyJointGroupPositions() [1/6]

void moveit::core::RobotState::copyJointGroupPositions ( const JointModelGroup group,
double *  gstate 
) const

For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 633 of file robot_state.cpp.

◆ copyJointGroupPositions() [2/6]

void moveit::core::RobotState::copyJointGroupPositions ( const JointModelGroup group,
Eigen::VectorXd values 
) const

For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 643 of file robot_state.cpp.

◆ copyJointGroupPositions() [3/6]

void moveit::core::RobotState::copyJointGroupPositions ( const JointModelGroup group,
std::vector< double > &  gstate 
) const
inline

For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 780 of file robot_state.h.

◆ copyJointGroupPositions() [4/6]

void moveit::core::RobotState::copyJointGroupPositions ( const std::string &  joint_group_name,
double *  gstate 
) const
inline

For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 770 of file robot_state.h.

◆ copyJointGroupPositions() [5/6]

void moveit::core::RobotState::copyJointGroupPositions ( const std::string &  joint_group_name,
Eigen::VectorXd values 
) const
inline

For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 794 of file robot_state.h.

◆ copyJointGroupPositions() [6/6]

void moveit::core::RobotState::copyJointGroupPositions ( const std::string &  joint_group_name,
std::vector< double > &  gstate 
) const
inline

For a given group, copy the position values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 757 of file robot_state.h.

◆ copyJointGroupVelocities() [1/6]

void moveit::core::RobotState::copyJointGroupVelocities ( const JointModelGroup group,
double *  gstate 
) const

For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 672 of file robot_state.cpp.

◆ copyJointGroupVelocities() [2/6]

void moveit::core::RobotState::copyJointGroupVelocities ( const JointModelGroup group,
Eigen::VectorXd values 
) const

For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 682 of file robot_state.cpp.

◆ copyJointGroupVelocities() [3/6]

void moveit::core::RobotState::copyJointGroupVelocities ( const JointModelGroup group,
std::vector< double > &  gstate 
) const
inline

For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 880 of file robot_state.h.

◆ copyJointGroupVelocities() [4/6]

void moveit::core::RobotState::copyJointGroupVelocities ( const std::string &  joint_group_name,
double *  gstate 
) const
inline

For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 870 of file robot_state.h.

◆ copyJointGroupVelocities() [5/6]

void moveit::core::RobotState::copyJointGroupVelocities ( const std::string &  joint_group_name,
Eigen::VectorXd values 
) const
inline

For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 894 of file robot_state.h.

◆ copyJointGroupVelocities() [6/6]

void moveit::core::RobotState::copyJointGroupVelocities ( const std::string &  joint_group_name,
std::vector< double > &  gstate 
) const
inline

For a given group, copy the velocity values of the variables that make up the group into another location, in the order that the variables are found in the group. This is not necessarily a contiguous block of memory in the RobotState itself, so we copy instead of returning a pointer.

Definition at line 857 of file robot_state.h.

◆ dirty()

bool moveit::core::RobotState::dirty ( ) const
inline

Returns true if anything in this state is dirty.

Definition at line 1564 of file robot_state.h.

◆ dirtyCollisionBodyTransforms()

bool moveit::core::RobotState::dirtyCollisionBodyTransforms ( ) const
inline

Definition at line 1558 of file robot_state.h.

◆ dirtyJointTransform()

bool moveit::core::RobotState::dirtyJointTransform ( const JointModel joint) const
inline

Definition at line 1548 of file robot_state.h.

◆ dirtyLinkTransforms()

bool moveit::core::RobotState::dirtyLinkTransforms ( ) const
inline

Definition at line 1553 of file robot_state.h.

◆ distance() [1/3]

double moveit::core::RobotState::distance ( const RobotState other) const
inline

Return the sum of joint distances to "other" state. Only considers active joints.

Definition at line 1576 of file robot_state.h.

◆ distance() [2/3]

double moveit::core::RobotState::distance ( const RobotState other,
const JointModel joint 
) const
inline

Return the sum of joint distances to "other" state. Only considers active joints.

Definition at line 1585 of file robot_state.h.

◆ distance() [3/3]

double moveit::core::RobotState::distance ( const RobotState other,
const JointModelGroup joint_group 
) const

Return the sum of joint distances to "other" state. Only considers active joints.

Definition at line 1032 of file robot_state.cpp.

◆ dropAccelerations()

void moveit::core::RobotState::dropAccelerations ( )

Remove accelerations from this state (this differs from setting them to zero)

Definition at line 336 of file robot_state.cpp.

◆ dropDynamics()

void moveit::core::RobotState::dropDynamics ( )

Reduce RobotState to kinematic information (remove velocity, acceleration and effort, if present)

Definition at line 346 of file robot_state.cpp.

◆ dropEffort()

void moveit::core::RobotState::dropEffort ( )

Remove effort values from this state (this differs from setting them to zero)

Definition at line 341 of file robot_state.cpp.

◆ dropVelocities()

void moveit::core::RobotState::dropVelocities ( )

Remove velocities from this state (this differs from setting them to zero)

Definition at line 331 of file robot_state.cpp.

◆ enforceBounds() [1/3]

void moveit::core::RobotState::enforceBounds ( )

Definition at line 939 of file robot_state.cpp.

◆ enforceBounds() [2/3]

void moveit::core::RobotState::enforceBounds ( const JointModel joint)
inline

Definition at line 1631 of file robot_state.h.

◆ enforceBounds() [3/3]

void moveit::core::RobotState::enforceBounds ( const JointModelGroup joint_group)

Definition at line 946 of file robot_state.cpp.

◆ enforcePositionBounds()

void moveit::core::RobotState::enforcePositionBounds ( const JointModel joint)
inline

Definition at line 1637 of file robot_state.h.

◆ enforceVelocityBounds()

void moveit::core::RobotState::enforceVelocityBounds ( const JointModel joint)
inline

Definition at line 1656 of file robot_state.h.

◆ getAttachedBodies() [1/3]

void moveit::core::RobotState::getAttachedBodies ( std::vector< const AttachedBody * > &  attached_bodies) const

Get all bodies attached to the model corresponding to this state.

Definition at line 1113 of file robot_state.cpp.

◆ getAttachedBodies() [2/3]

void moveit::core::RobotState::getAttachedBodies ( std::vector< const AttachedBody * > &  attached_bodies,
const JointModelGroup group 
) const

Get all bodies attached to a particular group the model corresponding to this state.

Definition at line 1121 of file robot_state.cpp.

◆ getAttachedBodies() [3/3]

void moveit::core::RobotState::getAttachedBodies ( std::vector< const AttachedBody * > &  attached_bodies,
const LinkModel link_model 
) const

Get all bodies attached to a particular link in the model corresponding to this state.

Definition at line 1129 of file robot_state.cpp.

◆ getAttachedBody()

const AttachedBody * moveit::core::RobotState::getAttachedBody ( const std::string &  name) const

Get the attached body named name. Return NULL if not found.

Definition at line 1075 of file robot_state.cpp.

◆ getCollisionBodyTransform() [1/4]

const Eigen::Isometry3d& moveit::core::RobotState::getCollisionBodyTransform ( const LinkModel link,
std::size_t  index 
)
inline

Definition at line 1503 of file robot_state.h.

◆ getCollisionBodyTransform() [2/4]

const Eigen::Isometry3d& moveit::core::RobotState::getCollisionBodyTransform ( const LinkModel link,
std::size_t  index 
) const
inline

Definition at line 1514 of file robot_state.h.

◆ getCollisionBodyTransform() [3/4]

const Eigen::Isometry3d& moveit::core::RobotState::getCollisionBodyTransform ( const std::string &  link_name,
std::size_t  index 
)
inline

Get the link transform w.r.t. the root link (model frame) of the RobotModel. This is typically the root link of the URDF unless a virtual joint is present. Checks the cache and if there are any dirty (non-updated) transforms, first updates them as needed.

As opposed to the visual links in |getGlobalLinkTransform|, this function returns the collision link transform used for collision checking.

Parameters
link_namename of link to lookup
indexspecify which collision body to lookup, if more than one exists

Definition at line 1498 of file robot_state.h.

◆ getCollisionBodyTransform() [4/4]

const Eigen::Isometry3d& moveit::core::RobotState::getCollisionBodyTransform ( const std::string &  link_name,
std::size_t  index 
) const
inline

Definition at line 1509 of file robot_state.h.

◆ getFrameInfo()

const Eigen::Isometry3d & moveit::core::RobotState::getFrameInfo ( const std::string &  frame_id,
const LinkModel *&  robot_link,
bool &  frame_found 
) const

Get the transformation matrix from the model frame (root of model) to the frame identified by frame_id.

If this frame is attached to a robot link, the link pointer is returned in robot_link. If frame_id was not found, frame_found is set to false and an identity transform is returned.

The returned transformation is always a valid isometry.

Definition at line 1211 of file robot_state.cpp.

◆ getFrameTransform() [1/2]

const Eigen::Isometry3d & moveit::core::RobotState::getFrameTransform ( const std::string &  frame_id,
bool *  frame_found = nullptr 
)

Get the transformation matrix from the model frame (root of model) to the frame identified by frame_id.

If frame_id was not found, frame_found is set to false and an identity transform is returned.

The returned transformation is always a valid isometry.

Definition at line 1191 of file robot_state.cpp.

◆ getFrameTransform() [2/2]

const Eigen::Isometry3d & moveit::core::RobotState::getFrameTransform ( const std::string &  frame_id,
bool *  frame_found = nullptr 
) const

Get the transformation matrix from the model frame (root of model) to the frame identified by frame_id.

If frame_id was not found, frame_found is set to false and an identity transform is returned.

The returned transformation is always a valid isometry.

Definition at line 1197 of file robot_state.cpp.

◆ getGlobalLinkTransform() [1/4]

const Eigen::Isometry3d& moveit::core::RobotState::getGlobalLinkTransform ( const LinkModel link)
inline

Definition at line 1471 of file robot_state.h.

◆ getGlobalLinkTransform() [2/4]

const Eigen::Isometry3d& moveit::core::RobotState::getGlobalLinkTransform ( const LinkModel link) const
inline

Definition at line 1482 of file robot_state.h.

◆ getGlobalLinkTransform() [3/4]

const Eigen::Isometry3d& moveit::core::RobotState::getGlobalLinkTransform ( const std::string &  link_name)
inline

Get the link transform w.r.t. the root link (model frame) of the RobotModel. This is typically the root link of the URDF unless a virtual joint is present. Checks the cache and if there are any dirty (non-updated) transforms, first updates them as needed. A related, more comprehensive function is |getFrameTransform|, which additionally to link frames also searches for attached object frames and their subframes.

The returned transformation is always a valid isometry.

Definition at line 1466 of file robot_state.h.

◆ getGlobalLinkTransform() [4/4]

const Eigen::Isometry3d& moveit::core::RobotState::getGlobalLinkTransform ( const std::string &  link_name) const
inline

Definition at line 1477 of file robot_state.h.

◆ getJacobian() [1/4]

Eigen::MatrixXd moveit::core::RobotState::getJacobian ( const JointModelGroup group,
const Eigen::Vector3d reference_point_position = Eigen::Vector3d(0.0, 0.0, 0.0) 
)
inline

Compute the Jacobian with reference to the last link of a specified group. If the group is not a chain, an exception is thrown.

Parameters
groupThe group to compute the Jacobian for
reference_point_positionThe reference point position (with respect to the link specified in link_name)
Returns
The computed Jacobian.

Definition at line 1307 of file robot_state.h.

◆ getJacobian() [2/4]

Eigen::MatrixXd moveit::core::RobotState::getJacobian ( const JointModelGroup group,
const Eigen::Vector3d reference_point_position = Eigen::Vector3d(0.0, 0.0, 0.0) 
) const

Compute the Jacobian with reference to the last link of a specified group. If the group is not a chain, an exception is thrown.

Parameters
groupThe group to compute the Jacobian for
reference_point_positionThe reference point position (with respect to the link specified in link_name)
Returns
The computed Jacobian.

Definition at line 1365 of file robot_state.cpp.

◆ getJacobian() [3/4]

bool moveit::core::RobotState::getJacobian ( const JointModelGroup group,
const LinkModel link,
const Eigen::Vector3d reference_point_position,
Eigen::MatrixXd &  jacobian,
bool  use_quaternion_representation = false 
)
inline

Compute the Jacobian with reference to a particular point on a given link, for a specified group.

Parameters
groupThe group to compute the Jacobian for
linkThe link model to compute the Jacobian for
reference_point_positionThe reference point position (with respect to the link specified in link)
jacobianThe resultant jacobian
use_quaternion_representationFlag indicating if the Jacobian should use a quaternion representation (default is false)
Returns
True if jacobian was successfully computed, false otherwise

Definition at line 1284 of file robot_state.h.

◆ getJacobian() [4/4]

bool moveit::core::RobotState::getJacobian ( const JointModelGroup group,
const LinkModel link,
const Eigen::Vector3d reference_point_position,
Eigen::MatrixXd &  jacobian,
bool  use_quaternion_representation = false 
) const

Compute the Jacobian with reference to a particular point on a given link, for a specified group.

Parameters
groupThe group to compute the Jacobian for
linkThe link model to compute the Jacobian for
reference_point_positionThe reference point position (with respect to the link specified in link)
jacobianThe resultant jacobian
use_quaternion_representationFlag indicating if the Jacobian should use a quaternion representation (default is false)
Returns
True if jacobian was successfully computed, false otherwise

Definition at line 1374 of file robot_state.cpp.

◆ getJointAccelerations() [1/2]

const double* moveit::core::RobotState::getJointAccelerations ( const JointModel joint) const
inline

Definition at line 648 of file robot_state.h.

◆ getJointAccelerations() [2/2]

const double* moveit::core::RobotState::getJointAccelerations ( const std::string &  joint_name) const
inline

Definition at line 643 of file robot_state.h.

◆ getJointEffort() [1/2]

const double* moveit::core::RobotState::getJointEffort ( const JointModel joint) const
inline

Definition at line 658 of file robot_state.h.

◆ getJointEffort() [2/2]

const double* moveit::core::RobotState::getJointEffort ( const std::string &  joint_name) const
inline

Definition at line 653 of file robot_state.h.

◆ getJointModel()

const JointModel* moveit::core::RobotState::getJointModel ( const std::string &  joint) const
inline

Get the model of a particular joint.

Definition at line 194 of file robot_state.h.

◆ getJointModelGroup()

const JointModelGroup* moveit::core::RobotState::getJointModelGroup ( const std::string &  group) const
inline

Get the model of a particular joint group.

Definition at line 200 of file robot_state.h.

◆ getJointPositions() [1/2]

const double* moveit::core::RobotState::getJointPositions ( const JointModel joint) const
inline

Definition at line 628 of file robot_state.h.

◆ getJointPositions() [2/2]

const double* moveit::core::RobotState::getJointPositions ( const std::string &  joint_name) const
inline

Definition at line 623 of file robot_state.h.

◆ getJointTransform() [1/4]

const Eigen::Isometry3d& moveit::core::RobotState::getJointTransform ( const JointModel joint)
inline

Definition at line 1525 of file robot_state.h.

◆ getJointTransform() [2/4]

const Eigen::Isometry3d& moveit::core::RobotState::getJointTransform ( const JointModel joint) const
inline

Definition at line 1542 of file robot_state.h.

◆ getJointTransform() [3/4]

const Eigen::Isometry3d& moveit::core::RobotState::getJointTransform ( const std::string &  joint_name)
inline

Definition at line 1520 of file robot_state.h.

◆ getJointTransform() [4/4]

const Eigen::Isometry3d& moveit::core::RobotState::getJointTransform ( const std::string &  joint_name) const
inline

Definition at line 1537 of file robot_state.h.

◆ getJointVelocities() [1/2]

const double* moveit::core::RobotState::getJointVelocities ( const JointModel joint) const
inline

Definition at line 638 of file robot_state.h.

◆ getJointVelocities() [2/2]

const double* moveit::core::RobotState::getJointVelocities ( const std::string &  joint_name) const
inline

Definition at line 633 of file robot_state.h.

◆ getLinkModel()

const LinkModel* moveit::core::RobotState::getLinkModel ( const std::string &  link) const
inline

Get the model of a particular link.

Definition at line 188 of file robot_state.h.

◆ getMinDistanceToPositionBounds() [1/3]

std::pair< double, const JointModel * > moveit::core::RobotState::getMinDistanceToPositionBounds ( ) const

Get the minimm distance from this state to the bounds. The minimum distance and the joint for which this minimum is achieved are returned.

Definition at line 965 of file robot_state.cpp.

◆ getMinDistanceToPositionBounds() [2/3]

std::pair< double, const JointModel * > moveit::core::RobotState::getMinDistanceToPositionBounds ( const JointModelGroup group) const

Get the minimm distance from a group in this state to the bounds. The minimum distance and the joint for which this minimum is achieved are returned.

Definition at line 970 of file robot_state.cpp.

◆ getMinDistanceToPositionBounds() [3/3]

std::pair< double, const JointModel * > moveit::core::RobotState::getMinDistanceToPositionBounds ( const std::vector< const JointModel * > &  joints) const

Get the minimm distance from a set of joints in the state to the bounds. The minimum distance and the joint for which this minimum is achieved are returned.

Definition at line 976 of file robot_state.cpp.

◆ getMissingKeys()

void moveit::core::RobotState::getMissingKeys ( const std::map< std::string, double > &  variable_map,
std::vector< std::string > &  missing_variables 
) const
private

Definition at line 467 of file robot_state.cpp.

◆ getRandomNumberGenerator()

random_numbers::RandomNumberGenerator& moveit::core::RobotState::getRandomNumberGenerator ( )
inline

Return the instance of a random number generator.

Definition at line 1830 of file robot_state.h.

◆ getRigidlyConnectedParentLinkModel()

const LinkModel * moveit::core::RobotState::getRigidlyConnectedParentLinkModel ( const std::string &  frame,
Eigen::Isometry3d *  transform = nullptr,
const moveit::core::JointModelGroup jmg = nullptr 
) const

Get the latest link upwards the kinematic tree which is only connected via fixed joints.

This behaves the same as RobotModel::getRigidlyConnectedParentLinkModel, but can additionally resolve parents for attached objects / subframes.

If transform is specified, return the (fixed) relative transform from the returned parent link to frame.

Definition at line 875 of file robot_state.cpp.

◆ getRobotMarkers() [1/4]

void moveit::core::RobotState::getRobotMarkers ( visualization_msgs::MarkerArray &  arr,
const std::vector< std::string > &  link_names,
bool  include_attached = false 
)
inline

Get a MarkerArray that fully describes the robot markers for a given robot. Update the state first.

Parameters
arrThe returned marker array
link_namesThe list of link names for which the markers should be created.

Definition at line 1900 of file robot_state.h.

◆ getRobotMarkers() [2/4]

void moveit::core::RobotState::getRobotMarkers ( visualization_msgs::MarkerArray &  arr,
const std::vector< std::string > &  link_names,
bool  include_attached = false 
) const

Get a MarkerArray that fully describes the robot markers for a given robot.

Parameters
arrThe returned marker array
link_namesThe list of link names for which the markers should be created.

Definition at line 1296 of file robot_state.cpp.

◆ getRobotMarkers() [3/4]

void moveit::core::RobotState::getRobotMarkers ( visualization_msgs::MarkerArray &  arr,
const std::vector< std::string > &  link_names,
const std_msgs::ColorRGBA &  color,
const std::string &  ns,
const ros::Duration dur,
bool  include_attached = false 
)
inline

Get a MarkerArray that fully describes the robot markers for a given robot. Update the state first.

Parameters
arrThe returned marker array
link_namesThe list of link names for which the markers should be created.
colorThe color for the marker
nsThe namespace for the markers
durThe ros::Duration for which the markers should stay visible

Definition at line 1881 of file robot_state.h.

◆ getRobotMarkers() [4/4]

void moveit::core::RobotState::getRobotMarkers ( visualization_msgs::MarkerArray &  arr,
const std::vector< std::string > &  link_names,
const std_msgs::ColorRGBA &  color,
const std::string &  ns,
const ros::Duration dur,
bool  include_attached = false 
) const

Get a MarkerArray that fully describes the robot markers for a given robot.

Parameters
arrThe returned marker array
link_namesThe list of link names for which the markers should be created.
colorThe color for the marker
nsThe namespace for the markers
durThe ros::Duration for which the markers should stay visible

Definition at line 1280 of file robot_state.cpp.

◆ getRobotModel()

const RobotModelConstPtr& moveit::core::RobotState::getRobotModel ( ) const
inline

Get the robot model this state is constructed for.

Definition at line 170 of file robot_state.h.

◆ getStateTreeJointString()

void moveit::core::RobotState::getStateTreeJointString ( std::ostream &  ss,
const JointModel jm,
const std::string &  pfx0,
bool  last 
) const
private

Definition at line 2354 of file robot_state.cpp.

◆ getStateTreeString()

std::string moveit::core::RobotState::getStateTreeString ( ) const

Definition at line 2329 of file robot_state.cpp.

◆ getVariableAcceleration() [1/2]

double moveit::core::RobotState::getVariableAcceleration ( const std::string &  variable) const
inline

Get the acceleration of a particular variable. An exception is thrown if the variable is not known.

Definition at line 461 of file robot_state.h.

◆ getVariableAcceleration() [2/2]

double moveit::core::RobotState::getVariableAcceleration ( int  index) const
inline

Get the acceleration of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed

Definition at line 469 of file robot_state.h.

◆ getVariableAccelerations() [1/2]

double* moveit::core::RobotState::getVariableAccelerations ( )
inline

Get raw access to the accelerations of the variables that make up this state. The values are in the same order as reported by getVariableNames(). The area of memory overlaps with effort (effort and acceleration should not be set at the same time)

Definition at line 396 of file robot_state.h.

◆ getVariableAccelerations() [2/2]

const double* moveit::core::RobotState::getVariableAccelerations ( ) const
inline

Get const raw access to the accelerations of the variables that make up this state. The values are in the same order as reported by getVariableNames()

Definition at line 404 of file robot_state.h.

◆ getVariableCount()

std::size_t moveit::core::RobotState::getVariableCount ( ) const
inline

Get the number of variables that make up this state.

Definition at line 176 of file robot_state.h.

◆ getVariableEffort() [1/4]

double* moveit::core::RobotState::getVariableEffort ( )
inline

Get raw access to the effort of the variables that make up this state. The values are in the same order as reported by getVariableNames(). The area of memory overlaps with accelerations (effort and acceleration should not be set at the same time)

Definition at line 494 of file robot_state.h.

◆ getVariableEffort() [2/4]

const double* moveit::core::RobotState::getVariableEffort ( ) const
inline

Get const raw access to the effort of the variables that make up this state. The values are in the same order as reported by getVariableNames().

Definition at line 502 of file robot_state.h.

◆ getVariableEffort() [3/4]

double moveit::core::RobotState::getVariableEffort ( const std::string &  variable) const
inline

Get the effort of a particular variable. An exception is thrown if the variable is not known.

Definition at line 552 of file robot_state.h.

◆ getVariableEffort() [4/4]

double moveit::core::RobotState::getVariableEffort ( int  index) const
inline

Get the effort of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed

Definition at line 560 of file robot_state.h.

◆ getVariableNames()

const std::vector<std::string>& moveit::core::RobotState::getVariableNames ( ) const
inline

Get the names of the variables that make up this state, in the order they are stored in memory.

Definition at line 182 of file robot_state.h.

◆ getVariablePosition() [1/2]

double moveit::core::RobotState::getVariablePosition ( const std::string &  variable) const
inline

Get the position of a particular variable. An exception is thrown if the variable is not known.

Definition at line 273 of file robot_state.h.

◆ getVariablePosition() [2/2]

double moveit::core::RobotState::getVariablePosition ( int  index) const
inline

Get the position of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed

Definition at line 281 of file robot_state.h.

◆ getVariablePositions() [1/2]

double* moveit::core::RobotState::getVariablePositions ( )
inline

Get a raw pointer to the positions of the variables stored in this state. Use carefully. If you change these values externally you need to make sure you trigger a forced update for the state by calling update(true).

Definition at line 213 of file robot_state.h.

◆ getVariablePositions() [2/2]

const double* moveit::core::RobotState::getVariablePositions ( ) const
inline

Get a raw pointer to the positions of the variables stored in this state.

Definition at line 220 of file robot_state.h.

◆ getVariableVelocities() [1/2]

double* moveit::core::RobotState::getVariableVelocities ( )
inline

Get raw access to the velocities of the variables that make up this state. The values are in the same order as reported by getVariableNames()

Definition at line 302 of file robot_state.h.

◆ getVariableVelocities() [2/2]

const double* moveit::core::RobotState::getVariableVelocities ( ) const
inline

Get const access to the velocities of the variables that make up this state. The values are in the same order as reported by getVariableNames()

Definition at line 310 of file robot_state.h.

◆ getVariableVelocity() [1/2]

double moveit::core::RobotState::getVariableVelocity ( const std::string &  variable) const
inline

Get the velocity of a particular variable. An exception is thrown if the variable is not known.

Definition at line 362 of file robot_state.h.

◆ getVariableVelocity() [2/2]

double moveit::core::RobotState::getVariableVelocity ( int  index) const
inline

Get the velocity of a particular variable. The variable is specified by its index. No checks are performed for the validity of the index passed

Definition at line 370 of file robot_state.h.

◆ harmonizePosition()

void moveit::core::RobotState::harmonizePosition ( const JointModel joint)
inline

Definition at line 1649 of file robot_state.h.

◆ harmonizePositions() [1/2]

void moveit::core::RobotState::harmonizePositions ( )

Call harmonizePosition() for all joints / all joints in group / given joint.

Definition at line 953 of file robot_state.cpp.

◆ harmonizePositions() [2/2]

void moveit::core::RobotState::harmonizePositions ( const JointModelGroup joint_group)

Definition at line 959 of file robot_state.cpp.

◆ hasAccelerations()

bool moveit::core::RobotState::hasAccelerations ( ) const
inline

By default, if accelerations are never set or initialized, the state remembers that there are no accelerations set. This is useful to know when serializing or copying the state. If hasAccelerations() reports true, hasEffort() will certainly report false.

Definition at line 388 of file robot_state.h.

◆ hasAttachedBody()

bool moveit::core::RobotState::hasAttachedBody ( const std::string &  id) const

Check if an attached body named id exists in this state.

Definition at line 1070 of file robot_state.cpp.

◆ hasEffort()

bool moveit::core::RobotState::hasEffort ( ) const
inline

By default, if effort is never set or initialized, the state remembers that there is no effort set. This is useful to know when serializing or copying the state. If hasEffort() reports true, hasAccelerations() will certainly report false.

Definition at line 486 of file robot_state.h.

◆ hasVelocities()

bool moveit::core::RobotState::hasVelocities ( ) const
inline

By default, if velocities are never set or initialized, the state remembers that there are no velocities set. This is useful to know when serializing or copying the state.

Definition at line 295 of file robot_state.h.

◆ initTransforms()

void moveit::core::RobotState::initTransforms ( )
private

Definition at line 189 of file robot_state.cpp.

◆ integrateVariableVelocity()

bool moveit::core::RobotState::integrateVariableVelocity ( const JointModelGroup jmg,
const Eigen::VectorXd qdot,
double  dt,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn() 
)

Given the velocities for the variables in this group (qdot) and an amount of time (dt), update the current state using the Euler forward method. If the constraint specified is satisfied, return true, otherwise return false.

Definition at line 1539 of file robot_state.cpp.

◆ interpolate() [1/3]

void moveit::core::RobotState::interpolate ( const RobotState to,
double  t,
RobotState state 
) const

Interpolate towards "to" state. Mimic joints are correctly updated and flags are set so that FK is recomputed when needed.

Parameters
tointerpolate to this state
ta fraction in the range [0 1]. If 1, the result matches "to" state exactly.
stateholds the result

Definition at line 1044 of file robot_state.cpp.

◆ interpolate() [2/3]

void moveit::core::RobotState::interpolate ( const RobotState to,
double  t,
RobotState state,
const JointModel joint 
) const
inline

Interpolate towards "to" state, but only for a single joint. Mimic joints are correctly updated and flags are set so that FK is recomputed when needed.

Parameters
tointerpolate to this state
ta fraction in the range [0 1]. If 1, the result matches "to" state exactly.
stateholds the result
jointinterpolate only for this joint

Definition at line 1621 of file robot_state.h.

◆ interpolate() [3/3]

void moveit::core::RobotState::interpolate ( const RobotState to,
double  t,
RobotState state,
const JointModelGroup joint_group 
) const

Interpolate towards "to" state, but only for the joints in the specified group. Mimic joints are correctly updated and flags are set so that FK is recomputed when needed.

Parameters
tointerpolate to this state
ta fraction in the range [0 1]. If 1, the result matches "to" state exactly.
stateholds the result
joint_groupinterpolate only for the joints in this group

Definition at line 1053 of file robot_state.cpp.

◆ invertVelocity()

void moveit::core::RobotState::invertVelocity ( )

Invert velocity if present.

Definition at line 567 of file robot_state.cpp.

◆ isValidVelocityMove()

bool moveit::core::RobotState::isValidVelocityMove ( const RobotState other,
const JointModelGroup group,
double  dt 
) const

Check that the time to move between two waypoints is sufficient given velocity limits and time step.

Parameters
other- robot state to compare joint positions against
group- planning group to compare joint positions against
dt- time step between the two points

Definition at line 1012 of file robot_state.cpp.

◆ knowsFrameTransform()

bool moveit::core::RobotState::knowsFrameTransform ( const std::string &  frame_id) const

Check if a transformation matrix from the model frame (root of model) to frame frame_id is known.

Definition at line 1259 of file robot_state.cpp.

◆ markAcceleration()

void moveit::core::RobotState::markAcceleration ( )
private

Definition at line 293 of file robot_state.cpp.

◆ markDirtyJointTransforms() [1/2]

void moveit::core::RobotState::markDirtyJointTransforms ( const JointModel joint)
inlineprivate

Definition at line 1943 of file robot_state.h.

◆ markDirtyJointTransforms() [2/2]

void moveit::core::RobotState::markDirtyJointTransforms ( const JointModelGroup group)
inlineprivate

Definition at line 1950 of file robot_state.h.

◆ markEffort()

void moveit::core::RobotState::markEffort ( )
private

Definition at line 303 of file robot_state.cpp.

◆ markVelocity()

void moveit::core::RobotState::markVelocity ( )
private

Definition at line 284 of file robot_state.cpp.

◆ operator=()

RobotState & moveit::core::RobotState::operator= ( const RobotState other)

Copy operator.

Definition at line 208 of file robot_state.cpp.

◆ printDirtyInfo()

void moveit::core::RobotState::printDirtyInfo ( std::ostream &  out = std::cout) const

Definition at line 2223 of file robot_state.cpp.

◆ printStateInfo()

void moveit::core::RobotState::printStateInfo ( std::ostream &  out = std::cout) const

Definition at line 2236 of file robot_state.cpp.

◆ printStatePositions()

void moveit::core::RobotState::printStatePositions ( std::ostream &  out = std::cout) const

Definition at line 2164 of file robot_state.cpp.

◆ printStatePositionsWithJointLimits()

void moveit::core::RobotState::printStatePositionsWithJointLimits ( const moveit::core::JointModelGroup jmg,
std::ostream &  out = std::cout 
) const

Output to console the current state of the robot's joint limits.

Definition at line 2171 of file robot_state.cpp.

◆ printTransform()

void moveit::core::RobotState::printTransform ( const Eigen::Isometry3d &  transform,
std::ostream &  out = std::cout 
) const

Definition at line 2279 of file robot_state.cpp.

◆ printTransforms()

void moveit::core::RobotState::printTransforms ( std::ostream &  out = std::cout) const

Definition at line 2297 of file robot_state.cpp.

◆ satisfiesBounds() [1/3]

bool moveit::core::RobotState::satisfiesBounds ( const JointModel joint,
double  margin = 0.0 
) const
inline

Definition at line 1663 of file robot_state.h.

◆ satisfiesBounds() [2/3]

bool moveit::core::RobotState::satisfiesBounds ( const JointModelGroup joint_group,
double  margin = 0.0 
) const

Definition at line 930 of file robot_state.cpp.

◆ satisfiesBounds() [3/3]

bool moveit::core::RobotState::satisfiesBounds ( double  margin = 0.0) const

Definition at line 921 of file robot_state.cpp.

◆ satisfiesPositionBounds()

bool moveit::core::RobotState::satisfiesPositionBounds ( const JointModel joint,
double  margin = 0.0 
) const
inline

Definition at line 1667 of file robot_state.h.

◆ satisfiesVelocityBounds()

bool moveit::core::RobotState::satisfiesVelocityBounds ( const JointModel joint,
double  margin = 0.0 
) const
inline

Definition at line 1671 of file robot_state.h.

◆ setAttachedBodyUpdateCallback()

void moveit::core::RobotState::setAttachedBodyUpdateCallback ( const AttachedBodyCallback callback)

Definition at line 1065 of file robot_state.cpp.

◆ setFromDiffIK() [1/2]

bool moveit::core::RobotState::setFromDiffIK ( const JointModelGroup group,
const Eigen::VectorXd twist,
const std::string &  tip,
double  dt,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn() 
)

Set the joint values from a Cartesian velocity applied during a time dt.

Parameters
groupthe group of joints this function operates on
twista Cartesian velocity on the 'tip' frame
tipthe frame for which the twist is given
dta time interval (seconds)

Definition at line 1482 of file robot_state.cpp.

◆ setFromDiffIK() [2/2]

bool moveit::core::RobotState::setFromDiffIK ( const JointModelGroup group,
const geometry_msgs::Twist &  twist,
const std::string &  tip,
double  dt,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn() 
)

Set the joint values from a Cartesian velocity applied during a time dt.

Parameters
groupthe group of joints this function operates on
twista Cartesian velocity on the 'tip' frame
tipthe frame for which the twist is given
dta time interval (seconds)

Definition at line 1490 of file robot_state.cpp.

◆ setFromIK() [1/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const Eigen::Isometry3d &  pose,
const std::string &  tip,
const std::vector< double > &  consistency_limits,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success.

Parameters
poseThe pose the last link in the chain needs to achieve
tipThe name of the frame for which IK is attempted.
consistency_limitsThis specifies the desired distance between the solution and the seed state
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

Definition at line 1642 of file robot_state.cpp.

◆ setFromIK() [2/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const Eigen::Isometry3d &  pose,
const std::string &  tip,
const std::vector< double > &  consistency_limits,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1096 of file robot_state.h.

◆ setFromIK() [3/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const Eigen::Isometry3d &  pose,
const std::string &  tip,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success.

Parameters
poseThe pose the last link in the chain needs to achieve
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

Definition at line 1595 of file robot_state.cpp.

◆ setFromIK() [4/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const Eigen::Isometry3d &  pose,
const std::string &  tip,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1075 of file robot_state.h.

◆ setFromIK() [5/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const Eigen::Isometry3d &  pose,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success.

Parameters
poseThe pose the last link in the chain needs to achieve
tipThe name of the link the pose is specified for
timeoutThe timeout passed to the kinematics solver on each attempt

Definition at line 1581 of file robot_state.cpp.

◆ setFromIK() [6/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const Eigen::Isometry3d &  pose,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1058 of file robot_state.h.

◆ setFromIK() [7/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const EigenSTL::vector_Isometry3d poses,
const std::vector< std::string > &  tips,
const std::vector< std::vector< double >> &  consistency_limits,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

Warning: This function inefficiently copies all transforms around. If the group consists of a set of sub-groups that are each a chain and a solver is available for each sub-group, then the joint values can be set by computing inverse kinematics. The poses are assumed to be in the reference frame of the kinematic model. The poses are assumed to be in the same order as the order of the sub-groups in this group. Returns true on success.

Parameters
posesThe poses the last link in each chain needs to achieve
tipsThe names of the frames for which IK is attempted.
consistency_limitsThis specifies the desired distance between the solution and the seed state
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

◆ setFromIK() [8/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const EigenSTL::vector_Isometry3d poses,
const std::vector< std::string > &  tips,
const std::vector< std::vector< double >> &  consistency_limits,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1141 of file robot_state.h.

◆ setFromIK() [9/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const EigenSTL::vector_Isometry3d poses,
const std::vector< std::string > &  tips,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

Warning: This function inefficiently copies all transforms around. If the group consists of a set of sub-groups that are each a chain and a solver is available for each sub-group, then the joint values can be set by computing inverse kinematics. The poses are assumed to be in the reference frame of the kinematic model. The poses are assumed to be in the same order as the order of the sub-groups in this group. Returns true on success.

Parameters
posesThe poses the last link in each chain needs to achieve
tipsThe names of the frames for which IK is attempted.
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

Definition at line 1660 of file robot_state.cpp.

◆ setFromIK() [10/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const EigenSTL::vector_Isometry3d poses,
const std::vector< std::string > &  tips,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1118 of file robot_state.h.

◆ setFromIK() [11/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const geometry_msgs::Pose &  pose,
const std::string &  tip,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success.

Parameters
poseThe pose the tip link in the chain needs to achieve
tipThe name of the link the pose is specified for
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

Definition at line 1571 of file robot_state.cpp.

◆ setFromIK() [12/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const geometry_msgs::Pose &  pose,
const std::string &  tip,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1040 of file robot_state.h.

◆ setFromIK() [13/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const geometry_msgs::Pose &  pose,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

If the group this state corresponds to is a chain and a solver is available, then the joint values can be set by computing inverse kinematics. The pose is assumed to be in the reference frame of the kinematic model. Returns true on success.

Parameters
poseThe pose the last link in the chain needs to achieve
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

Definition at line 1558 of file robot_state.cpp.

◆ setFromIK() [14/14]

bool moveit::core::RobotState::setFromIK ( const JointModelGroup group,
const geometry_msgs::Pose &  pose,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1022 of file robot_state.h.

◆ setFromIKSubgroups() [1/2]

bool moveit::core::RobotState::setFromIKSubgroups ( const JointModelGroup group,
const EigenSTL::vector_Isometry3d poses,
const std::vector< std::string > &  tips,
const std::vector< std::vector< double >> &  consistency_limits,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)

setFromIK for multiple poses and tips (end effectors) when no solver exists for the jmg that can solver for non-chain kinematics. In this case, we divide the group into subgroups and do IK solving individually

Parameters
posesThe poses the last link in each chain needs to achieve
tipsThe names of the frames for which IK is attempted.
consistency_limitsThis specifies the desired distance between the solution and the seed state
timeoutThe timeout passed to the kinematics solver on each attempt
constraintA state validity constraint to be required for IK solutions

◆ setFromIKSubgroups() [2/2]

bool moveit::core::RobotState::setFromIKSubgroups ( const JointModelGroup group,
const EigenSTL::vector_Isometry3d poses,
const std::vector< std::string > &  tips,
const std::vector< std::vector< double >> &  consistency_limits,
unsigned int  ,
double  timeout = 0.0,
const GroupStateValidityCallbackFn constraint = GroupStateValidityCallbackFn(),
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
)
inline

Definition at line 1164 of file robot_state.h.

◆ setJointEfforts()

void moveit::core::RobotState::setJointEfforts ( const JointModel joint,
const double *  effort 
)

Definition at line 576 of file robot_state.cpp.

◆ setJointGroupAccelerations() [1/6]

void moveit::core::RobotState::setJointGroupAccelerations ( const JointModelGroup group,
const double *  gstate 
)

Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 690 of file robot_state.cpp.

◆ setJointGroupAccelerations() [2/6]

void moveit::core::RobotState::setJointGroupAccelerations ( const JointModelGroup group,
const Eigen::VectorXd values 
)

Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 703 of file robot_state.cpp.

◆ setJointGroupAccelerations() [3/6]

void moveit::core::RobotState::setJointGroupAccelerations ( const JointModelGroup group,
const std::vector< double > &  gstate 
)
inline

Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 932 of file robot_state.h.

◆ setJointGroupAccelerations() [4/6]

void moveit::core::RobotState::setJointGroupAccelerations ( const std::string &  joint_group_name,
const double *  gstate 
)
inline

Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 914 of file robot_state.h.

◆ setJointGroupAccelerations() [5/6]

void moveit::core::RobotState::setJointGroupAccelerations ( const std::string &  joint_group_name,
const Eigen::VectorXd values 
)
inline

Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 943 of file robot_state.h.

◆ setJointGroupAccelerations() [6/6]

void moveit::core::RobotState::setJointGroupAccelerations ( const std::string &  joint_group_name,
const std::vector< double > &  gstate 
)
inline

Given accelerations for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 923 of file robot_state.h.

◆ setJointGroupActivePositions() [1/4]

void moveit::core::RobotState::setJointGroupActivePositions ( const JointModelGroup group,
const Eigen::VectorXd values 
)

Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group.

Definition at line 621 of file robot_state.cpp.

◆ setJointGroupActivePositions() [2/4]

void moveit::core::RobotState::setJointGroupActivePositions ( const JointModelGroup group,
const std::vector< double > &  gstate 
)

Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group.

Definition at line 609 of file robot_state.cpp.

◆ setJointGroupActivePositions() [3/4]

void moveit::core::RobotState::setJointGroupActivePositions ( const std::string &  joint_group_name,
const Eigen::VectorXd values 
)
inline

Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group.

Definition at line 744 of file robot_state.h.

◆ setJointGroupActivePositions() [4/4]

void moveit::core::RobotState::setJointGroupActivePositions ( const std::string &  joint_group_name,
const std::vector< double > &  gstate 
)
inline

Given positions for the variables of active joints that make up a group, in the order found in the group (excluding values of mimic joints), set those as the new values that correspond to the group.

Definition at line 726 of file robot_state.h.

◆ setJointGroupPositions() [1/6]

void moveit::core::RobotState::setJointGroupPositions ( const JointModelGroup group,
const double *  gstate 
)

Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 588 of file robot_state.cpp.

◆ setJointGroupPositions() [2/6]

void moveit::core::RobotState::setJointGroupPositions ( const JointModelGroup group,
const Eigen::VectorXd values 
)

Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 601 of file robot_state.cpp.

◆ setJointGroupPositions() [3/6]

void moveit::core::RobotState::setJointGroupPositions ( const JointModelGroup group,
const std::vector< double > &  gstate 
)
inline

Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 692 of file robot_state.h.

◆ setJointGroupPositions() [4/6]

void moveit::core::RobotState::setJointGroupPositions ( const std::string &  joint_group_name,
const double *  gstate 
)
inline

Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 671 of file robot_state.h.

◆ setJointGroupPositions() [5/6]

void moveit::core::RobotState::setJointGroupPositions ( const std::string &  joint_group_name,
const Eigen::VectorXd values 
)
inline

Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 704 of file robot_state.h.

◆ setJointGroupPositions() [6/6]

void moveit::core::RobotState::setJointGroupPositions ( const std::string &  joint_group_name,
const std::vector< double > &  gstate 
)
inline

Given positions for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 680 of file robot_state.h.

◆ setJointGroupVelocities() [1/6]

void moveit::core::RobotState::setJointGroupVelocities ( const JointModelGroup group,
const double *  gstate 
)

Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 651 of file robot_state.cpp.

◆ setJointGroupVelocities() [2/6]

void moveit::core::RobotState::setJointGroupVelocities ( const JointModelGroup group,
const Eigen::VectorXd values 
)

Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 664 of file robot_state.cpp.

◆ setJointGroupVelocities() [3/6]

void moveit::core::RobotState::setJointGroupVelocities ( const JointModelGroup group,
const std::vector< double > &  gstate 
)
inline

Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 832 of file robot_state.h.

◆ setJointGroupVelocities() [4/6]

void moveit::core::RobotState::setJointGroupVelocities ( const std::string &  joint_group_name,
const double *  gstate 
)
inline

Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 814 of file robot_state.h.

◆ setJointGroupVelocities() [5/6]

void moveit::core::RobotState::setJointGroupVelocities ( const std::string &  joint_group_name,
const Eigen::VectorXd values 
)
inline

Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 843 of file robot_state.h.

◆ setJointGroupVelocities() [6/6]

void moveit::core::RobotState::setJointGroupVelocities ( const std::string &  joint_group_name,
const std::vector< double > &  gstate 
)
inline

Given velocities for the variables that make up a group, in the order found in the group (including values of mimic joints), set those as the new values that correspond to the group.

Definition at line 823 of file robot_state.h.

◆ setJointPositions() [1/6]

void moveit::core::RobotState::setJointPositions ( const JointModel joint,
const double *  position 
)
inline

Definition at line 596 of file robot_state.h.

◆ setJointPositions() [2/6]

void moveit::core::RobotState::setJointPositions ( const JointModel joint,
const Eigen::Isometry3d &  transform 
)
inline

Definition at line 608 of file robot_state.h.

◆ setJointPositions() [3/6]

void moveit::core::RobotState::setJointPositions ( const JointModel joint,
const std::vector< double > &  position 
)
inline

Definition at line 591 of file robot_state.h.

◆ setJointPositions() [4/6]

void moveit::core::RobotState::setJointPositions ( const std::string &  joint_name,
const double *  position 
)
inline

Definition at line 581 of file robot_state.h.

◆ setJointPositions() [5/6]

void moveit::core::RobotState::setJointPositions ( const std::string &  joint_name,
const Eigen::Isometry3d &  transform 
)
inline

Definition at line 603 of file robot_state.h.

◆ setJointPositions() [6/6]

void moveit::core::RobotState::setJointPositions ( const std::string &  joint_name,
const std::vector< double > &  position 
)
inline

Definition at line 586 of file robot_state.h.

◆ setJointVelocities()

void moveit::core::RobotState::setJointVelocities ( const JointModel joint,
const double *  velocity 
)
inline

Definition at line 615 of file robot_state.h.

◆ setToDefaultValues() [1/3]

void moveit::core::RobotState::setToDefaultValues ( )

Set all joints to their default positions. The default position is 0, or if that is not within bounds then half way between min and max bound.

Definition at line 434 of file robot_state.cpp.

◆ setToDefaultValues() [2/3]

bool moveit::core::RobotState::setToDefaultValues ( const JointModelGroup group,
const std::string &  name 
)

Set the joints in group to the position name defined in the SRDF.

Definition at line 426 of file robot_state.cpp.

◆ setToDefaultValues() [3/3]

bool moveit::core::RobotState::setToDefaultValues ( const std::string &  group_name,
const std::string &  state_name 
)
inline

Definition at line 1356 of file robot_state.h.

◆ setToIKSolverFrame() [1/2]

bool moveit::core::RobotState::setToIKSolverFrame ( Eigen::Isometry3d &  pose,
const kinematics::KinematicsBaseConstPtr &  solver 
)

Transform pose from the robot model's base frame to the reference frame of the IK solver.

Parameters
pose- the input to change
solver- a kin solver whose base frame is important to us
Returns
true if no error

Definition at line 1620 of file robot_state.cpp.

◆ setToIKSolverFrame() [2/2]

bool moveit::core::RobotState::setToIKSolverFrame ( Eigen::Isometry3d &  pose,
const std::string &  ik_frame 
)

Transform pose from the robot model's base frame to the reference frame of the IK solver.

Parameters
pose- the input to change
ik_frame- the name of frame of reference of base of ik solver
Returns
true if no error

Definition at line 1625 of file robot_state.cpp.

◆ setToRandomPositions() [1/4]

void moveit::core::RobotState::setToRandomPositions ( )

Set all joints to random values. Values will be within default bounds.

Definition at line 353 of file robot_state.cpp.

◆ setToRandomPositions() [2/4]

void moveit::core::RobotState::setToRandomPositions ( const JointModelGroup group)

Set all joints in group to random values. Values will be within default bounds.

Definition at line 366 of file robot_state.cpp.

◆ setToRandomPositions() [3/4]

void moveit::core::RobotState::setToRandomPositions ( const JointModelGroup group,
random_numbers::RandomNumberGenerator rng 
)

Set all joints in group to random values using a specified random number generator. Values will be within default bounds.

Definition at line 373 of file robot_state.cpp.

◆ setToRandomPositions() [4/4]

void moveit::core::RobotState::setToRandomPositions ( random_numbers::RandomNumberGenerator rng)

Set all joints to random values using the specified random number generator. Values will be within default bounds.

Definition at line 358 of file robot_state.cpp.

◆ setToRandomPositionsNearBy() [1/4]

void moveit::core::RobotState::setToRandomPositionsNearBy ( const JointModelGroup group,
const RobotState seed,
const std::vector< double > &  distances 
)

Set all joints in group to random values near the value in seed. distances MUST have the same size as group.getActiveJointModels(). Each value in distances is the maximum amount the corresponding active joint in group will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds.

Definition at line 381 of file robot_state.cpp.

◆ setToRandomPositionsNearBy() [2/4]

void moveit::core::RobotState::setToRandomPositionsNearBy ( const JointModelGroup group,
const RobotState seed,
const std::vector< double > &  distances,
random_numbers::RandomNumberGenerator rng 
)

Set all joints in group to random values near the value in seed, using a specified random number generator. distances MUST have the same size as group.getActiveJointModels(). Each value in distances is the maximum amount the corresponding active joint in group will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds.

Definition at line 390 of file robot_state.cpp.

◆ setToRandomPositionsNearBy() [3/4]

void moveit::core::RobotState::setToRandomPositionsNearBy ( const JointModelGroup group,
const RobotState seed,
double  distance 
)

Set all joints in group to random values near the value in seed. distance is the maximum amount each joint value will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds.

Definition at line 405 of file robot_state.cpp.

◆ setToRandomPositionsNearBy() [4/4]

void moveit::core::RobotState::setToRandomPositionsNearBy ( const JointModelGroup group,
const RobotState seed,
double  distance,
random_numbers::RandomNumberGenerator rng 
)

Set all joints in group to random values near the value in seed, using a specified random number generator. distance is the maximum amount each joint value will vary from the corresponding value in seed. distance represents meters for prismatic/postitional joints and radians for revolute/orientation joints. Resulting values are clamped within default bounds.

Definition at line 413 of file robot_state.cpp.

◆ setVariableAcceleration() [1/2]

void moveit::core::RobotState::setVariableAcceleration ( const std::string &  variable,
double  value 
)
inline

Set the acceleration of a variable. If an unknown variable name is specified, an exception is thrown.

Definition at line 447 of file robot_state.h.

◆ setVariableAcceleration() [2/2]

void moveit::core::RobotState::setVariableAcceleration ( int  index,
double  value 
)
inline

Set the acceleration of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable)

Definition at line 454 of file robot_state.h.

◆ setVariableAccelerations() [1/5]

void moveit::core::RobotState::setVariableAccelerations ( const double *  acceleration)
inline

Given an array with acceleration values for all variables, set those values as the accelerations in this state.

Definition at line 414 of file robot_state.h.

◆ setVariableAccelerations() [2/5]

void moveit::core::RobotState::setVariableAccelerations ( const std::map< std::string, double > &  variable_map)

Set the accelerations of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 521 of file robot_state.cpp.

◆ setVariableAccelerations() [3/5]

void moveit::core::RobotState::setVariableAccelerations ( const std::map< std::string, double > &  variable_map,
std::vector< std::string > &  missing_variables 
)

Set the accelerations of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set.

Definition at line 528 of file robot_state.cpp.

◆ setVariableAccelerations() [4/5]

void moveit::core::RobotState::setVariableAccelerations ( const std::vector< double > &  acceleration)
inline

Given an array with acceleration values for all variables, set those values as the accelerations in this state.

Definition at line 425 of file robot_state.h.

◆ setVariableAccelerations() [5/5]

void moveit::core::RobotState::setVariableAccelerations ( const std::vector< std::string > &  variable_names,
const std::vector< double > &  variable_acceleration 
)

Set the accelerations of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 535 of file robot_state.cpp.

◆ setVariableEffort() [1/7]

void moveit::core::RobotState::setVariableEffort ( const double *  effort)
inline

Given an array with effort values for all variables, set those values as the effort in this state.

Definition at line 511 of file robot_state.h.

◆ setVariableEffort() [2/7]

void moveit::core::RobotState::setVariableEffort ( const std::map< std::string, double > &  variable_map)

Set the effort of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 544 of file robot_state.cpp.

◆ setVariableEffort() [3/7]

void moveit::core::RobotState::setVariableEffort ( const std::map< std::string, double > &  variable_map,
std::vector< std::string > &  missing_variables 
)

Set the effort of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set.

Definition at line 551 of file robot_state.cpp.

◆ setVariableEffort() [4/7]

void moveit::core::RobotState::setVariableEffort ( const std::string &  variable,
double  value 
)
inline

Set the effort of a variable. If an unknown variable name is specified, an exception is thrown.

Definition at line 538 of file robot_state.h.

◆ setVariableEffort() [5/7]

void moveit::core::RobotState::setVariableEffort ( const std::vector< double > &  effort)
inline

Given an array with effort values for all variables, set those values as the effort in this state.

Definition at line 520 of file robot_state.h.

◆ setVariableEffort() [6/7]

void moveit::core::RobotState::setVariableEffort ( const std::vector< std::string > &  variable_names,
const std::vector< double > &  variable_acceleration 
)

Set the effort of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 558 of file robot_state.cpp.

◆ setVariableEffort() [7/7]

void moveit::core::RobotState::setVariableEffort ( int  index,
double  value 
)
inline

Set the effort of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable)

Definition at line 545 of file robot_state.h.

◆ setVariablePosition() [1/2]

void moveit::core::RobotState::setVariablePosition ( const std::string &  variable,
double  value 
)
inline

Set the position of a single variable. An exception is thrown if the variable name is not known.

Definition at line 254 of file robot_state.h.

◆ setVariablePosition() [2/2]

void moveit::core::RobotState::setVariablePosition ( int  index,
double  value 
)
inline

Set the position of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable)

Definition at line 261 of file robot_state.h.

◆ setVariablePositions() [1/5]

void moveit::core::RobotState::setVariablePositions ( const double *  position)

It is assumed positions is an array containing the new positions for all variables in this state. Those values are copied into the state.

Definition at line 443 of file robot_state.cpp.

◆ setVariablePositions() [2/5]

void moveit::core::RobotState::setVariablePositions ( const std::map< std::string, double > &  variable_map)

Set the positions of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 455 of file robot_state.cpp.

◆ setVariablePositions() [3/5]

void moveit::core::RobotState::setVariablePositions ( const std::map< std::string, double > &  variable_map,
std::vector< std::string > &  missing_variables 
)

Set the positions of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set.

Definition at line 478 of file robot_state.cpp.

◆ setVariablePositions() [4/5]

void moveit::core::RobotState::setVariablePositions ( const std::vector< double > &  position)
inline

It is assumed positions is an array containing the new positions for all variables in this state. Those values are copied into the state.

Definition at line 233 of file robot_state.h.

◆ setVariablePositions() [5/5]

void moveit::core::RobotState::setVariablePositions ( const std::vector< std::string > &  variable_names,
const std::vector< double > &  variable_position 
)

Set the positions of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set.

Definition at line 485 of file robot_state.cpp.

◆ setVariableValues()

void moveit::core::RobotState::setVariableValues ( const sensor_msgs::JointState &  msg)
inline

Definition at line 1340 of file robot_state.h.

◆ setVariableVelocities() [1/5]

void moveit::core::RobotState::setVariableVelocities ( const double *  velocity)
inline

Given an array with velocity values for all variables, set those values as the velocities in this state.

Definition at line 319 of file robot_state.h.

◆ setVariableVelocities() [2/5]

void moveit::core::RobotState::setVariableVelocities ( const std::map< std::string, double > &  variable_map)

Set the velocities of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 498 of file robot_state.cpp.

◆ setVariableVelocities() [3/5]

void moveit::core::RobotState::setVariableVelocities ( const std::map< std::string, double > &  variable_map,
std::vector< std::string > &  missing_variables 
)

Set the velocities of a set of variables. If unknown variable names are specified, an exception is thrown. Additionally, missing_variables is filled with the names of the variables that are not set.

Definition at line 505 of file robot_state.cpp.

◆ setVariableVelocities() [4/5]

void moveit::core::RobotState::setVariableVelocities ( const std::vector< double > &  velocity)
inline

Given an array with velocity values for all variables, set those values as the velocities in this state.

Definition at line 327 of file robot_state.h.

◆ setVariableVelocities() [5/5]

void moveit::core::RobotState::setVariableVelocities ( const std::vector< std::string > &  variable_names,
const std::vector< double > &  variable_velocity 
)

Set the velocities of a set of variables. If unknown variable names are specified, an exception is thrown.

Definition at line 512 of file robot_state.cpp.

◆ setVariableVelocity() [1/2]

void moveit::core::RobotState::setVariableVelocity ( const std::string &  variable,
double  value 
)
inline

Set the velocity of a variable. If an unknown variable name is specified, an exception is thrown.

Definition at line 348 of file robot_state.h.

◆ setVariableVelocity() [2/2]

void moveit::core::RobotState::setVariableVelocity ( int  index,
double  value 
)
inline

Set the velocity of a single variable. The variable is specified by its index (a value associated by the RobotModel to each variable)

Definition at line 355 of file robot_state.h.

◆ update()

void moveit::core::RobotState::update ( bool  force = false)

Update all transforms.

Definition at line 729 of file robot_state.cpp.

◆ updateCollisionBodyTransforms()

void moveit::core::RobotState::updateCollisionBodyTransforms ( )

Update the transforms for the collision bodies. This call is needed before calling collision checking. If updating link transforms or joint transorms is needed, the corresponding updates are also triggered.

Definition at line 742 of file robot_state.cpp.

◆ updateLinkTransforms()

void moveit::core::RobotState::updateLinkTransforms ( )

Update the reference frame transforms for links. This call is needed before using the transforms of links for coordinate transforms.

Definition at line 770 of file robot_state.cpp.

◆ updateLinkTransformsInternal()

void moveit::core::RobotState::updateLinkTransformsInternal ( const JointModel start)
private

Definition at line 784 of file robot_state.cpp.

◆ updateMimicJoint() [1/2]

void moveit::core::RobotState::updateMimicJoint ( const JointModel joint)
inlineprivate

Definition at line 1963 of file robot_state.h.

◆ updateMimicJoint() [2/2]

void moveit::core::RobotState::updateMimicJoint ( const std::vector< const JointModel * > &  mim)
inlineprivate

Update a set of joints that are certain to be mimicking other joints.

Definition at line 1975 of file robot_state.h.

◆ updateMimicJoints()

void moveit::core::RobotState::updateMimicJoints ( const JointModelGroup group)
inlineprivate

Update all mimic joints within group.

Definition at line 1989 of file robot_state.h.

◆ updateStateWithLinkAt() [1/2]

void moveit::core::RobotState::updateStateWithLinkAt ( const LinkModel link,
const Eigen::Isometry3d &  transform,
bool  backward = false 
)

Update the state after setting a particular link to the input global transform pose.

Definition at line 823 of file robot_state.cpp.

◆ updateStateWithLinkAt() [2/2]

void moveit::core::RobotState::updateStateWithLinkAt ( const std::string &  link_name,
const Eigen::Isometry3d &  transform,
bool  backward = false 
)
inline

Update the state after setting a particular link to the input global transform pose.

This "warps" the given link to the given pose, neglecting the joint values of its parent joint. The link transforms of link and all its descendants are updated, but not marked as dirty, although they do not match the joint values anymore! Collision body transforms are not yet updated, but marked dirty only. Use update(false) or updateCollisionBodyTransforms() to update them as well.

Definition at line 1439 of file robot_state.h.

◆ zeroAccelerations()

void moveit::core::RobotState::zeroAccelerations ( )

Set all accelerations to 0.0.

Definition at line 319 of file robot_state.cpp.

◆ zeroEffort()

void moveit::core::RobotState::zeroEffort ( )

Set all effort values to 0.0.

Definition at line 325 of file robot_state.cpp.

◆ zeroVelocities()

void moveit::core::RobotState::zeroVelocities ( )

Set all velocities to 0.0.

Definition at line 313 of file robot_state.cpp.

Member Data Documentation

◆ acceleration_

double* moveit::core::RobotState::acceleration_
private

Definition at line 2020 of file robot_state.h.

◆ attached_body_map_

std::map<std::string, std::unique_ptr<AttachedBody> > moveit::core::RobotState::attached_body_map_
private

All attached bodies that are part of this state, indexed by their name.

Definition at line 2038 of file robot_state.h.

◆ attached_body_update_callback_

AttachedBodyCallback moveit::core::RobotState::attached_body_update_callback_
private

This event is called when there is a change in the attached bodies for this state; The event specifies the body that changed and whether it was just attached or about to be detached.

Definition at line 2042 of file robot_state.h.

◆ dirty_collision_body_transforms_

const JointModel* moveit::core::RobotState::dirty_collision_body_transforms_
private

Definition at line 2027 of file robot_state.h.

◆ dirty_joint_transforms_

unsigned char* moveit::core::RobotState::dirty_joint_transforms_
private

Definition at line 2035 of file robot_state.h.

◆ dirty_link_transforms_

const JointModel* moveit::core::RobotState::dirty_link_transforms_
private

Definition at line 2026 of file robot_state.h.

◆ effort_

double* moveit::core::RobotState::effort_
private

Definition at line 2021 of file robot_state.h.

◆ global_collision_body_transforms_

Eigen::Isometry3d* moveit::core::RobotState::global_collision_body_transforms_
private

Transforms from model frame to collision bodies.

Definition at line 2034 of file robot_state.h.

◆ global_link_transforms_

Eigen::Isometry3d* moveit::core::RobotState::global_link_transforms_
private

Transforms from model frame to link frame for each link.

Definition at line 2033 of file robot_state.h.

◆ has_acceleration_

bool moveit::core::RobotState::has_acceleration_
private

Definition at line 2023 of file robot_state.h.

◆ has_effort_

bool moveit::core::RobotState::has_effort_
private

Definition at line 2024 of file robot_state.h.

◆ has_velocity_

bool moveit::core::RobotState::has_velocity_
private

Definition at line 2022 of file robot_state.h.

◆ memory_

void* moveit::core::RobotState::memory_
private

Definition at line 2016 of file robot_state.h.

◆ position_

double* moveit::core::RobotState::position_
private

Definition at line 2018 of file robot_state.h.

◆ rng_

random_numbers::RandomNumberGenerator* moveit::core::RobotState::rng_
private

For certain operations a state needs a random number generator. However, it may be slightly expensive to allocate the random number generator if many state instances are generated. For this reason, the generator is allocated on a need basis, by the getRandomNumberGenerator() function. Never use the rng_ member directly, but call getRandomNumberGenerator() instead.

Definition at line 2049 of file robot_state.h.

◆ robot_model_

RobotModelConstPtr moveit::core::RobotState::robot_model_
private

Definition at line 2015 of file robot_state.h.

◆ variable_joint_transforms_

Eigen::Isometry3d* moveit::core::RobotState::variable_joint_transforms_
private

Local transforms of all joints.

Definition at line 2032 of file robot_state.h.

◆ velocity_

double* moveit::core::RobotState::velocity_
private

Definition at line 2019 of file robot_state.h.


The documentation for this class was generated from the following files:


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Sun Mar 3 2024 03:23:37