Robowflex
v0.1
Making MoveIt Easy
|
A sampleable goal region for OMPL for a set of TSRs. Samples goals in a separate thread using a clone of the world. More...
#include <robot.h>
Public Types | |
using | GroupsMap = std::map< std::string, std::vector< std::string > > |
A map of group name to member joints. More... | |
using | NamedStatesMap = std::map< std::string, std::map< std::string, Eigen::VectorXd > > |
A map of group name to a map of state name to configurations. More... | |
Public Member Functions | |
Constructors | |
Robot (const std::string &name) | |
Construct an empty robot. More... | |
Robot (robowflex::RobotPtr robot) | |
Convert a robowflex::Robot into a Dart robot. More... | |
Robot (const std::string &name, const ScenePtr &scene) | |
Convert a robowflex::Scene into a Dart robot. More... | |
RobotPtr | cloneRobot (const std::string &newName) const |
Clone this robot with a new name. More... | |
File Loading | |
bool | loadURDF (const std::string &urdf) |
Load a URDF into this robot. More... | |
bool | loadSRDF (const std::string &srdf) |
Load a SRDF into this robot. More... | |
State Operations | |
void | setStateFromMoveItMsg (const moveit_msgs::RobotState &msg) |
Set the current state of this robot from a MoveIt message. More... | |
void | setMoveItMsgFromState (moveit_msgs::RobotState &msg) const |
Set a MoveIt message from the current state of this robot. More... | |
void | setStateFromMoveItState (const robot_state::RobotState &state) |
Set the current state of this robot from a MoveIt robot state. More... | |
void | setMoveItStateFromState (robot_state::RobotState &state) const |
Set a MoveIt robot state from the current state of this robot. More... | |
void | setStateFromMoveItJMG (const std::string &jmg, const std::vector< double > &joints) |
Set the state using a MoveIt Joint Group. More... | |
void | setStateFromMoveItJMG (const std::string &jmg, const Eigen::Ref< const Eigen::VectorXd > &vec) |
Set the state using a MoveIt Joint Group. More... | |
void | setMoveItJMGFromState (const std::string &jmg, std::vector< double > &joints) const |
Set a MoveIt Joint Group state from the current state of the robot. More... | |
void | setMoveItJMGFromState (const std::string &jmg, Eigen::Ref< Eigen::VectorXd > vec) const |
Set a MoveIt Joint Group state from the current state of the robot. More... | |
Group Operations | |
void | setGroups (const GroupsMap &newGroups) |
Get the groups currently in the robot. A map of group name to a list of all joints in the group. More... | |
const GroupsMap & | getGroups () const |
Get the groups currently in the robot. A map of group name to a list of all joints in the group. More... | |
std::vector< std::string > & | getGroupJointNames (const std::string &group) |
Get the joint names in a group. More... | |
const std::vector< std::string > & | getGroupJointNamesConst (const std::string &group) const |
Get the joint names in a group. More... | |
std::vector< dart::dynamics::Joint * > | getGroupJoints (const std::string &group) const |
Get the joints for a group. More... | |
std::pair< std::size_t, dart::dynamics::Joint * > | getGroupJoint (const std::string &group, const std::string &joint) const |
Get a joint in a group along with its index in the group. More... | |
const std::vector< std::size_t > & | getGroupIndices (const std::string &group) const |
Get the indices of joints corresponding to a group. More... | |
bool | isGroup (const std::string &name) const |
Checks if a group exists. More... | |
std::size_t | getNumDofsGroup (const std::string &group) const |
Gets the number of DoFs controlled by a group. More... | |
void | getGroupState (const std::string &group, Eigen::Ref< Eigen::VectorXd > q) const |
Get the current state of the joints of a group. More... | |
void | setGroupState (const std::string &group, const Eigen::Ref< const Eigen::VectorXd > &q) |
Set the current state of the joints of a group. More... | |
Constructing Groups | |
bool | addJointToGroup (const std::string &group, const std::string &joint_name) |
Add a joint to a group. More... | |
bool | addLinkToGroup (const std::string &group, const std::string &link_name) |
Add a the parent joint of a link to a group. More... | |
bool | addChainToGroup (const std::string &group, const std::string &tip, const std::string &base) |
Add all the joints between two frames in a chain to a group. More... | |
bool | addGroupToGroup (const std::string &group, const std::string &other) |
Add all the joints in another group to this group. More... | |
Named States | |
void | setNamedGroupStates (const NamedStatesMap &states) |
Set the named states map. More... | |
const NamedStatesMap & | getNamedGroupStates () const |
Get the named states map. More... | |
std::vector< std::string > | getNamedGroupStates (const std::string &group) const |
Get all names for named states for a group. More... | |
bool | getNamedGroupState (const std::string &group, const std::string &name, Eigen::Ref< Eigen::VectorXd > q) const |
Get the configuration of a named group state. More... | |
void | setNamedGroupState (const std::string &group, const std::string &name, const Eigen::Ref< const Eigen::VectorXd > &q) |
Set or create a named group state. More... | |
Public Member Functions inherited from robowflex::darts::Structure | |
Structure (const std::string &name) | |
Create an empty structure. More... | |
Structure (const std::string &name, const SceneConstPtr &scene) | |
Copy a MoveIt (robowflex::Scene) into a structure. More... | |
virtual | ~Structure ()=default |
Destructor. More... | |
StructurePtr | cloneStructure (const std::string &newName) const |
Clones this structure with a new name. More... | |
const std::string & | getName () const |
Get the name of this structure. More... | |
ACMPtr | getACM () |
Get the ACM for the structure. More... | |
const ACMPtr & | getACMConst () const |
Get the ACM for the structure. More... | |
void | setSkeleton (const dart::dynamics::SkeletonPtr &skeleton) |
Set the skeleton for the structure. More... | |
dart::dynamics::SkeletonPtr & | getSkeleton () |
Get the underlying skeleton for the structure. More... | |
const dart::dynamics::SkeletonPtr & | getSkeletonConst () const |
Get the underlying skeleton for the structure. More... | |
void | dumpGraphViz (std::ostream &out, bool standalone=true) |
Dumps the structure of the skeleton to a GraphViz file. More... | |
void | setJoint (const std::string &name, double value) |
Set the value of a 1-DoF joint in the structure. More... | |
void | setJoint (const std::string &name, const Eigen::Ref< const Eigen::VectorXd > &value) |
Set the value of a n-DoF joint in the structure. More... | |
bool | solveIK () |
Solve the current whole-body IK problem imposed on the structure. More... | |
void | setDof (unsigned int index, double value) |
Set the DoF at index to value. More... | |
std::vector< std::string > | getJointNames () const |
Get the joint names for this structure. More... | |
dart::dynamics::Joint * | getJoint (const std::string &joint_name) const |
Get a reference to the joint in the structure. More... | |
dart::dynamics::BodyNode * | getFrame (const std::string &name="") const |
Get a body node within the structure. More... | |
dart::dynamics::BodyNode * | getRootFrame () const |
Get the root frame of this structure. More... | |
void | reparentFreeFrame (dart::dynamics::BodyNode *child, const std::string &parent="") |
Reparents the child node to the parent node. More... | |
void | setJointParentTransform (const std::string &name, const RobotPose &tf) |
Set the transform from a joint to its parent. More... | |
void | updateCollisionObject (const std::string &name, const GeometryPtr &geometry, const robowflex::RobotPose &pose) |
Update or add a collision object. More... | |
std::pair< dart::dynamics::RevoluteJoint *, dart::dynamics::BodyNode * > | addRevoluteFrame (const dart::dynamics::RevoluteJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a revolute joint to this structure. More... | |
std::pair< dart::dynamics::PrismaticJoint *, dart::dynamics::BodyNode * > | addPrismaticFrame (const dart::dynamics::PrismaticJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a prismatic joint to this structure. More... | |
std::pair< dart::dynamics::FreeJoint *, dart::dynamics::BodyNode * > | addFreeFrame (const dart::dynamics::FreeJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a free joint to this structure. More... | |
std::pair< dart::dynamics::WeldJoint *, dart::dynamics::BodyNode * > | addWeldedFrame (const dart::dynamics::WeldJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a fixed joint to this structure. More... | |
void | addGround (double z=0., double radius=10.) |
Add a ground plane. More... | |
Private Member Functions | |
bool | addNameToGroup (const std::string &group, const std::string &name) |
Adds a name to the group. More... | |
void | processGroup (const std::string &group) |
Process the members of a group to generate the set of indices. More... | |
Private Attributes | |
std::map< std::string, std::vector< std::string > > | groups_ |
Map of group names to joint names. More... | |
std::map< std::string, std::map< std::string, Eigen::VectorXd > > | group_states_ |
std::map< std::string, std::vector< std::size_t > > | group_indices_ |
Indices of group joints. More... | |
robowflex::RobotPtr | robot_ {nullptr} |
Robowflex robot. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from robowflex::darts::Structure | |
void | createShapeNode (dart::dynamics::BodyNode *body, const dart::dynamics::ShapePtr &shape) |
Create a shape node on a body. More... | |
Protected Attributes inherited from robowflex::darts::Structure | |
const std::string | name_ {"robot"} |
Name of the structure. More... | |
dart::dynamics::SkeletonPtr | skeleton_ {nullptr} |
Underlying skeleton. More... | |
ACMPtr | acm_ |
ACM for structure. More... | |
A sampleable goal region for OMPL for a set of TSRs. Samples goals in a separate thread using a clone of the world.
Definition at line 40 of file robowflex_dart/include/robowflex_dart/robot.h.
A map of group name to member joints.
Definition at line 45 of file robowflex_dart/include/robowflex_dart/robot.h.
using robowflex::darts::Robot::NamedStatesMap = std::map<std::string, std::map<std::string, Eigen::VectorXd> > |
A map of group name to a map of state name to configurations.
Definition at line 49 of file robowflex_dart/include/robowflex_dart/robot.h.
Robot::Robot | ( | const std::string & | name | ) |
Construct an empty robot.
[in] | name | Name of the robot. |
Definition at line 24 of file robowflex_dart/src/robot.cpp.
Robot::Robot | ( | robowflex::RobotPtr | robot | ) |
Convert a robowflex::Robot into a Dart robot.
[in] | robot | Robot to convert. |
Definition at line 28 of file robowflex_dart/src/robot.cpp.
Robot::Robot | ( | const std::string & | name, |
const ScenePtr & | scene | ||
) |
Convert a robowflex::Scene into a Dart robot.
[in] | name | Name of the robot. |
[in] | scene | Scene to convert. |
Definition at line 49 of file robowflex_dart/src/robot.cpp.
bool Robot::addChainToGroup | ( | const std::string & | group, |
const std::string & | tip, | ||
const std::string & | base | ||
) |
Add all the joints between two frames in a chain to a group.
[in] | group | Group to add joint to. |
[in] | tip | Tip of the chain. |
[in] | base | Base of the chain. |
Definition at line 135 of file robowflex_dart/src/robot.cpp.
bool Robot::addGroupToGroup | ( | const std::string & | group, |
const std::string & | other | ||
) |
Add all the joints in another group to this group.
[in] | group | Group to add other to. |
[in] | other | Other group to add. |
Definition at line 173 of file robowflex_dart/src/robot.cpp.
bool Robot::addJointToGroup | ( | const std::string & | group, |
const std::string & | joint_name | ||
) |
Add a joint to a group.
[in] | group | Group to add joint to. |
[in] | joint_name | Joint name to add. |
Definition at line 92 of file robowflex_dart/src/robot.cpp.
bool Robot::addLinkToGroup | ( | const std::string & | group, |
const std::string & | link_name | ||
) |
Add a the parent joint of a link to a group.
[in] | group | Group to add joint to. |
[in] | link_name | Link to add. |
Definition at line 108 of file robowflex_dart/src/robot.cpp.
|
private |
Adds a name to the group.
[in] | group | Group to add name to. |
[in] | name | Name to add to group. |
Definition at line 72 of file robowflex_dart/src/robot.cpp.
RobotPtr Robot::cloneRobot | ( | const std::string & | newName | ) | const |
Clone this robot with a new name.
[in] | newName | Name for cloned robot. |
Definition at line 53 of file robowflex_dart/src/robot.cpp.
const std::vector< std::size_t > & Robot::getGroupIndices | ( | const std::string & | group | ) | const |
Get the indices of joints corresponding to a group.
[in] | group | Group to get indices for. |
Definition at line 381 of file robowflex_dart/src/robot.cpp.
std::pair< std::size_t, dart::dynamics::Joint * > Robot::getGroupJoint | ( | const std::string & | group, |
const std::string & | joint | ||
) | const |
Get a joint in a group along with its index in the group.
[in] | group | Group to search. |
[in] | joint | Joint to find in group. |
Definition at line 366 of file robowflex_dart/src/robot.cpp.
std::vector< std::string > & Robot::getGroupJointNames | ( | const std::string & | group | ) |
Get the joint names in a group.
[in] | group | Group to get joint names for. |
Definition at line 347 of file robowflex_dart/src/robot.cpp.
const std::vector< std::string > & Robot::getGroupJointNamesConst | ( | const std::string & | group | ) | const |
Get the joint names in a group.
[in] | group | Group to get joint names for. |
Definition at line 352 of file robowflex_dart/src/robot.cpp.
std::vector< dart::dynamics::Joint * > Robot::getGroupJoints | ( | const std::string & | group | ) | const |
Get the joints for a group.
[in] | group | Group to get joint names for. |
Definition at line 357 of file robowflex_dart/src/robot.cpp.
const Robot::GroupsMap & Robot::getGroups | ( | ) | const |
Get the groups currently in the robot. A map of group name to a list of all joints in the group.
Definition at line 342 of file robowflex_dart/src/robot.cpp.
void Robot::getGroupState | ( | const std::string & | group, |
Eigen::Ref< Eigen::VectorXd > | q | ||
) | const |
Get the current state of the joints of a group.
[in] | group | Group to get state for. |
[out] | q | Configuration of the group. |
Definition at line 391 of file robowflex_dart/src/robot.cpp.
bool Robot::getNamedGroupState | ( | const std::string & | group, |
const std::string & | name, | ||
Eigen::Ref< Eigen::VectorXd > | q | ||
) | const |
Get the configuration of a named group state.
[in] | group | Group of the named state. |
[in] | name | Name of the state to get. |
[out] | q | Configuration to fill with named state. |
Definition at line 423 of file robowflex_dart/src/robot.cpp.
const Robot::NamedStatesMap & Robot::getNamedGroupStates | ( | ) | const |
Get the named states map.
Definition at line 406 of file robowflex_dart/src/robot.cpp.
std::vector< std::string > Robot::getNamedGroupStates | ( | const std::string & | group | ) | const |
Get all names for named states for a group.
[in] | group | Group to get named states for. |
Definition at line 411 of file robowflex_dart/src/robot.cpp.
std::size_t Robot::getNumDofsGroup | ( | const std::string & | group | ) | const |
Gets the number of DoFs controlled by a group.
[in] | group | Group to get DoFs for. |
Definition at line 386 of file robowflex_dart/src/robot.cpp.
bool Robot::isGroup | ( | const std::string & | name | ) | const |
bool Robot::loadSRDF | ( | const std::string & | srdf | ) |
Load a SRDF into this robot.
[in] | srdf | SRDF filename to load. Can be package URI. |
Definition at line 188 of file robowflex_dart/src/robot.cpp.
bool Robot::loadURDF | ( | const std::string & | urdf | ) |
Load a URDF into this robot.
[in] | urdf | URDF filename to load. Can be package URI. |
Definition at line 67 of file robowflex_dart/src/robot.cpp.
|
private |
Process the members of a group to generate the set of indices.
[in] | group | Group to process. |
Definition at line 568 of file robowflex_dart/src/robot.cpp.
void Robot::setGroups | ( | const GroupsMap & | newGroups | ) |
Get the groups currently in the robot. A map of group name to a list of all joints in the group.
Definition at line 335 of file robowflex_dart/src/robot.cpp.
void Robot::setGroupState | ( | const std::string & | group, |
const Eigen::Ref< const Eigen::VectorXd > & | q | ||
) |
Set the current state of the joints of a group.
[in] | group | Group to set state for. |
[out] | q | Configuration to set the group. |
Definition at line 396 of file robowflex_dart/src/robot.cpp.
void Robot::setMoveItJMGFromState | ( | const std::string & | jmg, |
Eigen::Ref< Eigen::VectorXd > | vec | ||
) | const |
Set a MoveIt Joint Group state from the current state of the robot.
[in] | jmg | Name of joint group. |
[out] | vec | Joint values to set. |
Definition at line 559 of file robowflex_dart/src/robot.cpp.
void Robot::setMoveItJMGFromState | ( | const std::string & | jmg, |
std::vector< double > & | joints | ||
) | const |
Set a MoveIt Joint Group state from the current state of the robot.
[in] | jmg | Name of joint group. |
[out] | joints | Joint values to set. |
Definition at line 550 of file robowflex_dart/src/robot.cpp.
void Robot::setMoveItMsgFromState | ( | moveit_msgs::RobotState & | msg | ) | const |
Set a MoveIt message from the current state of this robot.
[out] | msg | Message to set. |
Definition at line 484 of file robowflex_dart/src/robot.cpp.
void Robot::setMoveItStateFromState | ( | robot_state::RobotState & | state | ) | const |
Set a MoveIt robot state from the current state of this robot.
[out] | state | MoveIt state to set state to. |
Definition at line 523 of file robowflex_dart/src/robot.cpp.
void Robot::setNamedGroupState | ( | const std::string & | group, |
const std::string & | name, | ||
const Eigen::Ref< const Eigen::VectorXd > & | q | ||
) |
Set or create a named group state.
[in] | group | Group of the named state. |
[in] | name | Name of the state to set. |
[out] | q | Configuration for the named state. |
Definition at line 442 of file robowflex_dart/src/robot.cpp.
void Robot::setNamedGroupStates | ( | const NamedStatesMap & | states | ) |
Set the named states map.
[in] | states | New named states map. |
Definition at line 401 of file robowflex_dart/src/robot.cpp.
void Robot::setStateFromMoveItJMG | ( | const std::string & | jmg, |
const Eigen::Ref< const Eigen::VectorXd > & | vec | ||
) |
Set the state using a MoveIt Joint Group.
[in] | jmg | Name of joint group. |
[in] | vec | Value of Joint Group to set. |
Definition at line 540 of file robowflex_dart/src/robot.cpp.
void Robot::setStateFromMoveItJMG | ( | const std::string & | jmg, |
const std::vector< double > & | joints | ||
) |
Set the state using a MoveIt Joint Group.
[in] | jmg | Name of joint group. |
[in] | joints | Value of Joint Group to set. |
Definition at line 530 of file robowflex_dart/src/robot.cpp.
void Robot::setStateFromMoveItMsg | ( | const moveit_msgs::RobotState & | msg | ) |
Set the current state of this robot from a MoveIt message.
[in] | msg | Message to set state to. |
Definition at line 464 of file robowflex_dart/src/robot.cpp.
void Robot::setStateFromMoveItState | ( | const robot_state::RobotState & | state | ) |
Set the current state of this robot from a MoveIt robot state.
[in] | state | MoveIt state to set state to. |
Definition at line 516 of file robowflex_dart/src/robot.cpp.
|
private |
Indices of group joints.
Definition at line 304 of file robowflex_dart/include/robowflex_dart/robot.h.
|
private |
Map of group names to map of named states.
Definition at line 301 of file robowflex_dart/include/robowflex_dart/robot.h.
|
private |
Map of group names to joint names.
Definition at line 300 of file robowflex_dart/include/robowflex_dart/robot.h.
|
private |
Robowflex robot.
Definition at line 306 of file robowflex_dart/include/robowflex_dart/robot.h.