![]() |
Tesseract 0.28.4
|
Public Types | |
| using | Ptr = std::shared_ptr<Environment> |
| using | ConstPtr = std::shared_ptr<const Environment> |
| using | UPtr = std::unique_ptr<Environment> |
| using | ConstUPtr = std::unique_ptr<const Environment> |
Public Member Functions | |
| Environment () | |
| Default constructor. | |
| Environment (const Environment &)=delete | |
| Environment & | operator= (const Environment &)=delete |
| Environment (Environment &&)=delete | |
| Environment & | operator= (Environment &&)=delete |
| bool | init (const std::vector< std::shared_ptr< const Command > > &commands) |
| Initialize the Environment. | |
| bool | init (const tesseract::scene_graph::SceneGraph &scene_graph, const std::shared_ptr< const tesseract::srdf::SRDFModel > &srdf_model=nullptr) |
| Initialize the Environment. | |
| bool | init (const std::string &urdf_string, const std::shared_ptr< const tesseract::common::ResourceLocator > &locator) |
| bool | init (const std::string &urdf_string, const std::string &srdf_string, const std::shared_ptr< const tesseract::common::ResourceLocator > &locator) |
| bool | init (const std::filesystem::path &urdf_path, const std::shared_ptr< const tesseract::common::ResourceLocator > &locator) |
| bool | init (const std::filesystem::path &urdf_path, const std::filesystem::path &srdf_path, const std::shared_ptr< const tesseract::common::ResourceLocator > &locator) |
| Environment::UPtr | clone () const |
| Clone the environment. | |
| bool | reset () |
| reset to initialized state | |
| void | clear () |
| clear content and uninitialized | |
| bool | isInitialized () const |
| check if the environment is initialized | |
| int | getRevision () const |
| Get the current revision number. | |
| int | getInitRevision () const |
| Get the initialization revision number. | |
| std::vector< std::shared_ptr< const Command > > | getCommandHistory () const |
| Get Environment command history post initialization. | |
| bool | applyCommands (const std::vector< std::shared_ptr< const Command > > &commands) |
| Applies the commands to the environment. | |
| bool | applyCommand (std::shared_ptr< const Command > command) |
| Apply command to the environment. | |
| std::shared_ptr< const tesseract::scene_graph::SceneGraph > | getSceneGraph () const |
| Get the Scene Graph. | |
| std::vector< tesseract::common::JointId > | getGroupJointIds (const std::string &group_name) const |
| Get a groups joint IDs. | |
| std::shared_ptr< const tesseract::kinematics::JointGroup > | getJointGroup (const std::string &group_name) const |
| Get a joint group by name. | |
| std::shared_ptr< const tesseract::kinematics::JointGroup > | getJointGroup (const std::string &name, const std::vector< tesseract::common::JointId > &joint_ids) const |
| Get a joint group given a vector of joint ids. | |
| std::shared_ptr< const tesseract::kinematics::KinematicGroup > | getKinematicGroup (const std::string &group_name, const std::string &ik_solver_name="") const |
| Get a kinematic group given group name and solver name. | |
| Eigen::Isometry3d | findTCPOffset (const tesseract::common::ManipulatorInfo &manip_info) const |
| Find tool center point provided in the manipulator info. | |
| void | addFindTCPOffsetCallback (const FindTCPOffsetCallbackFn &fn) |
| This allows for user defined callbacks for looking up TCP information. | |
| std::vector< FindTCPOffsetCallbackFn > | getFindTCPOffsetCallbacks () const |
| This get the current find tcp callbacks stored in the environment. | |
| void | addEventCallback (std::size_t hash, const EventCallbackFn &fn) |
| Add an event callback function. | |
| void | removeEventCallback (std::size_t hash) |
| Remove event callbacks. | |
| void | clearEventCallbacks () |
| clear all event callbacks | |
| std::map< std::size_t, EventCallbackFn > | getEventCallbacks () const |
| Get the current event callbacks stored in the environment. | |
| void | setResourceLocator (std::shared_ptr< const tesseract::common::ResourceLocator > locator) |
| Set resource locator for environment. | |
| std::shared_ptr< const tesseract::common::ResourceLocator > | getResourceLocator () const |
| Get the resource locator assigned. | |
| void | setName (const std::string &name) |
| Give the environment a name. | |
| const std::string & | getName () const |
| Get the name of the environment. | |
| void | setState (const tesseract::scene_graph::SceneState::JointValues &joint_values, const tesseract::common::JointIdTransformMap &floating_joints={}) |
| Set the current state of the environment. | |
| void | setState (const std::vector< tesseract::common::JointId > &joint_ids, const Eigen::Ref< const Eigen::VectorXd > &joint_values, const tesseract::common::JointIdTransformMap &floating_joints={}) |
| void | setState (const tesseract::common::JointIdTransformMap &floating_joints) |
| Set the current state of the floating joint values. | |
| tesseract::scene_graph::SceneState | getState (const tesseract::scene_graph::SceneState::JointValues &joint_values, const tesseract::common::JointIdTransformMap &floating_joints={}) const |
| Get the state of the environment for a given set or subset of joint values. | |
| tesseract::scene_graph::SceneState | getState (const std::vector< tesseract::common::JointId > &joint_ids, const Eigen::Ref< const Eigen::VectorXd > &joint_values, const tesseract::common::JointIdTransformMap &floating_joints={}) const |
| tesseract::scene_graph::SceneState | getState (const tesseract::common::JointIdTransformMap &floating_joints) const |
| Get the state given floating joint values. | |
| tesseract::scene_graph::SceneState | getState () const |
| Get the current state of the environment. | |
| void | getLinkTransforms (tesseract::common::LinkIdTransformMap &link_transforms, const std::vector< tesseract::common::JointId > &joint_ids, const Eigen::Ref< const Eigen::VectorXd > &joint_values, const tesseract::common::JointIdTransformMap &floating_joints) const |
| Get the link transforms of the scene for a given set or subset of joint values. | |
| void | getLinkTransforms (tesseract::common::LinkIdTransformMap &link_transforms, const std::vector< tesseract::common::JointId > &joint_ids, const Eigen::Ref< const Eigen::VectorXd > &joint_values) const |
| Get the link transforms of the scene for a given set or subset of joint values. | |
| std::chrono::system_clock::time_point | getTimestamp () const |
| Last update time. Updated when any change to the environment occurs. | |
| std::chrono::system_clock::time_point | getCurrentStateTimestamp () const |
| Last update time to current state. Updated only when current state is updated. | |
| std::shared_ptr< const tesseract::scene_graph::Link > | getLink (const common::LinkId &id) const |
| Get a link in the environment. | |
| std::shared_ptr< const tesseract::scene_graph::Joint > | getJoint (const common::JointId &id) const |
| Get joint by id. | |
| std::shared_ptr< const tesseract::scene_graph::JointLimits > | getJointLimits (const common::JointId &joint_id) const |
| Gets the limits associated with a joint. | |
| bool | getLinkCollisionEnabled (const common::LinkId &id) const |
| Get whether a link should be considered during collision checking. | |
| bool | getLinkVisibility (const common::LinkId &id) const |
| Get a given links visibility setting. | |
| std::shared_ptr< const tesseract::common::AllowedCollisionMatrix > | getAllowedCollisionMatrix () const |
| Get the allowed collision matrix. | |
| std::vector< tesseract::common::JointId > | getJointIds () const |
| Get a vector of joint IDs in the environment. | |
| std::vector< tesseract::common::JointId > | getActiveJointIds () const |
| Get a vector of active joint IDs in the environment. | |
| Eigen::VectorXd | getCurrentJointValues () const |
| Get the current state of the environment. | |
| Eigen::VectorXd | getCurrentJointValues (const std::vector< tesseract::common::JointId > &joint_ids) const |
| Get the current joint values for a vector of joints by id. | |
| tesseract::common::JointIdTransformMap | getCurrentFloatingJointValues () const |
| Get the current floating joint values. | |
| tesseract::common::JointIdTransformMap | getCurrentFloatingJointValues (const std::vector< tesseract::common::JointId > &joint_ids) const |
| Get the current floating joint values by id. | |
| tesseract::common::LinkId | getRootLinkId () const |
| Get the root link id. | |
| std::vector< tesseract::common::LinkId > | getLinkIds () const |
| Get a vector of link IDs in the environment. | |
| std::vector< tesseract::common::LinkId > | getActiveLinkIds () const |
| Get a vector of active link IDs in the environment. | |
| std::vector< tesseract::common::LinkId > | getActiveLinkIds (const std::vector< tesseract::common::JointId > &joint_ids) const |
| Get a vector of active link ids affected by the provided joints in the environment. | |
| std::vector< tesseract::common::LinkId > | getStaticLinkIds () const |
| Get a vector of static link ids in the environment. | |
| std::vector< tesseract::common::LinkId > | getStaticLinkIds (const std::vector< tesseract::common::JointId > &joint_ids) const |
| Get a vector of static link ids not affected by the provided joints in the environment. | |
| tesseract::common::VectorIsometry3d | getLinkTransforms () const |
| Get all of the links transforms. | |
| Eigen::Isometry3d | getLinkTransform (const tesseract::common::LinkId &link_id) const |
| Get the transform corresponding to the link. | |
| Eigen::Isometry3d | getRelativeLinkTransform (const tesseract::common::LinkId &from_link_id, const tesseract::common::LinkId &to_link_id) const |
| Get transform between two links using the current state. | |
| std::unique_ptr< tesseract::scene_graph::StateSolver > | getStateSolver () const |
| Returns a clone of the environments state solver. | |
| tesseract::srdf::KinematicsInformation | getKinematicsInformation () const |
| Get the kinematics information. | |
| std::set< std::string > | getGroupNames () const |
| Get the available group names. | |
| tesseract::common::ContactManagersPluginInfo | getContactManagersPluginInfo () const |
| Get the contact managers plugin information. | |
| bool | setActiveDiscreteContactManager (const std::string &name) |
| Set the active discrete contact manager. | |
| std::unique_ptr< tesseract::collision::DiscreteContactManager > | getDiscreteContactManager () const |
| Get a copy of the environments active discrete contact manager. | |
| void | clearCachedDiscreteContactManager () const |
| Set the cached internal copy of the environments active discrete contact manager not nullptr. | |
| std::unique_ptr< tesseract::collision::DiscreteContactManager > | getDiscreteContactManager (const std::string &name) const |
| Get a copy of the environments available discrete contact manager by name. | |
| bool | setActiveContinuousContactManager (const std::string &name) |
| Set the active continuous contact manager. | |
| std::unique_ptr< tesseract::collision::ContinuousContactManager > | getContinuousContactManager () const |
| Get a copy of the environments active continuous contact manager. | |
| void | clearCachedContinuousContactManager () const |
| Set the cached internal copy of the environments active continuous contact manager not nullptr. | |
| std::unique_ptr< tesseract::collision::ContinuousContactManager > | getContinuousContactManager (const std::string &name) const |
| Get a copy of the environments available continuous contact manager by name. | |
| tesseract::common::CollisionMarginData | getCollisionMarginData () const |
| Get the environment collision margin data. | |
| std::shared_lock< std::shared_mutex > | lockRead () const |
| Lock the environment when wanting to make multiple reads. | |
| bool | operator== (const Environment &rhs) const |
| These operators are to facilitate checking serialization but may have value elsewhere. | |
| bool | operator!= (const Environment &rhs) const |
| Environment (std::unique_ptr< Implementation > impl) | |
| This should only be used by the clone method. | |
Friends | |
| template<class Archive> | |
| friend | void::tesseract::environment::serialize (Archive &ar, Environment &obj) |
| bool tesseract::environment::Environment::init | ( | const std::vector< std::shared_ptr< const Command > > & | commands | ) |
Initialize the Environment.
The template class provided should be a derived class from StateSolver.
| scene_graph | The scene graph to initialize the environment. |
| bool tesseract::environment::Environment::init | ( | const tesseract::scene_graph::SceneGraph & | scene_graph, |
| const std::shared_ptr< const tesseract::srdf::SRDFModel > & | srdf_model = nullptr ) |
Initialize the Environment.
The template class provided should be a derived class from StateSolver.
| scene_graph | The scene graph to initialize the environment. |
| Environment::UPtr tesseract::environment::Environment::clone | ( | ) | const |
Clone the environment.
| bool tesseract::environment::Environment::reset | ( | ) |
reset to initialized state
If the environment has not been initialized then this returns false
| int tesseract::environment::Environment::getRevision | ( | ) | const |
Get the current revision number.
| int tesseract::environment::Environment::getInitRevision | ( | ) | const |
Get the initialization revision number.
| std::vector< std::shared_ptr< const Command > > tesseract::environment::Environment::getCommandHistory | ( | ) | const |
Get Environment command history post initialization.
| bool tesseract::environment::Environment::applyCommands | ( | const std::vector< std::shared_ptr< const Command > > & | commands | ) |
Applies the commands to the environment.
| commands | Commands to be applied to the environment |
| bool tesseract::environment::Environment::applyCommand | ( | std::shared_ptr< const Command > | command | ) |
| std::shared_ptr< const tesseract::scene_graph::SceneGraph > tesseract::environment::Environment::getSceneGraph | ( | ) | const |
Get the Scene Graph.
| std::shared_ptr< const tesseract::kinematics::JointGroup > tesseract::environment::Environment::getJointGroup | ( | const std::string & | group_name | ) | const |
Get a joint group by name.
| group_name | The group name |
| std::shared_ptr< const tesseract::kinematics::JointGroup > tesseract::environment::Environment::getJointGroup | ( | const std::string & | name, |
| const std::vector< tesseract::common::JointId > & | joint_ids ) const |
Get a joint group given a vector of joint ids.
| name | The name to assign to the joint group |
| joint_ids | The joint ids that make up the group |
| std::shared_ptr< const tesseract::kinematics::KinematicGroup > tesseract::environment::Environment::getKinematicGroup | ( | const std::string & | group_name, |
| const std::string & | ik_solver_name = "" ) const |
Get a kinematic group given group name and solver name.
If ik_solver_name is empty it will choose the first ik solver for the group
| group_name | The group name |
| ik_solver_name | The IK solver name |
| Eigen::Isometry3d tesseract::environment::Environment::findTCPOffset | ( | const tesseract::common::ManipulatorInfo & | manip_info | ) | const |
Find tool center point provided in the manipulator info.
If manipulator information tcp is defined as a string it does the following
| manip_info | The manipulator info |
| void tesseract::environment::Environment::addFindTCPOffsetCallback | ( | const FindTCPOffsetCallbackFn & | fn | ) |
This allows for user defined callbacks for looking up TCP information.
| fn | User defined callback function for locating TCP information |
| std::vector< FindTCPOffsetCallbackFn > tesseract::environment::Environment::getFindTCPOffsetCallbacks | ( | ) | const |
This get the current find tcp callbacks stored in the environment.
| void tesseract::environment::Environment::addEventCallback | ( | std::size_t | hash, |
| const EventCallbackFn & | fn ) |
Add an event callback function.
When these get called they are protected by a unique lock internally so if the callback is a long event it can impact performance.
| hash | The id associated with the callback to allow removal. It is recommended to use std::hash<Object*>{}(this) to associate the callback with the class it associated with. |
| fn | User defined callback function which gets called for different event triggers |
| void tesseract::environment::Environment::removeEventCallback | ( | std::size_t | hash | ) |
Remove event callbacks.
| hash | the id associated with the callback to be removed |
| std::map< std::size_t, EventCallbackFn > tesseract::environment::Environment::getEventCallbacks | ( | ) | const |
Get the current event callbacks stored in the environment.
| void tesseract::environment::Environment::setResourceLocator | ( | std::shared_ptr< const tesseract::common::ResourceLocator > | locator | ) |
Set resource locator for environment.
| locator | The resource locator |
| std::shared_ptr< const tesseract::common::ResourceLocator > tesseract::environment::Environment::getResourceLocator | ( | ) | const |
Get the resource locator assigned.
This can be a nullptr
| const std::string & tesseract::environment::Environment::getName | ( | ) | const |
Get the name of the environment.
This may be empty, if so check urdf name
| void tesseract::environment::Environment::setState | ( | const tesseract::scene_graph::SceneState::JointValues & | joint_values, |
| const tesseract::common::JointIdTransformMap & | floating_joints = {} ) |
Set the current state of the environment.
After updating the current state these function must call currentStateChanged() which will update the contact managers transforms
| void tesseract::environment::Environment::setState | ( | const tesseract::common::JointIdTransformMap & | floating_joints | ) |
Set the current state of the floating joint values.
| floating_joint_values | The floating joint values to set |
| tesseract::scene_graph::SceneState tesseract::environment::Environment::getState | ( | const tesseract::scene_graph::SceneState::JointValues & | joint_values, |
| const tesseract::common::JointIdTransformMap & | floating_joints = {} ) const |
Get the state of the environment for a given set or subset of joint values.
This does not change the internal state of the environment.
| tesseract::scene_graph::SceneState tesseract::environment::Environment::getState | ( | const tesseract::common::JointIdTransformMap & | floating_joints | ) | const |
Get the state given floating joint values.
| floating_joint_values | The floating joint values to leverage |
| void tesseract::environment::Environment::getLinkTransforms | ( | tesseract::common::LinkIdTransformMap & | link_transforms, |
| const std::vector< tesseract::common::JointId > & | joint_ids, | ||
| const Eigen::Ref< const Eigen::VectorXd > & | joint_values, | ||
| const tesseract::common::JointIdTransformMap & | floating_joints ) const |
Get the link transforms of the scene for a given set or subset of joint values.
This is provided to optimize motion planning where link_transforms are poplated multiple time
This does not change the internal state of the solver.
| link_transforms | The link_transforms to populate with data. |
| joint_ids | The joints to change. |
| joint_values | The joint values |
| floating_joints | The floating joint origin transform |
| void tesseract::environment::Environment::getLinkTransforms | ( | tesseract::common::LinkIdTransformMap & | link_transforms, |
| const std::vector< tesseract::common::JointId > & | joint_ids, | ||
| const Eigen::Ref< const Eigen::VectorXd > & | joint_values ) const |
Get the link transforms of the scene for a given set or subset of joint values.
This is provided to optimize motion planning where link_transforms are poplated multiple time
This does not change the internal state of the solver.
| link_transforms | The link_transforms to populate with data. |
| joint_ids | The joints to change. |
| joint_values | The joint values |
| std::shared_ptr< const tesseract::scene_graph::Link > tesseract::environment::Environment::getLink | ( | const common::LinkId & | id | ) | const |
Get a link in the environment.
| id | The id of the link |
| std::shared_ptr< const tesseract::scene_graph::Joint > tesseract::environment::Environment::getJoint | ( | const common::JointId & | id | ) | const |
Get joint by id.
| id | The id of the joint |
| std::shared_ptr< const tesseract::scene_graph::JointLimits > tesseract::environment::Environment::getJointLimits | ( | const common::JointId & | joint_id | ) | const |
Gets the limits associated with a joint.
| joint_id | Id of the joint to be updated |
| bool tesseract::environment::Environment::getLinkCollisionEnabled | ( | const common::LinkId & | id | ) | const |
Get whether a link should be considered during collision checking.
| bool tesseract::environment::Environment::getLinkVisibility | ( | const common::LinkId & | id | ) | const |
Get a given links visibility setting.
| std::shared_ptr< const tesseract::common::AllowedCollisionMatrix > tesseract::environment::Environment::getAllowedCollisionMatrix | ( | ) | const |
Get the allowed collision matrix.
| Eigen::VectorXd tesseract::environment::Environment::getCurrentJointValues | ( | ) | const |
Get the current state of the environment.
Order should be the same as getActiveJointIds()
| Eigen::VectorXd tesseract::environment::Environment::getCurrentJointValues | ( | const std::vector< tesseract::common::JointId > & | joint_ids | ) | const |
Get the current joint values for a vector of joints by id.
Order should be the same as the input vector
| tesseract::common::JointIdTransformMap tesseract::environment::Environment::getCurrentFloatingJointValues | ( | ) | const |
Get the current floating joint values.
| tesseract::common::JointIdTransformMap tesseract::environment::Environment::getCurrentFloatingJointValues | ( | const std::vector< tesseract::common::JointId > & | joint_ids | ) | const |
Get the current floating joint values by id.
| tesseract::common::LinkId tesseract::environment::Environment::getRootLinkId | ( | ) | const |
Get the root link id.
| std::vector< tesseract::common::LinkId > tesseract::environment::Environment::getActiveLinkIds | ( | const std::vector< tesseract::common::JointId > & | joint_ids | ) | const |
Get a vector of active link ids affected by the provided joints in the environment.
| joint_ids | A list of joint ids |
| std::vector< tesseract::common::LinkId > tesseract::environment::Environment::getStaticLinkIds | ( | ) | const |
Get a vector of static link ids in the environment.
| std::vector< tesseract::common::LinkId > tesseract::environment::Environment::getStaticLinkIds | ( | const std::vector< tesseract::common::JointId > & | joint_ids | ) | const |
Get a vector of static link ids not affected by the provided joints in the environment.
| joint_ids | A list of joint ids |
| tesseract::common::VectorIsometry3d tesseract::environment::Environment::getLinkTransforms | ( | ) | const |
Get all of the links transforms.
Order should be the same as getLinkIds()
| Eigen::Isometry3d tesseract::environment::Environment::getLinkTransform | ( | const tesseract::common::LinkId & | link_id | ) | const |
Get the transform corresponding to the link.
| Eigen::Isometry3d tesseract::environment::Environment::getRelativeLinkTransform | ( | const tesseract::common::LinkId & | from_link_id, |
| const tesseract::common::LinkId & | to_link_id ) const |
Get transform between two links using the current state.
| from_link_id | The link id the transform should be relative to |
| to_link_id | The link id to get transform |
| std::unique_ptr< tesseract::scene_graph::StateSolver > tesseract::environment::Environment::getStateSolver | ( | ) | const |
Returns a clone of the environments state solver.
The Environment::getState contains mutex's which is may not be needed in all motion planners. This allows the user to get snap shot of the environment to calculate the state.
| tesseract::srdf::KinematicsInformation tesseract::environment::Environment::getKinematicsInformation | ( | ) | const |
Get the kinematics information.
| std::set< std::string > tesseract::environment::Environment::getGroupNames | ( | ) | const |
Get the available group names.
| tesseract::common::ContactManagersPluginInfo tesseract::environment::Environment::getContactManagersPluginInfo | ( | ) | const |
Get the contact managers plugin information.
| bool tesseract::environment::Environment::setActiveDiscreteContactManager | ( | const std::string & | name | ) |
Set the active discrete contact manager.
| name | The name used to register the contact manager |
| void tesseract::environment::Environment::clearCachedDiscreteContactManager | ( | ) | const |
Set the cached internal copy of the environments active discrete contact manager not nullptr.
This can be useful to save space in the event the environment is being saved
| bool tesseract::environment::Environment::setActiveContinuousContactManager | ( | const std::string & | name | ) |
Set the active continuous contact manager.
| name | The name used to register the contact manager |
| void tesseract::environment::Environment::clearCachedContinuousContactManager | ( | ) | const |
Set the cached internal copy of the environments active continuous contact manager not nullptr.
This can be useful to save space in the event the environment is being saved
| std::shared_lock< std::shared_mutex > tesseract::environment::Environment::lockRead | ( | ) | const |
Lock the environment when wanting to make multiple reads.
This is useful when making multiple read function calls and don't want the data to get updated between function calls when there a multiple threads updating a single environment
| bool tesseract::environment::Environment::operator== | ( | const Environment & | rhs | ) | const |
These operators are to facilitate checking serialization but may have value elsewhere.
| rhs | The environment to compare |