Robowflex
v0.1
Making MoveIt Easy
|
Loads information about a robot and maintains information about a robot's state. More...
#include <robot.h>
Classes | |
struct | IKQuery |
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric region (a robowflex::Geometry) at a pose. b) An orientation specified by some base orientation with allowable deviations specified by tolerances on the XYZ Euler axes. It is recommended to use the provided constructors to specify a query, or to use the addRequest() function. Multiple target tips can be specified, but note that not all kinematics solvers support multi-tip IK. Additionally, a robowflex::Scene can be specified to do collision-aware IK. More... | |
Public Types | |
typedef std::function< bool(YAML::Node &)> | PostProcessYAMLFunction |
A function that runs after loading a YAML file and can modify its contents. Returns true on success, false on failure. More... | |
typedef std::function< bool(tinyxml2::XMLDocument &)> | PostProcessXMLFunction |
A function that runs after loading a XML file and can modify its contents. Returns true on success, false on failure. More... | |
Public Member Functions | |
Robot (const std::string &name) | |
Constructor. More... | |
Robot (Robot const &)=delete | |
void | operator= (Robot const &)=delete |
Initialization and Loading | |
bool | initialize (const std::string &urdf_file) |
Initializes a robot from a kinematic description. A default semantic description is used. More... | |
bool | initializeKinematics (const std::string &kinematics_file) |
Initialize a robot with a kinematics description. More... | |
bool | initialize (const std::string &urdf_file, const std::string &srdf_file, const std::string &limits_file="", const std::string &kinematics_file="") |
Initializes a robot from a kinematic and semantic description. All files are loaded under the robot's namespace. More... | |
bool | initializeFromYAML (const std::string &config_file) |
Initializes a robot from a YAML config which includes URDF (urdf) and optional the SRDF (srdf), joint limits (joint_limits), IK plugins (kinematics) and a default state (robot_state). All files are loaded under the robot's namespace. The names of the YAML keys are in parenthesis. More... | |
bool | loadYAMLFile (const std::string &name, const std::string &file) |
Loads a YAML file into the robot's namespace under name. More... | |
bool | loadYAMLFile (const std::string &name, const std::string &file, const PostProcessYAMLFunction &function) |
Loads a YAML file into the robot's namespace under name, with a post-process function. More... | |
std::string | loadXMLFile (const std::string &file) |
Loads an XML or .xacro file into a string. More... | |
void | setURDFPostProcessFunction (const PostProcessXMLFunction &function) |
Sets a post processing function for loading the URDF. More... | |
bool | isLinkURDF (tinyxml2::XMLDocument &doc, const std::string &name) |
Checks if a node link exist with named name_link. More... | |
void | setSRDFPostProcessFunction (const PostProcessXMLFunction &function) |
Sets a post processing function for loading the SRDF. More... | |
void | setLimitsPostProcessFunction (const PostProcessYAMLFunction &function) |
Sets a post processing function for loading the joint limits file. More... | |
void | setKinematicsPostProcessFunction (const PostProcessYAMLFunction &function) |
Sets a post processing function for loading the kinematics plugin file. More... | |
void | setSRDFPostProcessAddPlanarJoint (const std::string &name) |
Adds a planar virtual joint through the SRDF to the loaded robot with name name. This joint will have three degrees of freedom: <name>/x, <name>/y, and <name>/theta. Will apply this joint between the world and the root frame. More... | |
void | setSRDFPostProcessAddFloatingJoint (const std::string &name) |
Adds a planar virtual joint through the SRDF to the loaded robot with name name. This joint will have three degrees of freedom: <name>/x, <name>/y, and <name>/theta. Will apply this joint between the world and the root frame. More... | |
bool | loadKinematics (const std::string &group, bool load_subgroups=true) |
Loads the kinematics plugin for a joint group and its subgroups. No kinematics are loaded by default. More... | |
Getters and Setters | |
const std::string & | getModelName () const |
Get the robot's model name. More... | |
const std::string & | getName () const |
Get the robot's name. More... | |
const robot_model::RobotModelPtr & | getModelConst () const |
Get a const reference to the loaded robot model. More... | |
robot_model::RobotModelPtr & | getModel () |
Get a reference to the loaded robot model. More... | |
urdf::ModelInterfaceConstSharedPtr | getURDF () const |
Get the raw URDF Model. More... | |
const std::string & | getURDFString () const |
Get the raw URDF Model as a string. More... | |
srdf::ModelConstSharedPtr | getSRDF () const |
Get the raw SRDF Model. More... | |
const std::string & | getSRDFString () const |
Get the raw SRDF Model as a string. More... | |
const IO::Handler & | getHandlerConst () const |
Get the underlying IO handler used for this robot. More... | |
IO::Handler & | getHandler () |
Get the underlying IO handler used for this robot. More... | |
Robot State Operations | |
const robot_model::RobotStatePtr & | getScratchStateConst () const |
Get a const reference to the scratch robot state. More... | |
robot_model::RobotStatePtr & | getScratchState () |
Get a reference to the scratch robot state. More... | |
robot_model::RobotStatePtr | cloneScratchState () const |
Allocate a new robot state that is a clone of the current scratch state. More... | |
robot_model::RobotStatePtr | allocState () const |
Allocate a new robot state. More... | |
void | setState (const std::vector< double > &positions) |
Sets the scratch state from a vector of joint positions (all must be specified) More... | |
void | setState (const std::map< std::string, double > &variable_map) |
Sets the scratch state from a map of joint name to position. More... | |
void | setState (const std::vector< std::string > &variable_names, const std::vector< double > &variable_position) |
Sets the scratch state from a vector of joint names and their positions. More... | |
void | setState (const sensor_msgs::JointState &state) |
Sets the scratch state from a joint state message. More... | |
void | setState (const moveit_msgs::RobotState &state) |
Sets the scratch state from a robot state message. More... | |
void | setStateFromYAMLFile (const std::string &file) |
Sets the scratch state from a robot state message saved to a YAML file. More... | |
void | setGroupState (const std::string &name, const std::vector< double > &positions) |
Sets the group of the scratch state to a vector of joint positions. More... | |
std::vector< double > | getState () const |
Gets the current joint positions of the scratch state. More... | |
moveit_msgs::RobotState | getStateMsg () const |
Get the current scratch state as a message. More... | |
void | setStateMsgGroupState (moveit_msgs::RobotState &state, const std::string &group, const std::vector< double > &positions) const |
Set the group state of a MoveIt RobotState message. More... | |
std::vector< std::string > | getJointNames () const |
Gets the names of joints of the robot. More... | |
bool | hasJoint (const std::string &joint) const |
Checks if a joint exists in the robot. More... | |
const RobotPose & | getLinkTF (const std::string &name) const |
Get the current pose of a link on the scratch state. More... | |
const RobotPose | getRelativeLinkTF (const std::string &base, const std::string &target) const |
Get the current pose of a link target in the frame of base. More... | |
Inverse Kinematics | |
bool | setFromIK (const IKQuery &query) |
Sets a group of the scratch state from an IK query. If the IK query fails the scratch state retains its initial value. More... | |
bool | setFromIK (const IKQuery &query, robot_state::RobotState &state) const |
Sets a robot state from an IK query. If the IK query fails the scratch state retains its initial value. More... | |
bool | validateIKQuery (const IKQuery &query, const robot_state::RobotState &state) const |
Validates that a state satisfies an IK query's request poses. More... | |
double | distanceToIKQuery (const IKQuery &query, const robot_state::RobotState &state) const |
Returns the distance of the state to satisfying the IK query. More... | |
std::vector< std::string > | getSolverTipFrames (const std::string &group) const |
Get the tip frames for the IK solver for a given joint model group group. More... | |
std::string | getSolverBaseFrame (const std::string &group) const |
Get the base frame for the IK solver given a joint model group group. More... | |
IO | |
bool | toYAMLFile (const std::string &file) const |
Dumps the current configuration of the robot as a YAML file. More... | |
bool | dumpGeometry (const std::string &file) const |
Dumps the names of links and absolute paths to their visual mesh files to a YAML file. More... | |
bool | dumpTransforms (const std::string &filename) const |
Dumps the tranforms of all links of a robot at its current state to a file. More... | |
bool | dumpPathTransforms (const robot_trajectory::RobotTrajectory &path, const std::string &filename, double fps=30, double threshold=0.0) const |
Dumps the tranforms of all links of a robot through a robot trajectory to a file. More... | |
bool | dumpToScene (const std::string &filename) const |
Dumps the current scratch configuration of the robot to a YAML file compatible with a scene. More... | |
Static Public Attributes | |
static const std::string | ROBOT_DESCRIPTION = "robot_description" |
Default robot description name. More... | |
static const std::string | ROBOT_SEMANTIC = "_semantic" |
Default robot semantic description suffix. More... | |
static const std::string | ROBOT_PLANNING = "_planning" |
Default robot planning description suffix. More... | |
static const std::string | ROBOT_KINEMATICS = "_kinematics" |
Default robot kinematics description suffix. More... | |
Protected Member Functions | |
Protected Initialization | |
bool | loadURDFFile (const std::string &urdf_file) |
Loads the URDF file. More... | |
bool | loadSRDFFile (const std::string &srdf_file) |
Loads the SRDF file. More... | |
void | initializeInternal (bool namespaced=true) |
Initializes and loads the robot. Calls post-processing functions and creates scratch state. More... | |
void | loadRobotModel (const std::string &description) |
Loads a robot model from the loaded information on the parameter server. More... | |
void | updateXMLString (std::string &string, const PostProcessXMLFunction &function) |
Updates a loaded XML string based on an XML post-process function. Called after initial, unmodified robot is loaded. More... | |
Protected Attributes | |
const std::string | name_ |
Robot name. More... | |
IO::Handler | handler_ |
IO handler (namespaced with name_) More... | |
std::string | urdf_ |
The URDF as a string. More... | |
std::string | srdf_ |
The SRDF as a string. More... | |
PostProcessXMLFunction | urdf_function_ |
URDF post-processing function. More... | |
PostProcessXMLFunction | srdf_function_ |
SRDF post-processing function. More... | |
PostProcessYAMLFunction | limits_function_ |
Limits YAML post-processing function. More... | |
PostProcessYAMLFunction | kinematics_function_ |
Kinematics plugin YAML post-processing function. More... | |
std::shared_ptr< robot_model_loader::RobotModelLoader > | loader_ |
Robot model loader. More... | |
robot_model::RobotModelPtr | model_ |
Loaded robot model. More... | |
std::map< std::string, robot_model::SolverAllocatorFn > | imap_ |
Kinematic solver allocator map. More... | |
kinematics_plugin_loader::KinematicsPluginLoaderPtr | kinematics_ |
Kinematic plugin loader. More... | |
robot_state::RobotStatePtr | scratch_ |
Scratch robot state. More... | |
Loads information about a robot and maintains information about a robot's state.
The Robot class is a wrapper around MoveIt!'s robot_model::RobotModel and a "scratch" robot_state::RobotState. Mostly, this class handles loading the relevant information to the parameter server without the use of a launch file. The necessary files are the URDF and SRDF (both either XML or xacro files), and the joint limits and kinematics plugin (both YAML files). These pieces of information are loaded to the parameter server under the name provided to the constructor so that multiple robots can be used. Note that all information is also loaded under the unique namespace generated by the IO::Handler.
By default, no IK kinematics plugins are loaded due to startup costs (particularly for R2). You must call loadKinematics() with the desired planning groups (as defined by the SRDF) if you want IK.
Additionally, post-processing function hooks are provided if modifications need to be done to any of the necessary files. This enables the addition of extra joints, semantic information, joint limit overloading, etc. as needed. These functions are called after the robot is initially loaded, so it is possible to access robot model information in these functions. For example, see setSRDFPostProcessAddPlanarJoint().
Definition at line 68 of file robowflex_library/include/robowflex_library/robot.h.
typedef std::function<bool(tinyxml2::XMLDocument &)> robowflex::Robot::PostProcessXMLFunction |
A function that runs after loading a XML file and can modify its contents. Returns true on success, false on failure.
Definition at line 79 of file robowflex_library/include/robowflex_library/robot.h.
typedef std::function<bool(YAML::Node &)> robowflex::Robot::PostProcessYAMLFunction |
A function that runs after loading a YAML file and can modify its contents. Returns true on success, false on failure.
Definition at line 74 of file robowflex_library/include/robowflex_library/robot.h.
Robot::Robot | ( | const std::string & | name | ) |
Constructor.
[in] | name | The name of the robot. Used to namespace information under. |
Definition at line 26 of file robowflex_library/src/robot.cpp.
|
delete |
robot_model::RobotStatePtr Robot::allocState | ( | ) | const |
Allocate a new robot state.
Definition at line 996 of file robowflex_library/src/robot.cpp.
robot_model::RobotStatePtr Robot::cloneScratchState | ( | ) | const |
Allocate a new robot state that is a clone of the current scratch state.
Definition at line 502 of file robowflex_library/src/robot.cpp.
double Robot::distanceToIKQuery | ( | const IKQuery & | query, |
const robot_state::RobotState & | state | ||
) | const |
Returns the distance of the state to satisfying the IK query.
[in] | query | The query to check. |
[in] | state | The state to check against the query. |
Definition at line 967 of file robowflex_library/src/robot.cpp.
bool Robot::dumpGeometry | ( | const std::string & | file | ) | const |
Dumps the names of links and absolute paths to their visual mesh files to a YAML file.
[in] | file | File to save to.The name of the link to find the transform of. |
Definition at line 1163 of file robowflex_library/src/robot.cpp.
bool Robot::dumpPathTransforms | ( | const robot_trajectory::RobotTrajectory & | path, |
const std::string & | filename, | ||
double | fps = 30 , |
||
double | threshold = 0.0 |
||
) | const |
Dumps the tranforms of all links of a robot through a robot trajectory to a file.
[in] | path | Path to output. |
[in] | filename | Filename to output to. |
[in] | fps | The transforms (frames) per second used to interpolate the given path. |
[in] | threshold | The minimum distance between states before transforms are output. |
Definition at line 1221 of file robowflex_library/src/robot.cpp.
bool Robot::dumpToScene | ( | const std::string & | filename | ) | const |
Dumps the current scratch configuration of the robot to a YAML file compatible with a scene.
[in] | filename | Filename to output to. |
Definition at line 1275 of file robowflex_library/src/robot.cpp.
bool Robot::dumpTransforms | ( | const std::string & | filename | ) | const |
Dumps the tranforms of all links of a robot at its current state to a file.
[in] | filename | Filename to output to. |
Definition at line 1213 of file robowflex_library/src/robot.cpp.
IO::Handler & Robot::getHandler | ( | ) |
Get the underlying IO handler used for this robot.
Definition at line 515 of file robowflex_library/src/robot.cpp.
const IO::Handler & Robot::getHandlerConst | ( | ) | const |
Get the underlying IO handler used for this robot.
Definition at line 510 of file robowflex_library/src/robot.cpp.
std::vector< std::string > Robot::getJointNames | ( | ) | const |
Gets the names of joints of the robot.
Definition at line 592 of file robowflex_library/src/robot.cpp.
const RobotPose & Robot::getLinkTF | ( | const std::string & | name | ) | const |
Get the current pose of a link on the scratch state.
[in] | name | The name of the link to find the transform of. |
Definition at line 974 of file robowflex_library/src/robot.cpp.
robot_model::RobotModelPtr & Robot::getModel | ( | ) |
Get a reference to the loaded robot model.
Definition at line 467 of file robowflex_library/src/robot.cpp.
const robot_model::RobotModelPtr & Robot::getModelConst | ( | ) | const |
Get a const reference to the loaded robot model.
Definition at line 462 of file robowflex_library/src/robot.cpp.
const std::string & Robot::getModelName | ( | ) | const |
Get the robot's model name.
Definition at line 452 of file robowflex_library/src/robot.cpp.
const std::string & Robot::getName | ( | ) | const |
Get the robot's name.
Definition at line 457 of file robowflex_library/src/robot.cpp.
const RobotPose Robot::getRelativeLinkTF | ( | const std::string & | base, |
const std::string & | target | ||
) | const |
Get the current pose of a link target in the frame of base.
[in] | base | The link to use as the base frame. |
[in] | target | The link to find the transform of. |
Definition at line 979 of file robowflex_library/src/robot.cpp.
robot_model::RobotStatePtr & Robot::getScratchState | ( | ) |
Get a reference to the scratch robot state.
Definition at line 497 of file robowflex_library/src/robot.cpp.
const robot_model::RobotStatePtr & Robot::getScratchStateConst | ( | ) | const |
Get a const reference to the scratch robot state.
Definition at line 492 of file robowflex_library/src/robot.cpp.
std::string Robot::getSolverBaseFrame | ( | const std::string & | group | ) | const |
Get the base frame for the IK solver given a joint model group group.
[in] | group | The group to get the base frame for. |
Definition at line 1016 of file robowflex_library/src/robot.cpp.
std::vector< std::string > Robot::getSolverTipFrames | ( | const std::string & | group | ) | const |
Get the tip frames for the IK solver for a given joint model group group.
[in] | group | The group to get the tip frames for. |
Definition at line 1006 of file robowflex_library/src/robot.cpp.
srdf::ModelConstSharedPtr Robot::getSRDF | ( | ) | const |
Get the raw SRDF Model.
Definition at line 482 of file robowflex_library/src/robot.cpp.
const std::string & Robot::getSRDFString | ( | ) | const |
Get the raw SRDF Model as a string.
Definition at line 487 of file robowflex_library/src/robot.cpp.
std::vector< double > Robot::getState | ( | ) | const |
Gets the current joint positions of the scratch state.
Definition at line 565 of file robowflex_library/src/robot.cpp.
moveit_msgs::RobotState Robot::getStateMsg | ( | ) | const |
Get the current scratch state as a message.
Definition at line 572 of file robowflex_library/src/robot.cpp.
urdf::ModelInterfaceConstSharedPtr Robot::getURDF | ( | ) | const |
Get the raw URDF Model.
Definition at line 472 of file robowflex_library/src/robot.cpp.
const std::string & Robot::getURDFString | ( | ) | const |
Get the raw URDF Model as a string.
Definition at line 477 of file robowflex_library/src/robot.cpp.
bool Robot::hasJoint | ( | const std::string & | joint | ) | const |
Checks if a joint exists in the robot.
Definition at line 597 of file robowflex_library/src/robot.cpp.
bool Robot::initialize | ( | const std::string & | urdf_file | ) |
Initializes a robot from a kinematic description. A default semantic description is used.
[in] | urdf_file | Location of the robot's URDF (XML or .xacro file). |
Definition at line 175 of file robowflex_library/src/robot.cpp.
bool Robot::initialize | ( | const std::string & | urdf_file, |
const std::string & | srdf_file, | ||
const std::string & | limits_file = "" , |
||
const std::string & | kinematics_file = "" |
||
) |
Initializes a robot from a kinematic and semantic description. All files are loaded under the robot's namespace.
[in] | urdf_file | Location of the robot's URDF (XML or .xacro file). |
[in] | srdf_file | Location of the robot's SRDF (XML or .xacro file). |
[in] | limits_file | Location of the joint limit information (a YAML file). Optional. |
[in] | kinematics_file | Location of the kinematics plugin information (a YAML file). Optional. |
Definition at line 50 of file robowflex_library/src/robot.cpp.
bool Robot::initializeFromYAML | ( | const std::string & | config_file | ) |
Initializes a robot from a YAML config which includes URDF (urdf) and optional the SRDF (srdf), joint limits (joint_limits), IK plugins (kinematics) and a default state (robot_state). All files are loaded under the robot's namespace. The names of the YAML keys are in parenthesis.
[in] | config_file | Location of the yaml config file. |
Definition at line 89 of file robowflex_library/src/robot.cpp.
|
protected |
Initializes and loads the robot. Calls post-processing functions and creates scratch state.
[in] | namespaced | Whether or not the parameter server description is under the handler namespace. |
Definition at line 308 of file robowflex_library/src/robot.cpp.
bool Robot::initializeKinematics | ( | const std::string & | kinematics_file | ) |
Initialize a robot with a kinematics description.
[in] | kinematics_file | Location of the kinematics plugin information (a YAML file). |
Definition at line 199 of file robowflex_library/src/robot.cpp.
bool Robot::isLinkURDF | ( | tinyxml2::XMLDocument & | doc, |
const std::string & | name | ||
) |
Checks if a node link exist with named name_link.
[in] | doc | The URDF description. |
[in] | name | The name of the link to find. |
Definition at line 215 of file robowflex_library/src/robot.cpp.
bool Robot::loadKinematics | ( | const std::string & | group, |
bool | load_subgroups = true |
||
) |
Loads the kinematics plugin for a joint group and its subgroups. No kinematics are loaded by default.
[in] | group | Joint group name to load. |
[in] | load_subgroups | Load kinematic solvers for subgroups of the requested group. |
Definition at line 347 of file robowflex_library/src/robot.cpp.
|
protected |
Loads a robot model from the loaded information on the parameter server.
[in] | description | Robot description on parameter server. |
Definition at line 334 of file robowflex_library/src/robot.cpp.
|
protected |
Loads the SRDF file.
[in] | srdf_file | The SRDF file name. |
Definition at line 40 of file robowflex_library/src/robot.cpp.
|
protected |
Loads the URDF file.
[in] | urdf_file | The URDF file name. |
Definition at line 30 of file robowflex_library/src/robot.cpp.
std::string Robot::loadXMLFile | ( | const std::string & | file | ) |
Loads an XML or .xacro file into a string.
[in] | file | File to load. |
Definition at line 276 of file robowflex_library/src/robot.cpp.
bool Robot::loadYAMLFile | ( | const std::string & | name, |
const std::string & | file | ||
) |
Loads a YAML file into the robot's namespace under name.
[in] | name | Name to load file under. |
[in] | file | File to load. |
Definition at line 243 of file robowflex_library/src/robot.cpp.
bool Robot::loadYAMLFile | ( | const std::string & | name, |
const std::string & | file, | ||
const PostProcessYAMLFunction & | function | ||
) |
Loads a YAML file into the robot's namespace under name, with a post-process function.
[in] | name | Name to load file under. |
[in] | file | File to load. |
[in] | function | Optional post processing function. |
Definition at line 249 of file robowflex_library/src/robot.cpp.
|
delete |
bool Robot::setFromIK | ( | const IKQuery & | query | ) |
Sets a group of the scratch state from an IK query. If the IK query fails the scratch state retains its initial value.
[in] | query | Query for inverse kinematics. See Robot::IKQuery documentation for more. |
Definition at line 858 of file robowflex_library/src/robot.cpp.
bool Robot::setFromIK | ( | const IKQuery & | query, |
robot_state::RobotState & | state | ||
) | const |
Sets a robot state from an IK query. If the IK query fails the scratch state retains its initial value.
[in] | query | Query for inverse kinematics. See Robot::IKQuery documentation for more. |
[out] | state | Robot state to set from IK. |
Definition at line 863 of file robowflex_library/src/robot.cpp.
void Robot::setGroupState | ( | const std::string & | name, |
const std::vector< double > & | positions | ||
) |
Sets the group of the scratch state to a vector of joint positions.
[in] | name | Name of group to set. |
[in] | positions | Positions to set. |
Definition at line 559 of file robowflex_library/src/robot.cpp.
void Robot::setKinematicsPostProcessFunction | ( | const PostProcessYAMLFunction & | function | ) |
Sets a post processing function for loading the kinematics plugin file.
[in] | function | The function to use. |
Definition at line 238 of file robowflex_library/src/robot.cpp.
void Robot::setLimitsPostProcessFunction | ( | const PostProcessYAMLFunction & | function | ) |
Sets a post processing function for loading the joint limits file.
[in] | function | The function to use. |
Definition at line 233 of file robowflex_library/src/robot.cpp.
void Robot::setSRDFPostProcessAddFloatingJoint | ( | const std::string & | name | ) |
Adds a planar virtual joint through the SRDF to the loaded robot with name name. This joint will have three degrees of freedom: <name>/x, <name>/y, and <name>/theta. Will apply this joint between the world and the root frame.
[in] | name | Name for new joint. |
Definition at line 437 of file robowflex_library/src/robot.cpp.
void Robot::setSRDFPostProcessAddPlanarJoint | ( | const std::string & | name | ) |
Adds a planar virtual joint through the SRDF to the loaded robot with name name. This joint will have three degrees of freedom: <name>/x, <name>/y, and <name>/theta. Will apply this joint between the world and the root frame.
[in] | name | Name for new joint. |
Definition at line 422 of file robowflex_library/src/robot.cpp.
void Robot::setSRDFPostProcessFunction | ( | const PostProcessXMLFunction & | function | ) |
Sets a post processing function for loading the SRDF.
[in] | function | The function to use. |
Definition at line 228 of file robowflex_library/src/robot.cpp.
void Robot::setState | ( | const moveit_msgs::RobotState & | state | ) |
Sets the scratch state from a robot state message.
[in] | state | The state to set. |
Definition at line 545 of file robowflex_library/src/robot.cpp.
void Robot::setState | ( | const sensor_msgs::JointState & | state | ) |
Sets the scratch state from a joint state message.
[in] | state | The state to set. |
Definition at line 539 of file robowflex_library/src/robot.cpp.
void Robot::setState | ( | const std::map< std::string, double > & | variable_map | ) |
Sets the scratch state from a map of joint name to position.
[in] | variable_map | Joint positions to set. |
Definition at line 526 of file robowflex_library/src/robot.cpp.
void Robot::setState | ( | const std::vector< double > & | positions | ) |
Sets the scratch state from a vector of joint positions (all must be specified)
[in] | positions | Joint positions to set. |
Definition at line 520 of file robowflex_library/src/robot.cpp.
void Robot::setState | ( | const std::vector< std::string > & | variable_names, |
const std::vector< double > & | variable_position | ||
) |
Sets the scratch state from a vector of joint names and their positions.
[in] | variable_names | Joint names. |
[in] | variable_position | Position of joint variable (index matches entry in variable_names) |
Definition at line 532 of file robowflex_library/src/robot.cpp.
void Robot::setStateFromYAMLFile | ( | const std::string & | file | ) |
Sets the scratch state from a robot state message saved to a YAML file.
[in] | file | The YAML file to load. |
Definition at line 551 of file robowflex_library/src/robot.cpp.
void Robot::setStateMsgGroupState | ( | moveit_msgs::RobotState & | state, |
const std::string & | group, | ||
const std::vector< double > & | positions | ||
) | const |
Set the group state of a MoveIt RobotState message.
[out] | state | The state message to set. |
[in] | group | Group in state to set. |
[in] | positions | Positions to set group state to. |
Definition at line 580 of file robowflex_library/src/robot.cpp.
void Robot::setURDFPostProcessFunction | ( | const PostProcessXMLFunction & | function | ) |
Sets a post processing function for loading the URDF.
[in] | function | The function to use. |
Definition at line 210 of file robowflex_library/src/robot.cpp.
bool Robot::toYAMLFile | ( | const std::string & | file | ) | const |
Dumps the current configuration of the robot as a YAML file.
[in] | file | File to write to. |
Definition at line 987 of file robowflex_library/src/robot.cpp.
|
protected |
Updates a loaded XML string based on an XML post-process function. Called after initial, unmodified robot is loaded.
[in,out] | string | Input XML string. |
[in] | function | XML processing function. |
Definition at line 288 of file robowflex_library/src/robot.cpp.
bool Robot::validateIKQuery | ( | const IKQuery & | query, |
const robot_state::RobotState & | state | ||
) | const |
Validates that a state satisfies an IK query's request poses.
[in] | query | The query to validate. |
[in] | state | The state to validate against the query. |
Definition at line 960 of file robowflex_library/src/robot.cpp.
|
protected |
IO handler (namespaced with name_)
Definition at line 793 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Kinematic solver allocator map.
Definition at line 805 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Kinematic plugin loader.
Definition at line 806 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Kinematics plugin YAML post-processing function.
Definition at line 801 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Limits YAML post-processing function.
Definition at line 800 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Robot model loader.
Definition at line 803 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Loaded robot model.
Definition at line 804 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Robot name.
Definition at line 792 of file robowflex_library/include/robowflex_library/robot.h.
|
static |
Default robot description name.
Definition at line 81 of file robowflex_library/include/robowflex_library/robot.h.
|
static |
Default robot kinematics description suffix.
Definition at line 84 of file robowflex_library/include/robowflex_library/robot.h.
|
static |
Default robot planning description suffix.
Definition at line 83 of file robowflex_library/include/robowflex_library/robot.h.
|
static |
Default robot semantic description suffix.
Definition at line 82 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
Scratch robot state.
Definition at line 808 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
The SRDF as a string.
Definition at line 796 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
SRDF post-processing function.
Definition at line 799 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
The URDF as a string.
Definition at line 795 of file robowflex_library/include/robowflex_library/robot.h.
|
protected |
URDF post-processing function.
Definition at line 798 of file robowflex_library/include/robowflex_library/robot.h.